0

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 "to substitute" and not just "to retrieve" or "to reference"?

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255

1 Answers1

1

Think of it in terms of the character strings: you start with

${variable}

and after variable substitution that becomes

value

The placeholder is replaced by the value, hence variable substitution. There’s no reference to the variable after this (the shell doesn’t remember where the value came from).

Stephen Kitt
  • 434,908