From: Julian Phillips Date: Mon, 23 Apr 2007 22:57:27 GMT Subject: [OT] CDPATH (was: Re: [PATCH] Fix tests when using bash_completion) Message-ID: In-Reply-To: <7vvefmdab8.fsf@assigned-by-dhcp.cox.net> On Mon, 23 Apr 2007, Junio C Hamano wrote: > Julian Phillips writes: > >> (I'm not the only one who thinks CDPATH is ick am I? :S) > > CDPATH is Ok as long as it stays as an interactive shell > variable. > > Sadly, if you google for "CDPATH environment", you would see > many many hits. That variable is not meant to be used as an > environment variable. True - though personally I tend to use more discriminate shell functions anyway. > > Something like this in .bashrc is acceptable: > > case "$PS1" in > '') > ;; # do not do useless thing for noninteractive > ?*) > CDPATH=my:favorite:path > . $HOME/.bash-completion > ;; > esac > > but people usually are way too careless than that and export > CDPATH to the environment, and that is where breakages start. I guess part of the problem is that a lot of these people don't actually understand the difference between shell variables and environment variables, or why the distinction is useful. Plenty of people seem to do "export FOO=..." by rote. -- Julian --- Anyone can hold the helm when the sea is calm. -- Publius Syrus