Multiple choice technology operating systems

What is the output of the last echo command executed on a bash shell? $ bash $ export a=aaagggccc $ echo ${a/g/b}

  1. aaagggccc/g/b

  2. aaabbbccc

  3. aaabggccc

  4. a/g/b

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

Bash parameter substitution ${a/g/b} replaces the FIRST occurrence of pattern 'g' with 'b'. Variable a='aaagggccc'. Only the first 'g' is replaced, giving 'aaabggccc'. Option B is wrong (too many replacements). Option C correctly shows single substitution.