Skip to content
@Minishell13

Minishell

his project is about creating a simple shell. Yes, your own little bash. You will learn a lot about processes and file descriptors.

🐚 Minishell Organization

Welcome to the Minishell Organization – a collaborative effort to build a fully functional shell in C as part of the 42 school curriculum.

🎯 Project Overview

Minishell is a simplified Unix shell designed to mimic the behavior of /bin/bash. It supports command parsing, input/output redirections, pipelines, environment variable expansion.

This organization splits the project into two main components to support clean development and collaboration:

🔧 Repositories

Owner: Hamza Wahmane

This repository focuses on the parsing logic, including:

  • Lexical analysis and tokenization
  • Grammar parsing (AST generation)
  • Command and redirections arrange
  • && and || with () for priorities
  • Quote and escape handling
  • Syntax validation and error handling

Owner: Abdellah Nsila

This repository handles the execution engine of the shell. It is responsible for:

  • Dollar $ expansion ($VAR, $?)
  • Wildcard * expansion (*, ls *)
  • Process forking and execve calls
  • Built-in command handling
  • Redirections (<, >, >>, <<)
  • Pipes (|)
  • Subshells and grouping
  • Environment management
  • File descriptor restoration and isolation

🔗 Collaboration Workflow

We follow a modular development approach:

  1. Parsing builds the AST (Abstract Syntax Tree) and handles all user input processing.
  2. Execution receives the AST and interprets it to run commands accurately.

Communication between the two repositories happens through a shared structure (AST nodes and enums) and clearly defined interfaces.


📦 Building the Shell

Each repository can be compiled separately, but to run the shell completely:

  • Link the parser output into the executor.
  • Use Makefile coordination or a script to compile and merge both.

✅ Features (in progress or complete)

  • Tokenization and Parsing
  • AST Generation
  • Built-in Commands (cd, echo, export, etc.)
  • Input/Output Redirections
  • Heredoc (<<)
  • Pipes (|)
  • Subshells ((cmd))
  • Manage fds, filesm redirs ((<, <<, >, >>))
  • Environment Variable Expansion
  • Wildcard expansion (*) (optional)
  • Signal handling refinement
  • Exit code manipulation
  • Test complex commands
  • Join Parsing with execution
  • Error and memory management
  • Optimize, clean up files and stream logic
  • Push 125/100

👥 Contributors


📚 License

This project is developed as part of the 42 School curriculum. All code is original and follows the guidelines set by the 42 Network.


🧠 Note

This shell is educational and built under restricted conditions:

  • No use of external libraries
  • Limited standard C functions
  • Manual memory and error management

The goal is to deeply understand how a real shell works internally.


Happy Hacking 💻

Pinned Loading

  1. Minishell Minishell Public

    Global Repo

    C 3

Repositories

Showing 4 of 4 repositories

Top languages

Loading…

Most used topics

Loading…