How rgrmra/minishell works
Minishell is an interactive shell: a user enters a command, which is processed into shell syntax and executed against built-ins or external programs. The tree also shows distinct execution paths for pipelines, conditionals, redirections, and subshells, plus variable, command, quote, and wildcard expansion. The source index confirms several module references, but the README only says “A Shell!” and many implementation files were not excerpted; dashed edges mark likely dispatch or feature links whose exact calls cannot be verified from the available evidence.
Main entry points: execute_command.c Command execution · execution.c Execution dispatch · prompt.c Prompt loop · tokenizer.c Tokenization
Components 23
Interactive input
- Shell startup
src/main.c - Prompt loop
src/prompt/prompt.c - Input formatting
src/prompt/format_input.c
Command syntax
- Tokenization
src/tokenizer/tokenizer.c - Command assembly
src/tokenizer/append_commands.c - Parser
src/parser/parser.c - AST construction
src/ast/ast.c - AST utilities
src/ast/ast_utils.c
Execution
- Execution dispatch
src/execution/execution.c - Command execution
src/execution/execute_command.c - Pipeline execution
src/execution/execute_pipe.c - Conditional execution
src/execution/execute_conditional.c - Redirection execution
src/execution/execute_redirection.c - Subshell execution
src/execution/execute_subshell.c - Word expansion
src/expansions/var_expansions.c - Command substitution
src/expansions/command_expansions.c - Wildcard expansion
src/expansions/wildcard_expansions.c - Quote removal
src/expansions/remove_quotes.c - Shell built-ins
src/builtin
Shell state
- Environment
src/getenv/get_env.c - Error handling
src/error/errors.c
Other components
- User
- External programs
Connections 23
- User → Prompt loop: enters commands
- Shell startup → Prompt loop: starts loop
src/main.c - Prompt loop → Input formatting: formats input
- Prompt loop → Tokenization: tokenizes input
- Tokenization → Command assembly: assembles commands
- Tokenization → Parser: invokes parser
- Parser → AST construction: builds syntax tree
- AST construction → AST utilities: uses utilities
- Prompt loop → Execution dispatch: executes input
- Execution dispatch → Command execution: dispatches commands
- Execution dispatch → Pipeline execution: dispatches pipelines
- Execution dispatch → Conditional execution: dispatches conditionals
- Execution dispatch → Redirection execution: dispatches redirections
- Execution dispatch → Subshell execution: dispatches subshells
- Command execution → Word expansion: expands variables
src/execution/execute_command.c - Command execution → Wildcard expansion: expands wildcards
src/execution/execute_command.c - Command execution → Quote removal: removes quotes
src/execution/execute_command.c - Command execution → Command substitution: expands commands
src/execution/execute_command.c - Command execution → Shell built-ins: dispatches built-ins
src/execution/execute_command.c - Command execution → External programs: executes program
src/execution/execute_command.c - Command execution → Environment: exports variables
src/execution/execute_command.c - Shell built-ins → Environment: updates variables
- Execution dispatch → Error handling: reports errors