I need to compare two numbers in a bash script. I get an integer error. Is there any other methods available?
The format for our builds are YYYY.M or YYYY.MM.
So I need to compare that build 2014.7 (July 2014) is older than 2014.10 (October 2014).
#!/bin/bash
NEWVER="2014.10"; # 2014.10
CURVER=$(head -n 1 /release.ver); # 2014.7
if [ $NEWVER > $CURVER ]; then
echo "this version is new";
fi