Web lists-archives.com

Re: Recomended tutoial(s) on doing arithmetic in Bash scripts




It is Sunday and I don't like Mondays
tell me why

tomas@xxxxxxxxxx:
> Hm. Neither expr nor bc are bash, they are "external" binaries. If you
> want to do arithmetic in bash, there's $((...)):
> 
>   tomas@rasputin:~$ echo $(( (3+4)/3 ))
>   2

I see your 2 and raise you
nosuchagency@bottomofthesea:~$ echo $(((3000000000+4000000000)/3))
2333333333

Infinitely inaccurate digital systems

> -- tomás

kAt

-- 
 "The most violent element in society is ignorance" rEG