How seeeedn/shell-task works
This repository implements an interactive Unix-style shell. A user enters a command; the shell reads and records the line, lexes and parses it into pipeline state, expands a leading alias, then runs a builtin or launches external commands with redirection, pipes, and optional background execution. Builtins include directory navigation, process signaling, and alias management. The generated parser’s semantic-action details and scanner rules were not shown, so their internal links to pipeline construction are omitted rather than inferred.
Main entry points: main.c Shell loop · helper.c Builtins · alias.c Alias table · lex.yy.c Command lexer
Components 12
Interactive shell
- Shell loop
main.c - Command history
history
Command language
- Command lexer
lex.yy.c - Command parser
parse.tab.c - Parser tokens
parse.tab.h
Command execution
- Pipeline state
shell.c - Builtins
helper.c - External commands
main.c
Alias management
- Alias builtins
helper.c - Alias table
alias.c
Other components
- User
- Operating system
Connections 14
- User → Shell loop: enters commands
main.c - Shell loop → Command history: reads and writes
main.c - Shell loop → Command lexer: scans input
main.c - Shell loop → Command parser: parses input
main.c - Command lexer → Parser tokens: uses tokens
lex.yy.c - Command parser → Parser tokens: uses interface
parse.tab.c - Shell loop → Pipeline state: initializes and clears
main.c - Shell loop → Builtins: dispatches builtins
main.c - Shell loop → External commands: launches commands
main.c - External commands → Operating system: forks and executes
main.c - Builtins → Operating system: uses system calls
helper.c - Builtins → Alias table: manages aliases
helper.c - Shell loop → Alias table: looks up aliases
main.c - Alias builtins → Alias table: updates alias table
helper.c