easyMultiple ChoiceObjective-mapped
XK0-006 Practice Question: A Linux administrator writes a script that uses…
A Linux administrator writes a script that uses bash-specific features like arrays and process substitution. Which shebang should be used?
⚠ Common exam trap
Many candidates assume /bin/sh is always bash or that any shell can run bash-specific syntax, but on many Linux distributions /bin/sh is a different shell (e.g., dash) that lacks these extensions.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
#!/bin/bash
The correct shebang is #!/bin/bash because the script uses bash-specific features such as arrays and process substitution. The shebang line tells the system to execute the script with the specified interpreter; /bin/bash is the Bourne Again SHell, which supports these features, while /bin/sh may be a POSIX shell that lacks them.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
#!/bin/bash
Why this is correct
Bash supports advanced features like arrays and process substitution.
- ✗
#!/bin/sh
Why it's wrong here
The /bin/sh shell may be a minimal POSIX shell (like dash) that does not support bash-specific features.
- ✗
#!/usr/bin/python3
Why it's wrong here
This shebang is for Python scripts, not bash scripts.
- ✗
#!/bin/ksh
Why it's wrong here
KornShell is a different shell; the script uses bash-specific features.
Go deeper
Related to this question
Learn chapter
Linux Fundamentals and History
Key term
Bash
Bash is a command-line interpreter that lets users interact with an operating system by typing text commands instead of clicking icons.
Key term
Shell
A shell is a computer program that provides a user interface to access an operating system's services, typically by accepting text commands.
About these practice questions
Courseiva writes every XK0-006 question from scratch — 979 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.