Skip to content

Commit e0cec3e

Browse files
minor fixes on wc -l numbers
1 parent 48caefa commit e0cec3e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

docs/04-redirection.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ of your kid's first birthday party, you also want to avoid overwriting your data
274274
```
275275

276276
```output
277-
802 bad_reads.txt
277+
537 bad_reads.txt
278278
```
279279
!!! terminal "code"
280280

@@ -300,7 +300,7 @@ search sequence. So our file was overwritten and is now empty.
300300
```
301301

302302
```output
303-
802 bad_reads.txt
303+
537 bad_reads.txt
304304
```
305305

306306
```bash
@@ -309,7 +309,7 @@ search sequence. So our file was overwritten and is now empty.
309309
```
310310

311311
```output
312-
802 bad_reads.txt
312+
537 bad_reads.txt
313313
```
314314

315315
The output of our second call to `wc` shows that we have not overwritten our original data.
@@ -322,7 +322,7 @@ The output of our second call to `wc` shows that we have not overwritten our ori
322322
```
323323

324324
```output
325-
802 bad_reads.txt
325+
537 bad_reads.txt
326326
```
327327

328328

@@ -412,15 +412,15 @@ number of lines. Luckily, this issue happens by the end of the file so we can al
412412
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
413413
```
414414

415-
The fifth and six lines in the output display "--" which is the default action for `grep` to separate groups of
415+
The sixth line in the output display "--" which is the default action for `grep` to separate groups of
416416
lines matching the pattern, and indicate groups of lines which did not match the pattern so are not displayed.
417417
To fix this issue, we can redirect the output of grep to a second instance of `grep` as follows.
418418

419419
!!! terminal "code"
420420

421421
```bash
422-
$ grep -B1 -A2 NNNNNNNNNN SRR098026.fastq | grep -v '^--' > bad_reads.fastq
423-
$ tail bad_reads.fastq
422+
$ grep -B1 -A2 NNNNNNNNNN SRR098026.fastq | grep -v '^--' > bad_reads.txt
423+
$ tail bad_reads.txt
424424
```
425425

426426
```output
@@ -436,10 +436,10 @@ To fix this issue, we can redirect the output of grep to a second instance of `g
436436
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
437437
```
438438

439-
The `-v` option in the second `grep` search stands for `--invert-match` meaning `grep` will now only display the
440-
lines which do not match the searched pattern, in this case `'^--'`. The caret (`^`) is an **anchoring**
441-
character matching the beginning of the line, and the pattern has to be enclose by single quotes so `grep` does
442-
not interpret the pattern as an extended option (starting with --).
439+
The `-v` option in the second `grep` search stands for `--invert-match` meaning `grep` will now only display the
440+
lines which do not match the searched pattern, in this case `'^--'`. The caret (`^`) is an **anchoring**
441+
character matching the beginning of the line, and the pattern has to be enclose by single quotes so `grep` does
442+
not interpret the pattern as an extended option (starting with --).
443443

444444

445445

0 commit comments

Comments
 (0)