| run_remote {qsub} | R Documentation |
run_remote - Runs the command locally or remotely using ssh.
Description
In run_remote the remote commands are enclosed in wrappers that allow to capture output.
By default stderr is redirected to stdout.
If there's a genuine error, e.g., the remote command does not exist, the output is not captured. In this case, one can
see the output by setting intern to FALSE. However, when the command is run but exits with non-zero code,
run_remote intercepts the generated warning and saves the output.
Usage
run_remote(
command,
remote = FALSE,
args = character(),
verbose = FALSE,
shell = FALSE
)
Arguments
command |
Command to run. If run locally, quotes should be escaped once. If run remotely, quotes should be escaped twice. |
remote |
Remote machine specification for ssh, in format such as |
args |
Character vector, arguments to the command. |
verbose |
If |
shell |
Whether to execute the command in a shell |
Details
The remote command will be put inside double quotes twice, so all quotes in cmd must be escaped twice: \\".
However, if the command is not remote, i.e., remote is NULL or empty string, quotes should be escaped
only once.
If the command itself redirects output, the stderr_redirect flag should be set to FALSE.
Value
A list with components:
-
statusThe exit status of the process. If this is NA, then the process was killed and had no exit status. -
stdoutThe standard output of the command, in a character scalar. -
stderrThe standard error of the command, in a character scalar. -
elapsed_timeThe number of seconds required before this function returned an output.
Warnings are really errors here so the error flag is set if there are warnings.