Math functions in shell script?

Tom Painter painter at juniper.UUCP
Thu Apr 7 09:45:00 AEST 1988


I am having problems finding out how to do calculations in a shell script.
I am assuming there are methods because of the ability to check variables
using -lt, -gt, ... (<,>,etc). Granted this does not necessarily mean 
that they do exist.

I would like to go through a loop 4 times,

The code roughly is :

if test "$cnt" -lt 5
     do
        msg$cnt= 'Message 1';;

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

     done (etc......)

Thanks in advance

Tom
-- 

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



More information about the Comp.unix.questions mailing list