CintermediatecliAI generated

Mini Unix Shell with Pipes and Redirection

A simplified command shell that parses user input, forks and execs external commands, and supports pipes and I/O redirection (<, >, >>). Learners practice fork/exec/wait, pipe() and dup2() system calls, and command-line parsing.

Estimate
~12h
Steps
6
Completed by
0
Proposed by
codeseed.app

unistd.h · sys/wait.h · fcntl.h

Project roadmap

  1. 01

    Build the read-eval loop and tokenizer

    ~1.5h

    Read a line of input and tokenize it into command and arguments respecting quoting.

  2. 02

    Implement single-command execution

    ~2h

    Fork a child process, exec the command with execvp, and wait for it in the parent.

  3. 03

    Add I/O redirection support

    ~2.5h

    Detect <, >, >> tokens and use dup2 to redirect the child's stdin/stdout to files before exec.

  4. 04

    Implement multi-stage pipes

    ~3h

    Support chaining commands with | by creating pipes and connecting each stage's stdout to the next's stdin.

  5. 05

    Add built-in commands

    ~1.5h

    Implement cd, exit, and pwd as built-ins handled directly in the parent process rather than forked.

  6. 06

    Add basic job control feedback

    ~1.5h

    Print exit status of foreground commands and handle Ctrl-C gracefully without killing the shell.

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~12h · 6 steps

Tech stack

unistd.hsys/wait.hfcntl.h