2024-03-21

Love, Hate relation Minishell

For all the students of the 42 foundation the project Minishell will be one of the most talked about. A really big project that let's you remake a simple shell with inspiration from bash. The project isn't immediatly super difficult it is more that the project is a lot of work and there are so many edge cases that need to be tested. My experience with minishell is that the beginning is super overwhelming. We started coding way to quick without a real plan and after some time we really needed to take some steps back to first research and think how we were going to do stuff. We started by reading the bash manual and just write things we think that were important on a paper. Then we set down and discussed our plans and things like data structures for example. This really gave us a starting point and we were both excited because we wanted to use a whole bunch of new things. We made the decision to work with an abstract syntax tree something we haven't done before. Setting this up was definetly a big challenge and also costed some time but in the end when we used the input for the commands it made it way more easy for us to understand and implement.

Would I say that an abstract syntax tree is the best solution? Probaly not but we just wanted to learn new stuff. I mostly worked on making the executor and the builtins. The builtins I didn't really like because it was just a bunch of recreating builtins from bash and I didn't really have much of a choice to use new stuff. In the environment setup I could really experiment and this is the part that I still like the most. The expander was also really quickly made because we already had all the basic functions we needed for it ready. Then the executor I was really scared for because it was a lot. Redirections, Pipes and here_docs, all things I hated while I was doing pipex. But I have to say doing pipex before really helped me this time and it made it much easier and enjoyable to make the executor.

So at the end I wouldn't say I didn't enjoy some times working on minishell but it just got a bit much and I was kinda done with it. It's definetly not my style of project that I like but I learned a lot about everything and that is the important part. I also want to shoutout my team mate Lorenzo for Minishell. His github can be found at the following url: https://github.com/LorenzoDP2 . It was really pleasant to work togheter with him and we had a really fun time. We shared some high moments and some really low :P but in the end everything worked out and we didn't kill eachother hehe. This was my small thought about the minishell project of the 42 foundation. Good luck for all the poeple that still need to do it and don't hesitate to send me a mail or discord message if you have any questions. See you guys next time.

Shell
19