Minishell is a project from the 42 curriculum where I built a simple Unix shell from scratch. The main goal for me was to understand how a shell actually works behind the scenes by implementing core features myself, such as command execution, parsing user input, and handling basic system behavior.
Instead of relying on existing shell implementations, I worked directly with low-level system calls to manage processes, file descriptors, and signals.
The project is not intended to fully replicate Bash, but rather to include the essential, commonly used features of a shell and provide a user experience that feels similar to Bash.
-
Execution of commands (
ls,echo,cat, etc.) -
Environment variable handling (
$PATH,$HOME, etc.) -
Built-in commands:
echocdpwdexportunsetenvexit
-
Pipes (
|) -
Redirections:
- Input (
<) - Output (
>) - Append (
>>) - Heredoc (
<<)
- Input (
-
Signal handling (
Ctrl+C,Ctrl+D,Ctrl+\) -
Basic error handling (syntax and execution)
- Process creation and control (
fork,execve,wait) - File descriptors and I/O redirection
- Parsing and tokenization
- Memory management
- Signal handling
- General Unix system programming concepts
Clone the repository:
git clone git@github.com:ausperg/minishell.git
cd minishellCompile:
makeRun:
./minishell$ echo Hello World
Hello World
$ export NAME=42
$ echo $NAME
42
$ cat < input.txt > output.txt- Language: C
- System calls:
fork,execve,pipe,dup2,waitpid - Standard C library and a custom
libft
This project is part of the 42 curriculum and is intended for learning purposes. It focuses on understanding core Unix behavior rather than building a production-ready shell.