Skip to content

Minimal Bash-like shell written in C for the 42 School curriculum. Supports built-in commands, pipes, redirections, environment variables, and signal handling.

Notifications You must be signed in to change notification settings

artidek/42_minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minishell

Minishell is a group project developed as part of the 42 School curriculum. The goal of this project is to create a minimal Unix shell that replicates the core behaviors of common Linux shells. This repository showcases a collaborative effort between two students: @artidek and @gvardovski.


Table of Contents


About the Project

This project is an educational exercise designed to deepen our understanding of process management, signal handling, input parsing, and the design of robust C applications. Minishell attempts to mimic the behavior of a standard shell, supporting built-in commands and handling complex user input scenarios.

Features

  • Execution of built-in shell commands (cd, echo, pwd, export, unset, env, exit)
  • Execution of external programs found in $PATH
  • Support for pipes (|), redirections (>, <, >>, <<)
  • Environment variable expansion
  • Quoting and escaping rules for input parsing
  • Signal handling (e.g., SIGINT, SIGQUIT)
  • Custom prompt and command history
  • Minimal memory leaks (valgrind clean)

Installation

To build Minishell, clone this repository and run:

git clone https://github.com/artidek/42_minishell.git
cd 42_minishell
make

Requirements:

  • GNU Make
  • GCC (or compatible C compiler)
  • GNU Readline library
  • Standard Linux environment

Usage

After building, launch the shell with:

./minishell

You will be greeted by a prompt. From there, you can type commands as you would in a standard shell.

Example commands

echo "Hello, World!"
export PATH="/usr/bin"
ls -l | grep minishell
cat < infile | grep foo > outfile

Project Structure

  • main.c — Entry point of the shell
  • builtins/ — Implementation of built-in commands
  • command_processor/ — Parsing and execution of command sequences and redirections
  • expand/ — Variable and parameter expansion logic
  • includes/ — Header files and public structures
  • input_processor/ — Input handling and prompt logic
  • libft/ — Custom C library functions (as required by 42 school)
  • utils/ — Utility functions and helpers

Other files:

  • Makefile — Build instructions
  • ms.subject.pdf — 42 project subject specification

Note: Directory listing may be incomplete. For the full list, see the repository contents.

Contributing

This project follows the 42 School collaboration policy and is developed by two students as a mandatory group assignment. Contributions outside of the original team are not accepted.

Authors

License

This project is intended for educational purposes and does not currently include a specific license. Please refer to the 42 School policy regarding code reuse and sharing.


Project repository: https://github.com/artidek/42_minishell

About

Minimal Bash-like shell written in C for the 42 School curriculum. Supports built-in commands, pipes, redirections, environment variables, and signal handling.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published