Skip to content

ychbily/minishell

Repository files navigation

minishell cover

minishell badge

Minishell

Overview

Minishell is a simplified Unix shell implemented in C, inspired by Bash. This project is part of the 42 Network curriculum and focuses on understanding processes, file descriptors, and signal handling.

Features

Minishell replicates the behavior of a basic shell with the following functionalities:

  • Interactive Shell: Displays a prompt while waiting for a command.
  • Command Execution: Runs executables using the PATH environment variable.
  • Quoting Handling: Supports single (') and double (") quotes.
  • Redirections:
    • < redirects input.
    • > edirects output.
    • << (here-document) reads input until a specified delimiter.
    • >> appends output to a file.
  • Pipes (|****): Connects multiple commands in a pipeline.
  • Environment Variables: Expands variables ($VAR) and supports $? for the last exit status.
  • Built-in Commands:
    • echo (with -n option)
    • cd (relative or absolute path)
    • pwd
    • export
    • unset
    • env
    • exit
  • Signal Handling:
    • Ctrl+C displays a new prompt.
    • Ctrl+D exits the shell.
    • *Ctrl+* does nothing in interactive mode.

Bonus Features

  • Logical operators (&& and ||) with parentheses for priority handling.
  • Wildcard expansion (*) for pattern matching in the current directory.

Usage

  1. Clone the repository:
git clone https://github.com/ychbily/minishell.git
  1. Compile the project:
make
./minishell

Screenshots

minishell Screenshot

Authors

Acknowledgments

Completed as part of the curriculum at 1337 School in Khouribga, Morocco, achieving a perfect score of 125/125. minishell Screenshot

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published