Skip to content

Commit

Permalink
improve the sample run
Browse files Browse the repository at this point in the history
  • Loading branch information
vladak committed Mar 11, 2024
1 parent 46aae49 commit aab16b2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/warm-up/grep.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ program will match a single string which is hard-coded in the program
in the form of (boundless) array (`char needle[] = "foobar";`).
The program will use `getchar()` to read the characters from the standard input.

Sample program run:
Sample program run (with the search string hard-coded as `bash`):
```
$ cat /etc/passwd | ./a.out
root:x:0:0:root:/root:/bin/bash
foo:x:1000:1000:Foo,,,:/home/foo:/bin/bash
backu:x:1001:1001:backup,,,:/home/backu:/bin/bash
perforce:x:133:141:Perforce Admin:/opt/perforce:/bin/bash
```
compared to the fgrep(1) utility:
```
$ fgrep bash /etc/passwd
root:x:0:0:root:/root:/bin/bash
Expand Down

0 comments on commit aab16b2

Please sign in to comment.