Math functions in shell script?

Sue LoVerso sue at encore.UUCP
Fri Apr 8 07:01:00 AEST 1988


In article <2653 at juniper.UUCP> painter at juniper.UUCP (Tom Painter ) writes:
>
>I am having problems finding out how to do calculations in a shell script.
>#somehow increment cnt and go through loop again
>        cnt=cnt + 1
>#       ^^^^^^^^^^^ wrong language but message should be clear

cnt=`expr $cnt + 1`

Man expr(1) for more details.
-- 
Susan J. LoVerso		Encore Computer Corp.
sue at multimax.arpa		
encore!sue



More information about the Comp.unix.questions mailing list