bug-bash
[Top][All Lists]
Advanced

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

Re: Consequences of shell errors


From: Chet Ramey
Subject: Re: Consequences of shell errors
Date: Thu, 18 Jun 2015 10:47:29 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

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

On 6/18/15 10:40 AM, Eric Blake wrote:
> On 06/18/2015 08:22 AM, Chet Ramey wrote:
>> On 6/18/15 9:08 AM, Eric Blake wrote:
>>> On 06/18/2015 06:51 AM, Chet Ramey wrote:
>> 
>>>> 
>>>> Neither of these are failures; the export command returns
>>>> success.  In fact, according to Posix, the export command cannot
>>>> fail.
>> 
>>> Not quite true; export CAN fail: 
>>> http://austingroupbugs.net/view.php?id=351
>> 
>> Introducing declaration commands that treat arguments as
>> assignments implies that these are variable assignment errors, not
>> return status values from export.  This interpretation doesn't
>> change the description of export, which continues to list `zero' as
>> the only possible exit status.
> 
> Ah, but:
> 
> $ export 1 bash: export: `1': not a valid identifier $ echo $? 1
> 
> How can that be considered a variable assignment error; nothing was 
> assigned?

I didn't say that; I only mentioned what was included in the interpretation
in the link.

Obviously, export can fail.  Posix just doesn't acknowledge it.

- -- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAlWC2foACgkQu1hp8GTqdKvelwCcDXN9w8HdkU0YRUVpW4GtuG+C
IL0Anim1eqHcFeyVG18QpV5wKyP7Mde+
=bCiM
-----END PGP SIGNATURE-----



reply via email to

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