Skip to main content

Is it possible to put 2 different commands in the 'execute command' section of the payload 'files and processes'?



I currently have an lpadmin -p ........ command in it and wanted to see if it was possible to also add an additional command such as jamf policy -trigger <triggername>



would i need to separate the two with a comma, semicolon ?

You can separate the commands with a semicolon, or use a script payload instead.


You can use a && e.g:



ls /Users && ls /Library

@davidacland's answer is good if the second command is reliant on the first. For example:



mkdir ~/Desktop/test; cp /some/files ~/Desktop/test


might act strangely if there was a problem creating the directory, whereas



mkdir ~/Desktop/test && cp /some/files ~/Desktop/test


will only execute the second command if the first returns a zero exit status.



Even more fun, you can use "||" to run the second command only if the first one produces a failure (non-zero exit status).


basically this is what i want to have done via 'files and processes' --> 'execute command'



i know i can also do it in a script, i like to give both ways a shot



lpadmin -p MathLab_Xer4112_Rm200 -o printer-is-shared=false; jamf policy -trigger TESTXeroxDriverCustomEvent


Reply