taboc741 / MacScripts

the place I put the scripts I write for my mac fleet
MIT License
38 stars 6 forks source link

unary operator expected #3

Closed neilrooney closed 4 years ago

neilrooney commented 5 years ago
/Library/Application Support/JAMF/tmp/AppleUpdateDefer1.sh: line 80: [: 3: unary operator expected
No new software available.
2019-Jul-01 19:44:20 : No updates pending. Setting plist remainingDeferral to 3.  It was 3.  Exiting

Getting the above "unary operator expected" when running the script from Jamf Pro and visible in a "jamf policy" command.

taboc741 commented 4 years ago

can you add additional context here? I am unable to duplicate the error.

neilrooney commented 4 years ago

@taboc741 there is not much more to add. I setup the script as you described. It works great but in the output I get this unary operator expected error.

neilrooney commented 4 years ago

I was able to solve this problem with the help of some of the admins on macadmins Slack.

I changed the shebang to #!/bin/bash and made a change to line 83. if [ -z "$remainDeferrals" ]; then