Syntax

Bash Here Document Syntax

In Bash, here document: feeds multi-line text into a command — cat <<EOF line one line two EOF

Quick Answer

Syntax
cat <<EOF line one line two EOF
BashSyntax

Here Document

Code example
cat <<EOF line one line two EOF

Feeds multi-line text into a command.

Learn More

How to here document in Bash

  1. Open your Bash file or editor.
  2. Copy the example, then replace its sample names and values for your code.

Bash Here Document Syntax

Use cat <<EOF line one line two EOF.

Related Syntax References

Frequently asked questions

What is the Bash syntax for here document?

Use this pattern: cat <<EOF line one line two EOF

Can I copy this Bash code example?

Yes. Use Copy code and adapt the example to your program.

Is this Bash syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify