bug-bash
[Top][All Lists]
Advanced

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

Re: Doc of "set -e" should mention non-locality


From: Chet Ramey
Subject: Re: Doc of "set -e" should mention non-locality
Date: Thu, 05 Jul 2012 12:07:44 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

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

On 7/5/12 11:55 AM, Dan Douglas wrote:

>> Remember that my main suggestion is to clearly document the intended
>> behavior (see the subject). This could mean to add a generic
>> paragraph to the documentation of "set" that describes the scope
>> and extent for all options. 
> 
> I'm all for better documentation. Scope in Bash is a complex subject. Almost 
> none of it is documented, and there is little standardization around how 
> function scope is supposed to work anyway. I'd call set -e a low priority 
> relative to documenting what scope behaviors are actually in place.

There really isn't that much scope.  Posix barely acknowledges the
existence of scopes, period.  It doesn't have local variables, options,
or traps.

The paragraph in the bash man page describing the behavior of the ERR,
DEBUG, and RETURN traps, and the various descriptions of local variables,
are about it.

Bash's use of dynamic scoping is where the complexity comes in, I think,
but the implementation is, I hope, consistent.

Chet
- -- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/1u9AACgkQu1hp8GTqdKs19QCfRvkBQ0rUxgNklTCZYhliQv4j
d8MAoIfmHmDq9y3EP3y2wxz0fCshO+bo
=EmUI
-----END PGP SIGNATURE-----



reply via email to

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