Page MenuHomeFreeBSD

grep(1): Add more EXAMPLES
ClosedPublic

Authored by fernape on Nov 18 2020, 12:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 20 2024, 11:15 PM
Unknown Object (File)
Feb 20 2024, 11:11 PM
Unknown Object (File)
Dec 22 2023, 11:54 PM
Unknown Object (File)
Nov 26 2023, 10:26 PM
Unknown Object (File)
Nov 22 2023, 11:13 PM
Unknown Object (File)
Nov 22 2023, 10:29 AM
Unknown Object (File)
Nov 13 2023, 3:43 PM
Unknown Object (File)
Nov 11 2023, 2:05 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 - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 34876
Build 31898: arc lint + arc unit

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

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.Nov 19 2020, 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!