A lightweight, custom Unix-like shell written in C from scratch to explore OS concepts, system calls, and low-level memory management.
- Basic REPL loop with standard Fork-Exec-Wait process execution.
- Script execution (batch mode) with support for ignoring
#comments. - Lexical analysis with basic double-quote (
"") state handling. - Robust memory model using deep copy (
strdup) and clean garbage collection.
- Custom dynamic Hash Map built from scratch for environment variables.
-
exportcommand with OS environment synchronization (setenv). -
cdcommand supporting~(home) and-(previous directory). - Basic utilities:
help,clear, andexit. - Variable expansion (
$VAR) supporting suffix concatenation.
- Command history saving and loading (
history.txt). - Tab-completion for basic built-in commands.
- Contextual syntax hints for specific commands.
- Extend
~(tilde) expansion globally (e.g.,ls ~/Documents). - Implement Inter-Process Communication (Pipes
|). - Implement I/O Redirection (
>,<,>>). - Add Signal Handling (intercept
SIGINT/SIGTSTPto protect the shell). - Implement Background Jobs & Job Control (
&,jobs,fg,bg).