Page MenuHomeFreeBSD

grep(1): Add more EXAMPLES
ClosedPublic

Authored by fernape on Wed, Nov 18, 12:45 PM.

Details

Reviewers
bcr
Group Reviewers
manpages
Commits
rS367850: grep(1): Add more EXAMPLES
Summary
  • Add more EXAMPLES covering flags: -A, -B, -c, -f, -i, -H, -l, -q, -R, -w
  • While here, change existing wording to use the imperative (remove "To find")
  • Reword first example to be consistent with how grep(1) understand words (-w)
Test Plan
  • mandoc -Tlint clean
  • igor clean
  • aspell happy
  • man ./grep.1 renders the page properly

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

The examples look good. Maybe another one to show how to do a case-sensitive search (i.e. just uppercase)?

usr.bin/grep/grep.1
459 ↗(On Diff #79698)

I'd just use "word" or "pattern" here instead of text to be consistent.

Be consistent with the descriptions of the examples.

Suggested by bcr@

In D27264#608857, @bcr wrote:

The examples look good. Maybe another one to show how to do a case-sensitive search (i.e. just uppercase)?

Except for the example with -i the rest of them are case sensitive. The example reading from the standard input uses the uppercase BSD in case sensitive mode. Do you mean a separate example?

Thanks!

In D27264#608857, @bcr wrote:

The examples look good. Maybe another one to show how to do a case-sensitive search (i.e. just uppercase)?

In D27264#608857, @bcr wrote:

The examples look good. Maybe another one to show how to do a case-sensitive search (i.e. just uppercase)?

Except for the example with -i the rest of them are case sensitive. The example reading from the standard input uses the uppercase BSD in case sensitive mode. Do you mean a separate example?

Thanks!

Right, I was thinking of a separate example at the beginning. Something along the lines of "Search for exactly this pattern ignoring case." You could combine this with count, so that for an input like
BSD
bsd

you'd get different counts for -i or without it.

  • Add new example with upper case and redo the previous one to show the difference when using -i (suggested by bcr@)
  • Remove -i from two examples since that flag is covered earlier
  • s/showing/show in the descritption of an example

Excellent, that looks good now. Thank you!

This revision is now accepted and ready to land.Thu, Nov 19, 11:36 AM
This revision was automatically updated to reflect the committed changes.
In D27264#609214, @bcr wrote:

Excellent, that looks good now. Thank you!

Thanks for the review!