Skip to content

Commit f778974

Browse files
committed
Isaac's lastest suggestions
1 parent 5d343ba commit f778974

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

concepts/redirection/about.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Recall that we introduced these in the [Pipelines and Command Lists][pipelines]
1010

1111
~~~~exercism/note
1212
Pipelines can be considered a form of redirection: the standard output from one program is sent directly to the standard input of another.
13-
But we've already covered pipelines.
14-
This document is about redirecting to and from files.
13+
We've already covered pipelines.
14+
This concept will cover redirecting to and from files.
1515
~~~~
1616

1717
Shell redirection is a powerful mechanism that allows you to change the destination of these streams.
@@ -107,6 +107,10 @@ It is useful for suppressing output or errors.
107107
```bash
108108
some_command > /dev/null # Discards stdout
109109
some_command 2> /dev/null # Discards stderr
110+
111+
# Using /dev/null as input will prevent the command
112+
# from reading data from the keyboard
113+
some_command < /dev/null
110114
```
111115

112116
## Combining redirections
@@ -162,7 +166,7 @@ some_command 2>&1 # stdout and stderr send to 'log.txt'
162166
```
163167
164168
This technique looks quite convoluted, but it can be very useful in situations where your script is being run by some other software package, and standard output is automatically captured by the software.
165-
The `bats` command works like this.
169+
The `bats` command, used to run unit tests for this track, works like this: `bats` captures a test's stdout and stderr, but strings sent to FD 3 will be displayed on the terminal.
166170
~~~~
167171

168172
## In Summary

0 commit comments

Comments
 (0)