A custom shell implementation in C as part of the 42 curriculum. Minishell replicates the behavior of a Unix shell, handling commands, environment variables, pipes, redirections, and more. This project provides an excellent opportunity to deepen your understanding of processes, system calls, and input/output redirection.
Minishell is a simple shell program that emulates basic functionalities of Bash. The project adheres to the requirements outlined by the 42 curriculum, focusing on:
- System programming
- Process control
- Memory management
- 🔄 Interactive Mode: Provides a prompt for user commands.
- 🏃 Execution of Commands: Runs executables from the system PATH.
- 🌐 Environment Variables: Handles
$VARIABLE
expansion. - 🔗 Pipes (
|
): Supports command chaining via pipes. - 📤 Redirections (
>
,<
,>>
): Redirects input/output streams. - 🔧 Built-in Commands:
echo
cd
pwd
export
unset
env
exit
- 🛡️ Signal Handling: Proper handling of
Ctrl+C
,Ctrl+D
, andCtrl+\
. - ❌ Error Handling: Displays descriptive error messages for invalid commands.
- Clone the repository:
git clone https://github.com/HoudaChairi/42_Minishell.git cd 42_Minishell make
./minishell
Command | Description |
---|---|
echo |
🗣️ Print arguments to the standard output. |
cd |
📂 Change the current working directory. |
pwd |
📍 Print the current directory. |
export |
📤 Set environment variables. |
unset |
❌ Unset environment variables. |
env |
🌐 Display environment variables. |
exit |
🚪 Exit the shell. |
-
🧠 Learn system programming concepts.
-
🛠️ Gain a deeper understanding of:
- Process creation and management (
fork
,exec
,wait
). - File descriptors and redirection.
- Unix signals.
- Process creation and management (
-
💻 Develop a robust and user-friendly application.