I'm trying to get the most current version of Big Sur so I can add it to an installer script. Basically just checking if the user has the most current version of the installer before it runs.
I have this so far but I am a noob at awk and grep commands.
#!/bin/sh
latestver=`curl -s http://itunes.apple.com/lookup?bundleId=com.apple.InstallAssistant.macOSBigSur&country=US | awk -F':' '/"com.apple.InstallAssistant.macOSBigSur", "version"/{print $3; exit}'`
echo "Latest Version is: $latestver"
I'm trying to get the 11.2.2 value into the latestver string. Any help would be much appreciated. Also, if anyone has a better way of getting the most current version number, I'm all ears. Thanks.