Results 1 to 5 of 5
How do i make it so when a admin logs on to the shell it runs a certain script? Thanks...
- 12-29-2011 #1Just Joined!
- Join Date
- Dec 2011
- Posts
- 7
Shell question
How do i make it so when a admin logs on to the shell it runs a certain script? Thanks
- 12-29-2011 #2
When anyone logs in (or opens an xterm) a script in their home directory called.bashrc is run automatically. If you modify root's .bashrc to do the things you want, they will be done on every root login.
"I'm just a little old lady; don't try to dazzle me with jargon!"
- 12-29-2011 #3Just Joined!
- Join Date
- Dec 2011
- Posts
- 7
Thank you for the help this is very awesome. To the shell script menu that is gong to eat up my time most of the week. AWAY!!!!
- 12-29-2011 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,970
Actually, .bashrc is run every time a shell is started. You want to use .bash_profile for scripts that are only run when a user logs in.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 12-30-2011 #5Linux Guru
- Join Date
- May 2011
- Posts
- 1,838
Good point, rubberman.
@OP,
I tend to use customized scripts in /etc/profile.d/*.sh for this purpose, when I want system wide things to happen at login.


Reply With Quote