Script parameter limits?

alexjdale
Valued Contributor III

Hi folks,

Edit after more testing: it appears there is a character limit of around 255 for paramaters, can anyone confirm?

I wrote a bash script which takes, as a parameter in Casper, a list of Apple Software Update IDs (separated by spaces) and processes them and applies only the updates available to the system running the script. I wanted to be able to push updates to clients while leveraging Software Update and Apple's SUS to only install specific updates, with some additional logic and user prompts to improve the user experience.

The problem I have is that I seem to be running into an issue with the parameters, possibly with a length limit (if there is one, I haven't found anything documented). I am able to successfully add the script to the policy without errors but once I click Save, the script disappears from the policy. I tried shortening the input list and it worked as expected.

Here is the parameter I am passing, can anyone please take a look and tell me if it is too long or if there is something else causing the issue?

AirPortUtility-6.3.1 iTunesX-11.0.4 iTunesXPatch-11.0.4 JavaForOSX-1.0 OSXUpd10.8.4-10.8.4 OSXUpdCombo10.8.4-10.8.4 RAWCameraUpdate4.07-4.07 RemoteDesktopClient-3.6.2 SecUpd2013-003-1.0 ThunderboltFirmwareUpdate1.2-1.2 Safari6.0.5Lion-6.0.5 Safari6.0.4Mountain-6.0.4 041-9577-2.14

It worked when I randomly cut it down to:

AirPortUtility-6.3.1 iTunesX-11.0.4 iTunesXPatch-11.0.4 JavaForOSX-1.0 OSXUpd10.8.4-10.8.4 OSXUpdCombo10.8.4-10.8.4

I guess if it is a hard length limit, I can store the list in a file and keep that on my DPs and my script can read it in since the DP will be mounted at a known sharepoint during execution.

Thanks,
Alex

4 REPLIES 4

mm2270
Legendary Contributor III

Well, that would make sense, since HFS+ itself has a 255 character length limitation, so I guess the JSS follows suit with that for script parameters.
http://en.wikipedia.org/wiki/HFS_Plus

rmanly
Contributor III

I would look at Reposado.

It is really easy to setup and can manage your updates quite simply.

The longest setup part for me was downloading the updates...give it a look.

JRM
Contributor

I've seen a couple of post like this and it looks more like the JSS isn't passing the entire string to the script. Usually hardcoding a longer string like this in to the script seems to do the trick.

[disclaimer] I didn't do any specific testing, I am just going off of what I read and can recall - so I would suggest searching previous posts and doing your own testing. [/disclaimer]

SamF
Contributor II
Contributor II

JRM is correct, although there may be a limitation outside the JSS, the MySQL database only allows for the storage of 255 characters per script parameter. Again, there may be another limitation for the shell you're using, but there is also one when passing the parameter from the JSS.