Ubuntu 遇到 bin/stop.sh: 52: kill: No such process和bin/stop.sh: 58: [: unexpected operator的问题
bin/stop.sh: 47: [: 25893: unexpected operator
-e ubuntu01: stopping canal 25893 ...
bin/stop.sh: 52: kill: No such process
bin/stop.sh: 58: [: unexpected operator
bin/stop.sh: 63: let: not found
bin/stop.sh: 58: [: unexpected operator
bin/stop.sh: 63: let: not found
bin/stop.sh: 58: [: unexpected operator
bin/stop.sh: 63: let: not found
bin/stop.sh: 58: [: unexpected operator
bin/stop.sh: 63: let: not found
bin/stop.sh: 58: [: unexpected operator
bin/stop.sh: 63: let: not found
bin/stop.sh: 58: [: unexpected operator
bin/stop.sh: 63: let: not found
bin/stop.sh: 58: [: unexpected operator
bin/stop.sh: 63: let: not found
bin/stop.sh: 58: [: unexpected operator
bin/stop.sh: 63: let: not found
解决办法如下:
因为ubuntu默认的sh是连接到dash的,又因为dash跟bash的不兼容所以出错了.执行时可以把sh换成bash文件名.sh来执行.成功.dash是什么东西,查了一下,应该也是一种shell,貌似用户对它的诟病颇多的。
by the way修改sh默认连接到bash的一种方法:
sudo dpkg-reconfigure dash
选择no即可.
sudo dpkg-reconfigure dash
[sudo] password for ubuntu01: 输入密码
Removing 'diversion of /bin/sh to /bin/sh.distrib by dash'
Adding 'diversion of /bin/sh to /bin/sh.distrib by bash'
Removing 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash'
Adding 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by bash'