Skip to main content

Crate bash_interop

Crate bash_interop 

Source
Expand description

Run bash under instrumentation, and hear what it says.

shellwhich bash a shell is, how it was started, what it has onon bash_strings
stacka call stack, as an instrument records it and as Rust reads iton shell
rigrun a bash program, hear every shell in it, answer what they askon shell
failureone error for anything that stops workon nothing
scratcha directory of bash scripts, and helpers a test builds shells from

Values travel as bash’s own quoted forms — the bash-strings crate. stack and rig are siblings: neither knows the other. A tool composes them — the walk goes into the bash a rig injects, through stack::with_walk — which is what bashcap and bashprof are.

Both read a walk against the shell it was taken in, which is why shell sits under both: bash writes $0 into BASH_SOURCE for code it was given rather than read, and no walk can say on its own which word that is.

Start with rig’s module doc; the book is docs/docs/overview.md in this crate’s repository.

Modules§

failure
One error for anything that stops a piece of work: what was being done, and what went wrong underneath.
rig
Run bash under instrumentation, and hear what it says.
scratch
Scratch material for tests built on the rig: a directory of bash scripts, the command line that runs one, an answer that sources a file, and accounts — shells built by hand where none need run.
shell
What a shell is: which bash, how it was given its code, and what it had switched on when it joined.
stack
A bash call stack, as an instrument records it — both halves.