Back to Portfolio
MiniShell - Custom Unix Shell
System Programming

MiniShell - Custom Unix Shell

A lightweight Unix shell written in C, replicating essential Bash behaviors including pipes, redirections, environment variable expansion, and built-in commands.

Project Overview

Minishell is a custom command-line interpreter developed in C as part of the 42 Network curriculum. The project aims to replicate the core functionality of the Bash shell, providing an interactive environment where users can execute system commands, use pipes, and handle redirections.

It supports a set of built-in commands such as `cd`, `echo`, `pwd`, `env`, `export`, `unset`, and `exit`, along with full environment variable management and signal handling.

The implementation features a lexer and parser for tokenizing user input, an executor for process management, and a robust error-handling system to prevent crashes or leaks.

This project strengthened my understanding of processes, file descriptors, inter-process communication, and Unix system calls.

Key Features

  • Interactive shell with command parsing
  • Support for pipes `|` and I/O redirections (`>`, `<`, `>>`, `<<`)
  • Environment variable expansion and `$?` handling
  • Built-in commands: `cd`, `echo`, `pwd`, `env`, `export`, `unset`, `exit`
  • Signal handling (Ctrl-C, Ctrl-D, Ctrl-\)
  • Error and memory management to ensure stability

Technologies Used

CPOSIX APIUnix System CallsProcess ManagementPipes & RedirectionsMakefileLinux

Project Gallery

Minishell running user commands
Handling pipes and redirections
Signal handling and process control

Project Details

Client

Personal Project

Timeline

4 weeks (Q3 2024)

Role

System Programmer & Shell Developer

© 2025 Younes Bouyzem. All rights reserved.

0%