run: Run a command line program and wait until it terminates.

Description Usage Arguments Value Examples

View source: R/cliff.R

Description

Run a command line program and wait until it terminates.

Usage

1
2
3
4
5
6
7
8
9
run(
  command,
  ...,
  input = NULL,
  error_on_status = TRUE,
  wd = NULL,
  timeout = Inf,
  env = NULL
)

Arguments

command

the command to run

...

the arguments pass to the program, supports the big bang operator !!!

input

text pass to stdin

error_on_status

raise an error if return code is not 0.

wd

working directory

timeout

throw an error after this amount of time in second

env

additional environment variables

Value

The stdout of the program in a scalar character. It may contain a trailing newline. Use trimws() to ensure the trailing newline is trimmed.

Examples

1
2
3
4
5
## Not run: 
git <- function(...) cliff::run("git", ...)
git("log", git("rev-parse", "--abbrev-ref", "HEAD"), "-n1")

## End(Not run)

cliff documentation built on Nov. 2, 2021, 9:09 a.m.

Related to run in cliff...