This project has been created as part of the 42 curriculum by lverschu, tle-rhun
The goal of the Minishell project is to recreate a simpler version of the bash program using bash --posix as a reference.
The subject states that we must :
- Display an unspecified prompt when waiting for a new command.
- Have a working history.
- Search/launch the correct executable using whether the relative or absolute path.
- Handle single quotes (' ') and double quotes (" ") correctly.
- Have working redirects (< infile, > outfile, << heredoc, >> append).
- Handle pipes ( | ), which use is to use the previous command output as the input for the next command.
- Have a working expander for environmental variables (ex :
echo $USER), as for$?which store the previous exit status. - Have signals as ctrl-C, ctrl-D, *ctrl-* behaving the same as in
bash --posix
However we shall not interpret \ (backslash), ; (semicolon), or anykind of special character, nor unclosed quotes.
We also must write our own built-ins for some functions.
echowith an enventual-n.cd(with absolute or relative path).pwdwith no options.exportwith no options.unsetwith no options.envwith no options or arguments.exitwith no options.
We must of course never have leaks of any kinds, with the exception of the readline command which we suppress using a special make val.
In order to launch Minishell you must first use the git clone command.
Then in the root directory you can use all the mandatory make command :
makemake cleanmake fcleanmake re
We also implemented our own like :
make good, which consists ofmake && make clean, so that we do not have all the *.o files.make val, which launch our Minishell with all the Valgrind flags we may need.
For the parsing the main source was the bash itself, testing directly is way faster than looking for the answer online.