As beautiful as a shell. Creating our own little bash.
Exploring process creation and synchronisation. Executing a command inside a shell implies creating a new process, which execution and final state will be monitored by its parent’s process.
- Git clone the repository
cdinto directory and runmake
./minishell- Show a prompt when waiting for a new command.
- Search and launch the right executable (based on the PATH variable or by using relative or absolute path) like in bash.
- It must implement the builtins like in bash:
echowith option ’-n’.cdwith only a relative or absolute path.pwdwithout any options.exportwithout any options.unsetwithout any options.envwithout any options and any arguments.exitwithout any options
- Parsing
;in the command should separate commands like in bash.’and"should work like in bash except for multiline commands.
- Redirection
- Redirections
< > “>>”should work like in bash except for file descriptor aggregation. - Pipes
|should work like in bash except for multiline commands.
- Redirections
- Expansion
- Environment variables (
$followed by characters) should work like in bash. $?should work like in bash.
- Environment variables (
- Signals
ctrl-C,ctrl-Dandctrl-\should have the same result as in bash.
- Termcaps
- Use up and down arrows to navigate through the command history.
- Move cursor left and right using arrows.
- Move to the beginning and end using HOME and END keys.