Operating System - HP-UX
1828045 Members
1667 Online
109973 Solutions
New Discussion

Setting up the PATH environment variable

 
SOLVED
Go to solution
Nikee Reddy
Regular Advisor

Setting up the PATH environment variable

Hello,

I would like to add the /opt/java1.4/bin path along with the exisitng path to the oracle user. How can I add this path to the exisiting path?

Thanks,
Nikee
10 REPLIES 10
Steven E. Protter
Exalted Contributor

Re: Setting up the PATH environment variable

In .profile

PATH=$PATH:/opt/java1.4/bin:
export PATH

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
TSaliba
Trusted Contributor

Re: Setting up the PATH environment variable

hi

in the oracle user profile add the following:

export PATH=$PATH:/opt/java1.4/bin
TS
jj
Nikee Reddy
Regular Advisor

Re: Setting up the PATH environment variable

Hello,

The system is responding with the following error message, when I run the following command:

export PATH=$PATH:/opt/java1.4/bin:

Thanks,
Nikee
Nikee Reddy
Regular Advisor

Re: Setting up the PATH environment variable

I am sorry the error is "Variable syntax."

Thanks,
Nikee
doug mielke
Respected Contributor
Solution

Re: Setting up the PATH environment variable

to test first you can
PATH=$PATH\;/opt/java1.4/bin

If you need all other users to have access to this path, consider adding to /etc/profile.

If there are other versions of java, with executables of the same name, you may have to experement with the placement in the path of this new entry.
ie: PATH=/opt/java1.4/bin\;$PATH
TSaliba
Trusted Contributor

Re: Setting up the PATH environment variable

hi
do you have csh shell?
jj
TSaliba
Trusted Contributor

Re: Setting up the PATH environment variable

hi
if you have csh shell you must add the following:
setenv PATH $PATH\:/opt/java1.4/bin

TS
jj
Michael Schulte zur Sur
Honored Contributor

Re: Setting up the PATH environment variable

Hi,

I think, TS is right. csh produces that error.

greetings,

Michael
Nikee Reddy
Regular Advisor

Re: Setting up the PATH environment variable

Hello Guys,

Now its working.

Thanks for the quick response.

Regards,
Nikee
Bill Hassell
Honored Contributor

Re: Setting up the PATH environment variable

The answers are valid for sh, ksh and csh (with the right syntax) but HP-UX n\makes this much easier if all users need java1.4 in their PATH variables. Just edit /etc/PATH and append the path onto the end of the (very long) line. Use A to move vi to the end of the line and append. Now, no change is necessary for any 'normal' shell user, just login again and they'll get the new $PATH.

Security alert: Be very careful not to insert : as the first character on the line, or to insert 2 adjacent :: characters or append :> or :: on the end of the line. In all cases, these character combinations are shorthand for $PWD or the current working directory. To see how this can be a big problem, do this:

cd
echo "echo Big Mistake! I am \$0 in your PATH" > su
chmod 755 su

I leave this file in my HOME directory and if I type su and get the above error message, I am reminded that this is a security risk and this simple notice could have been a hacker's attempt to steal my password.


Bill Hassell, sysadmin