-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bob Friesenhahn on 4/12/2008 10:39 AM:
| I have since learned that if CDPATH is set, then the shell prints the
| new path every time the directory path is changed

Actually, it only prints the path if CDPATH was used to find the
directory, and the directory was not anchored.  You can defeat it by using
an absolute path, or by prefixing a relative path with `./'.

| (something I have been
| looking at every day for years).  What does not make sense to me is that
| this happens in non-interactive scripts as well.

Yes.  POSIX requires this non-intuitive behavior.  Which is why it is a
good idea to unset CDPATH at the start of any robust script, in case
CDPATH was accidentally exported (generally, you should set it as a shell
variable rather than an environment variable).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgA694ACgkQ84KuGfSFAYCsvwCfQDfGznAc92tuDoZa+SKBOsmP
hAEAoL+quETWOblfB8/OkkjuMUMuRRu4
=zXnd
-----END PGP SIGNATURE-----


Reply via email to