Kenneth Stephen wrote:
>
> Jack,
>
> When you talk about .login and .logout files, your are talking
> about more traditional shells like the Bourne Shell (or was it the C
> shell?).
Works on both, tcsh to.
> Bash uses .bash_login and .bash_logout . Now given the fact that
> on most Linux distributions /bin/sh is a symbolic link to /bin/bash, and
> also given that if bash is invoked as /bin/sh it tries to emulate the
> Bourne shell behaviour as closely as it can, you _may_ get the .login and
> .logout files to work. I havent tried this in a while, though.
Only works if you are using tcsh, .bash_login and .bash_logout are the
login/logout scripts for the bash shells. No it doesn't work unless you
do some hard/sys linking to them.
> As for the PATH not being set up properly while the login scripts
> are being executed, this is completely predictable : bash reads the files
> /etc/profile, ~/.bash_profile, ~/.bash_login, and ~/.profile in that
> order. One just has to figure out in which of these files the PATH is
> being set.
It depends on the system, but %99 of the systems out there, set the
basic PATH
in /etc/profile, provide they use bash somewhere on the system, more
than likely
they will setup the /bin directory in your path for you.
Users then ussually customize their path to suit their needs.
Say a users wirte a script called 'check_disk', and puts that in his
~/bin directory
Now if he calls 'echo' from login, it will work find, if he calls
'check_disk' for
login, it will more than likely break, giving the all to famlair 'bash:
not found:'
error. Since his custom paths have not been read in yet.
I was just saying, if a login script breaks if is ussually a wrong path
or a type-o,
check you paths and syntax and try it again.
I also should of menationed that under csh/tcsh there will also be a
.cshrc, this is
used to 'configure' csh/tcsh it is best to edit/modify an existing one.
When in doubt listen to Kenneth :)
Jack
>
> Regards,
> Kenneth
>
> On Wed, 28 Jul 1999, Jack Barnett wrote:
>
> > In your home directory there will be 2 files .login and .logout(take
> > notice of the leading dot), the might not be there is not create them.
> > The you can put any commands in these files that you want to run when
> > you login and logout.
> >
> > Open .login with your favorite editor (vi, pico, joe, emac, xedit, etc)
> > and put any valid command in there, just to show you how it works put
> > the command
> >
> > echo "Hello, nice to see you have logged in"
> >
> > in your .login file and put
> >
> > echo "Goodbye"
> >
> > in your .logout file.
> >
> > your can put a "df -ak" in your login to show the amount of disk space
> > when you logon in, or the command "free" or "uptime" and it will display
> > the amount of free memory and how long the system has been up. Any
> > valid commands works, you can even called perl scripts from them.
> >
> > Sometimes it is best to put the direct path to the program like instead
> > of 'echo "hello"' you could put '/bin/echo "hello"' just to make sure it
> > can find the echo command, since you are just logging in, your path
> > *might* not be setup at this point
> >
> > If you want to put scripting in this, it is recommened that you use the
> > script launge of the shell you have, if you default shell is bash, put
> > bash if and loop statements in, since tcsh syntax may mess it up.
> >
> > Have Fun
> >
> >
> >
> >
> > [EMAIL PROTECTED] wrote:
> > >
> > > Thanks everyone for helping me those past few times but I still have
> > > more questions a coming :)
> > >
> > > The question is - How do I make / modify login scripts ...
> > >
> > > Thanx
> > > >From
> > >
> > > Robert Hickey
> >