personal implementation of a simple shell .
Your shell should :
_ Display a prompt when waition for a new command.
_ Have a working history.
_ Search and launch the right executable (based on PATH variable or using a relative or an absoluet path).
_ Not interpret unclosed quotes or special characters which are not required by the subject such as '' or ';' .
_ Handle ' (single quote) which should prevent the shell from interpreting the meta-characters in the quoted sequence.
_ Handle " (double quote) which should prevent the shell from interpreting the meta-characters in the quoted sequence except for $ (dollar sign).
_ Implement redirections ( < _ > _ >> _ <<) .
_ Implement infinite pipes.
_ Handle environment variables which should expand to their values by using " $ ".
_ Handle $? which should expand to the exit status value.
_ Handle ctrl-C, ctrl-D and ctrl-\ .
_ Implement thet following builtins :
β- 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
_ the aim of this project if to gain experience with some advanced programming techniques like process creationand control, file descriptors, signals and pipes.
_ clone the repo, execute make
command and then execute ./Minishell
and it will display a prompt.
then you can have fun with it.
- the Parsing part was done by :
@zmeribaa
https://github.com/zmeribaa - the Execution part was done by @me.
https://www.cs.purdue.edu/homes/grr/SystemsProgrammingBook/Book/Chapter5-WritingYourOwnShell.pdf
https://www.rozmichelle.com/pipes-forks-dups/
https://medium.com/swlh/tutorial-to-code-a-simple-shell-in-c-9405b2d3533e
https://www.geeksforgeeks.org/making-linux-shell-c/
https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Simple-Commands
https://mywiki.wooledge.org/BashParser
http://aosabook.org/en/bash.html
https://www.cs.cornell.edu/courses/cs414/2004su/homework/shell/shell.html
https://brennan.io/2015/01/16/write-a-shell-in-c/
https://hackernoon.com/lets-build-a-linux-shell-part-i-bz3n3vg1
https://chrismartine-e.medium.com/creating-your-own-linux-shell-1cbaaae2c41c
https://www.quora.com/How-do-I-create-my-own-shell-in-Linux
https://www.codementor.io/@sandesh87/how-and-why-i-built-a-mini-linux-shell-using-c-1dqk5olxgw
https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
https://pubs.opengroup.org/onlinepubs/7908799/xcu/chap2.html
https://blog.scottlowe.org/2015/01/27/using-fork-branch-git-workflow/
https://github.com/moisam/lets-build-a-linux-shell
https://putaindecode.io/articles/maitriser-les-redirections-shell/