Math functions in shell script?

karish karish at denali.UUCP
Fri Apr 8 14:06:48 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.
>I would like to go through a loop 4 times,
>The code roughly is :
>if test "$cnt" -lt 5
>     do
>        msg$cnt= 'Message 1';;
>        cnt=cnt + 1
>#       ^^^^^^^^^^^ wrong language but message should be clear
>
>     done (etc......)
>
	cnt=`expr $cnt + 1`



More information about the Comp.unix.questions mailing list