A small shell implementation in C, recreating key features of Bash 3.2.
The minishell project recreates a simplified version of Bash.
It allows executing commands, handling redirections and pipes, managing environment variables, and implementing built-in commands.
This project strengthens understanding of:
- "Parsing and Abstract Syntax Trees (AST)"
- "Process creation (
fork,execve)"- "Signals (
ctrl-C,ctrl-D,ctrl-\)"- "Redirections, heredocs, and pipes"
- Display a prompt and wait for commands
- History functionality
- Locate and launch executables (builtins,
$PATH, relative/absolute paths) - Manage single/double quotes
- Implement redirections (
<,>,<<,>>) - Implement pipes (
|) - Manage environment variables (
$) and$? - Proper signal handling (
ctrl-C,ctrl-D,ctrl-\)
- Logical operators:
&&and|| - Parentheses for priorities (no subshells)
- Wildcard
*(current directory only)
echowith-ncd(relative/absolute paths)pwdexportunsetenvexit
"No unclosed quotation marks" "No unsupported characters (e.g.,
\backslash,;semicolon)" "No features outside the subject specification"
Clone the repository and compile:
git clone https://github.com/hanmpark/minishell.git
cd minishell
makeRun the shell:
./minishellTo debug tokenization and AST generation:
./minishell debugminishell$ echo 1 | cat -e || (echo 2 && echo 3) || echo 4
