How santizabe/mini-s-hell works
Project type and purpose
• This is a C-based UNIX shell (“Minishell”) implementing core shell features: command parsing, pipelines, redirections, built-in commands, environment variable handling, and signal handling.
• The code is organized into:
• gnl/ folder: get_next_line implementation (input reader)
• libft/ folder: utility functions (string, memory, list helpers)
• src/ folder: main shell logic (parsing, expansion, execution, builtins, signals, etc.)
File structure
• Top‐level:
• Makefile, README.md, .gitignore
• gnl/: custom line‐reader module
• libft/: generic utility library
• /: shared headers (minishell.h)
• src/: core engine split into parsing, expansion, execution, builtins, signal handling
• Key patterns:
• Modular layering: input reader → parser/expander → execution engine
• Separation of concerns: builtins vs external commands, utilities vs core logic
• Configuration:
• Makefile drives compilation and links against readline library
• README documents dependencies (GCC, Make, libreadline)
Extract architectural insights from README
• Shell phases: read command → parse (tokenize, syntax tree) → expand variables/quotes → build pipeline with redirections → fork + exec or call builtin → wait and report exit status
• Uses readline (via get_next_line or directly) for history and line editing
• Handles signals (SIGINT, SIGQUIT) at multiple layers