Skip to content

Instantly share code, notes, and snippets.

@zygm0nt
Created March 6, 2021 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zygm0nt/2067d6fd3b87c72538a0e4e052285a8f to your computer and use it in GitHub Desktop.
Save zygm0nt/2067d6fd3b87c72538a0e4e052285a8f to your computer and use it in GitHub Desktop.

This is a big list of alternative shells! (As opposed to the common POSIX-ish shells like bash and zsh)

Some of them are more like languages, and some are more interactive. Some are active and some are dormant. They are written in many different languages.

This wiki page is EDITABLE. If you know of another significant or interesting shell, please add a link. If it's a DSL embedded in another language (like Python), add it to [[Internal DSLs for Shell]].

Related: [[ExternalResources]]

Active Alternative Shell Languages

Oil -- Our upgrade path from bash to a better language and runtime. Written in high-level, Python-based DSLs. FAQ: Why Create a New Unix Shell?

[[Fish Shell|https://fishshell.com/]] -- Probably the most popular non-POSIX shell (on Linux). Focused on the interactive use case, but also has a new programming language. Written in C++.

[[PowerShell|https://github.com/PowerShell/PowerShell]] -- Microsoft's shell that deals with structured data, and has "workflows". Even works on Unix. Depends on a big VM. 850K lines of C# code.

C shell (tcsh) — Command language interpreter usable both as an interactive login shell and a shell script command processor. It includes a command-line editor, programmable word completion, spelling correction, a history mechanism, job control and a C-like syntax. (C Shell on Wikipedia. This is the oldest non-POSIX shell! Originally written by Bill Joy, who also wrote vi, etc.)

[[Ion Shell|https://github.com/redox-os/ion]] -- Part of Redox OS, written in Rust. So far it looks like a fairly conservative design -- a cleaned-up version of shell, similar to Oil. But it doesn't have the goal of bash compatibility.

[[Oh Shell|https://github.com/michaelmacinnis/oh]] -- Goal: combine good programming features and an interactive shell. Influenced by Lisp, has prototypical inheritance, CSP with channels and threads. Oh is a new implementation of the Choc Shell in Go. This 2010 master's thesis (PDF, 182 pages) has a great historical overview of shells and a motivation for putting programming language features in a shell.

Nash -- Nash is a system shell, inspired by plan9 rc, that makes it easy to create reliable and safe scripts taking advantages of operating systems namespaces (on linux and plan9) in an idiomatic way.

[[NGS|https://ngs-lang.org/]] ([[Blog by Ilya Sher|https://ilya-sher.org/category/ngs/]]) -- Next Generation Unix Shell. Modern programming language built ground up for Ops tasks. Written in C.

[[Elvish|https://github.com/elves/elvish]] -- Goal: shell as a real programming language; structured data like lists and maps. Relies on lambdas for e.g. control structures. Extends output capture and pipelines to support structured data. Non-POSIX syntax, but generally looks familiar to POSIX shell users (barewords as strings, prefix syntax, etc.). Interactive shell enhancements. Written in Go.

[[Murex|https://github.com/lmorg/murex]] -- Murex is a cross-platform shell like Bash but with greater emphasis on writing safe shell scripts and powerful one-liners while maintaining readability. Written in Go. [[Syntax Guide|https://github.com/lmorg/murex/blob/master/docs/GUIDE.syntax.md]].

[[Neugram|https://github.com/neugram/ng/blob/master/docs/shell.md]] -- there is a command language with $$, but the control flow looks like Go rather than shell. Pipes?

liljencrantz/crush -- an attempt to make a traditional command line shell that is also a modern programming language. It has the features one would expect from a modern programming language like a type system, closures and lexical scoping, but with a syntax geared toward both batch and interactive shell usage. Written in Rust. (from the original author of fish)

[[ABS Language|https://github.com/abs-lang/abs]] (abs-lang.org)-- ABS is a scripting language that works best when you're scripting on your terminal. It tries to combine the elegance of languages such as Python, or Ruby, to the convenience of Bash. Written in Go.

[[Shell++|https://github.com/alexst07/shell-plus-plus]] I wanted a language that runs shell commands like Bash, and manipulate data structure with the ease of Python, I searched, but I did not find any that met my requirements, so I decided to use my free time to create one. Written in C++. (clean code!)

[[Mash Shell|http://mash-shell.org/]] ([[Github|https://github.com/mdr/mash]]) -- An object shell. Dealing with structured data. Written in Scala. See [[Command vs Expression Mode]]

[[Another Mash Shell|http://web.mit.edu/~svalente/src/mash/mash.html]] -- Mash is the "Make Shell." It is a simple scripting language used to build programs (and other files) from source files. No source code?

[[dgsh - Directed Graph Shell|https://www.spinellis.gr/sw/dgsh/]] -- A fork of bash which supports "multipipes" and blocks!

[[Shill|http://shill.seas.harvard.edu/]] -- Scripting with Least Privilege. Built on Racket, but it appears to be making its way from research into production? The language looks more like JavaScript than a shell.

[[execline|http://skarnet.org/software/execline/]] -- execline is a — non-interactive — scripting language, like sh ; but its syntax is quite different from a traditional shell syntax. The execlineb program is meant to be used as an interpreter for a text file; the other commands are essentially useful inside an execlineb script.

[[Ergonomica|https://github.com/ergonomica/ergonomica]] -- A shell written in Python using some libraries like python-prompt-toolkit. I'm including it in this section rather than grouping it with xonsh below because it appears to have its own language. It has map and filter, not sure about other constructs.

[[Batsh|https://github.com/BYVoid/Batsh]] -- A language that compiles to Bash and Windows Batch. Written in OCaml. Not that active. Looks a bit like JavaScript, i.e. not a shell-like syntax.

[[nushell|https://github.com/nushell/nushell]] -- Focused on pipes and tabular data (compare with [[Structured Data in Oil]]). ls and ps are a table. Not POSIX compatible, and it's not clear if it's Turing-complete. Initiated and first released in 2019. Written in Rust with async/await. Uses many Rust libraries for JSON, YAML, TOML, etc.

Magritte -- [Magritte is] a general-purpose language that is viable as a shell scripting language. Like shells, it manages concurrent processes which are composed [... with pipes]. Unlike traditional pipes, Magritte pipes can process rich values. [The language has] features such as data structures and lambda functions with lexical scope, as well as systems for automatic process cleanup and error handling. The syntax is designed for command-line usability. This work presents an implementation, along with a proposed method of integration with a POSIX system. (72-page thesis)

Marcel (https://www.marceltheshell.org/) -- The main idea is to rely on piping as the primary means of composition, as with any Unix or Linux shell. However, instead of passing strings from one command to the next, marcel passes Python values: builtin types such as lists, tuples, strings, and numbers; but also objects representing files and processes. Written in Python.

Atom -- Bash scripting needs to be outlawed. Written in Rust.

[[modernish|https://github.com/modernish/modernish]] -- Modernish is a library for shell script programming which provides features like safer variable and command expansion, new language constructs for loop iteration, and much more. I would describe it as an overhaul of shell, written in shell! That is, it's more of a language than a library.

TclEverything is a string. A scripting language and interactive shell that has been described as a bastard child of Bash and Lisp. $foo variable substitution works like "$foo" in the POSIX shell, eliminating a class of bugs. Written in C as a library and embedded in a bunch of software.

Janet Shell - Interactive shell for system commands mixed with Janet, a Lisp-like language. Supports plugins. Last commit in January 2020

Yori - Interactive shell patterned on CMD that's specific to Windows. Enhancements are primarily to interactive scenarios. Written in C, runs on ancient versions of Windows without requiring dependencies or installation.

Active / New POSIX Shells

Gash -- Part of the Guix project. Gash is a POSIX-compatible shell written in Guile Scheme. It provides both the shell interface, as well as a Guile library for parsing shell scripts. Gash is designed to bootstrap Bash as part of the Guix bootstrap process. We are planning to develop Gash into a general-purpose shell and tool for building interfaces between Scheme and the shell.

mrsh -- A minimal POSIX shell, which is structured as a library and a /bin/sh that consumes it. Written in C99.

Dormant/Historical

[[Bish|https://github.com/tdenniston/bish]] -- Bish is a lightweight language created to bring shell scripting into the 21st century. It gives programmers the comfort of modern syntax but compiles to Bash. Written in C++. Looks more like JavaScript than a shell though.

[[shok|http://shok.io/]] ([[Github|https://github.com/nfomon/shok]]) -- Cross-platform shell, appears to be dormant as of 2014. [[Hacker News Thread|https://news.ycombinator.com/item?id=6978496]]. Written in C++ (with Boost), and some Python.

[[es shell|https://wryun.github.io/es-shell/]] -- "A shell with higher order functions". Based on Lisp and has garbage collection. Influenced by the rc shell.

[[rc shell|https://scholar.google.com/scholar?cluster=8039020473461085552]] -- The Plan 9 Shell. No word splitting. Feature set is very similar to Bourne shell or bash, but the syntax is entirely different. "Nobody really knows what the Bourne shell's grammar is". There is also a unix reimplementation which is on most linux package managers.

[[v6 shell|https://github.com/JNeitzel/v6shell]] -- Osh(1) is an enhanced, backward-compatible port of the Sixth Edition Thompson shell.

[[PLASH Shell|http://www.cs.jhu.edu/~seaborn/plash/html/]] -- Principle of Least Authority Shell. Very interesting! Would be nice to take some lessons from this.

[[Inferno mash shell|http://www.vitanuova.com/inferno/man/1/mash.html]] -- with [[builtin make functionality|http://www.vitanuova.com/inferno/man/1/mash-make.html]]

Distributed Shells

[[DSH / Dancer's Shell|https://www.netfort.gr.jp/~dancer/software/dsh.html.en]] -- circa 2003, doesn't seem active. ''dsh is an implementation of a wrapper for executing multiple remote shell (rsh/remsh/ssh) commands. rsh/remsh/ssh are wrappers for executing shell (ksh/bash/zsh/tcsh/sh .. etc... ) on remote hosts.''

Interactive Shells

This section is for shells which are only interactive -- they do not define a new syntax for programming, i.e. they borrow the syntax from another language or combination of languages.

[[xonsh|http://xon.sh/index.html]] -- Xonsh is a Python-ish, BASHwards-looking shell language and command prompt. The language is a superset of Python 3.4+ with additional shell primitives that you are used to from Bash and IPython. This is focused on the interactive use case, and isn't its own programming language. It's written in Python and exposes Python to the user.

[[tako|https://takoshell.org/]] -- Fork of xonsh.

[[xiki|http://xiki.org/]] -- xsh tries to bring the wiki structure to the command line. Type Ctrl+X in your favorite shell (bash or zsh etc), and youll expand the command in xsh (Xiki Shell). Then you can type to filter down the output. No need to pipe to grep. Xiki runs in your text editor, so everything is editable text. Type commands anywhere. Edit the output. (Vs. typing commands at the bottom, and read-only output.) Intermix menus, headings, bullet points, wherever you want. Xiki == executable wiki. - Written in ruby.

[[scsh|https://scsh.net/]] -- The Scheme Shell. Scsh has two main components: a process notation for running programs and setting up pipelines and redirections, and a complete syscall library for low-level access to the operating system, i.e. to POSIX, the least common denominator of more or less all Unices, plus widely supported extensions such as symbolic links and BSD sockets. Moreover, scsh provides an awk facility for pattern-directed computation over streams of records, a rich facility for matching regular-expression patterns in strings, event-based interrupt handling, user-level threads, a futuristic module system, and an interactive environment.


Also see [[Interactive Shell]] for related experiments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment