Multiple choice technology operating systems

What character pair would you use to ensure the shell knows how to interpret a variable correctly?

  1. [ ]

  2. $$
  3. {}

  4. ##

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

The curly braces {} are used for parameter expansion in shell scripting. Writing ${VAR} ensures the shell correctly interprets variable names, especially when followed by alphanumeric characters or underscores. For example, ${VAR}_suffix prevents the shell from treating VAR_suffix as a single variable name. The syntax ${VAR:-default} also provides default values.