Hsh (Hshell) - Custom Unix Shell
November 2023 – February 2024
Hsh is a complete Unix shell implementation built from scratch using only the C 1978 standard library. This project showcases mastery of low-level system programming, including process management, file descriptor manipulation, and command parsing. The shell supports complex command piping, output redirection, and command chaining with sub-millisecond parsing performance. I used Valgrind for memory debugging and implemented function pointers for modularity, achieving a minimal memory footprint.
Key Achievements
- ✓Developed a complete UNIX shell implementation with only C 1978 standard library
- ✓Built a lightning-fast parser for efficient tokenization using stream manipulation and parser algorithms
- ✓Implemented command concatenation and output redirection using low-level file descriptors
- ✓Used Valgrind for memory debugging and function pointers for modularity and reduced memory footprint
- ✓Supports complex piping, redirections, and command chaining
- ✓Achieved sub-millisecond parsing performance
Features
Full Shell Features
Complete implementation of piping, redirections, and command chaining
Low-Level Optimization
Direct file descriptor manipulation for maximum performance and control
Memory Efficient
Minimal memory footprint through careful design and Valgrind optimization
Metrics
<1ms
Parsing Speed
~500KB
Memory Usage
50+
Commands Supported