Minishell is a Unix shell implementation developed as part of the 42 school curriculum. This project, undertaken collaboratively by Muna, stands out due to its unique use of Recursive Descent Parsing, which serves as the foundation for robust command interpretation and execution.
Minishell offers a wide range of features that make it a versatile and powerful Unix shell:
- Basic Shell Commands: Minishell supports a variety of fundamental Unix shell commands such as
ls
,cd
,echo
,pwd
, and many others. - Piping and Redirection: You can employ pipes (
|
) to connect commands and efficiently redirect input/output using<
,>
, and>>
. - Error Handling: Minishell provides informative error messages, making debugging easier and more effective.
- Built-in Commands: Several built-in commands are at your disposal, including
exit
,env
,export
, andunset
.
One of Minishell's most defining features is its utilization of Recursive Descent Parsing (RDP). RDP is a top-down parsing technique that empowers Minishell to efficiently interpret and execute user commands.
- Lexical Analysis: The input command undergoes lexical analysis, resulting in its tokenization into a sequence of tokens, which include command names, arguments, and operators.
- Parsing: Minishell's RDP engine parses the tokenized input by performing a recursive descent through the grammar rules of the shell language. This process culminates in the creation of a tree data structure that meticulously represents the command's structure.
- Execution: Following parsing, Minishell proceeds to execute the commands by traversing the parsed tree, ensuring precise adherence to the specified sequence of operations.
- Human-Readable Grammar: RDP facilitates the creation of a clear and human-readable grammar representation, enhancing the ease of maintaining and extending the shell's functionality.
- Error Recovery: Minishell's RDP engine exhibits robustness by being able to recover from certain syntax errors, significantly enhancing the user experience.
To harness the capabilities of Minishell, proceed as follows:
-
Clone the Repository:
git clone https://github.com/anassajaanan/Mini-Shell.git
-
Build the Project:
cd Mini-Shell make
-
Run Minishell:
./minishell
-
Begin Your Minishell Journey:
You can now start using Minishell to run commands and explore its plethora of features.
$ ./minishell
To install Minishell on your system, you'll need to follow these simple steps:
-
Clone the Repository:
git clone https://github.com/anassajaanan/Mini-Shell.git
-
Build the Project:
cd Mini-Shell make
-
Launch Minishell:
./minishell
-
Begin Your Minishell Journey:
You can now start using Minishell to run commands and explore its plethora of features.
Both Me and Muna welcome contributions to the Minishell project! If you have ideas for enhancements, bug fixes, or new features, please feel free to open an issue or submit a pull request. For substantial changes, we recommend initiating a discussion in the issue tracker before proceeding.