PT0-002 · Question #98
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…
The correct answer is E. #! The '#!' combination is called a 'shebang' (or hashbang). When placed at the very start of a script file followed by the interpreter path (e.g., '#!/bin/bash'), it tells the operating system kernel which interpreter to use to execute the script. Without it, the system may not…
Question
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?
Exhibit
Options
- A<#
- B<$
- C
- D#$
- E#!
How the community answered
(48 responses)- A8% (4)
- B2% (1)
- C2% (1)
- E88% (42)
Explanation
The '#!' combination is called a 'shebang' (or hashbang). When placed at the very start of a script file followed by the interpreter path (e.g., '#!/bin/bash'), it tells the operating system kernel which interpreter to use to execute the script. Without it, the system may not know how to run the file or may use a different default shell. The other options (#, <#, <$, #$) have no special meaning as interpreter directives in Unix/Linux.
Topics
Community Discussion
No community discussion yet for this question.
