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

system_check

Run a system command and check if it succeeds.


Description

This function automatically quotes both the command and each argument so they are properly protected from shell expansion.

Usage

system_check(
  cmd,
  args = character(),
  env = character(),
  quiet = FALSE,
  echo = FALSE,
  ...
)

Arguments

cmd

the command to run.

args

a vector of command arguments.

env

a named character vector of environment variables. Will be quoted

quiet

if TRUE, the command output will be echoed.

echo

if TRUE, the command to run will be echoed.

...

additional arguments passed to base::system()

Value

TRUE if the command succeeds, an error will be thrown if the command fails.


covr

Test Coverage for Packages

v3.5.1
GPL-3
Authors
Jim Hester [aut, cre], Willem Ligtenberg [ctb], Kirill Müller [ctb], Henrik Bengtsson [ctb], Steve Peak [ctb], Kirill Sevastyanenko [ctb], Jon Clayden [ctb], Robert Flight [ctb], Eric Brown [ctb], Brodie Gaslam [ctb], Will Beasley [ctb], Robert Krzyzanowski [ctb], Markus Wamser [ctb], Karl Forner [ctb], Gergely Daróczi [ctb], Jouni Helske [ctb], Kun Ren [ctb], Jeroen Ooms [ctb], Ken Williams [ctb], Chris Campbell [ctb], David Hugh-Jones [ctb], Qin Wang [ctb], Ivan Sagalaev [ctb, cph] (highlight.js library), Mark Otto [ctb] (Bootstrap library), Jacob Thornton [ctb] (Bootstrap library), Bootstrap contributors [ctb] (Bootstrap library), Twitter, Inc [cph] (Bootstrap library)
Initial release

We don't support your browser anymore

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