Skip to contents

Invoke a System Command

Usage

exec(cmd, ...)

Arguments

cmd

Command to be invoked, as a character string.

...

<dynamic dots> Additional arguments passed to cmd command. Empty arguments are automatically trimmed. If a single argument, such as a file path, contains spaces, it must be quoted, for example using shQuote().

Value

A command object.

Examples

cmd_run(exec("echo", "$PATH"))
#> Running command (2025-09-29 09:06:13): echo $PATH
#> 
#> Running scheduled exit task
#> Command process finished
#> System command succeed