It's a core part of the 42 curriculum that involves creating a simplified UNIX shell, helping students deepen their understanding of process management, parsing, signals, and environment variables in C.
The Minishell project that developed in C, is a simplified shell that emulates basic behavior of bash. It's designed to deepen understanding of:
- Processes and file descriptors
- Parsing complex input (e.g., quotes, pipes, redirections)
- Environment variables and their expansion
- Signal handling
- Built-in commands implementation
- Prompt display and command line input
- Lexical analysis and parsing
- Word splitting and quote removal
- Environment variable expansion (
$VAR) - Redirections:
>,>>,<,<< - Pipes (
|) - Built-in commands:
echocdpwdexportunsetenvexit
- Signal handling (
Ctrl+C,Ctrl+D,Ctrl+\) - Exit codes per POSIX standards
- Error handling and cleanup
- Language: C
- Tools:
readline,termios, POSIX APIs - Platform: Unix/Linux (macOS and Linux compliant)
Understand how shells work under the hood
Practice managing processes and signals
Implement a tokenizer and parser
Handle memory management manually
Learn to structure a medium-scale C project
git clone https://github.com/shahnajsc/42minishell.git
cd minishell
make./minishell
minishell$ echo "Hello, World!"
Hello, World!
minishell$ ls -l | grep .c > files.txt
Submission and peer evaluation is done. Secured 101%
