Attempt to recode simple shell.
Minishell manages to parse prompt, launch builtins and executables (ls, grep, wc, etc.) with arguments.
- Redirections (
>
,>>
,<
,<<
) and pipes (|
) are implemented. - Environment variables are handled.
As in real bash single quotes prevent minishell from interpreting the metacharacters in the quoted sequence.
Double quotes prevent minishell from interpreting the metacharacters in the quoted sequence except for $ (dollar sign). - $? expands to the exit status of the most recently executed foreground pipeline.
- Signals are processed.
Use Ctrl-C to display new prompt on new line, Ctrl-D to quit the program. Ctrl-\ does nothing. - Implemented builtins:
- echo with option -n
- cd with only a relative or absolute path
- pwd with no options
- export with no options
- unset with no options
- env with no options or arguments
- exit with no options
- echo with option -n
Click to see video
Minishell_example.mov
)
- Create executable file using command
make
- Run the program (
./minishell
)