I don't know why I am getting this error --> : integer expression expected: [: 82
value 82 comes from CURRENT. I am trying to grab the disk space usage and assign to variable called CURRENT and then email out. I don't know where I am going wrong? Any help is appreciated.
#!/bin/bash
[email protected]
THRESOLD=80
CURRENT=$(df -H | grep '/dev/mapper/cvs-cvs' | awk '{ print $5}' | cut -d'%' -f1)
if [ $CURRENT -ge $THRESOLD ]; then
echo "My CVS disk space usage is $CURRENT %" | mailx -s "Disk Space Usage" $ADMIN
fi
bash -x script.sh.set -vxis the shell debugger/verbose mode. Add that before you suspect line of code, then see the values that are substituted from CURRENT and THRESHOLD. Good luck.