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

Re: Proposed new POSIX sh policy (was: First draft of review of policy must usage)

On Sun,  5 Nov 2006 19:41:40 -0800, Russ Allbery wrote:
> +	    <item><tt>local</tt> to create a scoped variable must be
> +	      supported</item>

Underspecified. local in dash and bash behave differently. In dash the
variable value from outer scope is retained, in bash it is not.
Bugs caused by this do happen: see eg. #381237

Also local in dash is documented to be only allowed at the beginning of
a function, and take only variable names, not assignments, as arguments,
though in practice it seems this is not enforced and more bash-like
behaviour works.

Michał Politowski
Talking has been known to lead to communication if practiced carelessly.

Attachment: signature.asc
Description: Digital signature

Reply to: