Skip to main content
Question

Software Updates Best practices?

  • November 11, 2012
  • 28 replies
  • 215 views

Show first post

28 replies

Forum|alt.badge.img
  • New Contributor
  • March 2, 2017

The backticks around the UNIX commands are getting screwed up by the forum software.
Put backticks (the backwards apostrophe on the tilde ~ key) around

/usr/sbin/softwareupdate --list

and around

/usr/bin/who | /usr/bin/grep console | /usr/bin/cut -d " " -f 1

Forum|alt.badge.img+4
  • Contributor
  • March 13, 2017

Thanks @lilmatt - fixed up the backticks, but mine is still throwing up loads of syntax errors. I'm not that great with Perl scripting so I'm scratching my head a bit at how to patch it up!

Actions from policy log: [STEP 1 of 4] Executing Policy Prompt Software Updates - TEST [STEP 2 of 4] Running script Software Updates Prompt... Script exit code: 255 Script result: Backslash found where operator expected at /Library/Application Support/JAMF/tmp/Software Updates Prompt line 29, near ") " (Missing operator before ?) Backslash found where operator expected at /Library/Application Support/JAMF/tmp/Software Updates Prompt line 37, near ") " (Missing operator before ?) Backslash found where operator expected at /Library/Application Support/JAMF/tmp/Software Updates Prompt line 45, near "" (Missing semicolon on previous line?) Backslash found where operator expected at /Library/Application Support/JAMF/tmp/Software Updates Prompt line 51, near "" (Missing semicolon on previous line?) Backslash found where operator expected at /Library/Application Support/JAMF/tmp/Software Updates Prompt line 57, near "" (Missing semicolon on previous line?) syntax error at /Library/Application Support/JAMF/tmp/Software Updates Prompt line 14, near "if" syntax error at /Library/Application Support/JAMF/tmp/Software Updates Prompt line 29, near ") " syntax error at /Library/Application Support/JAMF/tmp/Software Updates Prompt line 37, near ") " syntax error at /Library/Application Support/JAMF/tmp/Software Updates Prompt line 41, near "}" syntax error at /Library/Application Support/JAMF/tmp/Software Updates Prompt line 41, near "else " syntax error at /Library/Application Support/JAMF/tmp/Software Updates Prompt line 44, near "}" syntax error at /Library/Application Support/JAMF/tmp/Software Updates Prompt line 50, near "}" syntax error at /Library/Application Support/JAMF/tmp/Software Updates Prompt line 56, near "}" syntax error at /Library/Application Support/JAMF/tmp/Software Updates Prompt line 61, near "}" Execution of /Library/Application Support/JAMF/tmp/Software Updates Prompt aborted due to compilation errors. Error running script: return code was 255. [STEP 3 of 4] [STEP 4 of 4]

EDIT - I've found the script in this post as well (including lots of other variants to play around with!) [https://www.jamf.com/jamf-nation/discussions/5404/jamfhelper-software-update-trigger](link URL)


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

I'm having a similar errorresult with my copy of the script. @UESCDurandal

Script exit code: 255
Script result: Backslash found where operator expected at /Library/Application Support/JAMF/tmp/TEST : Mac OS Software Updates : Weekly line 29, near ") "
(Missing operator before ?)
Backslash found where operator expected at /Library/Application Support/JAMF/tmp/TEST : Mac OS Software Updates : Weekly line 37, near ") "
(Missing operator before ?)
Backslash found where operator expected at /Library/Application Support/JAMF/tmp/TEST : Mac OS Software Updates : Weekly line 45, near ""
(Missing semicolon on previous line?)
Backslash found where operator expected at /Library/Application Support/JAMF/tmp/TEST : Mac OS Software Updates : Weekly line 51, near ""
(Missing semicolon on previous line?)
Backslash found where operator expected at /Library/Application Support/JAMF/tmp/TEST : Mac OS Software Updates : Weekly line 57, near ""
(Missing semicolon on previous line?)
syntax error at /Library/Application Support/JAMF/tmp/TEST : Mac OS Software Updates : Weekly line 14, near "if"
syntax error at /Library/Application Support/JAMF/tmp/TEST : Mac OS Software Updates : Weekly line 29, near ") "
syntax error at /Library/Application Support/JAMF/tmp/TEST : Mac OS Software Updates : Weekly line 37, near ") "
syntax error at /Library/Application Support/JAMF/tmp/TEST : Mac OS Software Updates : Weekly line 41, near "}"
syntax error at /Library/Application Support/JAMF/tmp/TEST : Mac OS Software Updates : Weekly line 41, near "else "
syntax error at /Library/Application Support/JAMF/tmp/TEST : Mac OS Software Updates : Weekly line 44, near "}"
syntax error at /Library/Application Support/JAMF/tmp/TEST : Mac OS Software Updates : Weekly line 50, near "}"
syntax error at /Library/Application Support/JAMF/tmp/TEST : Mac OS Software Updates : Weekly line 56, near "}"
syntax error at /Library/Application Support/JAMF/tmp/TEST : Mac OS Software Updates : Weekly line 61, near "}"
Execution of /Library/Application Support/JAMF/tmp/TEST : Mac OS Software Updates : Weekly aborted due to compilation errors.
Error running script: return code was 255.