On 4/21/16 2:39 PM, Grisha Levit wrote:
> On Thu, Apr 21, 2016 at 1:22 PM, Chet Ramey <chet.ra...@case.edu> wrote:
>>
>>> 1. coproc unsets readonly NAME after the process completes
>>
>> Yes.  This is a gray area.  Under some circumstances, e.g, getopts with
>> OPTARG, defined shell behavior can override a readonly setting.
> 
> Probably should at least disallow this case?
> 
> $ bash -r -c 'coproc PATH { :; }; wait; PATH=/whatever; echo $PATH'
> bash: PATH: readonly variable
> bash: PATH: readonly variable
> /whatever

Yes, even though the restricted shell is not a great example of anything,
it seems reasonable to follow printf/read/mapfile and not overwrite read-
only variables used as coproc names.  getopts will remain an outlier.

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

Reply via email to