Linux Shell (C)
Oct 2024
CConcurrencyData Structures
A custom shell written in C with support for command execution, piping, redirection, and signals. The project focuses on process control and correctness under typical shell behaviors.
Recursive pipe chaining supports arbitrary-depth pipelines via right-to-left parsing and fork/dup2 orchestration
5 built-ins (cd, source, prev, help, verbose) communicate with parent via a dedicated global IPC pipe
Single-pass tokenizer handles quoted strings, special characters, and whitespace with a custom 2x-growth dynamic vector
What I built
- Command execution with piping and I/O redirection
- Signal handling and process orchestration
- Built-in commands (source, prev, cd, help, verbose toggle)
How it works
- 1Parse input into commands and pipeline segments
- 2Fork/exec child processes and wire pipes between them
- 3Apply redirections and handle signals appropriately
- 4Track history for built-ins like prev
Next steps
- Add job control (fg/bg) if desired
- Harden parsing for edge cases and quoting rules