bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BASH bug CDPATH plus redirection


From: Tim Mooney
Subject: Re: BASH bug CDPATH plus redirection
Date: 28 Jun 2001 19:31:52 GMT

In article <m3ofr9fm3o.fsf@multivac.cwru.edu>,
Paul Jarc <prj@po.cwru.edu> wrote:
> mooney@dogbert.cc.ndsu.NoDak.edu (Tim Mooney) writes:
> > I suggest you set your CDPATH variable in your .profile or .bash_profile,
> > and not export it.
> 
> Then it would be set for login shells, but not other interactive
> shells.  Put it in .bashrc as well for them.

If you do that, you need to be careful to not do

        ENV=$HOME/.bashrc

and instead do

        BASH_ENV=$HOME/.bashrc

in your .profile (or .bash_profile, or whatever).  The reason is that
modern shells honor ENV, and will happily read what ENV points to when
starting a script or subshell.  That effectively undoes what the workaround
I suggested is trying to do: don't have CDPATH in the environment for
scripts.

Tim
-- 
Tim Mooney                              mooney@dogbert.cc.ndsu.NoDak.edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164



reply via email to

[Prev in Thread] Current Thread [Next in Thread]