Skip to main content

Module command_vars

Module command_vars 

Source
Expand description

Which shell variables a command has certainly set to a literal (#1953, #2079).

The write guards follow a command the way the shell would, but only as far as the text alone allows. A variable is known when this same command set it to a literal earlier, in a way that certainly took effect in the current shell, or when it is $TMPDIR — the scratch variable the guards themselves name as an allowed destination — and the command has not rebound it. Every other variable stays unknown, and an unknown variable leaves whatever depends on it unresolved.

Structs§

KnownVars
The variables known to hold a value when one segment starts.

Functions§

expand_leading_variable
Expand a target that starts with $NAME or ${NAME} from known — which includes $TMPDIR from the environment unless the command rebound it. None when the target starts with no variable or an unknown one.
literal_assignments_before_each_segment
For each segment, the variables known to hold a literal value when that segment starts (#1953).