Hi. I'm new to shell script and i have a problem
My code
ssh $i df -h|grep -ve Use | awk '{ if ( substr( $5, 1, length($5) - 1) > 80 ) echo -n "-----\n"$5" "$6 ; else echo -n "------\nOK!" }' | sort -u
The problem is : for example, if the %Use is ( 78;81 ), the scripts will print both "78" and "OK". I just want to print "78". "OK" is printed only if all the %Use < 80.
The same problem with this
if [ $j -gt 80 ]
then
echo $j"% " $name
else
echo "\nOK!\n"
fi
Can someone help me solve this