Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


xfun (version 0.30)

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)
)

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).

Value

The process ID as a character string.

See Also

proc_kill() to kill a process.