File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,6 +131,15 @@ Return an array of arguments from the quoted string `cmd`.
131131Interpolate embedded bash-style ` $VARNAME ` and ` ${VARNAME} ` variables with
132132the ` env ` object which like bash will replace undefined variables with ` "" ` .
133133
134+ Only simple ` $VARNAME ` and ` ${VARNAME} ` interpolation is supported.
135+ Bash parameter expansion beyond a plain variable name is not evaluated:
136+ forms such as array subscripts (` ${arr[i]} ` ), length (` ${#arr[@]} ` ),
137+ and modifiers (` ${var:-default} ` , ` ${var/a/b} ` )
138+ are treated as an unknown variable and expand to ` "" ` ,
139+ while arithmetic (` $((...)) ` ) and command substitution (` $(...) ` )
140+ are not interpreted.
141+ Whitespace inside ` ${...} ` throws a ` Bad substitution ` error.
142+
134143` env ` is usually an object but it can also be a function to perform lookups.
135144When ` env(key) ` returns a string, its result will be output just like ` env[key] `
136145would. When ` env(key) ` returns an object, it will be inserted into the result
You can’t perform that action at this time.
0 commit comments