Results 1 to 3 of 3

Thread: Add paths to $PATH and $MANPATH

  1. #1
    Join Date
    Mar 2008
    Location
    Behind you...
    Beans
    Hidden!
    Distro
    Ubuntu 11.04 Natty Narwhal

    Question Add paths to $PATH and $MANPATH

    I've searched on this topic for the last two hours and this (probably) very simple question is still unanswered.
    Please can someone tell me how to add paths to $PATH and $MANPATH ?
    The "solutions" I found via Google don't seem to work...

    Sorry for my bad English and thanks in advance.

  2. #2
    Join Date
    May 2009
    Location
    Grenoble, France
    Beans
    131
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Add paths to $PATH and $MANPATH

    Hi,

    it is very simple, you have to type:

    export PATH=$PATH:/the/path/you/want

    This is a valid command using the bash shell, but "bash" is the default on most linux installation. I will explain the command. The keyword "export" means make the change visible also for the other program that I can launch. Afterward is pretty self-explanatory, in bash to define a variable you type

    export MYVAR='the value of the variable'

    In the case of the PATH we have used $PATH on the right hand side of the expressions. When you have a dollar before a variable name the shell (bash) will expand it to its value.

    With MANPATH I guess you can just do the same.

    Francesco

  3. #3
    Join Date
    Jan 2008
    Location
    Poland/Warsaw
    Beans
    269
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Add paths to $PATH and $MANPATH

    @fr4nko
    MANPATH variable in Ubuntu Karmic is empty. manpath command gives sth like that, though:
    /usr/local/man:/usr/local/share/man:/usr/share/man

    If one wants to change manpath output, they should either modify /etc/manpath.config file (which isn't easy) or create new MANPATH variable.

    Example - recently, I replaced cdrkit packages with original cdrtools. Because of that, I had to add /opt/schily/man to manpath. A correct way is to do that:
    Code:
    unset MANPATH
    export MANPATH=/opt/schily/man:$(manpath)
    It's important to unset MANPATH first so that it actually takes real manpath output (inherited from /etc/manpath.config) before each change.

    Next 'manpath' invocation informs about a change:
    Code:
    $ manpath 
    manpath: warning: $MANPATH set, ignoring /etc/manpath.config
    /opt/schily/man:/usr/local/man:/usr/local/share/man:/usr/share/man
    Last edited by mgol; December 28th, 2009 at 01:45 PM.
    Michał Gołębiowski
    Dell Latitude E6500: P8600 | Intel GMA 4500MHD | 15,4'' 1440x900 LED (matte) | 4GiB DDR2 | 233 GiB HDD 7200 rpm (with Free Fall Sensor).
    Jabber ID: mgol /at/ jabster.pl - let me write in within my profile details, please!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •