I'm making a bash script which checks the available space on disk:
if [ check_space -gt "85" ]; then
echo "removing"
else
echo "not removing"
fi
check_space
returns a number like 52
and the check_space
function is:
check_space() {
df /dev/sda1 | tail -1 | awk '{print $5}' | sed 's/%//';
}
It's returning ./backup.sh: line 63: [: check_space: a full expression was expected
(I translated it from spanish, so that maybe not exact translation). What could be wrong?