a=$(df -h | grep -E 'root' | awk ' { print $5 " " $1}' | cut -f1 -d " " )
echo $a
b=${a::-1}
echo $b
if [ $b -ge 90 ] ; then
echo "hello"
else
echo "nope"
fi
in terminal you do it like this
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | awk '{ print $1}' | cut -d '%' -f1
echo $a
b=${a::-1}
echo $b
if [ $b -ge 90 ] ; then
echo "hello"
else
echo "nope"
fi
in terminal you do it like this
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | awk '{ print $1}' | cut -d '%' -f1
No comments:
Post a Comment