This project has been created as part of the 42 curriculum by hashammo, tzammar.
Minishell is about creating a simple shell, functioning as your very own little Bash. With Minishell, you'll travel back in time and experience the challenges developers faced before Windows existed. The primary goal of this project is to gain extensive knowledge about processes and file descriptors.
- Displays a prompt when waiting for a new command.
- Maintains a working command history.
- Searches and launches the right executable based on the PATH variable or by using a relative or absolute path.
- Handles ' (single quotes) to prevent the shell from interpreting meta-characters.
- Handles " (double quotes) to prevent interpretation of meta-characters, except for $ (dollar sign).
- Implements input and output redirections: <, >, << (heredoc), and >> (append mode).
- Implements pipes | to connect the output of one command to the input of the next.
- Handles environment variables expansion and the $? variable to expand to the exit status of the most recently executed foreground pipeline.
- Handles interactive signals ctrl-C, ctrl-D, and ctrl-\ mirroring Bash behavior.
- Implements the following built-in commands: echo (with -n), cd (relative/absolute paths), pwd, export, unset, env, and exit.
- Supports && and || logical operators, including the use of parenthesis for priorities.
- Supports wildcards (*) for the current working directory.
External Dependencies: This project relies on the previously created libraries. The following must be present and included to compile:
libft
To compile the program, run the following command in the root of the repository.
This will link all dependencies and generate the Minishell executable:
makeThis will delete all .o files but keep the Minishell executable:
make cleanThis will delete all .o files and the Minishell executable:
make fcleanThis will recompile the project:
make reOnce compiled, you can launch the interactive shell by running the output executable:
./minishell- Bash Reference Manual
- GNU C Library Documentation for processes, signals, and file descriptors.
- Let's build a super simple shell in C a great youtube video that explain how to build a simple shell.
During the learning journey, AI tools were utilized to reduce repetitive tasks and assist with technical explanations. All generated content was critically assessed, approached with caution, and systematically checked and reviewed with peers to avoid blind spots and bugs. Ultimately, only AI-generated concepts and code that were fully understood and could be taken responsibility for were integrated into the final submission.