CompTIA PenTest+ (PT0-002) — Question 109
When developing a shell script intended for interpretation in Bash, the interpreter /bin/bash should be explicitly specified.
Which of the following character combinations should be used on the first line of the script to accomplish this goal?
Answer options
- A. <#
- B. <$
- C. ##
- D. #$
- E. #!
Correct answer: E
Explanation
The correct answer is E, #!, which is known as a shebang and is used to specify the interpreter for script execution. Options A, B, C, and D are not valid ways to indicate the interpreter and will not correctly launch the script in Bash.