1. Some bash shell scripting rules
1) The first line in your script must be
#!/bin/bash
That is a # (Hash) followed by a ! (ban) followed by the path of the shell. This line lets the environment know the file is a shell script and the location of the shell.
2) Before executing your script, you [...]