redirection

Bash here document

Supply lines from the script as input. Quote the opening delimiter to suppress body expansion; the closing line contains the unquoted delimiter.

Formal Syntax & Structure

bash syntaxbash
[n]<<delimiter

Return Value

redirection effect

Supply lines from the script as input. Quote the opening delimiter to suppress body expansion; the closing line contains the unquoted delimiter.

Working Example

Example Snippetbash
name=Samcat <<ENDHello $nameTotal: $((2+3))ENDcat <<'END'Hello $nameTotal: $((2+3))END
Bash Reference