[lug] Changing paths

tpatnoe tpatnoe at peakss.com
Wed Apr 5 10:24:24 MDT 2000


This problem has has bitten me a couple of times. Each time I have to
re-read
the man pages and try and figure out what is happening. After reading a
bit
about the problems discussed here I decided to make a matrix and hold
onto it.
Hopefully the BLUG users will find it usefully too. I just did a quick
search
of the man pages so if I made mistakes I'm sure everyone will let me
know.

In my understanding there is a difference between "interactive" and
"non-interactive" shells, at least for bash, and what files they source
is to
avoid the problem where a user aliased ls='ls -l' and this will break a
shell
script expecting a standard ls. Similar problems arise with PATH
pointing to an
ls which is unexpected.

Session Type    ksh          bash                 csh          tcsh
------------    ------------ -------------------  ------------
------------
interactive     /etc/profile /etc/profile         /etc/.login 
/etc/csh.cshrc
login           ~/.profile   ~/.bash_profile* or  ~/.cshrc    
/etc/csh.login
                $ENV++       ~/.bash_login*       ~/.login    
~/.tcshrc*
                             ~/.profile*                       ~/.cshrc*
                                                               ~/.login
                                                              
~/.cshdirs*
                                                              
$dirsfile*++
                                                               
interactive     $ENV++       ~/.bashrc            ~/.cshrc    
/etc/csh.cshrc
non-login                                                     
~/.tcshrc*
                                                               ~/.cshrc*
                                       
non-interactive $ENV++       $BASH_ENV++          ~/.cshrc    
/etc/csh.cshrc
                                                              
~/.tcshrc*
                                                               ~/.cshrc*

* Which ever file it finds first.
++ If this variable exists, and has the correct uid it reads the file
which it
points to.

Wayde Allen wrote:
> 
> On Tue, 4 Apr 2000, Hugh Brown wrote:
> 
> > The easy thing to do then is to make your own .tcshrc and just set the
> > path variable
> 
> Yes, I think you are right.  I'd still kind of like to understand the
> reason for the behaviour however.
> 
> - Wayde
>   (wallen at boulder.nist.gov)
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug

-- 
Tory Patnoe                    tpatnoe at peakss.com
Peak Software Solutions        303-734-5031




More information about the LUG mailing list