Minishell is a 42 project, written in C, which consisted in recoding a bash shell and its numerous functionalities.
The execution of several commands (and builtins) with pipes, and redirections >
, >>,
<
.
The parsing of commands, the management of EXIT code, of some signals, and of environment variables.
This project taught me a lot of things, first of all the structuring of a big project in C.
A first big part is the parsing of the commands (managing single quotes
, double quotes
, backslash
, dollars
, etc...)
Another part is the execution of the different commands and the redirections, and builtins. The list of builtins to code is:
echo
and the -n optioncd
only with a relative or absolute pathpwd
without any optionexport
without any optionunset
without any optionenv
without any option or argumentexit
without any option
There is also the management of return codes, as well as the management of Ctrl+D
, Ctrl+\
, Ctrl+C
signals.
This project taught me to run different processes, to manage parsing well, to be structured on how to solve a problem, to test a lot of special cases and to understand how a shell like bash works globally.
Run the command make
, then run:
./minishell
You can know run the commands you want as, ls
, echo "Hello World"
and enjoy!