GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - drone/envsubst: Go package emulates bash environment variable substitution

BranchesTags
Open more actions menu

Latest commit

 

History

61 Commits
61 Commits

Folders and files

NameName
Last commit message
Last commit date
cmd/envsubst
cmd/envsubst
 
 
parse
parse
 
 
path
path
 
 
.drone.yml
.drone.yml
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
eval.go
eval.go
 
 
eval_test.go
eval_test.go
 
 
funcs.go
funcs.go
 
 
funcs_test.go
funcs_test.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
readme.md
readme.md
 
 
template.go
template.go
 
 

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

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

For a deeper reference, see bash-hackers or gnu pattern matching.

Unsupported Functions

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

About

Go package emulates bash environment variable substitution

Resources

Readme
MIT license
Activity
Custom properties

Stars

301 stars

Watchers

4 watching

Forks

58 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.