Tag Info

New answers tagged

1

If your script uses bash syntax, it must start with #!/bin/bash. If you execute it with /path/to/script then all will be well. If you call the interpreter (the shell) explicitly, then you need to call the correct one, i.e. bash, not sh or perl or whatever. There are several variants of sh. Bash is one. Dash is another. Compared with bash, dash has fewer ...


2

It seems to be more of an issue if parsing the commands. bash expects the closing bracket to be the last argument and complains if it not exactly a "]" string. bash$ [ 1 ] bash$ [ 1 ] hi bash: [: missing `]' bash$ [ 1 ]hi bash: [: missing `]' bash$ dash $ [ 1 ] $ [ 1 ] hi dash: 2: [: missing ] $ [ 1 hi] dash: 3: [: missing ] $ [ 1 ]: $ [ 1 ]hi $ The dash ...



Top 50 recent answers are included