Why am I getting "expr: non-numeric argument" here ?
I thought variables are not typed in bash.
If I initialize SIZE and TIME from command line the script works well.
Can you help ?
TIA
Code:
#!/bin/sh
report ()
{
echo $SIZE $TIME
RATE=`expr $1 / $2`
echo $RATE
}
i='1.00000,0.02012'
read SIZE TIME <<< `echo "$i" | cut -d , -f1-2 --output-delimiter=' '`
echo $SIZE $TIME
report $SIZE $TIME