nerdexam
Linux_Foundation

LFCS · Question #756

Which of the following command line redirection characters instructs the shell to read from the current input source until a specific word, on a separate line and without and trailing spaces, is…

The correct answer is A. <<. The << redirection operator signifies a 'here document,' instructing the shell to read input from the current source until a specified delimiter word is encountered on a separate line.

Submitted by ravi_2018· Apr 18, 2026Essential Commands

Question

Which of the following command line redirection characters instructs the shell to read from the current input source until a specific word, on a separate line and without and trailing spaces, is reached?

Options

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

How the community answered

(40 responses)
  • A
    90% (36)
  • B
    3% (1)
  • C
    3% (1)
  • D
    5% (2)

Why each option

The `<<` redirection operator signifies a 'here document,' instructing the shell to read input from the current source until a specified delimiter word is encountered on a separate line.

A<<Correct

The `<<` operator is used for a 'here document' which allows multi-line input to be provided directly within a shell script or from the command line. The shell reads all subsequent lines as standard input for the command until it encounters a specified delimiter word (on its own line, without leading/trailing spaces).

B<|

`<|` is not a standard shell redirection character for here documents; `<` redirects input from a file, and `|` creates a pipe.

C!<

`!<` is not a standard shell redirection character; `!` is generally used for history expansion in Bash.

D&<<

`&<<` is not a standard shell redirection character; `&` is used for file descriptor manipulation or backgrounding, not in this combination for here documents.

Concept tested: Here document redirection <<

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

Topics

#Shell Redirection#Here Document#Input/Output#Command Line Interface

Community Discussion

No community discussion yet for this question.

Full LFCS Practice