Skip to content

TiagoDev88/minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

198 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MINISHELL

Recreating a simplified Bash shell - 42 School project


About 💡

Minishell is a 42 School project that aims to recreate a simplified Bash shell, handling commands, pipes, redirections, environment variables and built-in commands, with proper signal and memory management.

This project focuses on learning Unix process management, input parsing, file descriptors, and the design of a minimal shell that behaves similarly to Bash in its core functionality.


Features 🚀

Minishell implements:

  • A custom prompt waiting for user input
  • Command execution via absolute/relative path or $PATH
  • History using the readline library
  • Input parsing with support for:
    • Quoting: ' and " (with correct expansion behavior)
    • Escaped characters inside quotes
    • Variable expansion ($VAR, $?)
  • Built-in commands:
    • echo, cd, pwd, export, unset, env, exit
  • Redirections:
    • > : output redirection
    • >>: output append
    • < : input redirection
    • <<: heredoc (with optional variable expansion)
  • Pipe support (|)
  • Proper signal handling:
    • Ctrl-C → display new prompt
    • Ctrl-D → exit shell
    • Ctrl-\ → ignored
  • Only one global variable used to store the signal number (as per subject constraints)
  • No support for bonus features like &&, ||, (), or wildcards

Usage 📘

Requirements

  • GCC compiler
  • Make

Instructions

1. Clone the repository

git clone https://github.com/TiagoDev88/minishell.git

2. Compile

make

3. Run

./minishell
  • Then enter commands as you would in a typical Bash session:
minishell$ echo Hello, world!
Hello, world!

Author 👤

42 login: tfilipe- / GitHub: @TiagoDev88

42 login: edfreder / GitHub: @EdgarFir

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •