[NTLUG:Discuss] adding to the path

Chris Cox cjcox at acm.org
Mon Nov 13 15:00:31 CST 2000


MadHat wrote:
> 
> Stephen Klein wrote:
> >
> > Just remember, if you want to make that path permenant, put it in your
> > /etc/profile file.  Else it will go back to what it was before when you
> > logout and log back in.
> 
> Quick notes...  the export command is only for BASH shell,not csh or
> tcsh or ksh (IIRC).
> 
>

True with regards to csh and tcsh.... however export is always present
in Bourne shell derivatives (e.g. sh, bash, ksh).  However, the ability
to do assignment is not in Bourne shell.  So the portable way for
sh, ksh and bash is:

PATH=add/this/new/path/to/front:$PATH
export PATH

The location of your master profile will vary in Linux distributions.
Stephen's comment about /etc/profile is historically correct.... but
YMMV with regards to its location nowadays on some distributions.


Regards,
Chris



More information about the Discuss mailing list