Trying to write a script that searches for the version of the Application then returns the value. My problem is the value is three to four intergers long (example 4.3.2).
I have searched for a while and can't find any syntax that would allow you to use a != or -ge for anything higher than a number with periods in it. Just wondering if anyone has a better way or I will just keep adding for every version release.
What I want
else if [ $version1 -ge "9.0.8" ]; then
How it is written now
vercheck=`mdls -name kMDItemVersion /Applications/iMovie.app`
version=`echo ${vercheck:17}`
version1=`echo ${version:1:5}`
[...]
else if [ $version1 = "9.0.8" ]; [ $version1 = "9.1.1" ]; then
echo "You already have this version or a higher version installed"
exit 0
mdls -raw -name kMDItemVersion /Applications/iMovie.app
will give you just the version number without the superfluous stuff.