Bird
0
0

Which of the following lines correctly specifies the interpreter for a Bash script?

easy📝 Syntax Q3 of 15
Bash Scripting - Basics
Which of the following lines correctly specifies the interpreter for a Bash script?
A#!/bin/bash
B#!/usr/bin/python
C#!/bin/shutdown
D#!/usr/local/bin/node
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct shebang for Bash

    The shebang line #!/bin/bash tells the system to use the Bash shell to run the script.
  2. Step 2: Analyze other options

    Options B, C, and D specify interpreters for Python, a non-existent shutdown command, and Node.js respectively, which are incorrect for Bash scripts.
  3. Final Answer:

    #!/bin/bash -> Option A
  4. Quick Check:

    Shebang for Bash is #!/bin/bash [OK]
Quick Trick: Use #!/bin/bash to start Bash scripts [OK]
Common Mistakes:
MISTAKES
  • Using Python or other interpreters as shebang
  • Omitting the shebang line
  • Using invalid interpreter paths

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes