Minishell is a project that aims to recreate a minimal Unix shell.
It executes commands, manages processes, and implements a subset of bash features.
The goal is to understand the internal mechanisms of a command-line interpreter and practice low-level Unix/Linux concepts such as processes, pipes, and redirections.
- Execution of simple commands with arguments.
- Path resolution using the
PATHenvironment variable. - Implementation of the following builtins:
echo(with-noption)cdpwdexportunsetenvexit
- Redirections:
<(input from file)>(output to file, overwrite)>>(output to file, append)<<(heredoc)
- Pipes (
|) between commands. - Signal handling (
Ctrl-C,Ctrl-D,Ctrl-\). - Environment variables management.
- Behavior closely matching
bashfor the specified cases.
Clone the repository and compile with make:
git clone https://github.com/your-username/minishell.git
cd minishell
makeThis will generate the minishell executable.
Run the shell:
./minishellExample session:
minishell$ echo "Hello World"
Hello World
minishell$ ls -l | grep minishell.
├── Makefile # Compilation rules
├── minishell.h # Main header file
├── src/ # Source code
│ ├── main.c
│ ├── parser.c
│ ├── executor.c
│ ├── builtins/
│ └── ...
├── libft/ # Utility library
└── README.md
- Language: C
- Coding style: Norminette (42 school standard)
- System calls:
fork,execve,pipe,dup2,signal,waitpid, etc.
- [Your Name]
- [Your partner’s name, if applicable]
- Understand how a shell works internally.
- Practice system programming in C.
- Improve memory management and pointer handling.
- Work with processes and inter-process communication.