This blog has moved! Redirecting...
You should be automatically redirected. If not, visit http://scrolls.mafgani.net/ and update your bookmarks.

Monday, September 25, 2006

BASH as a simple calculator

As long as you are satisfied with integer results:

[darkknight@darkworld ~]$ echo $[32 * 98]
3136
[darkknight@darkworld ~]$ echo $[332 / 98]
3
[darkknight@darkworld ~]$ echo $[29 + 56]
85
[darkknight@darkworld ~]$ echo $[29 - 156]
-127

0 Comments:

Post a Comment

<< Home