Expand description
Shell-aware command normalization: reduce a command to a scannable form before pattern matching.
Structs§
- Shell
Scan - Words of each simple command plus the bodies of command substitutions.
Functions§
- has_
dangerous_ structure - True when the command’s structure (argv, pipelines, evaluated substitutions)
is dangerous regardless of the literal text: recursive root deletes, remote
payloads fed to a shell, or
evalof a fetched script. - scan_
shell - Split
inputinto simple commands (quote-aware) and command-substitution bodies. - scannable_
command - Reduce
commandto a form where quoting, wrappers and nested shell payloads no longer hide the executable text. The result may span several lines: the unquoted original followed by each recursively normalized executed payload. - segment_
consumes_ shell_ stdin - True when the simple command reads its script from stdin (
bash -s,sh -,/dev/stdin, …), including through wrapper binaries such assudoorenv -S. - shell_
pipelines - Pipelines of the input, each as its segment strings (only pipelines with 2+ stages).