On Jun 28, Carey Evans wrote
> [EMAIL PROTECTED] (Erik B. Andersen) writes:
> 
> [snip]
> 
> > 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
> 42
> 
> -- 
>                 Carey Evans  <*>  [EMAIL PROTECTED]
> 

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

--
Erik B. Andersen   Web:    http://www.inconnect.com/~andersen/ 
                   email:  [EMAIL PROTECTED]
--This message was written using 73% post-consumer electrons--


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .

Reply via email to