Skip to content

ondbeh/minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Minishell - Custom Shell Implementation

License Stars Issues 42 Project

A custom Unix shell implementation with basic functionality inspired by bash

📋 Table of Contents

📖 Overview

Minishell is a Unix shell implementation that recreates essential functionalities of a command-line interpreter. This project focuses on parsing command syntax, implementing built-in commands, managing processes, and handling signals. It's developed as part of the 42 school curriculum to deepen understanding of process creation and control.


✨ Features

  • ✅ Command line parsing with support for quotes, double quotes, tilde and '*' wildcard
  • ✅ Command execution with PATH variable resolution
  • ✅ Built-in commands: echo, cd, pwd, export, unset, env, exit
  • ✅ Environment variable expansion
  • ✅ Signal handling (Ctrl+C, Ctrl+D, Ctrl+\)
  • ✅ Redirections (input, output, append) and pipes
  • ✅ Error handling with appropriate error messages and return values
  • ✅ Command history using readline library

🎮 Demo

Minishell Demo


🔧 Installation

  1. Clone the repository:
    git clone https://github.com/ondbeh/minishell.git
  2. Navigate to the project directory:
    cd minishell
  3. Compile the project:
    make

Requirements

  • GCC compiler
  • Make
  • Readline library

For Debian/Ubuntu:

sudo apt-get install libreadline-dev

For macOS:

brew install readline

📚 Usage

Run the shell:

./minishell

Supported Features

Feature Description
Commands Execute commands found in $PATH
Quotes Handle single ' and double " quotes
Redirections < (input), > (output), >> (append), <<(heredoc)
Pipes | to pipe from first command STD_OUT to second command STD_IN
Logical Operators && (and), || (or) to chain commands
Parenthesis ( and ) to determine command priority
Wildcards * for pattern matching in current working directory
Variables $VAR environment variable expansion
Exit status $? for last command's exit status
Signals Ctrl+C, Ctrl+D, Ctrl+\ handling

🤝 Contributing


📞 Contacts

GitHub

Email

LinkedIn


📜 License

This project is licensed under the MIT License - see the license file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •