The minishell project aims for students to recreate a simplified yet useable shell. Introduced/refined concepts include signals, processes, file descriptors, environment variables, Termcap library...
This project is subject to 42's norm which restricts naming conventions, function and line lenghts and more. Some weird sections may therefore be the result of said norm.
The final version of the project was rated 109/115 by three fellow students. This minishell was a team effort from pminne and myself.
- builtins: echo (with -n), cd (only relative/absolute paths), pwd/export/unset/env/exit (w/o options)
- display a prompt while waiting for input
- ; separates commands like in bash
- ' and " act like in bash except for multiline commands
- <, > and >> act like in bash except for file descriptor aggreation
- | act like in bash
- environment variables and $? act like in bash
- ctrl-C, ctrl-D and ctrl-\ act like in bash
- line edition
- left/right cursor movement
- up/down arrows for command history and subsequent line edition
- goto start/end of a line w/ home/end keys
- variable declaration w/o export (
$ my_var=my_value
) - ctrl-L to clear the screen
- the prompt displays the current directory name and git information if applicable
- cd implicitly by entering the desired directory name
Our minishell should play nicely on MacOS and Linux. Copy paste the following command in your shell and execute it.
git clone https://github.com/paozer/minishell && cd minishell && make && ./minishell