Skip to content

minishell: 42's mid-course project, second biggest project in it's common core, aimed to create our own "mini" shell, handling its behaviour similarly to how bash works

Notifications You must be signed in to change notification settings

nvillalt/42_minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minishell

As beautiful as a Shell

Aim

The objective of this project is for you to create a simple Shell. Yes, your own little bash or zsh. You will learn a lot about processes and file descriptors.

Documentation and Development

Our working shell (mishell), was a beast of a project tackled and developed by both myself and my minishell partner fmoran-m. The first and most relevant point was setting a clear basis of how we were going to structure the project and setting the boundaries of what our shell would and would not contemplate, something which came from reading plenty of Bash documentation and talking to our peers in 42 to properly grasp how shells should work. Here are some useful links:

After getting some ground work done we decided on the following structures to create our project:

  • Tokenising the input by saving in a linked node list each "word" or "symbol" sent to the readline function.
  • Expanding the $COMMAND symbols encountered after reading the nodes
  • Adding each of the "tokens" in our token list to a process list (organise whatever we got between pipes in the following manner, to afterwards send to the executor/processes part of the program)
    • A linked node list containing commands/builtins and their arguments with another linked node list contained within in order to handle all redirections
  • Properly handle all status responses to print and expand with $?
  • Properly handle exit errors, memory allocations and de-allocations, truly one of the most difficult parts of the project.

Aftermath

Minishell's scope is so huge and you truly need to define the project in such a way (set boundaries of the scope of what you will handle, coordinate with another developer, set clear basis for both of you to work...) that makes it the most challenging and useful project to date in the 42 Cursus Common Core. You truly learn a lot not only about bash's innards, but also about how to clean code, organisation, teamwork and project definition and execution. Good luck with your shell! It truly is as beautiful as a shell!

About

minishell: 42's mid-course project, second biggest project in it's common core, aimed to create our own "mini" shell, handling its behaviour similarly to how bash works

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages