A custom UNIX command interpreter implemented in C, recreating core shell functionality from scratch.
A lightweight UNIX command line interpreter written in C, implementing essential shell functionality from the ground up. This project demonstrates low-level systems programming concepts by recreating a fundamental tool that developers use every day.
cd command with proper path handling$? and $$The shell follows a modular design with components handling specific functions:
Main Flow:
+---------------+ +------------------+ +----------------+
| Input Parser |----->| Command Executor |----->| Output Handler |
+---------------+ +------------------+ +----------------+
| | |
| | |
v v v
+---------------+ +------------------+ +----------------+
| Token Manager | | Environment Mgr | | Error Handler |
+---------------+ +------------------+ +----------------+
The shell parses user input, breaking commands into tokens while handling special cases like quoted strings and escape characters. The tokenizer splits command lines into individual arguments using delimiters while properly managing memory allocation.
The execution engine determines whether commands are built-in shell functions or external programs. Built-ins are handled internally, while external commands are executed using process creation and management functions.
Custom implementation for handling environment variables, including retrieving, setting, and unsetting them. This component maintains the shell's environment context.
Locates executable files by searching through the directories specified in the PATH environment variable, implementing proper executable discovery logic.
Comprehensive error detection and reporting system that provides meaningful feedback to users when operations fail.