BEVERLYQIN

Back to Projects

Unix-Style Minishell Implementation

my role

Developer

year

2025

contribution

Development, Testing

tools

C, Bash, Shell

team

Sanjay Kumar

Project Details

Built a lightweight, executable shell program in C that replicates core Unix shell functionality. The project required implementing process management, signal handling, and file system navigation at a low level, demonstrating practical systems programming skills.

Note: Course assignment – full code not public, available upon request.

Key Features

Interactive Prompt

• Displays current working directory in real time using getcwd, with color-coded formatting (ANSI escape sequences)

Built-in Commands

• Implemented cd (with support for ~, nested paths, and quoted directory names) and exit without relying on exec

Process Management

• Forks and executes external commands with exec, ensuring parent waits for child process completion

Error Handling

• Robust error messages for all system calls (fork, exec, chdir, wait, malloc), preventing crashes

Signal Handling

• Captures SIGINT (Ctrl+C) safely using async-safe signal handlers, returning the user to the prompt without terminating the shell

Extra

• Quoted directory name support (cd “some folder name”)

• Multi-process piping (chains of up to 64 processes, e.g. echo “5\n3\n2” | sort | uniq)