[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: where to put shell scripts?




Krzys Majewski wrote:
> 
> I have a  habit of writing many shell scripts  for everything. Some of
> them are  very local to me, so  I put them in  ${HOME}/shell and stick
> that in my  PATH.

Makes sense.

> Some of them may be generally  useful, so although I
> don't have any users, I'm anal,  and I put them in /usr/local/sbin/. I
> don't  know what  the "s"  stands for,  maybe "system"?

According to the FHS 2.0
<http://www.pathname.com/fhs/2.0/fhs-3.10.html>, sbin stands for "System
BINaries", so yes, it does stand for system.


> This location works well enough except locally compiled system software
> may also put stuff there, in which case we have both binaries and sh 
> scripts in the same directory, is that OK? Any better suggestions? 

There are no problem mixing scripts and binaries that I can see.  As far
as the shell is concerned, they're the same, you just execute them.

Also according to the FHS:
  "Deciding what things go into "sbin" directories is simple: If a 
   normal (not a system administrator) user will ever run it directly,
   then it should be placed in one of the "bin" directories. Ordinary 
   users should not have to place any of the sbin directories in their 
   path."

So some of your scripts might be better served in /usr/local/bin, if
they are of more general use.

Best of Luck,
-Gleef



Reply to: