Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Add another Path

  1. #1
    Join Date
    Sep 2009
    Beans
    101
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Add another Path

    Hello,
    From terminal, echo $PATH gives something like the following:
    Code:
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
    I need to add another path to this path - /home/admin/www/cakephp/cake/console - to be able running cake bake from the terminal.

    I read several posts on the form, but I need to a clear method to do that permanently beside it should keep the current path too. In other word, I'd like to have the following path:
    Code:
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/admin/www/cakephp/cake/console
    Best Regards,
    Said Bakr
    AMD Athlon XP 1800+, Shuttle AK31 V3.1, 1.25 GB DDR RAM, ATI Radeon 9550 with 128 MB DDR and Viewsonic VA1912w wide screen with 1440 X 900 resoultion.

  2. #2
    Join Date
    Feb 2010
    Location
    Chicago metro
    Beans
    1,310
    Distro
    Ubuntu Development Release

    Re: Add another Path

    add
    Code:
    PATH="$HOME/www/cakephp/cake/console:$PATH"
    to the bottom of the user named admin's .profile
    If this helped you, please take the time to rate the value of this post:
    http://rate.affero.net/andrewthomas/

  3. #3
    Join Date
    Sep 2009
    Beans
    101
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Add another Path

    This is not permanent modification or add to the Path. It gives the same old Path when closing the current session of the terminal and starting new one. I need a permanent modification to the Path.
    Best Regards,
    Said Bakr
    AMD Athlon XP 1800+, Shuttle AK31 V3.1, 1.25 GB DDR RAM, ATI Radeon 9550 with 128 MB DDR and Viewsonic VA1912w wide screen with 1440 X 900 resoultion.

  4. #4
    Join Date
    May 2006
    Location
    Switzerland
    Beans
    2,541
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Add another Path

    Quote Originally Posted by saidbakr View Post
    This is not permanent modification
    Of course it is

    Quote Originally Posted by saidbakr View Post
    It gives the same old Path when closing the current session of the terminal and starting new one.
    Then you edited the wrong file. If you put that PATH statement into the right place such as e.g. ~/.bashrc, ~/.profile, ~/.bash_profile (depends on your config) then this will remain in there. So it is permanent.

  5. #5
    Join Date
    Apr 2009
    Location
    Midwest, U.S.A.
    Beans
    1,209
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Add another Path

    And to make it system-wide, add it to /etc/profile using sudo.

    EDIT: You'll have to logout and login for it to take effect.
    Last edited by AlphaLexman; September 2nd, 2010 at 12:29 AM.
    Laptop: Dell Inspiron 8200 - Fedora 13 - Goddard
    Desktop: Self-Built - [Ku, Lu, Xu, U]buntu - Lucid 10.04.3 (LTS)
    Linux User: 498249 / Ubuntu User: 29241

  6. #6
    Join Date
    Sep 2009
    Beans
    101
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Add another Path

    The following is a copy of /etc/profile, so where could I add the new addition to Path?
    Code:
    # /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
    # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
    
    if [ -d /etc/profile.d ]; then
      for i in /etc/profile.d/*.sh; do
        if [ -r $i ]; then
          . $i
        fi
      done
      unset i
    fi
    
    if [ "$PS1" ]; then
      if [ "$BASH" ]; then
        PS1='\u@\h:\w\$ '
        if [ -f /etc/bash.bashrc ]; then
        . /etc/bash.bashrc
        fi
      else
        if [ "`id -u`" -eq 0 ]; then
          PS1='# '
        else
          PS1='$ '
        fi
      fi
    fi
    
    umask 022
    Best Regards,
    Said Bakr
    AMD Athlon XP 1800+, Shuttle AK31 V3.1, 1.25 GB DDR RAM, ATI Radeon 9550 with 128 MB DDR and Viewsonic VA1912w wide screen with 1440 X 900 resoultion.

  7. #7
    Join Date
    Apr 2009
    Location
    Midwest, U.S.A.
    Beans
    1,209
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Add another Path

    Either right before or right after the 'umask 022' on a separate line of course!
    Laptop: Dell Inspiron 8200 - Fedora 13 - Goddard
    Desktop: Self-Built - [Ku, Lu, Xu, U]buntu - Lucid 10.04.3 (LTS)
    Linux User: 498249 / Ubuntu User: 29241

  8. #8
    Join Date
    Sep 2009
    Beans
    101
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Add another Path

    I added the following to the end of /etc/profile - after unmask 002 -
    Code:
    PATH = '/home/admin/www/cakephp/cake/console:/opt/lampp/bin:$PATH'
    Does it need restarting the computer to be applied?
    Last edited by saidbakr; September 2nd, 2010 at 01:16 AM. Reason: spelling
    Best Regards,
    Said Bakr
    AMD Athlon XP 1800+, Shuttle AK31 V3.1, 1.25 GB DDR RAM, ATI Radeon 9550 with 128 MB DDR and Viewsonic VA1912w wide screen with 1440 X 900 resoultion.

  9. #9
    Join Date
    Apr 2009
    Location
    Midwest, U.S.A.
    Beans
    1,209
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Add another Path

    No, just logout and log back in.
    Laptop: Dell Inspiron 8200 - Fedora 13 - Goddard
    Desktop: Self-Built - [Ku, Lu, Xu, U]buntu - Lucid 10.04.3 (LTS)
    Linux User: 498249 / Ubuntu User: 29241

  10. #10
    Join Date
    Sep 2009
    Beans
    101
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Add another Path

    I performed logout and restarting, but I only get the old Path
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

    without any new Path added as described before.

    Is there anything wrong in the line that I had added to /etc/profile ?
    Best Regards,
    Said Bakr
    AMD Athlon XP 1800+, Shuttle AK31 V3.1, 1.25 GB DDR RAM, ATI Radeon 9550 with 128 MB DDR and Viewsonic VA1912w wide screen with 1440 X 900 resoultion.

Page 1 of 3 123 LastLast

Tags for this Thread

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
  •