Open joobei opened 3 years ago
Yes, since it is comparing 11.X to 10.8 by comparing X to 8 and X is 6 or less. the same is true for Monterey where it is comparing 12.2 to 10.8 by comparing 2 to 8.
If the function using the bc command is defined: ifbc () { test $(echo "$@" | bc -l ) -ne 0; }
Then the test could be changed to
ifbc "sw_vers -productVersion | cut -d. -f1,2
> 10.8" && echo "true, it's greater" || echo "no, it's less or ="
If the version test code at the point of the "# check compatibility" comment is replaced by the following it should work.
# use bc as numerical decimal test
ifbc () { test $(echo "$@" | bc -l ) -ne 0; }
# check compatibility
# get version in XX.YY form
MACOS2NO=$(/usr/bin/sw_vers -productVersion | cut -d. -f1,2)
if ( ifbc "$MACOS2NO < 10.8" ) ; then
Error message says that it only support macos 10.8+