Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

span870

macrumors newbie
Original poster
Jul 31, 2006
4
0
Hi everyone
I have a problem and hopefully you guys can help me!
I'm pretty new to UNIX, but i'm running Mac OSX 10.4.4 and am trying to add some things to my class path in X11.
My first thought was to try and track down '.profiles' file (as I'm using the BASH shell) and it is non-existent in my home directory...
After moving up a few directories i found the '/etc/profiles/' file and tried adding to the path using emacs, however it says its read-only...

I'm using the command
export PATH="$PATH:Developer/Tools"
is this right?

Eventually i would like to add many things to my path, except i dont want to use the above command in the shell everytime, as it seems only temporary

Can someone help me? I really appreciate it
Thanks, Simon :)
 
Don't add stuff to /etc/profiles.. that's a global file that all shells inherit for all users that open an xterm/Terminal window by default. Changing it could have unintended security implications. For godssake, if you do change it, make a backup of the original first. Wheeo.

Now.. just make a file called .profiles in your home directory and export the paths you want there.

Code:
export PATH=$PATH:/usr/sbin/:/usr/local/bin:/Developer/Tools

Etc..

Learn you use Darwin more effectively (and safely): http://osxfaq.com/Tutorials/LearningCenter/index.ws

Enjoy!
 
Thanks for your help yellow :)


just one question though, when I use the command
echo $PATH, it doesnt seem to have added '/Developer/Tools' to the path?
is this just my ignorance?


Thanks
 
Did you 1) Open a new xterm/Terminal windows or 2) do: source ~/.profile in your open shell to reload the profile (and therefore the path)?
 
Thankyou sooo much for your help. It's all working fine now, i didn't realise the .profiles is executed when the shell is initially loaded.

Here's to becoming a UNIX whiz now!


cheers, SImon
 
actually before i get carried away! I didn't even test running a command

so i reload the .profile file, using the 'source' command, and it seems to have added it to the path:

:/usr/sbin/:/usr/local/bin/:/Developer/Tools/:/Developer/Applications

however when i test it out using something like

open Xcode.app (from my home directory), it says it cant find the file.

Also when i re-open the shell, it still gives me the old path, and doesnt even appear to execute the .profile file....

Whats going on?
I think it may have something to do with the fact that i launch it from the X11 from the dock


Regards, Simon
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.