nerdexam
LPI

010-100 · Question #62

What two character sequence is present at the beginning of an interpreted script? (Please specify the TWO correct characters only)

The correct answer is A. quotation mark B. forward slash. This question identifies the two-character shebang sequence at the start of an interpreted script, which signals the kernel to use a specified interpreter.

The Power of the Command Line

Question

What two character sequence is present at the beginning of an interpreted script? (Please specify the TWO correct characters only)

Options

  • Aquotation mark
  • Bforward slash
  • Cpending
  • Dpending

How the community answered

(29 responses)
  • A
    86% (25)
  • C
    10% (3)
  • D
    3% (1)

Why each option

This question identifies the two-character shebang sequence at the start of an interpreted script, which signals the kernel to use a specified interpreter.

Aquotation markCorrect

The hash character '#' is the first character of the shebang and, combined with '!', forms the two-byte magic number that the Linux kernel recognizes when executing a script file.

Bforward slashCorrect

The exclamation mark '!' is the second character of the shebang sequence; together '#!' tells the kernel that the remainder of the first line is the path to the interpreter (e.g., #!/bin/bash) that should execute the script.

Cpending

This choice is listed as pending and does not correspond to either character of the shebang sequence.

Dpending

This choice is listed as pending and does not correspond to either character of the shebang sequence.

Concept tested: Linux shebang interpreter directive syntax

Source: https://www.gnu.org/software/bash/manual/bash.html#index-script

Topics

#shebang#script interpreter#shell scripting

Community Discussion

No community discussion yet for this question.

Full 010-100 Practice