On Thu, Aug 01, 2002 at 07:20:33AM -0700, Paul Eggert wrote: > -Setting @code{CDPATH} to the empty value is not enough for most shells. > -A simple path separator is enough except for @code{zsh}, which prefers a > -leading dot: > [...] > +To work around the problem, Autoconf-generated scripts unset > +@code{CDPATH} if possible, and set @code{CDPATH} to > +@code{$PATH_SEPARATOR} if @command{unset} is not available.
Looks good, except that the leading "." to pacify zsh got lost in the shuffle. > @@ -9654,7 +9657,7 @@ if (unset FOO) >/dev/null 2>&1; then > else > unset=false > fi > -$unset CDPATH || CDPATH=: > +$unset CDPATH || CDPATH=$PATH_SEPARATOR > @end example That "." wasn't here even in the old version, but probably should be. Seems to me that CDPATH's primary effect (messing with where "cd" takes you) is just as undesirable as the side-effect under discussion (verbosity), so both should be disabled. But one appears a lot harder than the other to do portably. So why not: - Disable the primary effect as Paul suggests: $unset CDPATH || CDPATH=$PATH_SEPARATOR - Rather than trying to disable the verbosity in a highly non-portable way, work around it in a portable (though ugly) way: abs=`cd $rel >/dev/null && pwd` Hmmm, time for a CANONICALIZE_PATHNAME macro? Bonus: it could be made to work with pathnames other than directories. -- | | /\ |-_|/ > Eric Siegerman, Toronto, Ont. [EMAIL PROTECTED] | | / Anyone who swims with the current will reach the big music steamship; whoever swims against the current will perhaps reach the source. - Paul Schneider-Esleben