This project is about creating a simple shell. You will learn a lot about processes and file descriptors. The existence of shells is linked to the very existence of IT.
make all
./minishell
You can now try all the different functionalities !
- Prompt Display: Displays a prompt when waiting for a new command.
- History: Maintains a working history of commands.
- Executable Search: Searches and launches the correct executable based on the PATH variable or using a relative or absolute path.
- Quote Handling: Handles single quotes (
'
) and double quotes ("
) to prevent the shell from interpreting the metacharacters in the quoted sequence, with the exception of the dollar sign ($
) in double quotes. - Redirections: Implements input (
<
), output (>
), append mode output (>>
) redirections, and delimiter-based input (<<
). - Pipes: Implements pipes (
|
) to connect the output of each command in the pipeline to the input of the next command. - Environment Variables: Handles environment variables and expands them to their values. Also handles
?
which expands to the exit status of the most recently executed foreground pipeline. - Key Handling: Handles
ctrl-C
,ctrl-D
, andctrl-\
keys like in bash. In interactive mode, ctrl-C displays a new prompt on a new line, ctrl-D exits the shell, and ctrl-\ does nothing. - Builtins: Implements builtins including 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, and exit with no options.