Hint This behavior is dependent on your operating system.
cmd.exeis used. For Unix,
/bin/bashis used. Command will wait for the OS command to finish.
!. In this mode, any other params need to be positional. There is no CommandBox parsing applied to the command's arguments. They are passed straight to the native shell. As such, you don't need to escape any of the parameters for CommandBox when using this syntax.
&&will get passed straight to the OS. On Windows, the following string will run the
vercommand twice in Windows.
runcommand. This example will run the Windows
vercommand followed by the CommandBox
echoto have CommandBox process the backtick expansions first before sending it off to the OS for processing.
echocommand has the
package show nameexpression expanded into the string and then the ENTIRE string is piped to
runwhere the pipe and the
findcommand are processed by Windows. Note, there is no need for preceding the command with
!when passing to
!is just an alias for
runcommand, you are allowed to pipe the result back into another CommandBox command in that specific case. This is only possible when
runappears with nothing after it.
clipis a Windows binary that will read the standard input and place that text on the clipboard. When the
runcommand receives two inputs, it will assume the first input is the piped input and the second input is the actual command to run.
cmdrequire line breaks after the input or it won't process. In the specific case of Windows
cmdit seems to require at least two line breaks for some reason (this is also true outside of CommandBox)
runcommand, the command will not also be able to read from your keyboard (this is true of any shell) and it will execute in a non-interactive manner, which means the ping's output above would appear all at once as opposed to flowing in one line at a time.
runcommand you cannot also pipe the output of the run command like so:
!, then the rest of the line is "eaten" and passed to the native shell.
/bin/bashto any shell of your choosing, like zsh. This will let you use shell specific aliases. You can set your native shell property using the
config setcommand (i.e.,
config set nativeShell=/bin/zsh)
runcommand itself and will be available via the usual mechanisms such as