Path

Discussion in 'Mac Help/Tips' started by mmmdreg, Apr 15, 2002.

  1. mmmdreg macrumors 65816

    mmmdreg

    Joined:
    Apr 14, 2002
    Location:
    Sydney, Australia
    #1
    I might look stupid here but does anyone know how to add directories to ur path? I had fink software in /sw and it was in my path but after i backed it up and partitioned my HD, its not there anymore when i "echo $path". Did i not backup a file that defined my path or something?
     
  2. mmmdreg thread starter macrumors 65816

    mmmdreg

    Joined:
    Apr 14, 2002
    Location:
    Sydney, Australia
    #2
    i found out how to do it. For all those who might want to know one day, in a terminal window, type "setenv PATH ${PATH}:ThePathToTheExecutable" without the quotes...

    -Dreg-
     
  3. mmmdreg thread starter macrumors 65816

    mmmdreg

    Joined:
    Apr 14, 2002
    Location:
    Sydney, Australia
    #3
    actually i was wrong..thats only temporary

    -me-
     
  4. Beej macrumors 68020

    Beej

    Joined:
    Jan 6, 2002
    Location:
    Buffy's bedroom
    #4
    Looks like you have a nice conversation with yourself there! :D
     
  5. teabgs macrumors 68030

    teabgs

    Joined:
    Jan 18, 2002
    Location:
    behind you
    #5
    Hey Beej

    I just noticed your animated avatar...neat.
     
  6. Mr. Anderson Moderator emeritus

    Mr. Anderson

    Joined:
    Nov 1, 2001
    Location:
    VA
    #6
    Ah, the old smoking corn cob.

    I think I liked the prawn better.

    But it is animated, very subtly too, unlike mine. Nice job.
     
  7. evildead macrumors 65816

    evildead

    Joined:
    Jun 18, 2001
    Location:
    WestCost, USA
    #7
    you have to edit ....

    im not that sure how to do it in OS X but I know in Solaris and other S UNIX blends, you just have to edit your .cshrc file. You will find $PATH in there there are aslo other config files for bash and the other schells. Normaly they are found in the users home dirctory.. and there is one for what ever your defalt shell is. I dont see them on my mac right away so I would have to look longer.

    What do you need to add? most command line apps are found in directories that are given and are in the defalt paths for at least the shells that I use.

    most packages are put defalt under /usr/local/bin and sbin anyway

    ******* update... I took a look at it*******

    take a look at the files under /usr/share/init/tcsh
    the file /usr/share/init/tcsh/login is probably what you want to edit.

    you may also want to take a look at what in:
    /etc/csh.cshrc
    /etc/csh.login
    /etc/csh.logout


    Now... if you edit /usr/share/init/tcsh/login you will be editing the original ... so if you mess up ... thats bad. so you will want to make a copy of it and call it some thing like csh.cshrc.save... or something... I think you can just make your own .cshrc file (copy the origional one) and call it .cshrc and put in the users home directory that you will be using.... then eddit the line that sets the PATH. that should work. You can do the same thing with other shells if you use other ones.. I like bash the most my self but csh is defalt for OS X

    if you log in and things are all srewed up.. change shells and go and put everything back the way it was.

    as mmmdreg said above you can use setenv to do it.. but also like he said, its only temp. It lasts as long as your termial window that you did it in, is open. Worse comes to worst.. you could make a double clicable or a just a normal script that you can run when ever you need to change the PATH so you dont have to remeber the comands.

    do you know enuph UNIX commands to do the rest?
    cp
    cd
    ls -a
    su -
    vi or pico


    -evildead
     
  8. mmmdreg thread starter macrumors 65816

    mmmdreg

    Joined:
    Apr 14, 2002
    Location:
    Sydney, Australia
    #8
    actually, I was right after all. You have to do that setenv thing I mentioned above but put it into your ~/.login file. This loads on "login" or basically when you start up a terminal. An alternative to the command I did which does exactly the same thing is "setenv PATH /path/you/want/to/put/in:$PATH" (without the quotes) but again, this has to go your the ~/.login file.
     
  9. Taft macrumors 65816

    Taft

    Joined:
    Jan 31, 2002
    Location:
    Chicago
    #9
    That only sets Path for the current user. If you want it to be global, put it in /etc/csh.login or /etc/csh.cshrc

    Matthew
     

Share This Page