Bird
0
0

Which of the following lines correctly starts a Bash script with a shebang?

easy📝 Syntax Q3 of 15
Bash Scripting - Basics
Which of the following lines correctly starts a Bash script with a shebang?
A#!/bin/bash
B#!/bash/bin
C!#/bin/bash
D#!/bin/sh/bash
Step-by-Step Solution
Solution:
  1. Step 1: Recognize correct shebang syntax

    The shebang must start with #! followed by the absolute path to the interpreter.
  2. Step 2: Validate interpreter path

    /bin/bash is the standard location for Bash on most systems.
  3. Final Answer:

    #!/bin/bash is the correct shebang line -> Option A
  4. Quick Check:

    Shebang starts with #! and valid interpreter path [OK]
Quick Trick: Shebang must start with #! and valid interpreter path [OK]
Common Mistakes:
MISTAKES
  • Swapping characters in the path
  • Using incorrect interpreter paths
  • Starting with !# instead of #!

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes