[RndTbl] PATH problem

Gilbert E. Detillieux gedetil at cs.umanitoba.ca
Thu Jan 3 15:29:22 CST 2002


According to author:
> How do I make an entry to the Red Hat 7.1
> system wide PATH ?
> I've looked up /etc/profile and it doesn't look
> like something that should be edited. Besides,
> I can't see a typical PATH line to edit.
> So I took a look at /root/.bash_profile and
> it looks more like what I'm used to. But that's
> only good for loggin in root and I don't always
> do that.
> I'm used to Slackware where all you have to
> do is edit the /etc/profile file to add a program
> to the system wide PATH.
> What do I have to do in Red Hat 7.1 to add
> something like /usr/local/Slab/effects  to the
> PATH ?  And what file records the PATH?
>   Any hints would be appreciated. 

Under Red Hat systems, /etc/profile is indeed the place to change it.

You'll note constructs such as this at the start of the file...

if ! echo $PATH | /bin/grep -q "/usr/X11R6/bin" ; then
    PATH="$PATH:/usr/X11R6/bin"
fi

These are done to add the path component only if it's not already there, to
avoid duplication, and to avoid simply clobbering the existing components in
the path.  Just mimic that construct for any additional directories you want
to add.

Note that this file (/etc/profile) will be used by any user (including root)
that has a Bourne shell (including bash) as their login shell.  You might
also want to do something similar for csh (and tcsh) users, by adding
something equivalent (with appropriate syntax for that shell) to the
/etc/csh.cshrc and/or /etc/csh.login files, if you have any users of those
shells.

-- 
Gilbert E. Detillieux		E-mail:	<gedetil at cs.umanitoba.ca>
Dept. of Computer Science	Web:	http://www.cs.umanitoba.ca/~gedetil/
University of Manitoba		Phone:	(204)474-8161
Winnipeg, MB, CANADA  R3T 2N2	Fax:	(204)474-7609



More information about the Roundtable mailing list