run_remote: 'run_remote' - Runs the command locally or remotely using...

Description Usage Arguments Details Value

View source: R/ssh.R

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

1
2
3
4
5
6
7
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 user@server that does not require interactive password entry. For local execution, pass FALSE (default). For execution on the default qsub config remote, use TRUE.

args

Character vector, arguments to the command.

verbose

If TRUE prints the command.

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:

Warnings are really errors here so the error flag is set if there are warnings.


qsub documentation built on Sept. 23, 2021, 5:09 p.m.