Archive
Archive for December 22, 2025
Using printf to write variable values to JSON strings in Bash scripts
December 22, 2025
Leave a comment
As part of my personal changeover from using the Jamf Pro Classic API to using the Jamf Pro API, I’ve needed to change from using XML for the Jamf Pro Classic API to now using JSON for the Jamf Pro API. In particular, one of my issues has been figuring out how to properly write variables to JSON when updating something on the Jamf Pro server using the Jamf Pro API. As always when writing scripts, there’s usually multiple ways to solve a problem and I figured out a solution to mine using the printf command. For more details, please see below the jump.
Categories: Jamf Pro API, Jamf Pro Classic API, Scripting
Recent Comments