sh vs. bash
Today I learned that sh and bash are not the same thing. I'd been using sh bashfile.sh to run my bash scripts on the command line, and they have usually worked. When rewriting some grading scripts in my virtual Ubuntu environment, I ran into some syntax errors that I had not encountered on Mac.
Syntax error near "(" meant, in this case, that sh did not have the same syntax for arrays that bash did. My script had valid Bash syntax that was tripping up because my command asked sh to run it. Source
So I made the file executable with chmod u+x bashscript.sh, ran it with ./bashscript.sh and that solved the problem.












