Mac OS X Version Check

#!/bin/bash
 
Version=$( sw_vers | grep ProductVersion | tail -c 7 )
 
if [[ "$Version" < 10.9 ]]
 then
 echo "$Version is less than 10.9"
fi
 
if [[ "$Version" > 10.8.5 ]]
 then
echo "$Version is greater than 10.8.5"
fi

Leave a Reply

Your email address will not be published. Required fields are marked *

*