[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
status on $[arith] for eval arith vsl $((arith))??
From: |
Linda Walsh |
Subject: |
status on $[arith] for eval arith vsl $((arith))?? |
Date: |
Sat, 07 Apr 2012 13:45:55 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Gecko/20100228 Lightning/0.9 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666 |
In modifying some released code on my distro, I ran into the
extensive use
of $[arith] as a means for returning arithmetic evaluations of the
expression.
I vaguely remember something like that from years ago, but never see any
reference to
it -- yet it works, and old code seems to rely on it -- and
"$[(1+2)/3]" looks cleaner than "$(((1+2)/3))". So what's up with that?
If it wasn't designed to run in non-bash environments, I might think it was
an artifact of array evaluation.. I.e. with no array name after $,
instead of that
number being used as an index for the array, it's returned as a raw
value... but
I've seen it in code designed for 'sh'...
Is it an accidental omission from the bash manpage?
- status on $[arith] for eval arith vsl $((arith))??,
Linda Walsh <=
- Re: status on $[arith] for eval arith vsl $((arith))??, Mike Frysinger, 2012/04/07
- Re: status on $[arith] for eval arith vsl $((arith))??, Chet Ramey, 2012/04/07
- Re: status on $[arith] for eval arith vsl $((arith))??, Maarten Billemont, 2012/04/08
- Re: status on $[arith] for eval arith vsl $((arith))??, Chet Ramey, 2012/04/08
- Re: status on $[arith] for eval arith vsl $((arith))??, dethrophes, 2012/04/08
- Re: status on $[arith] for eval arith vsl $((arith))??, Maarten Billemont, 2012/04/09
- Re: status on $[arith] for eval arith vsl $((arith))??, Linda Walsh, 2012/04/09
- Re: status on $[arith] for eval arith vsl $((arith))??, Maarten Billemont, 2012/04/10