Multiple choice technology operating systems

"What will be the output of following command var=hello varx=goodbye echo ${var}x"

  1. goodbye

  2. hello

  3. hellox

  4. hellogoodbye

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The parameter expansion ${var} evaluates to the value of var, which is hello. The trailing x in echo ${var}x is treated as a literal character, resulting in the output hellox. Note that since the braces isolate var, it does not reference the variable varx.