SystemCmd: Wrapper function to system()

Description Usage Arguments Value Examples

View source: R/SystemCmd.R

Description

Wrapper function to system()

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
SystemCmd(
  ...,
  sep = "",
  debug = FALSE,
  intern = FALSE,
  ignore.stdout = FALSE,
  ignore.stderr = FALSE,
  wait = TRUE,
  input = NULL
)

Arguments

...

one or more arguments of type string, which can be concatenated using the paste function (e.g. 'ls','-lrt','/bin').

sep

character used to seperate the terms. Used in the paste function.

debug

print command before execution.

intern

a logical (not 'NA') which indicates whether to capture the output of the command as an R character vector (parameter to system function).

ignore.stdout, ignore.stderr

a logical (not 'NA') indicating whether messages written to 'stdout' or 'stderr' should be ignored (parameter to system function).

wait

a logical (not 'NA') indicating whether the R interpreter should wait for the command to finish, or run it asynchronously. This will be ignored (and the interpreter will always wait) if 'intern = TRUE' (parameter to system function).

input

if a character vector is supplied, this is copied one string per line to a temporary file, and the standard input of 'command' is redirected to the file (parameter to system function).

Value

Return value of the executed command.

Examples

1
2
3
    SystemCmd('ls -lrt /') 
    SystemCmd('ls -lrt /', debug = TRUE) 
    SystemCmd('ls', '-lrt', '/') 

smu/smumisc documentation built on March 21, 2021, 3:38 a.m.