bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EXIT_CANCELED


From: Eric Blake
Subject: Re: EXIT_CANCELED
Date: Sat, 24 Oct 2009 11:19:49 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----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             address@hidden
-----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-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]