On 7/6/17 12:41 AM, Arnaud Gaillard wrote:

> Bash Version: 4.4
> Patch Level: 12
> Release Status: release
> 
> Description:
> 
>             According to the help page of the `printf` builtin, it
> should not return success when an error has occurred during the
> assignment:
> 
>> Exit Status:
>> Returns success unless an invalid option is given or a write or assignment
>> error occurs.
> 
> Assigning a value to a `readonly` variable returns an error code:
> 
>> bash$ readonly a=2
>> bash$ a=3
>> -bash: a: readonly variable
>> bash$ echo $?
>> 1
> 
> However, assigning the value to a `readonly` variable via `printf -v`
> returns success:

Thanks for the report.  This is a reasonable improvement to make.

Chet

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

Reply via email to