How louka2b/minishell works
Minishell is a compact Unix command interpreter. Its documented workflow accepts commands, parses and tokenizes them, expands environment variables, prepares commands and redirections, then executes processes with pipes and builtins while maintaining shell environment state. The README establishes the product capabilities; several implementation files were not sampled, so internal handoffs without direct evidence are shown as unverified dashed links.
Main entry points: minishell.c Shell entry · executeur.c Execution coordinator · executeur_child.c Child execution · token.c Tokenization
Components 21
Input and parsing
- Shell entry
src/minishell.c - Prompt input
src/prompt.c - Tokenization
src/token.c - Token splitting
src/token_split.c - Variable expansion
src/variable_extend.c - Argument handling
src/args.c - Command parsing
src/utils/parse_cmd.c - Redirection parsing
src/utils/parse_files.c
Execution
- Execution coordinator
src/executeur.c - Pipe management
src/executeur_pipes.c - Child execution
src/executeur_child.c - Redirection setup
src/executeur_redirs.c - Open redirections
src/open_file.c - Here documents
src/heredoc.c
Shell state
- Builtins
src/utils/builtin.c - Environment table
src/env.c - Environment updates
src/env_more.c
Runtime support
- Signal behavior
src/prompt.c - C utility library
src/libft/ft_split.c
Other components
- Shell user
- External commands
Connections 20
- Shell user → Shell entry: runs
README.md - Shell entry → Prompt input: reads input
- Prompt input → Tokenization: submits command
- Tokenization → Token splitting: splits tokens
- Tokenization → Variable expansion: expands variables
- Variable expansion → Environment table: reads values
- Token splitting → Argument handling: prepares arguments
- Argument handling → Command parsing: builds commands
- Command parsing → Redirection parsing: parses redirections
- Shell entry → Execution coordinator: executes commands
- Execution coordinator → Pipe management: manages pipes
- Execution coordinator → Child execution: spawns processes
- Child execution → Redirection setup: applies redirections
- Execution coordinator → Open redirections: opens files
- Open redirections → Here documents: handles heredoc
- Child execution → Builtins: dispatches builtins
- Builtins → Environment table: updates state
- Shell entry → Signal behavior: handles signals
- Child execution → External commands: executes commands
- Shell entry → C utility library: uses utilities