A minimal Bash-like shell written in C (42 School project) featuring parsing, builtins, pipes, redirections, environment management, and signals.
Minishell is a command-line interpreter designed to replicate core behaviors of bash. It focuses on understanding how a shell works internally:
- lexing + parsing user input into commands and arguments
- expanding environment variables
- executing builtins and external programs
- handling pipes (
|) and redirections (<,>,>>,<<) - managing processes (
fork,execve,waitpid) - handling interactive signals (
Ctrl-C,Ctrl-\,Ctrl-D)
Repository: otelliq/Minishell
Default branch: main
- Builtins (directory
minishell/builtins/): commonlyecho,cd,pwd,export,unset,env,exit - Pipelines:
cmd1 | cmd2 | cmd3 - Redirections:
- input:
< file - output:
> file - append:
>> file - heredoc:
<< LIMITER
- input:
- Environment handling (
env.c,env_utils.c) - Signal handling (
signals.c) for interactive behavior - Custom memory utilities (e.g.,
ft_malloc.*) and customlibft/
No screenshots provided yet.
Suggested screenshots:
- prompt + a pipeline example
- heredoc usage
export/ env variable expansion example
make- C compiler (
cc/clang/gcc) - A UNIX-like OS (Linux/macOS)
From the repository root:
make -C minishellThis should produce the minishell executable (depending on Makefile rules).
Run the shell:
./minishell/minishellExample commands to try:
echo hello
export NAME=world
echo $NAME
ls -la | wc -l
cat < input.txt | grep foo > out.txt.
├── README.md
└── minishell/
├── Makefile
├── minishell.c
├── minishell.h
├── builtins/
├── lexer/
├── Parsing_system/
├── execve/
├── libft/
├── env*.c
├── fork.c
├── redirections*.c
├── signals.c
├── syntax_error.c
└── utils*.c
- If this project uses
readline, make sure your environment links it properly (Linux/macOS differ). - Behavior aims to match bash for the supported subset, but it is not a full POSIX shell.
No license file is currently included in this repository.
If you want this to be reusable beyond the academic context, consider adding a LICENSE file (MIT/Apache-2.0 are common choices) and updating this section accordingly.