Re: path keeps bloating with repeated entries on invoking subshells
- From: Robert Heller <heller@xxxxxxxxxxxx>
- Date: Wed, 30 Jul 2008 15:41:09 -0500
At Wed, 30 Jul 2008 16:18:45 +0000 (UTC) Rahul <nospam@xxxxxxxxxxxxxx> wrote:
In my tcshell I used to follow the construct:
set path=(./ ~/bin/ ~/bin/foocmds [snip]........ $path)
I thought this was the right way to go since I only append to the
systemwide path settings without overwriting anything as a user.
But yesterday I got a "word too long error" and on investigation I find
that each time I invoke a subshell (say, I made a change to the .cshrc or
added a new script to the bin) I find that the path keeps bloating up with
duplicate entries (I guess a side-effect of appending the $path at the
end).
Is there a smart-way around this?
Don't set your path in your .bashrc. Set it in your .bash-login.
Environment variables (like path) are inherieted by sub-shells and every
sub-shell sources .bashrc, so your path is both inherieted AND is being
prepended to.
--
Robert Heller -- Get the Deepwoods Software FireFox Toolbar!
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
heller@xxxxxxxxxxxx -- Contract Programming: C/C++, Tcl/Tk
.
- References:
- Prev by Date: Re: usb stick and ext3?
- Next by Date: Re: path keeps bloating with repeated entries on invoking subshells
- Previous by thread: Re: path keeps bloating with repeated entries on invoking subshells
- Next by thread: Re: path keeps bloating with repeated entries on invoking subshells
- Index(es):
Relevant Pages
|