$linuxjunkies
>

oil(1)

The Oil shell is a modern Unix shell that improves upon bash with better syntax, error handling, and performance.

UbuntuDebianFedoraArch

Synopsis

oil [OPTIONS] [FILE] [ARGS]

Description

Oil is a shell language that aims to be a drop-in replacement for bash while fixing long-standing issues with shell syntax and semantics. It supports both bash-compatible code and a cleaner Oil syntax within the same interpreter.

Oil provides stricter error handling, better string interpolation, and more predictable behavior compared to traditional shells. It can run existing bash scripts while allowing you to gradually adopt Oil's improved syntax.

The Oil shell is still under development but is suitable for interactive use and scripting. Use oil as a login shell or invoke it with scripts like oil script.oil.

Common options

FlagWhat it does
-cExecute the given command string and exit
-nParse the script without executing it (syntax check)
-xPrint each command before executing (debug mode)
--versionDisplay the Oil shell version number
--helpShow usage information and exit
-iRun in interactive mode even if input is not a terminal
-lAct as a login shell
--ast-formatSpecify AST output format (text or json) for debugging

Examples

Start an interactive Oil shell session

oil

Execute an Oil script file

oil script.oil

Run a single Oil command and exit

oil -c 'echo hello world'

Check script syntax without executing it

oil -n script.oil

Run command with debug output showing each command executed

oil -x -c 'x=5; echo $x'

Run bash script through Oil shell (compatible mode)

bash_script.sh | oil

Related commands