-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Jim Meyering on 10/24/2009 9:23 AM: >> +case `env -- -i PATH="$PATH" echo fail` in >> + pass) ;; >> + *) fail=1 ;; >> +esac > > Thanks, but that cannot work (expecting to invoke ./-i) unless you > have "." in your PATH. Since I don't, that new test fails for me. > > This patch makes it pass. Does it do what you intended?
Yes, I tested with . on my PATH, and didn't catch that. Maybe it would be smarter to rewrite the test to exercise -u instead of -i, as that is less problematic, but your patch looks good for now. > -case `env -- -i PATH="$PATH" echo fail` in > +case `PATH="$(pwd):$PATH"; export PATH; env -- -i echo fail` in > pass) ;; > *) fail=1 ;; > esac > > BTW, this PATH= setting has no effect, > unless your shell lacks an "echo" built-in. I guess some of the confusion I'm seeing is how execvp behaves when encountering a shell script, as opposed to a binary. So there's definitely some thought required to make sure we are writing a portable test of env. - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----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/ iEYEARECAAYFAkrjNzQACgkQ84KuGfSFAYC+FACeI7fNniLts6phG9W+28cPNMIZ EbAAniyMTuXXvCLzZTnEyFhw1D2OYHvv =aK4E -----END PGP SIGNATURE-----