I'm trying to write my own bash script that detects if Debian's release version is less than 9.0
code:
VERSION=$(cat /etc/debian_version)
echo $VERSION
if [ "$VERSION" -lt "9.0" ]; then
echo "Debian version is less than 9"
else
echo "Debian version is greater than 9"
fi
but the error i'm receiving is:
./test.sh: line 4: [: 8.2: integer expression expected
basically, $VERSION
is a string type, but it's 8.2
. I'm trying to make it become 8.2
, but as a float. so I can use <=
on it.