This project implements a small educational Unix shell called ush, written in C (C11). It reads commands from standard input, parses them, and executes built‑ins and external programs. A lightweight support library, libmx, is included in the repository and built automatically by the Makefile.
- POSIX‑compatible environment (macOS or Linux)
clangmake
The Makefile builds the ush binary and the bundled libmx library.
# Build (default)
make
# Rebuild from scratch
make reinstall
# Remove build artifacts for this project
make clean
# Remove the binary and clean libmx
make uninstallThe resulting binary will be placed at:
./ush
After building, start the shell with:
./ushThen type commands at the prompt and press Enter. Use Ctrl+D (EOF) to exit, or the built‑in exit if implemented for your current version.
Key directories and files in this repository:
libmx/- utility/support library used byush(built automatically by the Makefile).inc/- public headers forush.src/- source code for parsing, execution, models, and utilities.Makefile- build script with common targets (make,make clean,make uninstall,make reinstall).
- C standard: C11
- Default compiler flags (from Makefile):
-std=c11 -Wall -Wextra -Werror -Wpedantic - Include paths:
-I./inc -I./libmx/inc
- If you change headers or
libmx, prefermake reinstallto ensure a clean rebuild. - On systems where
clangis not default, install it or adjustCCin the Makefile (use at your own risk).
Not specified. If you intend to distribute this project, please add a license file appropriate for your use case.