Skip to content

elinakly/minishell42

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

229 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minishell

This project is part of the 42 School curriculum. Minishell is a simple Unix shell implementation in C that replicates key features of Bash.


🛠️ Features

✅ Command parsing (with quotes, special characters)

✅ Built-in commands (cd, echo, pwd, export, unset, env, exit)

✅ Execution of external programs using PATH

✅ Pipes (|) and redirections (>, <, >>, <<)

✅ Environment variable handling

✅ Custom prompt display

✅ Command history (without using read_history())


⚙️ How to Build

git clone git@github.com:elinakly/minishell42.git
cd minishell42
make

🚀 Usage

./minishell

You’ll see a custom prompt where you can run commands like:

  • ls -la | grep minishell
  • echo $HOME
  • cat file.txt > out.txt

📚 Project Rules

  • Only allowed to use specific system calls and standard library functions
  • Must handle signals (CTRL+C, CTRL+) properly
  • Built-in commands must work with and without pipes

💁 File Structure

minishell/
├── src/          # source files
├── include/      # header files
├── lib/          # libraries (if any)
├── Makefile

💡 What I Learned

  • Building a shell from scratch
  • Process management (fork, exec, wait)
  • File descriptors and pipes
  • Signal handling
  • Memory management and avoiding leaks
  • Linked lists for command management

💊 Author

Made by Me and Mika at 42 School.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors