History log of /freebsd-current/usr.bin/grep/grep.1
Revision Date Author Comments
# bdcbfde3 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# b2c76c41 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line nroff pattern

Remove /^\.\\"\s*\$FreeBSD\$$\n/


# cf7fe60e 18-Dec-2022 Jose Luis Duran <jlduran@gmail.com>

grep.1: Add an ENVIRONMENT section

Document the environment variables used by grep(1).

Reviewed by: pauamma, kevans
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D37726


# 085a42d0 01-Nov-2022 Elvin Aslanov <rwp.primary@gmail.com>

grep: correct argument name in man page

MFC after: 1 week
Fixes: 4dc88ebedf94 ("Add BSD grep to the base system...")
Pull Request: https://github.com/freebsd/freebsd-src/pull/622


# 070e8d36 05-Oct-2022 Daniel Engberg <diizzy@FreeBSD.org>

grep: Add quotes in manpage when using wildcards with --include

Examples uses --include=*.h which doesn't work as intended

Approved by: kevans
Differential Revision: https://reviews.freebsd.org/D36883


# 4c14980b 09-Nov-2021 Kyle Evans <kevans@FreeBSD.org>

grep: fix/remove references to -P

-P in gnugrepland means PCRE, which we do not support. We may eventually
support it if onigmo ends up getting imported as a more performant regex
implementation, and we can re-add it properly in these places (and more)
when that time comes.

The optstr change is a functional nop; the case was not explicitly handled,
thus ending in usage() anyways.

Reported by: Vladimir Misev (via twitter)


# be6b8b7a 05-Feb-2021 Mateusz Piotrowski <0mp@FreeBSD.org>

grep: Fix an incorrect description of the -C flag

It seems that the number of lines is no longer an optional parameter to
the -C flag. Document it accordingly both in the manual page and the
usage message.

Reviewed by: yuripv
Approved by: yuripv
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D28509


# 2373acbb 04-Feb-2021 Kyle Evans <kevans@FreeBSD.org>

grep: turn off -w if -x is specified

-x overcomes -w in gnugrep, and it should here as well. Flip it off as
needed to avoid confusing other parts of grep.


# 5be3f744 19-Nov-2020 Fernando ApesteguĂ­a <fernape@FreeBSD.org>

grep(1): Add more EXAMPLES

* 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)

Approved by: manpages (bcr@)
Differential Revision: https://reviews.freebsd.org/D27264


# 88d24183 07-Aug-2020 Gordon Bergling <gbe@FreeBSD.org>

grep(1): correct typos for 'if a name patches' to 'if a name matches'

PR: 237635
Submitted by: durin42 <raf atdurin42 dot com>
Reviewed by: kevans
Approved by: kevans
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D25994


# 6ddfef55 20-Aug-2018 Mateusz Piotrowski <0mp@FreeBSD.org>

Adjust formatting of grep and zgrep manual pages.

grep(1) changes:
- Pet mandoc & igor.
- Stylize the text more with macros when appropriate.
- Stylize equal signs in long options (e.g., "--color=auto") with
the "Cm" macro as suggested by mdoc(7).
- Add missing arguments to --exlude, --exclude-dir, --include and
--include-dir.
- Remove a duplicate entry for the --context flag.
- Use a list in the EXAMPLES sections to make it easier to tell
which paragraphs belong to which example.
- Cross reference zgrep(1).

zgrep(1) changes:
- Fix Nd.
- Split synopsis into paragraphs for readability.
- Cross reference bzip(1), grep(1) and xz(1).

Reviewed by: bcr
Approved by: mat (mentor)
Differential Revision: https://reviews.freebsd.org/D16779


# 24a656c2 07-May-2018 Kyle Evans <kevans@FreeBSD.org>

bsdgrep: Allow "-" to be passed to -f to mean "standard input"

A version of this patch was originally sent to me by se@, matching behavior
from newer versions of GNU grep.

While there have been some differences of opinion on whether stdin should be
closed or not after depleting it in process of -f, I've opted to leave stdin
open and just let the later matching stuff fail and result in a no-match.
I'm not married to the current behavior- it was generally chosen since we
are adopting this in particular from GNU grep, and I would like to stay
consistent without a strong argument to the contrary. The current behavior
isn't technically wrong, it's just fairly unfriendly to the developer-user
of grep that may not realize their usage is trivially invalid.

Submitted by: se


# bd509bdb 25-Apr-2018 Kyle Evans <kevans@FreeBSD.org>

