Bird
0
0

Which line correctly starts a Bash script to tell the system to use Bash?

easy📝 Syntax Q12 of 15
Bash Scripting - Basics
Which line correctly starts a Bash script to tell the system to use Bash?
A#!/bin/bash
B#!/bin/sh
C#!/usr/bin/python
D#!/bin/csh
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct shebang for Bash

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

    #!/bin/sh is for sh shell, #!/usr/bin/python is for Python, and #!/bin/csh is for C shell, not Bash.
  3. Final Answer:

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

    Shebang for Bash = #!/bin/bash [OK]
Quick Trick: Bash scripts start with #!/bin/bash [OK]
Common Mistakes:
MISTAKES
  • Using #!/bin/sh which may not be Bash
  • Confusing Python or C shell shebangs
  • Omitting the shebang line

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes