Newbie question: How to add additional path to the PATH environment string?

Newbie question: How to add additional path to the PATH environment string?

Post by neo_in_mat » Fri, 26 Dec 2003 23:23:49


I want to add a path to the system-wide PATH environment string. I
want the path is available to every logged on use. Is it possible?

Thanks.
 
 
 

Newbie question: How to add additional path to the PATH environment string?

Post by Ross Ax » Sat, 27 Dec 2003 11:44:48


Add something like

PATH=$(PATH):/whatever/path/you/want/to/add

to /etc/profile (or to /etc/profile.d or whatever, depends)

HTH
Ross

 
 
 

Newbie question: How to add additional path to the PATH environment string?

Post by neo_in_mat » Sun, 28 Dec 2003 17:35:31


I found /etc/profile.d on my system, there are dozens of files. But I
don't think I could find a suitable file to add that line to.

More details please, I'm a NEWBIE.
 
 
 

Newbie question: How to add additional path to the PATH environment string?

Post by R.F. Pel » Sun, 28 Dec 2003 19:20:54


Then create an extra one.

--
Ruurd
.o.
..o
ooo
 
 
 

Newbie question: How to add additional path to the PATH environment string?

Post by Ross Ax » Mon, 29 Dec 2003 00:07:30


Yeah, what he said.
The idea is that everything inside /etc/profile.d gets run (probably by
/etc/profile) when you log in. My Slackware system has

# Append any additional sh scripts found in /etc/profile.d/:
for file in /etc/profile.d/*.sh ; do
if [ -x $file ]; then
. $file
fi
done

in /etc/profile to run the scripts in /etc/profile.d. Note that this
setup requires all scripts to end with `.sh' and have the executable bit
set. In _Slackware's_ /etc/profile.d, there are 2 versions of all the
scripts, one ending with `.sh' for bash & friends and one ending `.csh'
for csh and friends, which is why the .sh extension is required.

HTH,
Ross