bsdgrep(1): Sneak in some man page updates

- The --exclude{,-dir} and --include{,-dir} directives now match GNU
behavior of being processed in order and latest matching directive wins

- --label was previously not really documented, and -L and -l did not
indicate that --label applied to them

- The flags listed as being extensions to POSIX spec were not updated with
the removal of compression-related flags

MFC after: 1 week


# 4a5b4207 25-Apr-2018 Baptiste Daroussin <bapt@FreeBSD.org>

Remove compression support from bsdgrep

Compression support is now handled by an external script, remove it from the
bsdgrep(1) utility.
This removes the support for -Z -J -X and -M

Note: that it matches the changes in newer GNU grep

Reviewed by: kevans
Approved by: kevans
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D15197


# 5ee1ea02 17-Apr-2017 Ed Maste <emaste@FreeBSD.org>

bsdgrep: add -z/--null-data support

-z treats input and output data as sequences of lines terminated by a
zero byte instead of a newline. This brings it more in line with GNU grep
and brings us closer to passing the current tests with BSD grep.

Submitted by: Kyle Evans <kevans91 at ksu.edu>
Reviewed by: cem
Relnotes: Yes
Differential Revision: https://reviews.freebsd.org/D10101


# bf10f246 03-Apr-2017 Conrad Meyer <cem@FreeBSD.org>

bsdgrep(1): create rgrep link

Create a convenience rgrep link for bsdgrep(1) that observes 'grep -r'
behavior.

A follow-up to r316473.

Submitted by: Kyle Evans <kevans91 at ksu.edu>
Reviewed by: emaste (earlier version), cem
Differential Revision: https://reviews.freebsd.org/D10109


# 6b91f517 19-Feb-2017 Ed Maste <emaste@FreeBSD.org>

bsdgrep: document ignored option -u

MSDOS and Windows GNU grep uses -u to mean "print byte offsets as if
running on an UNIX system." The option has no effect on systems that
do not use CRLF line endings.

PR: 171200
Submitted by: deeptech71@gmail.com, Anders Jensen-Waud
MFC after: 1 month


# 7e700c30 08-Feb-2014 Joel Dahl <joel@FreeBSD.org>

mdoc: minor paragraph fixes.


# b66a823b 07-Apr-2011 Gabor Kovesdan <gabor@FreeBSD.org>

- Adjust a comment to actual behaviour
- Makefile nit
- Add more CVS/SVN keywords to make it easier to track changes from NetBSD
in case they add further improvements

Approved by: delphij (mentor)
Obtained from: The NetBSD Project


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# a4f5b3df 30-Jul-2010 Joel Dahl <joel@FreeBSD.org>

Fix spelling.


# 55e44f51 28-Jul-2010 Gabor Kovesdan <gabor@FreeBSD.org>

- Use the traditional behaviour for filename and directory name inclusion
and exclusion patterns [1]
- Some improvements on the exiting code, like replacing memcpy with
strlcpy/strcpy

Approved by: delphij (mentor)
Pointed out by: bf [1], des [1]


# e9a67923 23-Jul-2010 Gabor Kovesdan <gabor@FreeBSD.org>

- Add Russian catalog [1]
- Fix two minor nits in manpage [2]
- style.Makefile(5)

Submitted by: pluknet <pluknet at gmail.com> [1],
Alex Kozlov <spam@rm-rf.kiev.ua> [2]
Reviewed by: delphij


# 4dc88ebe 22-Jul-2010 Gabor Kovesdan <gabor@FreeBSD.org>

Add BSD grep to the base system and make it our default grep.

Deliverables: Small and clean code (1,4 KSLOC vs GNU's 8,5 KSLOC),
lower memory usage than GNU grep, GNU compatibility,
BSD license.

TODO: Performance is somewhat behind GNU grep but it is only
significant for bigger searches. The reason is complex, the
most important factor is that GNU grep uses lots of
optimizations to improve the speed of the regex library.
First, we need a modern regex library (practically by adopting
TRE), add support for GNU-style non-standard regexes and then
reevalute the performance issues and look for bottlenecks. In
the meantime, for those, who need better performance, it is
possible to build GNU grep by setting WITH_GNU_GREP.

Approved by: delphij (mentor)
Obtained from: OpenBSD (http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/grep/),
freegrep (http://github.com/howardjp/freegrep)
Sponsored by: Google SoC 2008
Portbuild tests run by: kris, pav, erwin
Acknowledgements to: fjoe (as SoC 2008 mentor),
everyone who helped in reviewing and testing