Bird
0
0

Identify the error in this shell script:

medium📝 Debug Q6 of 15
Bash Scripting - Basics
Identify the error in this shell script:
#!/bin/bash
echo "Hello World
AMissing semicolon after echo
BMissing closing double quote in echo statement
CIncorrect shebang line
DVariable not defined
Step-by-Step Solution
Solution:
  1. Step 1: Check syntax of echo command

    The echo command starts with a double quote but does not have a closing double quote.
  2. Step 2: Verify other parts

    Shebang line is correct, semicolon is not required, and no variables are used.
  3. Final Answer:

    Missing closing double quote in echo statement -> Option B
  4. Quick Check:

    Unclosed quotes cause syntax errors [OK]
Quick Trick: Always close quotes in commands [OK]
Common Mistakes:
MISTAKES
  • Ignoring missing quotes
  • Thinking semicolon is mandatory
  • Confusing shebang errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes