Posted on 02-06-2019 08:59 AM
Hello all,
I have a numb question that we have never actually dealt with in the past.
We are trying to limit a script to only those devices that meet certain OS values.
I have the limitations set to: 10.13.4, 10.13.5, 10.13.6, 10.14.1, 10.14.
Wondering if I enter in 10.14 or 10.14.x will that perform the same thing as having to write the 10.14.1, 10.14.2, 10.14.3... so that when time comes I don't have to go in and change the values to search for that criteria as well?
Posted on 02-06-2019 09:28 AM
Yeah, 10.14.x,10.13x,10.12.x
etc will do the trick.
Posted on 02-06-2019 02:18 PM
You could also add the check within the script.
#!/bin/sh
# Verify OS version is 10.13 or later
osMinor=$(/usr/bin/sw_vers -productVersion | awk -F. {'print $2'})
if [[ $osMinor -ge 13 ]];
then
echo "detected macOS 10.$osMinor"
<YOUR CODE HERE>
else
echo "macOS 10.$osMinor not supported"
exit 0
end