Skip to main content

Module stack

Module stack 

Source
Expand description

A bash call stack, as an instrument records it — both halves.

stack.bash ships bash’s five parallel arrays as they are; Columns puts them back together. What comes out is a Stack: the frames one instrument reported, innermost first, never empty.

Structs§

Args
BASH_ARGC and BASH_ARGV, as one instrument reported them.
Columns
One frame walk, in the sections stack.bash writes.
Frame
One frame: what it is, where its code came from, which line it is executing, and what it was called with.
Stack
A walk, innermost first. Never empty: the frame it was taken in is always one of them, and a walk that reaches no frame is refused where it is read.

Enums§

Site
What a frame is, as FUNCNAME names it. Two of bash’s words are not function names, and a script that defines a function called main or source is indistinguishable from them — bash reports the same word.
Source
Where a frame’s code came from, as BASH_SOURCE names it. Two of bash’s words are not paths at all.

Functions§

with_walk
The frame walk, and a tool’s own bash after it — the order the shells source them in.