Bird
0
0

You wrote a script file but get "bad interpreter" error when running it. What is the likely cause?

medium📝 Debug Q6 of 15
Bash Scripting - Basics
You wrote a script file but get "bad interpreter" error when running it. What is the likely cause?
AMissing execute permission
BIncorrect shebang line path
CScript file is empty
DFilename has spaces
Step-by-Step Solution
Solution:
  1. Step 1: Understand "bad interpreter" error meaning

    This error means the system cannot find the interpreter specified in the shebang line.
  2. Step 2: Identify the cause

    If the shebang line path is wrong or misspelled, the error occurs.
  3. Final Answer:

    Incorrect shebang line path -> Option B
  4. Quick Check:

    Bad interpreter error = wrong shebang path [OK]
Quick Trick: Check shebang path if you get bad interpreter error [OK]
Common Mistakes:
MISTAKES
  • Confusing with permission errors
  • Thinking empty file causes this
  • Assuming spaces in filename cause this error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes