Since I sometimes write shell scripts for automating tasks and want them to be usable without the complete path-typing, I put them in my ~/bin directory. But for some reason, my MacOS 10.8 didn't find the scripts residing there, because my PATH-variable for /bin/bash obviously lacked the standard user directory.
To change that, simply open a terminal and edit .bash_profile e.g by
nano .bash_profile
and add the following line to that file:
export PATH=~/bin:$PATH
After that, Control+X and answer yes, then simply quit and open again the terminal, and it will find all the scripts residing in your ~/bin which are executable (if they are not, chmod u+x yourscriptname can fix that easily) whereever you call the name of the script.
No comments:
Post a Comment