A small POSIX-like shell written in C++23.
Note
Only Unix-like systems are supported for now.
- Builtins:
echo,type,pwd,cd,history,exit. - Running external programs found on
PATH. - Pipelines.
- Output redirection.
- Single/double quoting and backslash escapes.
- Line editing, history and tab completion.
- Persistent history.
- GCC 11+ or Clang 17+.
- CMake 3.25+.
- Ninja (optional, only needed if you build with the CMake presets).
- GNU Readline and its headers.
pkg-config.
cmake --preset clang-release
cmake --build --preset clang-release
./build/clang-release/ashPresets are named <compiler>-<variant>, with clang or gcc as the compiler:
| Variant | Description |
|---|---|
debug |
Debug build |
release |
Release build |
asan |
Debug build with ASan and UBSan |
Tip
cmake --list-presets and cmake --build --list-presets show all available CMake presets.
Use any generator that CMake supports:
cmake -B build
cmake --build build
./build/ashNot yet implemented:
- Track exit statuses.
- Signal handling.
- Multi-line input.
- Input redirection and
2>&1. - Variables: assignment & expansion.
- Tilde expansion and globbing.
- Command substitution.
- Command lists (
;,&&,||). - Environment (
export,unset). - Aliases (
alias,unalias). - Background jobs and job control (
&,jobs,fg,bg). - Compound commands (
if,while,for). - Scripts,
-cand comments.
This repository is released under the MIT license. See MIT for details.