mash)A lightweight, feature-rich Unix shell written in C++17. Designed to be clean, responsive, and independent of heavy terminal dependency libraries (like readline), using direct POSIX system APIs and terminal raw mode configuration.
$PATH) and file/folder paths. Directory completions automatically append a trailing slash /. Supports double-tab listing of matches.Ctrl+C cancels the current input line without terminating the shell. Pressing Ctrl+D on an empty line cleanly exits the shell.|): Pipe the output of one command to another (e.g., uptime | grep uptime).< and standard output using > (overwrite) or >> (append). (e.g., echo "output" > log.txt).*): Expands file glob patterns automatically (e.g., ls header/*.h or rm *.o).nano, vim, or interactive commands like sudo) function perfectly.SIGINT (Ctrl+C) while waiting for children, allowing child termination without exiting the shell.'...' or double quotes "..." (e.g. mkdir "my directory").\ for paths with special characters.~ to the user’s home directory.$VAR expressions (like $USER or $HOME) in commands or double quotes.In addition to running external programs via execvp, mash implements the following built-ins directly:
cd, pwd, ls (colorized table-format output), which, uptime, free.mkdir, rm, touch, cp, mv, cat, head, tail, find (recursive name search).chmod, chown, chgrp.echo, date, uname, whoami, version, help, history, clear.env, export, alias, unalias, source (executes shell script files).g++ 8+ or clang++).You can download the compiled binaries directly from the Releases page of this repository:
mash-linux-amd64mash-macosAfter downloading, grant execution permissions and run:
chmod +x mash-linux-amd64 # or mash-macos
./mash-linux-amd64
Compile the shell executable using the provided build script:
./build.sh
Launch the shell:
./mash
This project is licensed under the MIT License. See the LICENSE file for details.