Bird
0
0

Identify the error in this script:

medium📝 Debug Q6 of 15
Bash Scripting - String Operations
Identify the error in this script:
name="UserName"
echo ${name^^?}
AInvalid syntax with extra '?' after ^^
BVariable name is incorrect
CMissing quotes around variable
DNo error, script runs fine
Step-by-Step Solution
Solution:
  1. Step 1: Check syntax of uppercase conversion

    The correct syntax for all uppercase is ${variable^^} without any extra characters.
  2. Step 2: Identify error

    The extra '?' after ^^ is invalid and causes syntax error.
  3. Final Answer:

    Invalid syntax with extra '?' after ^^ -> Option A
  4. Quick Check:

    Extra characters after ^^ cause syntax error [OK]
Quick Trick: Do not add extra characters after ^^ or ,, [OK]
Common Mistakes:
MISTAKES
  • Adding extra symbols after ^^ or ,,
  • Misnaming variables
  • Omitting braces around variable

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes