Skip to content

palgarob/Minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔔 Before you start 🔔

This project is part of the 42 computer programming schools common-core curriculum. 42 is a non-profit educational organization characterized by its peer-to-peer and project-based learning method. You'll find the subject of the project in the repository.


🐚 minishell

demo

Table of Contents

🛫 Intro

minishell is a simplified Unix shell recreated as part of the 42 curriculum. The goal is to replicate the core behavior of a bash-like shell by handling user input, parsing commands, managing processes, and mimicking the environment in which real-world shells operate.

The project encourages an in-depth understanding of process control, file descriptors, signals, and parsing logic, all while conforming to the strict coding norms of 42.

terminal screenshot

✨ Characteristics

  • Implements a command-line interface supporting:
    • Built-in commands: echo, cd, pwd, export, unset, env, exit
    • Redirections: >, >>, <, << (here-doc)
    • Pipes: |
    • Quoting rules: single ' and double " quotes
    • Environment variable expansion: $VAR
  • Error handling for invalid syntax and command failure
  • Signal handling (SIGINT, SIGQUIT, EOF) that mimics bash behavior
  • Minimal memory leaks (checked with Valgrind)

🛠️ Tools used

Tool/Lib Purpose
readline Handles command history and editing
termios.h Terminal behavior configuration
unistd.h Access to execve, fork, pipe, dup2
stdlib.h Memory allocation
signal.h Signal handling
string.h String operations
fcntl.h File descriptor manipulation

This project was developed and tested on Linux, using the GNU readline library.

🚀 Quick guide

Clone the repository and compile using make:

git clone https://github.com/YOUR_USERNAME/minishell.git
cd minishell
make
./minishell

⚠️ This README was partially generated with the assistance of ChatGPT to ensure clarity and structure.

About

42 cursus minishell project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors