The purpose of Minishell is to create a simple small shell program in C based on Bash.
A shell, in simple terms, is a command-line interface that allows you to interact with your computer's operating system by typing commands in order to tell it what to do.
The project's requirements:
- Prompt display
- Command history (⬆️ and ⬇️ arrows)
- System executables available from the environment (
ls
,cat
,grep
, etc.) - Local executables (
./minishell
) - Builtin commands :
echo
(with option-n
)cd
(with only a relative or absolute path)pwd
(no options)export
(no options)unset
(no options)env
(no options or arguments)exit
(with exit number)
- Pipes
|
connects two or more commands in a way that allows the output of one command to be used as the input for another - Redirections:
>
redirects output>>
redirects output in append mode<
redirects input<< DELIMITER
displays a new prompt, reads user input until reachingDELIMITER
, redirects user input to command input (does not update history)
- Environment variables (i.e.
$USER
or$HOME
) that expand to their values.$?
expands to the exit status of the most recently executed foreground pipeline.
- User keyboard signals:
ctrl-c
displays a new prompt line.ctrl-d
exits minishellctrl-\
does nothing
This Minishell DOES NOT support \
, ;
, &&
, ||
, or wildcards.
Clone github repository and compile program:
git clone [email protected]:mariav7/minishell_42project.git
cd minishell_42project && make
Run the program:
./minishell
OR
Run the program using valgrind:
./leak_test.sh