Skip to content

Go package emulates bash environment variable substitution

License

Notifications You must be signed in to change notification settings

ashwilliams1/envsubst

 
 

Repository files navigation

envsubst

envsubst is a Go package for expanding variables in a string using ${var} syntax. Includes support for bash string replacement functions.

Documentation

Documentation can be found on GoDoc.

Supported Functions

  • ${var^}
  • ${var^^}
  • ${var,}
  • ${var,,}
  • ${var:position}
  • ${var:position:length}
  • ${var#substring}
  • ${var##substring}
  • ${var%substring}
  • ${var%%substring}
  • ${var/substring/replacement}
  • ${var//substring/replacement}
  • ${var/#substring/replacement}
  • ${var/%substring/replacement}
  • ${#var}
  • ${var=default}
  • ${var:=default}
  • ${var:-default}

Unsupported Functions

  • ${var-default}
  • ${var+default}
  • ${var:?default}
  • ${var:+default}

About

Go package emulates bash environment variable substitution

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%