Welcome to WebmasterWorld Guest from 220.127.116.11 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
Where should I store shell scripts? Which directory universetoday msg:914567 6:11 am on Jun 8, 2006 (gmt 0) I'm still learning the webmastering trade, and I'm writing some simple shell scripts to run some backups. I know this is a strange question, but where should I store them? In my /home directory? Is there some place people commonly keep them?
jtara msg:914568 6:08 pm on Jun 8, 2006 (gmt 0)
Shell scripts generally go in the same place that executables go.
If the script is only used by a particular account, put it in that account's ~/bin directory. If it is used by multiple users, it would typically go in /usr/local/bin, /opt, etc.
In this particular case, since these are "system maintainence" type of scripts, I would put them in /usr/local/sbin.
linsys msg:914569 4:23 am on Jun 14, 2006 (gmt 0)
They can really go anywhere, in allmost every large corporate environment I've worked in we stored them in /usr/local/scripts then added that to the PATH environment variable.
If you don't have access to /usr/local/scripts I would put them in /home/username/bin/