Discover Packages
github.com/carapace-sh/carapace
third_party
github.com
drone
envsubst
package
Version:
v1.11.4
Opens a new window with list of versions in this module.
Published: Apr 26, 2026
License: Apache-2.0, MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Envsubst
Expands variables in a string using ${var} syntax.
Supported Functions
Expression
Meaning
${var}
Value of $var
${#var}
String length of $var
${var^}
Uppercase first character of $var
${var^^}
Uppercase all characters in $var
${var,}
Lowercase first character of $var
${var,,}
Lowercase all characters in $var
${var:n}
Offset $var n characters from start
${var:n:len}
Offset $var n characters with max length of len
${var#pattern}
Strip shortest pattern match from start
${var##pattern}
Strip longest pattern match from start
${var%pattern}
Strip shortest pattern match from end
${var%%pattern}
Strip longest pattern match from end
${var-default
If $var is not set, evaluate expression as $default
${var:-default
If $var is not set or is empty, evaluate expression as $default
${var=default
If $var is not set, evaluate expression as $default
${var:=default
If $var is not set or is empty, evaluate expression as $default
${var/pattern/replacement}
Replace as few pattern matches as possible with replacement
${var//pattern/replacement}
Replace as many pattern matches as possible with replacement
${var/#pattern/replacement}
Replace pattern match with replacement from $var start
${var/%pattern/replacement}
Replace pattern match with replacement from $var end
Skip expansion with a ! prefix.
Expression
Substitution
${HOME}
/home/user
${!HOME}
${HOME}
${UNSET:-default}
default
${!UNSET:-default}
${UNSET:-default}
Expand ▾
Collapse ▴
Documentation
¶
Eval replaces ${var} in the string based on the mapping function.
EvalEnv replaces ${var} in the string according to the values of the
current environment variables. References to undefined variables are
replaced by the empty string.
Template is the representation of a parsed shell format string.
Parse creates a new shell format template and parses the template
definition from string s.
ParseFile creates a new shell format template and parses the template
definition from the named file.
Execute applies a parsed template to the specified data mapping.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.