Skip to main content
Solved

Big Sur Current Version?

  • March 2, 2021
  • 3 replies
  • 18 views

Forum|alt.badge.img+12

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.

Best answer by skeenan07

This uses Jamf's patch URL to get the current version of Big Sur.

#!/bin/sh
latestver=$(curl -s "https://jamf-patch.jamfcloud.com/v1/software/303" | grep currentVersion | tr -d '"' | awk '{ print $2 }')
echo "Latest Version is: $latestver"

3 replies

skeenan07
Forum|alt.badge.img+10
  • Contributor
  • Answer
  • March 2, 2021

This uses Jamf's patch URL to get the current version of Big Sur.

#!/bin/sh
latestver=$(curl -s "https://jamf-patch.jamfcloud.com/v1/software/303" | grep currentVersion | tr -d '"' | awk '{ print $2 }')
echo "Latest Version is: $latestver"

Forum|alt.badge.img+15
  • Esteemed Contributor
  • March 2, 2021

Your curl command is returning JSON. You could use jq to work with the JSON. The only problem is that jq isn't included in macOS.

curl -s "http://itunes.apple.com/lookup?bundleId=com.apple.InstallAssistant.macOSBigSur&country=US" | jq -r ".results[].version"


Forum|alt.badge.img+12
  • Author
  • Contributor
  • March 3, 2021

I'm definitely using that patch URL again. That makes it much easier. Thanks @skeenan07 !