The point of minishell is to make a simple shell that mimics certain bash functionalities.
- Implementation of a prompt waiting for commands.
- Execution of basic commands found in the PATH.
- Implementation of key built-in commands:
echo
,cd
,pwd
,export
,unset
,env
,exit
. - Handling of environment variables.
- Implementation of simple redirections (
>
,<
,>>
) and pipes (|
). - Handling of
$?
to reflect the return status of the last executed command. - Signal handling (
Ctrl-C
,Ctrl-D
,Ctrl-\
).
Advanced functionalities enhance the basic implementation, such as:
- Advanced Redirections: Handling of more complex redirection scenarios.
- Command line editing: Implementing features allowing line editing with termcap.
- Improved expandability: Better handling of environment variables and expansions.
To clone the repository and the subdir, use:
git clone https://github.com/moop250/minishell.git
Compilation & cleanup:
make
: Compiles the minishell program.make debug
: Compiles the program wih an address sanitizer.make all
: Compiles evrything.make re
: Cleans and recompiles the minishell program.make clean
: Cleans up object files (.o).make fclean
: Cleans up all files generated by running make, including the executable.make help
: Shows the possible make commands.
Example usage:
./minishell
This will start the minishell, presenting a command prompt for running shell commands.