Skip to main content
Question

Scripting issue with macOS 10.13.6 update and trailing space


Forum|alt.badge.img+1

I have a script that installs updates using policy parameters to feed the update name (for reusability purposes). The install command is pretty simple:

softwareupdate --install "$4"

I have used this script to install several updates successfully, however I've run into an issue with the High Sierra 10.13.6 update. It appears as though Apple has included a trailing space on the package name of the update.

In manual testing, the following command fails ("No such update.")

softwareupdate --install "macOS High Sierra 10.13.6 Update-"

However, if I add a trailing space, the update is able to complete:

softwareupdate --install "macOS High Sierra 10.13.6 Update- "

I tried added a trailing space to the string in policy parameter 4, but Jamf doesn't pass it. Has anyone else run into this issue? Any ideas on how I could solve it without needing a new script?

donmontalvo
Forum|alt.badge.img+36
  • Legendary Contributor
  • August 3, 2018

(nevermind misread the post)


Forum|alt.badge.img+17
  • Contributor
  • August 3, 2018

I have a custom patching script that uses a list of "approved" updates to check for and install. In my function that reads in the list and builds an array of eligible updates, I had to add a custom logic branch just to deal with this trailing space, since it normally gets dropped by other operations.

I'm amazed Apple hasn't fixed this yet. It's been around for well over a year.


stutz
Forum|alt.badge.img+5
  • Contributor
  • December 7, 2018

I second this as it would be nice to have a fix to that space.

I just added a space after the 4 in the script as shown below. Unfortunately now this script cannot be used as an umbrella cover all macOS updates.

softwareupdate --install "$4 "

Forum|alt.badge.img
  • New Contributor
  • December 12, 2018

This same issue happens with the recent 10.14.2 updates. I updated my script to look like this:

includeSpace=$4

if [ $includeSpace == "YES" ]; then
    updateName="$5 "
else
    updateName=$5
fi
...
softwareupdate --install "$updateName"

so that it's still reusable when the update doesn't include a trailing space.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings