Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

███╗   ███╗██╗███╗   ██╗██╗███████╗██╗  ██╗███████╗██╗     ██╗
████╗ ████║██║████╗  ██║██║██╔════╝██║  ██║██╔════╝██║     ██║
██╔████╔██║██║██╔██╗ ██║██║███████╗███████║█████╗  ██║     ██║
██║╚██╔╝██║██║██║╚██╗██║██║╚════██║██╔══██║██╔══╝  ██║     ██║
██║ ╚═╝ ██║██║██║ ╚████║██║███████║██║  ██║███████╗███████╗███████╗
╚═╝     ╚═╝╚═╝╚═╝  ╚═══╝╚═╝╚══════╝╚═╝  ╚═╝╚══════╝╚══════╝╚══════╝

A minimal UNIX shell — built from scratch at École 42 Le Havre

42 School Language


📖 About

Minishell is a project from the 42 curriculum that challenges students to implement a functional UNIX shell in C. The goal is to deeply understand how a shell works — process creation, file descriptors, signals, and how the terminal interprets commands.

"The most important thing we've ever engineered is the shell."


✨ Features

Feature Description
🖥️ Interactive prompt Displays a prompt and waits for user input
📜 Command history Navigate previous commands with /
🔍 PATH resolution Finds and executes binaries from $PATH
🔗 Pipes Chain commands with |
↩️ Redirections >, >>, <, << (heredoc)
💬 Quotes Handles single ' and double " quotes
🌍 Environment variables Expands $VAR and $?
Signals ctrl-C, ctrl-D, ctrl-\ behave like bash
🔧 Builtins Full implementation of all required builtins

🔧 Builtins

echo    [-n]              # Print text to stdout
cd      [path]            # Change current directory
pwd                       # Print working directory
export  [name[=value]]    # Set environment variables
unset   [name]            # Remove environment variables
env                       # Print environment
exit    [status]          # Exit the shell

🚀 Getting Started

Prerequisites

  • gcc or clang
  • make
  • readline library
# macOS
brew install readline

# Linux (Debian/Ubuntu)
sudo apt-get install libreadline-dev

Installation

git clone git@github.com:LnnRust/Minishell.git
cd Minishell
make

Usage

./Minishell
minishell$ echo "Hello, World!"
Hello, World!
minishell$ ls -la | grep .c | wc -l
42
minishell$ export NAME=student && echo "Hi $NAME"
Hi student
minishell$ cat << EOF
> this is a heredoc
> EOF
this is a heredoc
minishell$ exit

📚 Resources


👥 Authors

aandreo fbenech memillet


📜 License

This project is part of the 42 curriculum. Do not copy or submit it as your own work.


Made with ☕ and way too many segfaults at 42

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages