Skip to content

shahnajsc/42minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

316 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minishell:

It's a core part of the 42 curriculum that involves creating a simplified UNIX shell, helping students deepen their understanding of process management, parsing, signals, and environment variables in C. The Minishell project that developed in C, is a simplified shell that emulates basic behavior of bash. It's designed to deepen understanding of:

  • Processes and file descriptors
  • Parsing complex input (e.g., quotes, pipes, redirections)
  • Environment variables and their expansion
  • Signal handling
  • Built-in commands implementation

Features

  • Prompt display and command line input
  • Lexical analysis and parsing
  • Word splitting and quote removal
  • Environment variable expansion ($VAR)
  • Redirections: >, >>, <, <<
  • Pipes (|)
  • Built-in commands:
    • echo
    • cd
    • pwd
    • export
    • unset
    • env
    • exit
  • Signal handling (Ctrl+C, Ctrl+D, Ctrl+\)
  • Exit codes per POSIX standards
  • Error handling and cleanup

Technical Details

  • Language: C
  • Tools: readline, termios, POSIX APIs
  • Platform: Unix/Linux (macOS and Linux compliant)

Learning Goals

Understand how shells work under the hood

Practice managing processes and signals

Implement a tokenizer and parser

Handle memory management manually

Learn to structure a medium-scale C project

Installation

git clone https://github.com/shahnajsc/42minishell.git
cd minishell
make

Usage

./minishell
minishell$ echo "Hello, World!"
Hello, World!

minishell$ ls -l | grep .c > files.txt

Contributors

Shahnaj

Hager

Project Status

Submission and peer evaluation is done. Secured 101%

Screenshot from 2025-06-05 13-17-51

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors