How sozahra/minishell works
MiniBG is an interactive Unix-style shell. The main workflow initializes shell state, builds an environment, accepts command lines, tokenizes and expands them, converts tokens into commands/redirections, then executes built-ins or child processes with pipes and file redirections. The tree and sampled sources support this overall structure; unsampled execution and parsing details are represented at their enclosing directories, and uncertain call wiring is omitted.
Main entry points: loop.c Interactive loop · generic_exec.c Child execution · main.c Shell entry · cd.c Directory changes
Components 20
Shell lifecycle
- Shell entry
src/main.c - Interactive loop
src/loop/loop.c - Signal handling
src/signaux/handle_signal.c
Command parsing
- Tokenization
src/loop/proc.c - Token list
src/tokens/add_tokens.c - Expansion
src/loop/expand.c - Wildcard expansion
src/jokers/skibidi_split.c - Command construction
src/loop/commands_lst.c
Execution
- Shell built-ins
src/builtins/gestion_builtins.c - Directory changes
src/builtins/cd.c - Execution dispatch
src/exec.c - Child execution
src/exec/generic_exec.c - Redirection setup
src/exec/redirections.c - File opening
src/exec/open_fct.c - Here-documents
src/exec/heredoc.c - Pipe and descriptors
src/exec/fd_utils.c
Shell state
- Environment list
src/env/build_env_list.c
Other components
- Shell user
- Filesystem
- OS processes
Connections 25
- Shell user → Shell entry: starts
- Shell entry → Environment list: builds
- Shell entry → Interactive loop: starts
- Shell entry → Signal handling: installs
- Interactive loop → Shell user: prompts
- Interactive loop → Tokenization: tokenizes
- Tokenization → Token list: adds tokens
- Interactive loop → Expansion: expands
- Interactive loop → Wildcard expansion: expands patterns
- Interactive loop → Command construction: builds commands
- Interactive loop → Execution dispatch: dispatches
- Execution dispatch → Shell built-ins: runs built-in
- Shell built-ins → Directory changes: handles cd
- Directory changes → Filesystem: changes directory
- Directory changes → Environment list: updates variables
- Execution dispatch → Child execution: runs external command
- Child execution → Environment list: reads variables
- Child execution → OS processes: spawns and waits
- Child execution → Redirection setup: sets up redirections
- Redirection setup → File opening: opens targets
- File opening → Filesystem: reads or writes
- Redirection setup → Here-documents: handles here-doc
- Here-documents → Shell user: reads delimiter input
- Child execution → Pipe and descriptors: configures descriptors
- Pipe and descriptors → OS processes: connects pipelines