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"?

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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.