顯示具有 程式-ShellScript 標籤的文章。 顯示所有文章
顯示具有 程式-ShellScript 標籤的文章。 顯示所有文章

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