Re: expansions upon arithmetic evaluation in array subscripts

2014-10-14 Thread Chet Ramey
On 10/14/14, 2:17 PM, Linda Walsh wrote: > > > Chet Ramey wrote: > >> >>> Note that it's not only variable expansion, it's also tilde >>> (even though ~ is also an arithmetic operator) expansion. >>> >>> $ HOME=1 a='b[~]' bash -c 'b=(1 2 3); echo $((a))' >>> 2 >>> >>> That means for instance th

Do not create or remove /tmp/xx in make check

2014-10-14 Thread Kiyoshi KANAZAWA
Hello, bash-4.3 make check uses "/tmp/xx" as tmp file. It may destroy user file. Should be done in tests directory. Regards, --- Kiyoshi xx_list.xz Description: Binary data

Re: expansions upon arithmetic evaluation in array subscripts

2014-10-14 Thread Linda Walsh
Chet Ramey wrote: Note that it's not only variable expansion, it's also tilde (even though ~ is also an arithmetic operator) expansion. $ HOME=1 a='b[~]' bash -c 'b=(1 2 3); echo $((a))' 2 That means for instance that foo=-1 echo $((a[~foo])) won't work on systems where there's a "foo

Re: expansions upon arithmetic evaluation in array subscripts

2014-10-14 Thread Chet Ramey
On 10/13/14, 10:28 AM, Stephane Chazelas wrote: > 2014-10-13 09:02:38 -0400, Chet Ramey: > [...] >> You have to put it together. A variable need not be expanded before >> arithmetic evaluation, so the evaluator expands, for instance, a bare >> `a' to `b[$(echo 1+1)]'. When a variable is expanded,