Minishell is a team project to create a basic shell program in C. It implements redirections and pipes, as well as environment variable expansions and the cd, echo, env, exit, export, pwd and unset builtin commands.
To compile:
makeTo run the program:
./minishellA prompt will appear. You may enter your commands to be executed.
Minishell is a miniature shell program based on Bash. Minishell supports:
- Prompt display
- Command history (⬆️ ⬇️ arrows)
- System executables available from the environment (
ls,cat,grep, etc.) - Local executables (
./minishell) - Builtin commands :
echo(and option-n)cd(relative or absolute path)pwd(no options)export(no options)unset(no options)env(no options or arguments)exit(with optional exit code)
- Pipes
|which redirect output from one command to input for the next - Redirections:
>redirects output>>redirects output in append mode<redirects input<< DELIMITERdisplays a new prompt, reads user input until reachingDELIMITER, redirects user input to command input (does not update history)
- Environment variables (i.e.
$USERor$VAR) that expand to their values.$?expands to the exit status of the most recently executed foreground pipeline.
- User keyboard signals:
ctrl-cdisplays a new prompt line.ctrl-dexits minishellctrl-\does nothing
❌ However, Minishell does not support \, ;, &&, ||, or wildcards.
Minishell is tested with Valgrind to ensure memory safety.
valgrind --leak-check=full --show-leak-kinds=all --suppressions=readline.supp ./minishell👥 Teammates