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

toddburch

macrumors 6502a
Original poster
Dec 4, 2006
748
0
Katy, Texas
I want to modify my default PATH for the default shell in Terminal. Can't figure out where the .profile or _login files are on Tiger.

Thanks!
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
By default your user doesn't have a .profile. The system one gets used. But if you add a .profile to your ~ directory then it'll get used...
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
The bash man page indicates that it should be at /etc/profile

And it is :) I'd really not recommend changing it though
 

toddburch

macrumors 6502a
Original poster
Dec 4, 2006
748
0
Katy, Texas
Interesting. I installed JRUBY some time ago and its install modified /etc/profile to set an env. variable (JRUBY_HOME) and it modifies the path there to include its own bin path.

Code:
# System-wide .profile for sh(1)

JRUBY_HOME="/Users/toddburch/jruby-1.0.1"

PATH="/bin:/sbin:/usr/bin:/usr/sbin:$JRUBY_HOME/bin"
export PATH

if [ "${BASH-no}" != "no" ]; then
        [ -r /etc/bashrc ] && . /etc/bashrc
fi

Is that poor form?
 

yellow

Moderator emeritus
Oct 21, 2003
16,018
6
Portland, OR
Is that poor form?

Yes! Exceedingly poor form.

Code:
yellow$ more profile 
# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
        eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
        [ -r /etc/bashrc ] && . /etc/bashrc
fi


Then in your ~/.bash_profile or ~/.profile:

Code:
PATH=$PATH[COLOR="RoyalBlue"]:/usr/local/bin:/sw/bin:/sw/sbin:/Developer/Tools:/usr/X11R6/bin[/COLOR]
export PATH

Where the stuff in blue is the modified PATH.
 

toddburch

macrumors 6502a
Original poster
Dec 4, 2006
748
0
Katy, Texas
OK, thanks yellow. I'll digest this, and a bit of the bash syntax (I have a book) and fix things up accordingly.

Is that "path_helper" something you put together?
 

yellow

Moderator emeritus
Oct 21, 2003
16,018
6
Portland, OR
I was afraid you might have Tiger, but figured not when I looked at your profile and saw that you had a fat MP. My bad. :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.