Skip to content

tinyblinker/wish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wish Shell 🐚

Wish Shell is a lightweight Unix-like shell implemented in C for fun!
It demonstrates how a basic command-line interpreter works, including parsing, process creation, execution, and I/O redirection.


πŸ“Œ Project Overview

Wish Shell is a simplified shell inspired by Unix shells such as bash and sh.

It supports:

  • Command execution (ls, echo, cat, etc.)
  • Built-in commands (e.g., cd, exit)
  • Input/output redirection (only >)
  • Background execution (&)
  • Basic command parsing and tokenization
  • Process creation using fork() and exec()

The goal of this project is to understand Linux process model, system calls, and shell internals.


βš™οΈ Architecture

Wish Shell follows a classic shell execution pipeline:

User Input β†’ Lexer β†’ Parser β†’ Executor β†’ OS (fork/exec)

Key Components:

  • Tokenizer: splits input into commands and arguments
  • Parser: interprets redirection and background execution
  • Executor: handles process creation and execution
  • Process Manager: uses wait()/waitpid() for synchronization

πŸš€ Build & Run

Compile

gcc -o wish wish.c -g -O0 -Wall

Run

./wish

About

First bad project: My toyshell based on the OSTEP's homework(wish shell)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors