How thedixon11/minishell works
Minishell is an interactive Unix-shell implementation. Its principal workflow reads a command line, tokenizes and validates shell syntax, expands quoting and environment references, prepares redirections and heredocs, then dispatches built-ins or external programs and reports status. The graph also preserves environment management, signal handling, and the supporting C utility library. The README documents the overall workflow and capabilities; several orchestration and execution files were not sampled, so uncertain internal handoffs are omitted rather than inferred.
Main entry points: minishell.c Interactive loop · val_manager.c Value expansion · execute_cmds.c Execution dispatch · to_token.c Tokenizer
Components 21
Input and parsing
- Interactive loop
src_parsing/minishell.c - Tokenizer
src_parsing/to_token.c - Syntax validation
src_parsing/to_token_control.c - Command parsing
src_parsing/to_parse.c - Command fusion
src_parsing/to_parse_fusion_cmd.c
Expansion and environment
- Value expansion
src_xpand/val_manager.c - Quote handling
src_xpand/quote_manager.c - Dollar handling
src_xpand/dollar_manager.c - Variable lookup
src_xpand/env_var_manager.c
Execution and I/O
- Heredoc input
src_heredoc/heredoc_exec.c - Redirections and pipes
src_exec/manage_redirections.c - Execution dispatch
src_exec/execute_cmds.c - External commands
src_exec/child_process.c - Built-in commands
src_builtin/builtin_exec.c
Shell services
- Shell environment
src_parsing/create_env.c - Signal handling
src_signal/signal.c - Errors and cleanup
src_errors/ft_error.c
C utilities
- Libft utilities
libft/libft.h
Other components
- Shell user
- Readline
- System executables
Connections 21
- Shell user → Interactive loop: enters commands
- Interactive loop → Readline: reads input
- Interactive loop → Tokenizer: parses input
- Tokenizer → Syntax validation: validates operators
src_parsing/to_token_control.c - Interactive loop → Command parsing: builds commands
- Command parsing → Command fusion: fuses commands
- Interactive loop → Value expansion: expands values
- Value expansion → Quote handling: handles quotes
src_xpand/val_manager.c - Quote handling → Dollar handling: expands double quotes
src_xpand/quote_manager.c - Dollar handling → Variable lookup: looks up variables
src_xpand/dollar_manager.c - Value expansion → Shell environment: reads variables
- Interactive loop → Heredoc input: handles heredocs
- Interactive loop → Execution dispatch: executes commands
- Execution dispatch → Redirections and pipes: applies redirections
- Execution dispatch → Built-in commands: dispatches built-ins
src_builtin/builtin_exec.c - Execution dispatch → External commands: runs binaries
- External commands → System executables: executes via PATH
- Built-in commands → Shell environment: updates environment
- Shell user → Signal handling: sends signals
- Interactive loop → Errors and cleanup: reports failures
- Value expansion → Libft utilities: uses string utilities
src_xpand/val_manager.c