minishell is a minimalistic UNIX shell built as part of the 42 curriculum. This project replicates key features of Bash, allowing users to execute commands, manage processes, and handle environment variables. The goal is to understand how a shell interacts with the operating system while implementing core shell functionalities.
- Command Execution - Supports built-in and external commands.
- Pipes (
|) - Enables command chaining through pipes. - Redirections (
>,<,>>,<<) - Implements file input/output redirections. - Environment Variables (
export,$VAR) - Allows variable manipulation. - Signal Handling - Handles
Ctrl+C,Ctrl+D, andCtrl+\for process control. - Process Management - Supports foreground and background execution.
- Basic Parsing & Tokenization - Splits and interprets user commands.
- Clone the repository:
git clone https://github.com/zekmaro/minishell.git cd minishell - Compile the shell:
make
- Start the shell:
./minishell
| Command | Description |
|---|---|
echo |
Prints text to standard output |
cd |
Changes the current directory |
pwd |
Displays the current directory |
export |
Sets an environment variable |
unset |
Unsets an environment variable |
env |
Displays environment variables |
exit |
Exits the shell |
$ echo "Hello, World!"
Hello, World!
$ export VAR=42
$ echo $VAR
42
$ ls -l | grep minishell
$ cat file.txt > output.txt
$ ./script.sh &- Developer: zekmaro
- Project: Part of the 42 School curriculum
- Inspiration: UNIX Shells (Bash, Zsh)
💻 Enjoy hacking around with minishell! Contributions and feedback are welcome.