Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • what does #proj_env_repo do? what if i need to pass as a variable like $value? would it take that? Commented Oct 16, 2019 at 21:20
  • @swat ${something#prefix} removes the string prefix from the beginning of the value of $something. So ${variable#proj_env_repo} removes the string proj_env_repo from beginning of the value $variable (which is the name of one of those variables whose name starts with proj_env_repo). For you second follow up question, see the function towards the second half of my answer. Commented Oct 16, 2019 at 21:24
  • Example code doesn't work in bash 5.0+. Commented Oct 29, 2020 at 0:47