elvish(1)
Elvish is an expressive programming language and shell for Linux and other Unix-like systems.
Synopsis
elvish [FLAG]... [FILE]...Description
Elvish is a modern shell written in Go that combines the features of a traditional Unix shell with those of a programming language. It offers a more expressive syntax, better error handling, and structured data types including lists and maps, making it suitable for both interactive use and scripting.
When invoked without arguments, Elvish starts an interactive REPL. When given a script file, it executes the file. Elvish can also be used as a login shell or invoked with the -c flag to execute inline code.
Common options
| Flag | What it does |
|---|---|
-c CODE | Execute CODE as Elvish script and exit |
-norc | Skip loading the RC file (~/.config/elvish/rc.elv) |
-deprecation-level LEVEL | Set deprecation warning level (0=silent, 1=soft, 2=hard); default is 2 |
-log-level LEVEL | Set logging level (debug, info, warn, error); default is warn |
-log-file FILE | Write logs to FILE instead of stderr |
-help | Show help message and exit |
-version | Show version information and exit |
Examples
Start the Elvish interactive shell
elvishExecute the Elvish script file myscript.elv
elvish myscript.elvExecute inline Elvish code that outputs the result of 2+3
elvish -c 'put (+ 2 3)'Run a loop that iterates over a list and outputs each element
elvish -c 'for x [1 2 3] { put $x }'Start Elvish without loading the RC configuration file
elvish -norcCreate a list and output it using Elvish's data structures
elvish -c 'set arr = [apple banana cherry]; echo $arr'