CompTIA PenTest+ (PT1-002) — Question 110
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. It tells the system which interpreter to use to execute the script. The other options do not serve this purpose and will not correctly specify /bin/bash as the interpreter.