This is one of the Ecole 42 common core projects.
It is about implementing a shell (bash) in team of 2 students.
The project is written with holly C language and provides good understanding of processes, file descriptors and popular bash commands.
The final 42_minishell includes:
- Show a prompt when waiting for a new command.
- Have a working History.
- Search and launch the right executable (based on the PATH variable)
- Implemented the builtins:
echo
with option -ncd
pwd
with no optionsexport
with no optionsunset
with no optionsenv
with no options or argumentsexit
with no options
โ
inhibit all interpretation of a sequence of characters."
inhibit all interpretation of a sequence of characters except for $.- Redirections:
<
redirects input.>
redirects output.<<
reads input from the current source until a line containing only the delimiter is seen.>>
redirects output with append mode.
- Pipes | The output of each command in the pipeline is connected via a pipe to the input of the next command.
- Environment variables ($ followed by characters) expands to their values.
$?
expands to the exit status of the most recently executed foreground pipeline.ctrl-C
ctrl-D
ctrl-\
works like in bash.
Full project description you can find in en.subject.pdf
.
- installed
clang++
- installed
Makefile
In project directory:
- Run
make
to compile the project. - Execute
./minishell
to run 42_minishell. - Try any common bash commands from the list above to test 42_minishell.
- Run
make fclean
to delete all created files.