nerdexam
Linux_Foundation

LFCS · Question #831

Which of the following characters can be combined with a separator string in order to read from the current input source until the separator string, which is on a separate line and without any…

The correct answer is A. <<. The << characters are used in Bash to create a 'here document' (heredoc), which allows multiline input to be supplied to a command until a specified separator string is encountered on its own line.

Submitted by lucia.co· Apr 18, 2026Essential Commands

Question

Which of the following characters can be combined with a separator string in order to read from the current input source until the separator string, which is on a separate line and without any trailing spaces, is reached?

Options

  • A<<
  • B<|
  • C!<
  • D&<

How the community answered

(30 responses)
  • A
    93% (28)
  • B
    3% (1)
  • C
    3% (1)

Why each option

The `<<` characters are used in Bash to create a 'here document' (heredoc), which allows multiline input to be supplied to a command until a specified separator string is encountered on its own line.

A<<Correct

The `<<` shell operator signifies a 'here document' or 'heredoc', which reads input from the current source until a line containing only the specified separator string (often called a 'delimiter' or 'terminator') is found. This is commonly used to provide multiline input to commands or scripts.

B<|

`<|` is not a standard shell redirection or special character combination for input in this context.

C!<

`!<` is not a standard shell redirection or special character combination for input in this context; `!` is typically used for history expansion or negation.

D&<

`&<` is not a standard shell redirection or special character combination for input in this context; `&` is used for backgrounding commands or combining file descriptors.

Concept tested: Bash here document syntax

Source: https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Here-Documents

Topics

#here document#shell redirection#standard input

Community Discussion

No community discussion yet for this question.

Full LFCS Practice