Bird
0
0

Identify the error in this Bash script:

medium📝 Debug Q14 of 15
Bash Scripting - Basics
Identify the error in this Bash script:
#!/bin/bash
echo Hello World
AMissing quotes around Hello World
Becho command is misspelled
CNo error, script runs fine
DMissing shebang line
Step-by-Step Solution
Solution:
  1. Step 1: Check script syntax

    The script has a correct shebang line and uses echo properly.
  2. Step 2: Understand echo argument rules

    Quotes are optional if no special characters or spaces that confuse shell; here it works fine.
  3. Final Answer:

    No error, script runs fine -> Option C
  4. Quick Check:

    echo without quotes works here [OK]
Quick Trick: Quotes optional if no special chars or spaces [OK]
Common Mistakes:
MISTAKES
  • Assuming quotes are always required
  • Thinking shebang is missing
  • Believing echo is misspelled

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes