A fully functional custom UNIX-like shell implemented in C, built from scratch without relying on existing shell code.
Implements core shell features such as command execution, directory navigation, piping, redirection, and prompt customization.
- Command Execution – Runs any executable in the system’s
$PATHusingexecvp - Multiple Commands per Line – Separate with
; - Change Directory – Built-in
cdwith home (~) expansion - Prompt Customization – Shows shortened current working directory
- Exit Methods – Type
exitor pressCtrl-D - Pipes – Basic single-pipe support using
popen() - I/O Redirection –
<for input,>for output - Error Handling – Graceful handling of invalid commands and arguments
main.c– Entry point and main program loopshell.c– Core shell logic (command parsing, execution, pipes, redirection)shell.h– Header file for shared functions and constantsmakefile– Build automation (make,make clean).gitignore– Ignore compiled binaries and temp files
makeProduces the myshell binary.
./myshellls -l
cd Documents
echo "Hello, World!" > output.txt
cat < input.txt | grep keyword
pwd; whoami; dateExit the shell:
exitor press Ctrl-D.
make clean- Designed for POSIX-compliant systems (macOS, Linux)
- No external dependencies beyond a C compiler
- Simple single-pipe implementation; multiple pipes can be added with minor parsing changes
- Low-level C systems programming
- Process control with
fork(),execvp(), andwait() - Command parsing using
strsep()and tokenization - File descriptor manipulation for I/O redirection
- Basic inter-process communication with
popen() - Terminal prompt customization
Developed by Andrew Choi, Victor Kamrowski, and Tony Chen.
This repository was imported in a single commit from a private development repo where it was originally created and maintained.
The commit history was reset to remove unrelated school references.