Mac OS X (10.6.8)
From terminal, we can execute a bash script easily.
That works fine, obviously, but it would be soooo cool if we could just call myscript from any location or folder. From terminal, we do the following.
Switch to the current user’s root.
$ cd ~/
Add the script path to your bash_profile.
$ sudo vi .bash_profile
Save, exit and reload your bash_profile.
$ . ~/.bash_profile
Now we can run myscript from anywhere, with tab completion!