Skip to content
Yassine Ajagrou edited this page Apr 20, 2025 · 2 revisions

🐚 Minishell | 42 Project

A minimalist UNIX shell written in C.


πŸ“– Overview

Minishell is a 42 project where you create a simplified version of a UNIX shell (like bash or zsh), featuring:
βœ” Basic command execution (ls, grep, etc.)
βœ” Environment variable handling ($PATH, $HOME)
βœ” Redirections (>, >>, <, <<)
βœ” Pipes (|)
βœ” Signals (Ctrl-C, Ctrl-D, Ctrl-\)
βœ” Builtins (echo, cd, export, unset, env, exit)


πŸš€ Getting Started

πŸ“‹ Prerequisites

  • 42 School’s libft (or your own C library)
  • Basic understanding of:
    • Processes & forks (fork(), execve())
    • File descriptors (open(), dup2(), pipe())
    • Signals (signal(), sigaction)

πŸ“₯ Installation

git clone https://github.com/iaceene/Minishell_42.git
cd minishell
make

πŸ›  Usage

Run the shell:

./minishell

Exit with:

exit

οΏ½ Features Breakdown

Feature Status Details
Command Parsing βœ… Splits input by `
Redirections βœ… Supports >, >>, <, << (heredoc)
Pipes βœ… Handles multiple pipes (`cmd1
Builtins βœ… echo, cd, export, etc.
Signals βœ… Ctrl-C (interrupt), Ctrl-D (EOF)
Env Variables βœ… Expands $USER, $PATH, etc.

πŸ“š Resources

πŸ”— 42 Subject (Official PDF)
πŸ”— UNIX Shell Guide (Bash Reference)
πŸ”— Advanced Pipe Handling (Systems Programming PDF)


🀝 Contributing

Found a bug? Want to improve Minishell?

  1. Fork the repo.
  2. Create a branch (git checkout -b fix/awesome-feature).
  3. Submit a Pull Request.