LX0-104 · Question #513
An administrator is looking into a new script they received from a senior executive. In the very first line the administrator notices a #! followed by a file path. This indicates that:
The correct answer is D. the program at that location will be used to process the script.. The #! (shebang) on the first line of a script specifies the interpreter program that should be used to execute the script.
Question
Options
- Athe file at that location was used to make the script.
- Bthis script provides identical functionality as the file at that location.
- Cthis script will self-extract into a file at that location.
- Dthe program at that location will be used to process the script.
How the community answered
(25 responses)- A4% (1)
- C4% (1)
- D92% (23)
Why each option
The `#!` (shebang) on the first line of a script specifies the interpreter program that should be used to execute the script.
The shebang indicates the interpreter for execution, not the tool used to create the script.
The shebang specifies the interpreter, not that the script provides identical functionality to the interpreter itself.
The shebang is for execution, not for self-extraction; self-extracting archives use different mechanisms.
The `#!` sequence, known as a 'shebang,' at the beginning of a script indicates the interpreter program that the operating system should use to execute the script. The file path following `#!` points to the executable program, such as `/bin/bash` or `/usr/bin/python`, responsible for parsing and running the script's commands.
Concept tested: Shebang interpreter directive
Source: https://www.gnu.org/software/bash/manual/html_node/Shebang-Lines.html
Topics
Community Discussion
No community discussion yet for this question.