Skip to content

Repository files navigation

minishell

42

AboutHow to useMandatoryBonusNorminetteContributing

ABOUT

This project consists of creating a simple shell. It serves as a practical introduction to the world of processes and file descriptors. The goal is to develop a program capable of reading commands, parsing them, and executing them, mimicking the basic behavior of Bash.

HOW TO USE

1º - Clone the repository

git clone https://github.com/realgetOff/mini_hell.git
cd mini_hell

2º - Go to the root of the project and run the following command:

make

3º - Launch the shell as follows:

If you wanna test leaks use the readline vsupp, since the library is leaking (--suppressions=vsupp)

./mini_hell

MAKEFILE RULES

make - Compile so_long files.

make clean - Delete all .o (object files) files.

make fclean - Delete all .o (object files) and .a (executable) files.

make re - Use rules fclean + all.

MANDATORY

  • Prompt: Displays a prompt when waiting for a new command.
  • History: Working command history.
  • Execution: Searches and launches executables (PATH, absolute or relative paths).
  • Signals: - ctrl-C displays a new prompt. ctrl-D exits the shell. ctrl-\ does nothing.
  • Quotes: - ' (Single quotes) prevent interpretation of meta-characters. " (Double quotes) prevent interpretation except for $.
  • Redirections: Handles <, >, >>, and << (heredoc).
  • Pipes: Connects the output of a command to the input of the next.
  • Environment: Handles $ expansion and $? for exit status.

BUILT-INS

  • echo (with -n), cd, pwd, export, unset, env, exit.

BONUS

  • Logical Operators: Handles && and || with parentheses for priorities.
  • Wildcards: Handles * for the current working directory.

NORMINETTE

At 42 School, it is expected that almost every project is written following the Norm.

  • No memory leaks (except from the readline library).
  • Only one global variable allowed (for signals).
  • Compliance with the 42 Norm (v3).
  • 42 Norms - Information about 42 code norms. PDF
  • Norminette - Tool to respect the code norm, made by 42. GitHub
  • 42 Header - 42 header for Vim. GitHub

CONTRIBUTING

If you find any issues or have suggestions for improvements, feel free to fork the repository and open an issue or submit a pull request.

All credits go to @jotavare for the original README template.

About

A POSIX-compliant shell implementation in C, featuring lexer/parser pipeline, fork/execve process spawning, heredoc handling, fd duplication via dup2, and inter-process communication through pipes.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages