I think I have configured bash as shell, but why is this happening?My shell is bash:# ls -al `which sh`  lrwxrwxrwx 1 root root 4 Jul 12 03:25 /bin/sh -> bash Error executing a script with sh# sh ubuntu/util.sh  ubuntu/util.sh: line 32: `test-build-release': not a valid identifierNo error from bash# bash ubuntu/util.sh
which bash is executing?
bash;shell
It is running the bash executable you expect, but your shell is not simply bash; it is bash running in POSIX sh compatibility mode. It does this by looking at the command name it was invoked as, and if that is sh, then it automatically activates POSIX mode. It does a very terrible job at this, and should not be fully relied on for testing POSIX sh compatible scripts, but it should considerably restrict allowed syntax.--posixChange the behavior of bash where the default operation differs from the POSIX standard to match the standard (posix mode).   See SEE ALSO below for a reference to a document that details how posix mode affects bash's behavior.And from http://tiswww.case.edu/php/chet/bash/POSIX :Starting Bash with the --posix command-line option or executing set  -o posix while Bash is running will cause Bash to conform more closely to the POSIX standard by changing the behavior to match that  specified by POSIX in areas where the Bash default differs.When invoked as sh, Bash enters POSIX mode after reading the startup  files.