How do I execute a bash script in Terminal?
Yet another way to execute it (this time without setting execute permissions):
bash /path/to/scriptname
cd to the directory that contains the script, or put it in a bin folder that is in your $PATH
then type
./scriptname.sh
if in the same directory or
scriptname.sh
if it's in the bin folder.
$prompt: /path/to/script
and hit enter. Note you need to make sure the script has execute permissions.