Multiple choice general knowledge science & technology

Suppose a variable Count= var_17 Which of the following command can be use to extract last two digit from variable Count and store in a variable var?

  1. Var=${Count: -2}

  2. var=${Count: -2}

  3. var=${Count: +2}

  4. Var=${count: -2}

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

In bash parameter expansion, ${Count: -2} extracts the last 2 characters from the variable. The space before -2 is required when using negative offsets to distinguish from default value syntax. Option A is wrong because 'Var' uses incorrect case. Option C uses +2 which would start from position 2, not extract the last 2. Option D uses 'count' with wrong case.