When trying to compare 2 numbers which are decimal in an if condition, I am getting the following error
./cpu.sh: line 8: ((: 1 -gt 1.0 | bc : syntax error in expression (error token is "1.0 | bc ")
./cpu.sh: line 8: ((: 0 -gt 1.0 | bc : syntax error in expression (error token is "1.0 | bc ")
./cpu.sh: line 8: ((: 2 -gt 1.0 | bc : syntax error in expression (error token is "1.0 | bc ")
./cpu.sh: line 8: ((: 3.0 -gt 1.0 | bc : syntax error: invalid arithmetic operator (error token is ".0 -gt 1.0 | bc ")
#!/bin/bash
val1=$*
for i in $val1
do
if (( $i -gt 1.0 | bc ))
then
echo $i
fi
done