command-line calculator?
Sergey Zaharchenko
doublef at tele-kom.ru
Fri Jun 25 19:50:04 PDT 2004
On Fri, Jun 25, 2004 at 01:31:33PM -0600,
Warren Block probably wrote:
> On Fri, 25 Jun 2004, Parv wrote:
>
> > Perl:
> > perl -e 'print +(17 * 36)'
>
> Or just
>
> perl -e 'print 17 * 36'
>
> but for neatness
>
> perl -e 'print 17 * 36, "\n"'
Or just
$ sh -c 'echo $((17*36))'
612
or
$ echo $((17*36))
if you use sh as your interactive shell.
--
DoubleF
The first time, it's a KLUDGE!
The second, a trick.
Later, it's a well-established technique!
-- Mike Broido, Intermetrics
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040626/c93ee56e/attachment.bin
More information about the freebsd-questions
mailing list