Command not found for shell script

bashcommand lineterminal

I created the following bash script in OS X 10.7.5:

$ cd ~/Documents/github/scripts
$ vim



echo "The script starts now."

echo "Hi, $USER!"

echo "I will now fetch you a list of connected users:"

echo "I'm setting two variables now."
echo "This is a string: $COLOUR"
echo "AND this is a number: $VALUE"

echo "I'm giving you back your prompt now."

Then I make sure it is executable:

$ chmod ugo+rwx
$ ls -l
-rwxrwxrwx  1 GuardDog_02  staff  325 Mar 13 18:51

Then I add the directory to the contents of the PATH variable:

$ vim ~/.profile
export PATH=/Users/GuardDog_02/QtSDK/Desktop/Qt/474/gcc/bin/:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/X11/bin:/usr/local/mysql/bin
export PATH

I then run the following to have the effect applied:

$ . ~/.profile

Then I open a new controlling terminal window, and I run, but get command not found:

-bash: command not found

Why isn't the shell script recognized from the interactive bash shell in the controlling terminal? I tried the same thing in Ubuntu and it worked just fine.

Best Answer

Do you have a ~/.bash_profile? If so, then that will be preferred over the ~/.profile startup script. Next, verify the setting of your path (echo $PATH). Also (and this may be a dumb question) are you actually logged in as GuardDog_02? In other words, is ~ identical to /Users/GuardDog_02?