Skip to content

Commit 1debd14

Browse files
committed
a more active voice
1 parent efc991f commit 1debd14

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

concepts/heredocs/about.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ DELIMITER
2828
## How it Works
2929

3030
* Bash reads all the lines between the starting `<< DELIMITER` and the ending `DELIMITER`.
31-
* This content is then treated as standard input (`stdin`) to the command.
31+
* Bash connects this content to the command's standard input.
3232
* The command processes this input as if it were coming from the keyboard.
3333

3434
### Example 1: Simple Text Output
@@ -130,7 +130,7 @@ The current date is Thu Apr 24 13:47:32 EDT 2025
130130
Two plus two is 4
131131
```
132132

133-
Quoting the delimiter (single or double quotes) prevents these expansions.
133+
When the delimiter is quoting (using single or double quotes), these expansions are prevented.
134134
The content is taken literally.
135135
This is like single quoted strings.
136136

@@ -157,10 +157,11 @@ This is useful for indenting the heredoc content within your script without affe
157157

158158
```bash
159159
# Note, the leading whitespace is tab characters only, not spaces!
160+
# and the ending delimiter can have leading tabs as well
160161
cat <<- END
161-
This line has a leading tab.
162-
This line also has a leading tab.
163-
END
162+
This line has a leading tab.
163+
This line also has a leading tab.
164+
END
164165
```
165166

166167
The output is printed without the leading tabs:
@@ -171,7 +172,7 @@ This line also has a leading tab.
171172
```
172173

173174
The author doesn't recommend this usage.
174-
While it does improve the readability of the script, it's too easy to accidentally replace the tab characters with spaces and it's too hard to spot the difference.
175+
While it can improve the readability of the script, it's too easy to accidentally replace the tab characters with spaces and it's too hard to spot the difference.
175176

176177
## When to Use Here Documents
177178

0 commit comments

Comments
 (0)