zebraman zebraman - 2 years ago 121
Bash Question

How to make a shell script global?

I am on Mac's OS 10.6, and I am trying to learn a thing or two about shell scripting. I understand how to save a shell script and make it executable, but I am wondering what I can do or where I can save the file to make it global (that is, accessible no matter what folder I am in).

For example, if I save a .sh file in the /Users/username/ directory and make it executable, I can only execute that script in that specific directory. If I navigate to /Users/username/Downloads, for example, I can't execute the script.

Also, any suggestions of resources for learning more about shell scripting would be helpful. Thanks

Answer Source

/usr/local/bin would be the most appropriate location. Mac OS X has it in the PATH by default

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download