Operating System - HP-UX
1834208 Members
2610 Online
110066 Solutions
New Discussion

How to set the envionment variables PATH?

 
SOLVED
Go to solution
westcamp_hu
Occasional Contributor

How to set the envionment variables PATH?

I want set the envionment variables 'PATH' in system default in hp_ux 11.0,so that I must not set the PATH for every user.How can I do? Please Thanks.
westcamp_hu
6 REPLIES 6
S.K. Chan
Honored Contributor

Re: How to set the envionment variables PATH?

To set a global PATH for every users you would do this in the file /etc/profile.
For example :-

PATH=/usr/bin:/bin:/usr/bin/X11
PATH=$PATH:/usr/apps/bin:/usr/apps/bin/X11

Just edit appropriately.
Mohammad Iqbal_1
Occasional Advisor
Solution

Re: How to set the envionment variables PATH?

Write the entry in /etc/skel/.profile file.
Iqbal "the Captain"
Pete Randall
Outstanding Contributor

Re: How to set the envionment variables PATH?

Your /etc/profile should contain the following:
export PATH=`cat /etc/PATH`
export MANPATH=`cat /etc/MANPATH`

Set up /etc/PATH like so:
yukon(166)root# cat /etc/PATH
/opt/informix/bin:/opt/informix/local/bin:/opt/fourgen/bin:/opt/softbench/bin:/u
sr/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/sbin:/opt/ansic/bin:/opt/nettladm/bin:
/opt/cobol/bin:/opt/langtools/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:
/opt/fcms/bin:/opt/upgrade/bin:/opt/imake/bin:/opt/hpxt/enware/bin:/opt/REEL/bin
:/opt/dtcmgr/sbin:/opt/pd/bin:/opt/fortran/bin:/opt/perf/bin:/bin:/opt/ignite/bi
n:/opt/lrom/bin:/opt/hparray/bin:/opt/java1.2/bin:/opt/java/bin:/opt/groff/bin:/
opt/fantasia/bin:/opt/fantasia:/opt/grafsman/bin:/opt/Acrobat/bin:/opt/gnu/bin:/
opt/fortran90/bin:/opt/fortran90/contrib/bin:/opt/omni/bin:/opt/dynatext/bin:/op
t/OV/bin/OpC:/opt/resmon/bin:/opt/pred/bin:/opt/sas82:/bin/posix:/usr/local/bin:
/opt/cobol:/apps/hols/bin/shared:/usr/sbin/stm/uut/bin/progs

Only an example - put whatever you need in /etc/PATH.

Hope this helps,
Pete

Pete
Juan Manuel López
Valued Contributor

Re: How to set the envionment variables PATH?

You have to add your path on /etc/path
If you want to add a man path for an aplication man, edit /etc/manpath

Check the sintaxis on these files to see how add the entries.

I hope this help you.

Juanma.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.
Darrell Allen
Honored Contributor

Re: How to set the envionment variables PATH?

Hi,

The default /etc/profile utilizes /etc/PATH. Make changes there for those who use Bourne shell and it's derivitaves (K, Posix).

/etc/csh.login needs to be modified if you have csh users.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Bill Hassell
Honored Contributor

Re: How to set the envionment variables PATH?

Actually, the purpose of the file: /etc/PATH is to eliminate having to change .profile, .cshrc, .kshrc, etc since the primary login profiles: /etc/profile and /etc/csh.login already reference /etc/PATH.

A couple of notes:

- /etc/PATH is one long line

- Two adjacent :: chars or :.: will include the current working directory, a security risk for all users, expecially root

- Excessively long /etc/PATH strings means excessively long delays searching for a match, the possibility of duplicate paths (and the requsite search again), and the possibility of mistakes going unnoticed.

- Use aliases for specific commands, or an env variable such as $ORAHOME or $IFMXBIN to 'remember' long pathnames.

- Good script writing will temporarily establish a local $PATH inside the script with just a few directories to prevent Trojan Horses from running.


Bill Hassell, sysadmin