Bird
0
0

Why does the shebang line use #! instead of just # or !?

hard🧠 Conceptual Q10 of 15
Bash Scripting - Basics
Why does the shebang line use #! instead of just # or !?
ABecause <code>#!</code> signals the kernel to use an interpreter
BBecause <code>#</code> alone is a comment and ignored
CAll of the above
DBecause <code>!</code> alone has no meaning in scripts
Step-by-Step Solution
Solution:
  1. Step 1: Understand kernel behavior

    The kernel recognizes #! at the start of a file to run the specified interpreter.
  2. Step 2: Recognize comment and syntax roles

    # alone is a comment, and ! alone is not special in scripts.
  3. Step 3: Combine all facts

    Therefore, all statements about #! usage are true.
  4. Final Answer:

    All of the above -> Option C
  5. Quick Check:

    Shebang uses #! to signal interpreter [OK]
Quick Trick: Shebang #! tells kernel to use interpreter [OK]
Common Mistakes:
MISTAKES
  • Thinking # alone works as shebang
  • Assuming ! alone is special
  • Ignoring kernel's role

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes