Minishell is a team project developed at 42 with my partner https://github.com/marine-i. The objective is to create a minimal Unix shell in C, reproducing the core behavior of bash.
This project focuses on understanding how a shell works internally, including process creation, command parsing, execution, and signal handling.
-
Execution of external commands
-
Built-in commands
-
Pipes (
|) -
Redirections:
- Input (
<) - Output (
>) - Append (
>>) - Heredoc (
<<)
- Input (
-
Environment variable management
-
Exit status handling
-
Signal handling (
Ctrl-C,Ctrl-D,Ctrl-\) -
Bash-like behavior (as required by the subject)
Minishell implements the following built-ins:
echo(with-n)cdpwdexportunsetenvexit
To compile the project, run:
makeThis will generate the minishell executable.
Launch the shell with:
./minishellYou can then execute commands as you would in bash.
- Parsing and tokenization of user input
- Execution management
- Built-in commands
- Signal handling
- Environment variables
- Memory management
(All implemented following the constraints of the 42 subject.)
- Language: C
- System calls:
fork,execve,pipe,dup2,wait,signal, etc. - Libraries: standard C library and allowed 42 functions