Skip to content

Latest commit

 

History

History
123 lines (87 loc) · 4.55 KB

File metadata and controls

123 lines (87 loc) · 4.55 KB

☠️ Underworld Shell

🩸 What Exactly Will You Build?

You are about to forge your own command-line shell — a creature born in the depths of C, crafted with precision, and shaped through the raw mechanics of systems programming. This is not just another tool. This is your shell: a program that reads user commands, parses them with eerie elegance, spawns processes from the shadows, navigates the underworld of filesystems, and manages input/output streams with surgical control.

🕯️ What Will You Learn?

By building this shell from scratch, you will walk through the haunted corridors of:

  • Process creation & management using fork(), exec() and wait()
  • Command parsing & tokenization — taming user input monsters
  • Signals & job control — whispering to running processes
  • Files, directories & navigation — traversing the dark filesystem labyrinth
  • Environment variables & PATH resolution
  • Interactive terminal experience — REPL loops, history, autocompletion
  • Redirection, pipelines, quoting mechanics — mastering the rituals of the Unix underworld

🪦 Why Build Such a Project?

Because this is a rite of passage. Because understanding a shell gives you power. Because system-level mastery is the mark of a true engineer. Because shells are tiny universes — elegant, terrifying, and beautiful. Because after building one, everything else in system programming becomes clearer.

Crafting your own shell sharpens your understanding of Linux internals, process trees, terminal behavior, and how commands truly come alive. When you finish this journey, you will never see Bash or Zsh the same way again.

🔮 Pre-requisites Before Entering the Abyss

  • Intermediate knowledge of C
  • Comfort with Linux, terminals, and basic system calls
  • Understanding of processes & filesystem structures
  • Curiosity, patience, and a taste for dark engineering

⚰️ Stages of the Shell (From Bones to Beast)

🧿 Phase 1 · Awakening the Shell

  • Print a prompt — Very Easy
  • Handle invalid commands — Easy
  • Implement a REPL — Medium
  • Implement exitEasy
  • Implement echoMedium
  • Implement typeMedium
  • Locate executable files — Medium
  • Run a program — Medium

🔗 Phase 2 · Walking the Filesystem

  • pwd builtin — Easy
  • cd (absolute paths) — Medium
  • cd (relative paths) — Medium
  • cd (home directory) — Medium

🕸️ Phase 3 · The Art of Quoting & Escaping

  • Single quotes — Medium
  • Double quotes — Medium
  • Backslash outside quotes — Medium
  • Backslash within single quotes — Medium
  • Backslash within double quotes — Medium
  • Execute a quoted executable — Medium

🔥 Phase 4 · Redirection Rituals

  • Redirect stdout — Medium
  • Redirect stderr — Medium
  • Append stdout — Medium
  • Append stderr — Medium

🩻 Phase 5 · Autocompletion

  • Builtin completion — Medium
  • Completion with arguments — Medium
  • Missing completions — Easy
  • Executable completion — Medium
  • Multiple completions — Hard
  • Partial completions — Hard

🩶 Phase 6 · Summoning Pipelines

  • Dual-command pipeline — Hard
  • Pipelines with built-ins — Hard
  • Multi-command pipelines — Hard

🕯️ Phase 7 · History of the Fallen Commands

  • History builtin — Easy
  • Listing history — Medium
  • Limiting entries — Medium
  • Up-arrow navigation — Medium
  • Down-arrow navigation — Medium
  • Executing commands from history — Medium

⛓️ Phase 8 · History Persistence

  • Read history from file — Medium
  • Write history to file — Medium
  • Append history to file — Hard
  • Read history on startup — Easy
  • Write history on exit — Easy
  • Append history on exit — Medium

🦇 Final Thoughts From the Underworld

🜸 About the Creator

Crafted in the depths by ExploitEngineer — a builder of systems, breaker of assumptions, and seeker of truth.

"Engineering is the art of turning chaos into machinery — and the courage to build what others only fear to imagine."

By the time this project breathes its first breath, you will have stitched together processes, parsing, pipes, redirection, quoting rules, and intricate terminal features — forming a complete shell creature.

This is not an ordinary README. This is a summoning book. A guide to conjure your own Hell-born shell.

Brace yourself. Your terminal will never feel the same.