2009年3月4日 星期三

[Debug]shell script 'Syntax error: word unexpected (expecting ")")'

The reason that works on Linux and not on FreeBSD is that on Linux "sh" is really bash. On FreeBSD, sh is the bourne shell and bash is bash. Bash will run all sh scripts, but sh will not run all bash scripts. Bash extends the sh language. That script is a bash script, not a sh script.

所以
sh xx.sh 改用 bash xx.sh
即可

沒有留言:

wibiya widget