#1
  1. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    758
    Rep Power
    125

    Adding to the beginning of PATH


    I add something to the beginning of PATH:
    Code:
    PATH=/usr/local/mysql-5.6.14-osx10.6-x86_64/bin:$PATH:/usr/local/bin:/usr/local/sbin
    but when I export $PATH I get an error:
    Code:
    -bash: export: `/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql-5.6.14-osx10.6-x86_64/bin': not a valid identifier
    How do I correctly add a path in the beginning?
  2. #2
  3. Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2006
    Posts
    2,687
    Rep Power
    1841
    It's been a long time, but isn't it just export PATH?
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    7
    Rep Power
    0
    Originally Posted by epanagio
    I add something to the beginning of PATH:
    Code:
    PATH=/usr/local/mysql-5.6.14-osx10.6-x86_64/bin:$PATH:/usr/local/bin:/usr/local/sbin
    but when I export $PATH I get an error:
    Code:
    -bash: export: `/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql-5.6.14-osx10.6-x86_64/bin': not a valid identifier
    How do I correctly add a path in the beginning?
    Don't use the $ character in front of PATH, that is causing the problem. Here you have instructions on how to make your variable available to programs lanched from the shell.

IMN logo majestic logo threadwatch logo seochat tools logo