Minishell is a project from 42 school that involves creating a basic Unix shell. The goal is to develop a functional shell that can interpret and execute commands, manage processes, and handle system calls.
The Minishell project is a simplified implementation of a Unix shell that supports basic commands, input/output redirections, and pipes. This project is designed to provide experience with process management, signals, and how shells interpret and execute commands.
- Command Parsing : Parses user input to handle commands, options, and arguments.
- Process Management : Uses
fork(),execve(), andwait()system calls to create and manage child processes. - Signal Handling : Catches and manages signals (e.g., Ctrl+C) to control shell behavior.
- C Language : Core language for shell implementation
- Unix System Calls : For process management, input/output, and signal handling
- Basic Command Execution : Execute basic system commands found in Unix.
- Input and Output Redirection : Supports
<,>, and>>for redirection of input and output. - Piping : Ability to use pipes (
|) to chain multiple commands together. - Environment Variables : Access and modify environment variables within the shell.
- Signal Handling : Manages signals for interruption and suspension (e.g., Ctrl+C, Ctrl+Z).
To set up minishell, clone the repository and compile the program.
git clone https://github.com/garcia2/42_minishell
cd 42_minishell
makeThis will create an executable named minishell.
To run the shell, execute the following command:
./minishellOnce running, you can enter commands as you would in a standard Unix shell. Some examples:
- Run simple commands:
ls,echo "Hello" - Use redirections:
echo "Hello" > output.txt - Chain commands with pipes:
cat file.txt | grep "text"
Project developed by Nicolas Garcia as part of 42 school.