In Section 2.3 Token Recognition under Shell Command Language, what does the io_here token refer to?

2.3 Token Recognition

The shell shall read its input in terms of lines. (For details about how the shell reads its input, see the description of sh.) The input lines can be of unlimited length. These lines shall be parsed using two major modes: ordinary token recognition and processing of here-documents.

When an io_here token has been recognized by the grammar (see Shell Grammar), one or more of the subsequent lines immediately following the next NEWLINE token form the body of one or more here-documents and shall be parsed according to the rules of Here-Document.

When it is not processing an io_here, the shell shall break its input into tokens by applying the first applicable rule below to the next character in its input. The token shall be from the current position in the input until a token is delimited according to one of the rules below; the characters forming the token are exactly those in the input, including any quoting characters. If it is indicated that a token is delimited, and no characters have been included in a token, processing shall continue until an actual token is delimited.

1 Answer 1


The shell grammar defines io_here as

io_here          : DLESS     here_end
                 | DLESSDASH here_end

DLESS is <<, DLESSDASH is <<-, and here_end is the end-of-here-document marker.

So the io_here token is the token introducing a here-doc.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .