Learn R Programming

blit (version 0.1.0)

cmd_run: Execute command

Description

  • cmd_run: Run the command.

  • cmd_background: Run the command in the background.

  • cmd_help: Print the help document for this command.

Usage

cmd_run(
  command,
  stdout = TRUE,
  stderr = TRUE,
  stdin = NULL,
  timeout = NULL,
  verbose = TRUE
)

cmd_background( command, stdout = NULL, stderr = NULL, stdin = NULL, verbose = TRUE )

cmd_help(command, stdout = NULL, stderr = NULL, verbose = TRUE)

Value

  • cmd_run: Exit status invisiblely.

  • cmd_background: Returns the process ID, which can be terminated manually using tools::pskill(). You can also use sys::exec_status() to check the process's exit status.

  • cmd_help: the input command invisiblely.

Arguments

command

A command object.

stdout, stderr

How output streams of the child process are processed. Possible values are:

  • TRUE: print the child output in R console.

  • FALSE: suppress output stream

  • string: name or path of file to redirect output

  • connection: a writable R connection object

  • function: a callback function (including purrr-like lambda syntax) with one argument accepting a raw vector (use as_text() to convert to text).

For cmd_background(), only a string (file path), or a single boolean value can be used.

For cmd_help(), only a string (file path), connection, or function can be used.

stdin

should the input be diverted? A character string naming a file.

timeout

Timeout in seconds. This is a limit for the elapsed time running command in the separate process.

verbose

A single boolean value indicating whether the command execution should be verbose.

See Also

cmd_wd()/cmd_envvar()/cmd_envpath()