Operating System - HP-UX
1835662 Members
3442 Online
110082 Solutions
New Discussion

Re: update environment variables for all users

 
Anthony Alvarez_1
Occasional Contributor

update environment variables for all users

Could you kindly share your experience with me?

The nano editor has just installed to our HPUX 10.20 machine. How can
the path be modified so that ALL users can simply type "nano" to
start the program without knowing the file locatation of nano?

The nano editor has been installed to /opt/nano/bin/nano.

Precompiled nano editor binary for HPUX 10.20 ...
http://hpux.cs.utah.edu/hppd/hpux/Editors/nano-1.1.6/

I am new to installing software on UNIX. Where can a tutorial about
configuring startup enviroment variables be found on the Internet?
For example: PATH and MANPATH.

Any advise, tips, comments or suggestions are welcome. Please advise.
Thank you
8 REPLIES 8
Rodney Hills
Honored Contributor

Re: update environment variables for all users

Within /etc/profile (system wide setup), enter the following

alias nano=/opt/nano/bin/nano

Then a user only needs to enter
nano filename

to run nano

-- Rod Hills
There be dragons...
Pete Randall
Outstanding Contributor

Re: update environment variables for all users

Or, assuming you are using /etc/PATH in /etc/profile (which you should be), you can simply add the path to your nano executable to /etc/PATH.

Pete

Pete
harry d brown jr
Honored Contributor

Re: update environment variables for all users

You could easily just put a symbolic link in /usr/bin

ln -s /opt/nano/bin/nano /usr/bin/nano

or modify all of the profiles you might have on the system.

Or modify /etc/profile

live free or die
harry
Live Free or Die
Klaus Crusius
Trusted Contributor

Re: update environment variables for all users

Add :/opt/nano/bin to /etc/PATH.
Also add :/opt/nano/man to /etc/MANPATH.

These files should be used in /etc/profile in a way like PATH=/mypathes:$(/etc/PATH)

Thanks, Klaus
There is a live before death!
A. Clay Stephenson
Acclaimed Contributor

Re: update environment variables for all users

My preference for doing this is to make symbolic links in /usr/bin for the actual executables especially those that are invoked often or repeatedly in scripts. You can take a big performance hit by having an extremely long PATH setting for commands that are executed often and are near the end of PATH variable. You can certainly simply add to /etc/MANPATH but for heavily used commands, you need to rethink the problem and use symbolic links.

If it ain't broke, I can fix that.
Ameet_HP
Frequent Advisor

Re: update environment variables for all users

Making a symbolic link will run the command easily with current set up. Adding alias in /etc/profile will also be useful if it needs to load any another variable file.

Ameet
Bill Hassell
Honored Contributor

Re: update environment variables for all users

To answer your question about documentation, all HP-UX documentation is online and can be downloaded from:

http://docs.hp.com

However, you will need a broader view of HP-UX system administration to be successful. I would suggest looking at Marty Poniatoski's books on HP-UX. Go to Amazon or Barnes&Noble and search for HP-UX.


Bill Hassell, sysadmin
T G Manikandan
Honored Contributor

Re: update environment variables for all users

For sh and ksh

you can use /etc/profile
PATH=$PATH:/opt/nano/bin

For csh
set path=($path /opt/nano/bin)

for MANPATH

MANPATH=$MANPATH:/opt/nano/man


Also you can set the path in

/etc/PATH or /etc/MANPATH



THanks