This is the minishell project from the 42 core curriculum. The goal of this project is to create a bash-style shell, capable of handling basic command-line operations. The minishell project is designed to deepen your understanding of processes, file descriptors, and basic shell functionality.
- Command Execution: Minishell can execute simple commands with or without arguments.
- Redirection: Support for input and output redirection (>, <).
- Pipes: Ability to handle multiple commands connected by pipes (|).
- AND/OR Operations: Allows executing commands based on conditions (&&, ||).
- Subshells: Enables execution in a separate environment for parts of a command (()).
- Environment Variables: Implement basic support for environment variables like $HOME, $PWD, etc.
- Signals: Minishell should handle signals (Ctrl-C, Ctrl-D, etc.) appropriately.
- Line Editing: Use the GNU Readline library to provide basic line editing capabilities.
- Error Handling: Implement error handling and display meaningful error messages, including syntax errors.
brew install readline
brew link --force readline
Add the path to the lib Replace ~/.zshrc with ~/.bashrc if you use bash instead of zsh
echo 'export C_INCLUDE_PATH="/usr/local/opt/readline/include:$C_INCLUDE_PATH"' >> ~/.zshrc
echo 'export LIBRARY_PATH="/usr/local/opt/readline/lib:$LIBRARY_PATH"' >> ~/.zshrc
source ~/.zshrc
-
Clone the repository:
git clone https://github.com/lorbke/42_minishell.git
-
Change into the project directory:
cd 42_minishell -
Build the project:
make
-
Run Minishell:
./minishell