Minishell is a program written in C that behaves as a simplified version of an actual shell. You can use redirections, environment variables, pipes, built-in commands and execution of commands like you would in a normal shell.
I faced three major challenges while working on the project. Firstly, I had to learn and implement two complex concepts which were the parser and lexer. Then I faced the next two most difficult problems which were to handle the proper execution of commands that were inputted alongside pipes and/or redirections, and also ensuring the proper handling of exit codes. Additionally, it was challenging to deal with the Heredoc implementation so it worked as intended.
However, it was really interesting to learn about how to organize files and the different functions. If I had to redo the project, I would definitely take more time to design the code in a different way, even though I don't think the work was bad after all.
This are commands that I had to program from scratch to implement them as built-in.
Command | Options |
---|---|
echo |
With option -n |
cd |
With only a relative or absolute path |
pwd |
With no options |
export |
With no options |
unset |
With no options |
env |
With no options or arguments |
exit |
With no options |
# Clone the repository:
git clone [email protected]:Flamiing/42_minishell.git
# Access the folder:
cd 42_minishell/
# Compile the program:
make
# To run the program:
./minishell