system

The .system command executes an operating system command from within rsql. This is useful for running shell commands, inspecting the environment, or integrating with other tools without leaving the CLI.

Usage

.system command [args]

Description

The system command executes the specified operating system command. The command and any optional arguments are passed to the operating system shell for execution. The output of the command is displayed to the defined output.

When to use

  • Use .system to run shell commands (e.g., ls, pwd, cat file.txt) without leaving rsql.
  • Helpful for automation, scripting, or when you need to check files, directories, or system status during a session.

Examples

Print the current working directory:

.system pwd

List the current directory:

.system ls -l

Run a script or external tool:

.system ./myscript.sh arg1 arg2

Troubleshooting

  • If a command fails, check the syntax and ensure the command exists in your system's PATH.
  • Output is sent to the current output destination (see .output).
  • Some commands may behave differently depending on your OS (macOS, Linux, Windows).

Demonstration