Questions tagged [variable-substitution]

Use where the name of a variable is textually substituted with the value of the variable

Variable substitution is the textual process of inserting the value of a variable (possibly in some modified way) in the context where the variable's name (typically with some syntax indicator that it is a variable's name) stands.

325 questions
1
vote
1 answer

special symbols, . * # inside curly brackets

bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.} echo "BASH VERSION --- $BASH_VERSION" echo "bmajor ----- $bmajor" echo "bminor ----- $bminor" prints, BASH VERSION --- 4.2.46(1)-release bash --- 4.2 bmajor ----- 4 bminor ----- 2 I…
user93868
0
votes
1 answer

Why is variable substitution called variable substitution if we retrieve the value?

I've read here the following text: The name of a variable is a placeholder for its value, the data it holds. Referencing (retrieving) its value is called variable substitution. If we retrieve/or reference the value, why is the terminology is…
-1
votes
2 answers

Variable substitution from/to file

How do I replace placeholders in a file with variables from another file? (Like docker-compose is doing it.) I found many articles about single variable replacements or replacement by environment variables but not file to file. .env…
jwillmer
  • 101