Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

runOSCommand

Run OS Commands on Local or Remote Machines


Description

This is a helper function to run arbitrary OS commands on local or remote machines. The interface is similar to system2, but it always returns the exit status and the output.

Usage

runOSCommand(
  sys.cmd,
  sys.args = character(0L),
  stdin = "",
  nodename = "localhost"
)

Arguments

sys.cmd

[character(1)]
Command to run.

sys.args

[character]
Arguments for sys.cmd.

stdin

[character(1)]
Argument passed to system2.

nodename

[character(1)]
Name of the SSH node to run the command on. If set to “localhost” (default), the command is not piped through SSH.

Value

[named list] with “sys.cmd”, “sys.args”, “exit.code” (integer), “output” (character).

See Also

Examples

## Not run: 
runOSCommand("ls")
runOSCommand("ls", "-al")
runOSCommand("notfound")

## End(Not run)

batchtools

Tools for Computation on Batch Systems

v0.9.15
LGPL-3
Authors
Michel Lang [cre, aut] (<https://orcid.org/0000-0001-9754-0393>), Bernd Bischl [aut], Dirk Surmann [ctb] (<https://orcid.org/0000-0003-0873-137X>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.