if jamf
is on the PATH then you would normally invoke it jusing just jamf
but that assumes that you are running the command inside a shell (bash or zsh) and the shell itself is what handles the PATH completion and finds jamf
within /usr/local/bin
automatically for you.
When you invoke a command using wait
in bigfix actionscript, there is no shell. This is direct process invocation. This means there is not the same kind of PATH completion. You must provide absolute paths to the executable you are invoking in most cases.
Alternatively, you could use actionscript like this:
wait bash -c "jamf policy -trigger upgradeSnagit"
BigFix invokes bash, then bash runs the command provided within the shell, which then means PATH completion works!
I’m not saying this will definitely work, I haven’t tested it. I am however saying why wait jamf policy -trigger upgradeSnagit
probably isn’t working.
As for the sudo
part. You can include it or not, it doesn’t matter since BigFix will run it is root regardless. Best to leave it out, but if you keep it, it shouldn’t do anything one way or the other.
The real question is, why don’t you need to provide the absolute path to bash
, but you do to other commands? I don’t fully know the answer, but I know this is the case on MacOS and Windows and Linux… just that some things you can invoke directly using a relative path and they work, while others require the shell to help you find the relative path or to invoke something that is a command that only exists within the shell itself and does not exist as a binary / executable on the PATH.