Re: declare -n next=arr[++elem] == nowork ? [[ -v

2021-03-08 Thread Alex fxmbsw7 Ratchev
thank you for your answer i have a question about [[ -v $next ]] i havent tried but you say it works it would ? expand $next but wont it then check '[[ -v ]]' and fail ? ill benchmark the usage of : $next ; before [[ -v now, if its minimal its all fine i can use i just remember it used to work fo

Re: declare -n next=arr[++elem] == nowork ? [[ -v

2021-03-08 Thread Chet Ramey
On 3/7/21 9:36 PM, Alex fxmbsw7 Ratchev wrote: [msg(shbot)] # foo() { declare -a foo=( "$@" ) ; declare i=-1 ; declare -p foo ; declare -n next=foo[++i] now=foo[i] ; while [[ -v next ]] ; do : $now ; done ; printf -- $i ; } ; foo '' 1 2 3 [shbot(~shbot@37.139.2.101)] declare -a foo=([0]="" [1]="1