June 2017
Beginner
502 pages
11h 26m
English
We just saw that $label is the way we reference the content of a variable, but if you have a look at some scripts, you can find another way of retrieving variable content:
${label}
The two ways of referencing the content of a variable are both valid, and you can use the first, more compact, in any case except when concatenating the variable name to any characters, which could change the variable name itself. In this case, it becomes mandatory to use the extended version of the variable substitution, as the following example will make clear.
Let's start printing our variable again:
gzarrelli:~$ echo $FIRST_VARIABLEamazing
Now, let's do it again using the extended version of substitution:
gzarrelli:~$ echo ${FIRST_VARIABLE} ...Read now
Unlock full access