Documentation ¶
Overview ¶
Package shell contains high-level features that use the syntax and interp packages under the hood.
This package is a work in progress and EXPERIMENTAL; its API is not subject to the 1.x backwards compatibility guarantee.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Expand ¶
Expand performs shell expansion on s, using env to resolve variables. The expansion will apply to parameter expansions like $var and ${#var}, but also to arithmetic expansions like $((var + 3)), and command substitutions like $(echo foo).
Any side effects or modifications to the system are forbidden when interpreting the program. This is enforced via whitelists when executing programs and opening paths.
func SourceFile ¶
SourceFile sources a shell file from disk and returns the variables declared in it.
A default parser is used; to set custom options, use SourceNode instead.
func SourceNode ¶
SourceNode sources a shell program from a node and returns the variables declared in it.
Any side effects or modifications to the system are forbidden when interpreting the program. This is enforced via whitelists when executing programs and opening paths.
Types ¶
This section is empty.