On Fri, 13 Aug 2004 09:13:14 -0600, Von Fugal <[EMAIL PROTECTED]> wrote: > * Andrew McNabb [Thu, 12 Aug 2004 at 17:36 -0600] > <quote> > > On Thu, Aug 12, 2004 at 02:09:44PM -0600, Chris Alvarez wrote: > > > I've a question about exporting. In my .bashrc file I have the > > > following: > > > > > > export ECLIPSE_HOME=/opt/eclipse > > > export PATH=$PATH:$ECLIPSE_HOME:. > > > > > > if i do that, for some reason the things that I try to append to the > > > path get repeated in it. > > > > > > > echo$PATH > > > /home/calvarez/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:<bla bla > > > blah, more stuff>:/opt/eclipse:.:/opt/eclipse:.:/opt/eclipse:. > > > > Here's one possible explanation (I can't verify it for sure, though): > > every time Bash is started it inherits the environment of its parent > > process. If you start Bash from within another instance of Bash, you'll > > get the effect you described. > > > > I would recommend setting the entire PATH in your .bashrc. For example, > > my .zshrc has the following line: > > > > export > > PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/network/bin:$HOME/bin:/usr/bin/X11:/usr/games/bin" > > > </quote> > > Another possible solution is to set the path in your .profile instead of > .bashrc. The difference between .profile and .bashrc is .bashrc gets sourced > everytime you open a new terminal, eg for every xterm you open. .profile, > however, gets sourced once per login session. So if you login into your > wm or Desktop, your path and such are set then, and when you open a terminal > your not logging in because you already are, so .profile isn't sourced again. > This is one of those things that's really nice to know, but doesn't lend > itself to conspicuous discovery.
This can be a problem though, because some things are run without a login session. It seems to me I've run commands over ssh (without a shell) that only get .bashrc. This is one of my pet peeves about bash, but I figure theres just something I'm not getting. _______________________________________________ newbies mailing list [EMAIL PROTECTED] http://phantom.byu.edu/cgi-bin/mailman/listinfo/newbies
