Hey @ruanyf ,
I was running the CPU.sh
script, but the USE variable is getting a floating-point value instead of an integer. Because of this, the script does not enter the if block even when USE is greater than MAX.
Suggestion:
USE=$(grep 'cpu' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage "" }' | awk -F. '{print $1}')
Output:
./CPU.sh
./CPU.sh: line 7: [: 11.6836: integer expected
Should I create PR for this?