Terminal User Guide
Shell scripts must be executable files in order to run. You can use the chmod command to indicate that the text file is executable (that is, its contents can be run as a shell script).
In the Terminal app on your Mac, use the cd command to move into the directory that contains the file you want to make executable. For example:
Enter the chmod command. For example:
% chmod 755 YourScriptName.sh
You can use the chmod command to indicate that the text file is executable (that is, its contents can be run as a shell script). In the Terminal app on your Mac, use the cd command to move into the directory that contains the file you want to make executable. For example:% cd YourScriptDirectory. Make sure that your chmod switches are doing what you want them to do also. I experienced an issue whereby executing stuff on root would not do anything, but prepending my command with 'sudo' did the trick, I then realised I had an issue with my root group in /etc/group. For.dmg, double click the file to “virtually” mount it to your MAC. A popup window should appear asking you to copy the file by dragging the app icon to your Applications folder. To launch the program, just double click the app icon inside your Applications folder which you have copied earlier.
After making the shell script file executable, you can run it by entering its pathname. For example:
or

% cd ~/Documents/Dev/
% ./YourScriptName.sh
Chmod App For Mac Shortcut
Terminal User Guide

Shell scripts must be executable files in order to run. You can use the chmod command to indicate that the text file is executable (that is, its contents can be run as a shell script).
In the Terminal app on your Mac, use the cd command to move into the directory that contains the file you want to make executable. For example:
Enter the chmod command. For example:
% chmod 755 YourScriptName.sh

After making the shell script file executable, you can run it by entering its pathname. For example:
Chmod For Mac
or
% cd ~/Documents/Dev/
% ./YourScriptName.sh