Skip to content

About

A Bash-inspired Unix shell written in C, developed as a team project at 42 Heilbronn.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

127 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐚 Minishell

A small Unix shell written in C, inspired by Bash, developed as a team project at 42 Heilbronn.

The goal was to recreate core shell functionality while working directly with Unix processes, file descriptors, pipes, signals, and system calls.

✨ Features

  • Command execution
  • Pipes (|)
  • Redirections (<, >, >>, <<)
  • Environment variables & $?
  • Single & double quotes
  • Built-ins: echo, cd, pwd, export, unset, env, exit
  • Signal handling
  • Process & file descriptor management

🏗️ Architecture

We divided the project into two clearly defined parts:

User Input
    │
    ▼
┌──────────┐
│  Parser  │  ← Project Partner
└────┬─────┘
     │
     ▼
Parsed Commands
     │
     ▼
┌───────────┐
│ Execution │  ← Paula
└─────┬─────┘
      │
      ▼
Processes / Pipes / Redirections

This separation made development efficient and easy to coordinate. With a clear interface between parsing and execution, we could work in parallel, test our components independently, and isolate bugs more easily.

⚙️ My Contribution — Execution

I focused on the execution layer, including:

  • Process creation with fork()
  • Command execution with execve()
  • $PATH resolution
  • Pipes & file descriptors
  • Input/output redirections
  • Here-documents
  • Built-in execution
  • Process synchronization with waitpid()
  • Exit status handling
  • Signals & error handling

🔧 Compilation & Usage

Clone the repository and compile:

git clone <repository-url>
cd minishell
make

Run the shell:

./minishell

Make commands

make        # Compile
make clean  # Remove object files
make fclean # Remove object files and executable
make re     # Recompile

Example

$ echo "Hello, Minishell!"
Hello, Minishell!

$ ls | grep ".c" | wc -l
5

$ export NAME=Paula
$ echo "Hello $NAME"
Hello Paula

About

A Bash-inspired Unix shell written in C, developed as a team project at 42 Heilbronn.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages