using the expr command

Hi friends
how can i execute expr $va1 * $var2
provided i m not supposed to use '/' also the
nglob variable is turned off.

hum...

expr $var1 \* $var2 

is that ok?

Or:

expr $var1 '*' $vars

or

#!/bin/sh
res=0
while [ $var1 -gt 0 ]
do
  res=`expr $res + $var2`
  var1=`expr $var1 - 1`
done

:smiley:

i m not supposed to use '\'

Can u use echo command instead of expr

in that case

value=`echo "$var1 * $var2" | bc`

echo $value will give the multiplication value of the given numbers