Skip to content

Commit 5762c13

Browse files
explain -v and -^ a bit more
1 parent e0cec3e commit 5762c13

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

docs/04-redirection.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,9 @@ 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+
- `-v`: This option tells grep to invert the match, meaning it will return lines that do not match the specified pattern.
440+
- `'^--'`: This is a regular expression where:
441+
`^` asserts that the following characters (`--`) must be at the start of the line.
443442

444443

445444

0 commit comments

Comments
 (0)