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

Re: Login script!



On Sat, Aug 07, 1999 at 08:44:30PM +0200, Rudy Broersma wrote:
> Is it possible that Linux executes a script file when a user logs on?
> So for example, if user RUDY logs on, it executes the /home/rudy/script
> file, and when ROOT logs on, it executes the /root/script file!

your shell takes care of this for you.  Note the bash manpage ('man
bash') for the specifics of what it executes and when, but the summary
is this:

if a shell is a login shell (like when you sit down and LOG IN) it
executes:
/etc/profile
~/.bash_profile
~/.bash_login
~/.profile

(note: login shells execute ~/.bash_logout when they exit)

if it is not a login shell (typically, xterms use non-login shells --
as a general, but not universal rule, if you need a password to start
it, it's a login shell), it executes:
~/.bashrc

Other shells have equivalent files, but you'll have to look in the
manpages for the details.

					-Michael

-- 
  Michael Stenner			Office Phone: 919-660-2513
  Duke University, Dept. of Physics	  mstenner@phy.duke.edu
  Box 90305, Durham N.C. 27708-0305


Reply to: