HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

setting ENV (Environmental variables ) in HP-UX

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

setting ENV (Environmental variables ) in HP-UX

Hi

what are files used to set env varialbles like PATH, PS1 in HP-UX.
10 REPLIES
Ganesan R
Honored Contributor
Solution

Re: setting ENV (Environmental variables ) in HP-UX

Hi,

it will be /etc/profile and user profile.
Best wishes,

Ganesh.
Sharma Sanjeev
Respected Contributor

Re: setting ENV (Environmental variables ) in HP-UX

Hi

system wise is done in /etc/profile

for user's
$HOME/.profile

Regards
Sanjeev
Everything is Possible as " IMPOSSIBLE" word itself says I M POSSIBLE
James R. Ferguson
Acclaimed Contributor

Re: setting ENV (Environmental variables ) in HP-UX

Hi:

You _really_ need to do some research yourself! You continue to ask fundamental questions that a bit of reading would lead you to the answer. If you have any UNIX/Linux experience you should be able to leverage that to learn more. You will learn much better by applying a little effort.

...JRF...
Steven E. Protter
Exalted Contributor

Re: setting ENV (Environmental variables ) in HP-UX

Shalom,

Assuming you use the POSIX or korn shell.

Set variables in /etc/profile and .profile

PATH=/usr/bin:/usr/contrib/bin:$PATH
export PATH

If you look at /etc/profile on an HP-UX system you will see some examples that will illuminate things.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Gokul Chandola
Trusted Contributor

Re: setting ENV (Environmental variables ) in HP-UX

Hi,
You can set PATH through PATH Command.

PATH=
export PATH

After that you can check that, PATH is exported or not useing..

#echo $PATH

There you will see one more defined path by you.

Regards,
Gokul Chandola
There is always some scope for improvment.
Paul McCleary
Honored Contributor

Re: setting ENV (Environmental variables ) in HP-UX

Hi,

You might find this link useful to answer a range of questions on HP-UX that you might have:

http://docs.hp.com/en/B2355-90950/index.html

HTH, Paul
點燃
Valued Contributor

Re: setting ENV (Environmental variables ) in HP-UX

You can set variables in /etc/profile and .profile

Regards!
Man's mind, once stretched by a new idea, never regains its original dimensions
點燃
Valued Contributor

Re: setting ENV (Environmental variables ) in HP-UX

Hi Senthil,
here is more information..

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=997541

Regards!
Man's mind, once stretched by a new idea, never regains its original dimensions

Re: setting ENV (Environmental variables ) in HP-UX

You can also set PATH from /etc/PATH:
PATH=$PATH:$(< /etc/PATH)
Suraj K Sankari
Honored Contributor

Re: setting ENV (Environmental variables ) in HP-UX

Hi,

/etc/profile and /home/.profile is the file to set the environment veriables
/etc/profile is excuted for every user who loggin to the system and /home/.profile is exeuted for the local user
if you need to set any variable then you need to set into your .profile which is under /home
and if you need to set any variables which is required by all user in the system then you need to edit /etc/profile

Suraj