Re: COMPREPLY as a nameref to a readonly associative array

2017-02-25 Thread Chet Ramey
On 2/24/17 6:57 PM, Grisha Levit wrote: > It's possible to change any readonly associative array to the indexed > array (''): Thanks for the report. It really is possible to do a lot of dumb things if you try hard enough. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer

COMPREPLY as a nameref to a readonly associative array

2017-02-24 Thread Grisha Levit
It's possible to change any readonly associative array to the indexed array (''): $ declare -rA var=([foo]=bar) $ f() { declare -ng COMPREPLY=var; } $ compgen -F f . bash: compgen: warning: -F option may not work as you expect $ declare -p var declare -ar var=([0]="")