Math functions in shell script?

Michael Morrell morrell at hpsal2.HP.COM
Fri Apr 8 07:00:59 AEST 1988


#somehow increment cnt and go through loop again
        cnt=cnt + 1
#       ^^^^^^^^^^^ wrong language but message should be clear

Tom Painter    ut-emx!mybest!painter  
	       or uunet!bigtex!mybest!painter 
----------

The proper syntax is to use expr:

   cnt=`expr $cnt + 1`


  Michael Morrell



More information about the Comp.unix.questions mailing list