On 2008-08-26 11:50, Ron Johnson wrote:
> On 08/25/08 20:34, s. keeling wrote:
>> Ron Johnson <ron.l.johnson@cox.net>:
>>> On 08/24/08 11:32, Rick Pasotto wrote:
>>>> Why pipe it to bc? Keep it in the shell:
>>>>
>>>> $ echo $[$[$(date -d 20090824 +%s) - $(date -d 20080724 +%s)] / 86400]
>>>> 396
>>> [snip]
>>>
>>> One stylistic reason for piping to bc is that some people think that
>>> bash's $[] syntax gets too hard to read if you nest it too much.
>>
>> I've been running *nix on my home boxes since '93, and I've never even
>> seen that syntax. That's a bashism, I hope?
>
> Yes. And a relatively modern one at that. Somewhere in the 3.x series.
Maybe not tooooo modern. Just looking at man bash on lenny:
Arithmetic Expansion
Arithmetic expansion allows the evaluation of an arithmetic
expression and the substitution of the result. The
format for arithmetic expansion is:
$((expression))
The old format $[expression] is deprecated and will be removed in
upcoming versions of bash.
--> *old format*
Johannes
Attachment:
signature.asc
Description: OpenPGP digital signature