Problem in arithemetic operation

Hi All,

I am facing a problem while doing arithemetic operation
My code pasted below.

COUNT_BREAKTIME=`expr ($COUNT_TOTALTIME1 - $COUNT_AVGTIME) / $COUNTER`

error is ./OFR_Break_Avgtime.sh: command substitution: line 30: syntax error near unexpected token `$COUNT_TOTALTIME1'
./OFR_Break_Avgtime.sh: command substitution: line 30: `expr ($COUNT_TOTALTIME1 - $COUNT_AVGTIME) / $COUNTER'

can any one help me

expr is picky about its syntax, it wants spaces between everything; in particular, on both sides of parentheses, operators, variables, and, well, everything else. You also need to quote or backslash-escape the parentheses, otherwise you will get a warning from the shell. (Actually that's the warning you are getting at the mo.)

echo "($COUNT_TOTALTIME1 - $COUNT_AVGTIME) / $COUNTER" | bc

Thanks its working