run
command. You can read the API docs for run
here.Hint This behavior is dependent on your operating system.
run binary
cmd.exe
is used. For Unix, /bin/bash
is used. Command will wait for the OS command to finish.!binary
!
. 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 ver
command twice in Windows.run
command. This example will run the Windows ver
command followed by the CommandBox ver
command.echo
to have CommandBox process the backtick expansions first before sending it off to the OS for processing.echo
command has the package show name
expression expanded into the string and then the ENTIRE string is piped to run
where the pipe and the find
command are processed by Windows. Note, there is no need for preceding the command with !
when passing to run
since !
is just an alias for run
.run
command, you are allowed to pipe the result back into another CommandBox command in that specific case. This is only possible when run
appears with nothing after it.clip
is a Windows binary that will read the standard input and place that text on the clipboard. When the run
command receives two inputs, it will assume the first input is the piped input and the second input is the actual command to run.cmd
require line breaks after the input or it won't process. In the specific case of Windows cmd
it seems to require at least two line breaks for some reason (this is also true outside of CommandBox)chr()
function.run
command, 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.run
command you cannot also pipe the output of the run command like so:run
or !
, then the rest of the line is "eaten" and passed to the native shell./bin/bash
to 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 set
command (i.e., config set nativeShell=/bin/zsh
)run
command itself and will be available via the usual mechanisms such as ${exitCode}
.