Skip to content

Commit b81ac31

Browse files
authored
Merge pull request #550 from dflamand/here-document
Expand on "here document"
2 parents 8cfae52 + 1178af6 commit b81ac31

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,13 @@ Notes:
156156
}
157157
```
158158

159-
- Know about "here documents" in Bash, as in `cat <<EOF ...`.
159+
- A "here document" allows [redirection of multiple lines of input](https://www.tldp.org/LDP/abs/html/here-docs.html) as if from a file:
160+
```
161+
cat <<EOF
162+
input
163+
on multiple lines
164+
EOF
165+
```
160166

161167
- In Bash, redirect both standard output and standard error via: `some-command >logfile 2>&1` or `some-command &>logfile`. Often, to ensure a command does not leave an open file handle to standard input, tying it to the terminal you are in, it is also good practice to add `</dev/null`.
162168

0 commit comments

Comments
 (0)