Integer expression expected

Hi,

I have placed the script and running successfully on AIX
However in Linux it throws integer expression expected
Could some one please help me to fix this

MaxThreshold4alert=`echo "$MaxCapacitycnt*(80/100)" |bc -l`
echo $MaxThreshold4alert

Error:

40.00000000000000000000: integer expression expected

basically I need to get only the number 40 in the output

Try

MaxThreshold4alert=`echo "scale=0; $MaxCapacitycnt*80/100" |bc -l`
echo $MaxThreshold4alert

Or on bash/ksh/sh shells you can also use:

let MaxThreshold4alert=MaxCapacitycnt*80/100
1 Like

Thanks Chuber, the first one worked !