Your shell's search path does not include the directory that the shell script is stored in. Move the file containing the shell script to the directory $HOME/bin. This directory is usually in your default search path.
There are errors in the construction and syntax of the shell script. Read through your script checking its logical operations and the commands that it uses.
You can also use command line options to debug your script.