A tiny, Bash-inspired shell in C. Built for 42 school. Fast and simple!
- Execute commands via PATH or absolute/relative paths
- Quoting + expansion: single quotes, double quotes,
$VAR,$? - Redirections:
<,>,>>,<<(heredoc, no history update) - Pipes:
cmd1 | cmd2 | ... - Builtins:
echo -n,cd,pwd,env,export,unset,exit - Signals: Ctrl-C (new prompt on new line), Ctrl-D (exit), Ctrl-\ (ignored)
- Error handling and exit status mimic bash
minishell/
├─ libft/ # utility library (built via its own Makefile)
├─ src/ # lexer, parser, executor, builtins, env, signals
├─ Makefile # cc with -Wall -Wextra -Werror (no relink)
├─ README.md
├─ minishell.h # main project header
└─ readline.supp # valgrind suppressions for readline
make # build ./minishell
./minishell # run- Unix-like OS (Linux/macOS)
- C compiler (C99) + GNU Make
echo "hello, shell"
ls -l | grep \.c$
cat < in.txt | grep pattern > out.txt
A=world echo "hello $A"- One global variable only
- No global data structures
- No leaks (valgrind-friendly)
- No forbidden constructs (ternary, for, VLAs, switch, etc.)
- Functions: <= 25 lines, <= 5 vars, <= 4 params, 80 cols, 4-char tabs
- Makefile targets:
all,clean,fclean,re