Re: path keeps bloating with repeated entries on invoking subshells



On Wed, 30 Jul 2008 16:18:45 +0000 (UTC), Rahul 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?

I set an environment variable (_my_path) and if _my_path is not set
set it, and add it to $PATH.

.



Relevant Pages

  • Re: Capture console output to file ?
    ... In article, Jeffrey Ross wrote: ... > If you want to append to these files rather than overwriting them use ... > If you want both stdout and stderr in the same file (noting that they may ...
    (linux.redhat)
  • Re: WriteFile, insert data in the middle of the file.
    ... of the file without overwriting what's already there. ... What most programs do is create a temp file write everything they want to ... > all the data from the insertion point, and append my new data, and write ... Isn't this too inefficient? ...
    (microsoft.public.vc.mfc)
  • Re: Append to the end of file when "write"
    ... append the new content to the end of the file (instead of ... overwriting the current content). ... FileStream lStream = ... The FileInfo class exposes an AppendText method, ...
    (microsoft.public.dotnet.general)
  • Re: Append mode in write operation
    ... overwriting the current content). ... believe the append mode is defined with different parameters from the ... What are the correct parameters to define the "append" ...
    (microsoft.public.dotnet.general)
  • Re: path keeps bloating with repeated entries on invoking subshells
    ... I thought this was the right way to go since I only append to the ... systemwide path settings without overwriting anything as a user. ... Don't set your path in your .bashrc. ... sub-shell sources .bashrc, so your path is both inherieted AND is being ...
    (comp.os.linux.misc)