git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[OT] CDPATH (was: Re: [PATCH] Fix tests when using bash_completion)

From
Julian Phillips <julian@quantumfyre.co.uk>
Date
Apr 23, 2007, 22:57 UTC
Message-ID
<Pine.LNX.4.64.0704232351530.8430@beast.quantumfyre.co.uk>
In-Reply-To
<7vvefmdab8.fsf@assigned-by-dhcp.cox.net>
On Mon, 23 Apr 2007, Junio C Hamano wrote:
Show 10 quoted lines
> Julian Phillips <julian@quantumfyre.co.uk> 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.

Show 14 quoted lines
>
> 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
Previous: Junio C HamanoNext: Ron Parker
Message 5 of 8 in “Fix tests when using bash_completion”
  1. Fix tests when using bash_completionRon Parker, Apr 23, 2007
  2. Junio C HamanoApr 23, 2007
  3. Julian PhillipsApr 23, 2007
  4. Junio C HamanoApr 23, 2007
  5. [OT] CDPATH (was: Re: [PATCH] Fix tests when using bash_completion)Julian Phillips, Apr 23, 2007
  6. Ron ParkerApr 24, 2007
  7. Junio C HamanoApr 24, 2007
  8. Unset CDPATH in the test libraryRon Parker, Apr 24, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.