bug-bash
[Top][All Lists]
Advanced

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

Re: param expansion with single-character special vars in the environmen


From: Chet Ramey
Subject: Re: param expansion with single-character special vars in the environment
Date: Mon, 2 May 2016 14:48:48 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Thunderbird/45.0

On 5/2/16 12:12 PM, Chet Ramey wrote:
> On 4/27/16 4:07 PM, Eduardo A. Bustamante López wrote:
> 
>> The 'mapfile' one is interesting, because it drops the nameref attribute from
>> the 'r' variable.
> 
> Array variables can't have the nameref attribute.  The process of creating
> and clearing the array with the name supplied as an argument clears that
> attribute.  Maybe it should display a warning.

I was poking around with this idea to see what ksh93 does, and it's not all
that consistent.  Consider the difference in behavior between these two
cases.  This one throws an error:

typeset -n foo ; typeset -i foo=7*6 ; typeset -p foo

and this one throws away the nameref attribute:

typeset -n foo ; typeset -i foo ; foo=7*6 ; typeset -p foo

-- 
``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/



reply via email to

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