1827452 Members
4500 Online
109965 Solutions
New Discussion

MANPATH problem

 
SOLVED
Go to solution
Sauvik Basu
Advisor

MANPATH problem

How do I add something to MANPATH variable permanently?
6 REPLIES 6
Robert-Jan Goossens
Honored Contributor
Solution

Re: MANPATH problem

Hi,

Check your /etc/profile

# Set MANPATH to the contents of /etc/MANPATH, if it exists.
if [ -r /etc/MANPATH ]
then
MANPATH=`cat /etc/MANPATH`
fi
export MANPATH

Add the new path to the /etc/MANPATH file.


Hope this helps,
Robert-Jan
Joseph Loo
Honored Contributor

Re: MANPATH problem

hi,

if u have not modify "# Set MANPATH" variable in /etc/profile, just vi to /etc/MANPATH and add the new path with a colon (:) as a separator.

hope it helps.

regards.
what you do not see does not mean you should not believe
Sauvik Basu
Advisor

Re: MANPATH problem

But I don't have /etc/MANPATH file.So what do I do?
Joseph Loo
Honored Contributor

Re: MANPATH problem

hi,

then u just have to create one.

# vi /etc/MANPATH
/usr/share/man/%L:/usr/share/man:/usr/local/man/%L:/usr/local/man/
after adding the rest of the manual path, chown:
# chown bin:bin /etc/MANPATH
# chmod 444 /etc/MANPATH

regards.

regards.
what you do not see does not mean you should not believe
Vibhor Kumar Agarwal
Esteemed Contributor

Re: MANPATH problem

If you are a normal user, then there might be a possibility you don't have access to /etc/MANPATH.

So just edit your .profile
MANPATH=$MANPATH:...
Vibhor Kumar Agarwal
Bill Hassell
Honored Contributor

Re: MANPATH problem

"I don't have /etc/MANPATH"

Are you running a very old version of HP-UX (pre-10.00)? If so, then /etc/PATH and /etc/MANPATH won't exist and you have no choice but to create something like that in that very obsolete system. If this is 10.20 or 11.xx or later, then someone has removed /etc/MANPATH, which is not a good idea. Many installation and patch packages will add updated pathname information to these files. For 10.xx and higher, your /etc/pofile will have statements like:

PATH=`cat /etc/PATH`
MANPATH=`cat /etc/MANPATH`

(usually wrapped in an if test for readability of those files) If those statements are not in /etc/profile, make sure they go back in again. See the original /etc/profile that came with your system at:

/usr/newconfig/etc/profile

And for pre-10.00 systems, just add a statements like the above to your /etc/profile and simply add to the single line in /etc/MANPATH or /etc/PATH as needed. NOTE: Both files must have one long line (become familiar with vi and very long lines) for the complete list.


Bill Hassell, sysadmin