Re: dc and bc in Important?
On Jun 28, Carey Evans wrote
> firstname.lastname@example.org (Erik B. Andersen) writes:
> > For most math, expr works just fine. Of course, expr is limited
> > to integer math, but it works and is portable.
> Actually, for integer math, bash or ksh works quite well.
> bash$ a=41
> bash$ let a+=1
> bash$ echo $a
> Carey Evans <*> email@example.com
iThis is correct, but has the unfortunate side effect of not being portable,
since not all /bin/sh happin to be bash. If you want to allow the program
to run on non-Linux machines, or machines running ash, etc. then expr
is the most portable way. If you don't care about using bash-isms, which
is often the case for Debian, then what you describe above is much easier.
Erik B. Andersen Web: http://www.inconnect.com/~andersen/
--This message was written using 73% post-consumer electrons--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
Trouble? e-mail to firstname.lastname@example.org .