Skip to content

duarteagostinho/minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

124 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minishell

Minishell Logo

A simplified Bash-like shell written in C as a 42 Lisboa project.

AboutFeaturesInstallationUsage


About

Minishell is a collaborative project from 42 Lisboa that involves creating a simple, yet functional, Unix shell. This project is a deep dive into process creation, synchronization, and input/output management, reinforcing core systems programming concepts.

The shell handles command execution, environment variables, signals, and built-in commands, providing a hands-on understanding of how tools like Bash or Zsh work under the hood.

Key Learning Objectives:

  • Process creation and management using fork(), execve(), and waitpid().
  • Input parsing, tokenization, and handling of quoting and escaping.
  • Redirections (>, >>, <, <<) and pipes (|).
  • Signal handling (e.g., Ctrl-C, Ctrl-D, Ctrl-\).
  • Environment variable expansion ($VAR).

Features

Category Implemented Features
Command Execution Executes commands found in the PATH (e.g., ls, grep, cat).
Built-ins echo, cd, pwd, export, unset, env, exit.
Redirections Input (<), Output (>), Append (>>), Heredoc (<<).
Pipes Multiple pipes in a single command line (e.g., ls │ grep .c │ cat -e).
Variables Expands $USER and $? (exit status of the last command).
Quotes & Escapes Handles single quotes ' ', double quotes " ", and the backslash \.
Signals Ctrl-C displays a new prompt, Ctrl-D exits the shell, Ctrl-\ does nothing.

Installation

  1. Clone the repository
    git clone https://github.com/duarteagostinho/minishell.git
    cd minishell
  2. Compile the program
    make
    This will generate the minishell executable.

Usage

Run the shell by executing the generated binary:

./minishell

About

The objective of this project is to create a "simple shell", written in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors