Skip to content

Shell Commands

Basic Shell Commands

$`ls -l`
fail:
    print("Command failed! Exiting script!")
$`ls -l`
recover:
    print("Command failed! Continuing script...")

Critical Shell Commands

$!`ls -l`

Unsafe Shell Commands

unsafe $`ls -l`

Output Capture

err_code = $!`ls -l`
err_code, stdout = $!`ls -l`
err_code, stdout, stderr = $!`ls -l`

Suppress Announcements

By default, Rad will 'announce' (i.e. print) commands as they're executed. Example:

Without quiet
$!`ls`
$!`echo hello`
Without quiet output
⚡️ Running: ls
pick.rsl  simple.rsl  sorting.rsl
⚡️ Running: echo hello
hello

These announcements can be suppressed with the quiet keyword. It does not impact stdout/stderr output for the command.

With quiet
quiet $!`ls`
quiet $!`echo hello`
With quiet output
pick.rsl  simple.rsl  sorting.rsl
hello