I always use Perl when I need to do some calculation.
$ perl -le 'print <arithmetic expression here>'
The debugger is handy for iterative calculations:
$ perl -de0
Update - tip: Be careful with constructs like:
print (5 + 4) * 3;
This is equivalent to (print 5 + 4) * 3, probably not what you want.
In reply to Re: Favourite One-liners?
by calin
in thread Favourite One-liners?
by ghenry
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |