A bourne shell inspired by dash.
These goals guide design decisions and the feature roadmap. Once the shell is complete, we can look at more ambitious goals like implementing features beyond POSIX, extending the programming language, and more aggressive speed optimizations.
The guiding goals include:
- A high level of POSIX compliance
- Helpful error messages
- Modern terminal interface features
- Fast
- Secure by default (even when it means violating POSIX)
The overall design is inspired by the dash shell which is the default
/bin/sh
on Debian and Ubuntu. It has a long lineage dating back to
early bourne shells.
Dash was built for speed, POSIX compliance, and a small codebase. It's a great source of design wisdom and serves as a good reference implementation when the POSIX spec is unclear.
Rash's parser and evaluator take inspiration from dash. Rash uses a parser generator called LALRPOP to generate an AST. It then walks the AST evaluating statements. The grammar and AST are based on the grammar and terminology defined by POSIX which makes it easy to use the standard as a reference for understanding rash.
Contributions are welcomed! The status list below is a great place to find a feature to implement. If the codebase looks too complicated at first, there are several features that don't require changing much existing code.
Open a GitHub Issue for questions, requests, or patches.
The project is licensed under the Apache License 2.0.
Except for the most obscure features, syntax and functionality are either fully implemented or not at all. This means that you can be confident when using the features marked as complete below. Any errors or omissions in existing functionality are bugs and may be treated as such.
Features:
- executing commands
- pipelines
- boolean logic
- async execution (
&
) - path searching
- variable interpolation
- environment manipulation (export, unset, readonly, variable prefixes)
- cd
- saving the exit status (
$?
) - quoting: double quotes, single quotes, backslash escaping
- subshells
- parameter expansion (e.g.
${}, $ () and backticks) - I/O Redirection
- job control
- shell startup arguments (e.g.
-c
,-l
) -
set
command - control flow operators (
if
,while
,case
) - functions
Interactive Mode:
- history (not yet configurable or persistent)
- keybindings (not yet configurable)
- configurable settings
- tab completion
- configurable prompts
Quality Improvements:
- Compliance test suite
- See osh tests
- consistent error message format
- Path hashing
- Other common performance optimizations