Learn R Programming

xfun (version 0.48)

bg_process: Start a background process

Description

Start a background process using the PowerShell cmdlet Start-Process-PassThru on Windows or the ampersand & on Unix, and return the process ID.

Usage

bg_process(
  command,
  args = character(),
  verbose = getOption("xfun.bg_process.verbose", FALSE)
)

Value

The process ID as a character string.

Arguments

command, args

The system command and its arguments. They do not need to be quoted, since they will be quoted via shQuote() internally.

verbose

If FALSE, suppress the output from stdout (and also stderr on Windows). The default value of this argument can be set via a global option, e.g., options(xfun.bg_process.verbose = TRUE).

See Also

proc_kill() to kill a process.