shell script location w/ Panther

I'm sure there things have only been asked a thousand times (I just couldn't find the answers):

I am running Panther (Mac OS X ver. 10.3.2.[at present]).
I am using the (default) bash shell.
I am *starting* to write shell scripts.

I would like to "install" some shell scripts, so that they are always available for execution (for me only), and preferably so that they can be called by simply typing their filename (plus optional parameters).
I don't want to type ./filename or something.

I *suspect* I'd need to do the following:

  • Write the script(s) and store it/them in a location where it's good practice to put them.
  • Write/edit a ~/.bashrc file and add an alias/aliases for every command I want included.

Am I right with the above?
Would there be additional things I'd need to do?
Also, what location would be good practice to put these things in?

Alternatively, there wouldn't be a way to just include the files in the path and it would work, would it? (I remember this from goody ole DOS.)

Also, I'd be interested to learn how I can make these scripts available to everyone (but otherwise as above). This would obviously mean storing them in a commonly accessible location -- again, I'd like to know where it's good practice to put them. Plus, I'd need something else than ~/.bashrc.

Again, if I'm entirely on the wrong track, please do not hesitate correcting me. I am not looking for a quick fix, I am looking for a solution that's truly best practice with my OS.

Many thanks in advance!!!

:slight_smile: :slight_smile: :slight_smile:

rop

Put them in a new directory under your home directory - add that new directory to your path with your .profile or shell . file.

Hmmm, I don't use your OS but in any you will find different places that are normal for inclusion as a directory where everyone can access scripts - it just matters what we were taught - it only matters that you don't start giving access to directories that users should not be running/changing scripts in. You also don't want to put them where the OS puts things only for the fact that an upgrade may delete them. Using /usr/local/bin or /usr/local/sbin is what we use at my company but I have also seen /opt directories created for the same purpose - as long as it's added to the environment PATH you would have no problem.

Thanks folks, the issue is resolved.
The "bloody comptetition" :slight_smile: was quicker this time! :wink:

(Hmm. Couldn't find an option to close threads. Wonder if they do that automatically, then?)