Ravi Sir's Cards › AWS
Here-doc and here-string
This revision card explains Here-doc and here-string. It starts from the need that many lines into a command. It describes one string in. The how-to section notes command as a file. An example on the card is quote EOF to stop expansion.
Read card text
What this card says
Why do we need it?
Many lines into a command.
cat <<'EOF'
What is it?
One string in.
bc <<< 5+7
How to do it
Command as a file.
diff <(sort a) <(sort b)
Example
Quote EOF to stop expansion.