build: update gnulib to latest; and update bootstrap
[grep.git] / NEWS
blob2dfa23cebaeda182e670d9f48fa11a778b58669f
1 GNU grep NEWS                                    -*- outline -*-
3 * Noteworthy changes in release ?.? (????-??-??) [?]
5 ** Bug fixes
7   Searching a directory with at least 100,000 entries no longer fails
8   with "Operation not supported" and exit status 2. Now, this prints 1
9   and no diagnostic, as expected:
10     $ mkdir t && cd t && seq 100000|xargs touch && grep -r x .; echo $?
11     1
12   [bug introduced in grep 3.11]
14   -mN where 1 < N no longer mistakenly lseeks to end of input merely
15   because standard output is /dev/null.
17 ** Changes in behavior
19   On Windows platforms and on AIX in 32-bit mode, grep now supports
20   Unicode characters outside the Basic Multilingual Plane.
23 * Noteworthy changes in release 3.11 (2023-05-13) [stable]
25 ** Bug fixes
27   With -P, patterns like [\d] now work again.  Fixing this has caused
28   grep to revert to the behavior of grep 3.8, in that patterns like \w
29   and \b go back to using ASCII rather than Unicode interpretations.
30   However, future versions of GNU grep and/or PCRE2 are likely to fix
31   this and change the behavior of \w and \b back to Unicode again,
32   without breaking [\d] as 3.10 did.
33   [bug introduced in grep 3.10]
35   grep no longer fails on files dated after the year 2038,
36   when running on 32-bit x86 and ARM hosts using glibc 2.34+.
37   [bug introduced in grep 3.9]
39   grep -P no longer fails to match patterns using negated classes
40   like \D or \W when linked with PCRE2 10.34 or newer.
41   [bug introduced in grep 3.8]
44 ** Changes in behavior
46   grep --version now prints a line describing the version of PCRE2 it uses.
47   For example, it prints this when built with the very latest from git:
48     grep -P uses PCRE2 10.43-DEV 2023-04-14
49   or this with what's currently available in Fedora 37:
50     grep -P uses PCRE2 10.40 2022-04-14
52   previous versions of grep wouldn't respect the user provided settings for
53   PCRE_CFLAGS and PCRE_LIBS when building if a libpcre2-8 pkg-config module
54   was found.
57 * Noteworthy changes in release 3.10 (2023-03-22) [stable]
59 ** Bug fixes
61   With -P, \d now matches only ASCII digits, regardless of PCRE
62   options/modes. The changes in grep-3.9 to make \b and \w work
63   properly had the undesirable side effect of making \d also match
64   e.g., the Arabic digits: ٠١٢٣٤٥٦٧٨٩.  With grep-3.9, -P '\d+'
65   would match that ten-digit (20-byte) string. Now, to match such
66   a digit, you would use \p{Nd}. Similarly, \D is now mapped to [^0-9].
67   [bug introduced in grep 3.9]
70 * Noteworthy changes in release 3.9 (2023-03-05) [stable]
72 ** Bug fixes
74   With -P, some non-ASCII UTF8 characters were not recognized as
75   word-constituent due to our omission of the PCRE2_UCP flag. E.g.,
76   given f(){ echo Perú|LC_ALL=en_US.UTF-8 grep -Po "$1"; } and
77   this command, echo $(f 'r\w'):$(f '.\b'), before it would print ":r".
78   After the fix, it prints the correct results: "rú:ú".
80   When given multiple patterns the last of which has a back-reference,
81   grep no longer sometimes mistakenly matches lines in some cases.
82   [Bug#36148#13 introduced in grep 3.4]
85 * Noteworthy changes in release 3.8 (2022-09-02) [stable]
87 ** Changes in behavior
89   The -P option is now based on PCRE2 instead of the older PCRE,
90   thanks to code contributed by Carlo Arenas.
92   The egrep and fgrep commands, which have been deprecated since
93   release 2.5.3 (2007), now warn that they are obsolescent and should
94   be replaced by grep -E and grep -F.
96   The confusing GREP_COLOR environment variable is now obsolescent.
97   Instead of GREP_COLOR='xxx', use GREP_COLORS='mt=xxx'.  grep now
98   warns if GREP_COLOR is used and is not overridden by GREP_COLORS.
99   Also, grep now treats GREP_COLOR like GREP_COLORS by silently
100   ignoring it if it attempts to inject ANSI terminal escapes.
102   Regular expressions with stray backslashes now cause warnings, as
103   their unspecified behavior can lead to unexpected results.
104   For example, '\a' and 'a' are not always equivalent
105   <https://bugs.gnu.org/39678>.  Similarly, regular expressions or
106   subexpressions that start with a repetition operator now also cause
107   warnings due to their unspecified behavior; for example, *a(+b|{1}c)
108   now has three reasons to warn.  The warnings are intended as a
109   transition aid; they are likely to be errors in future releases.
111   Regular expressions like [:space:] are now errors even if
112   POSIXLY_CORRECT is set, since POSIX now allows the GNU behavior.
114 ** Bug fixes
116   In locales using UTF-8 encoding, the regular expression '.' no
117   longer sometimes fails to match Unicode characters U+D400 through
118   U+D7FF (some Hangul Syllables, and Hangul Jamo Extended-B) and
119   Unicode characters U+108000 through U+10FFFF (half of Supplemental
120   Private Use Area plane B).
121   [bug introduced in grep 3.4]
123   The -s option no longer suppresses "binary file matches" messages.
124   [Bug#51860 introduced in grep 3.5]
126 ** Documentation improvements
128   The manual now covers unspecified behavior in patterns like \x, (+),
129   and range expressions outside the POSIX locale.
132 * Noteworthy changes in release 3.7 (2021-08-14) [stable]
134 ** Changes in behavior
136   Use of the --unix-byte-offsets (-u) option now evokes a warning.
137   Since 3.1, this Windows-only option has had no effect.
139 ** Bug fixes
141   Preprocessing N patterns would take at least O(N^2) time when too many
142   patterns hashed to too few buckets. This now takes seconds, not days:
143   : | grep -Ff <(seq 6400000 | tr 0-9 A-J)
144   [Bug#44754 introduced in grep 3.5]
147 * Noteworthy changes in release 3.6 (2020-11-08) [stable]
149 ** Changes in behavior
151   The GREP_OPTIONS environment variable no longer affects grep's behavior.
152   The variable was declared obsolescent in grep 2.21 (2014), and since
153   then any use had caused grep to issue a diagnostic.
155 ** Bug fixes
157   grep's DFA matcher performed an invalid regex transformation
158   that would convert an ERE like a+a+a+ to a+a+, which would make
159   grep a+a+a+ mistakenly match "aa".
160   [Bug#44351 introduced in grep 3.2]
162   grep -P now reports the troublesome input filename upon PCRE execution
163   failure.  Before, searching many files for something rare might fail with
164   just "exceeded PCRE's backtracking limit".  Now, it also reports which file
165   triggered the failure.
168 * Noteworthy changes in release 3.5 (2020-09-27) [stable]
170 ** Changes in behavior
172   The message that a binary file matches is now sent to standard error
173   and the message has been reworded from "Binary file FOO matches" to
174   "grep: FOO: binary file matches", to avoid confusion with ordinary
175   output or when file names contain spaces and the like, and to be
176   more consistent with other diagnostics.  For example, commands
177   like 'grep PATTERN FILE | wc' no longer add 1 to the count of
178   matching text lines due to the presence of the message.  Like other
179   stderr messages, the message is now omitted if the --no-messages
180   (-s) option is given.
182   Two other stderr messages now use the typical form too.  They are
183   now "grep: FOO: warning: recursive directory loop" and "grep: FOO:
184   input file is also the output".
186   The --files-without-match (-L) option has reverted to its behavior
187   in grep 3.1 and earlier.  That is, grep -L again succeeds when a
188   line is selected, not when a file is listed.  The behavior in grep
189   3.2 through 3.4 was causing compatibility problems.
191 ** Bug fixes
193   grep -I no longer issues a spurious "Binary file FOO matches" line.
194   [Bug#33552 introduced in grep 2.23]
196   In UTF-8 locales, grep -w no longer ignores a multibyte word
197   constituent just before what would otherwise be a word match.
198   [Bug#43225 introduced in grep 2.28]
200   grep -i no longer mishandles ASCII characters that match multibyte
201   characters.  For example, 'LC_ALL=tr_TR.utf8 grep -i i' no longer
202   dumps core merely because 'i' matches 'İ' (U+0130 LATIN CAPITAL
203   LETTER I WITH DOT ABOVE) in Turkish when ignoring case.
204   [Bug#43577 introduced partly in grep 2.28 and partly in grep 3.4]
206   A performance regression with -E and many patterns has been mostly fixed.
207   "Mostly" as there is a performance tradeoff between Bug#22357 and Bug#40634.
208   [Bug#40634 introduced in grep 2.28]
210   A performance regression with many duplicate patterns has been fixed.
211   [Bug#43040 introduced in grep 3.4]
213   An N^2 RSS performance regression with many patterns has been fixed
214   in common cases (no backref, and no use of -o or --color).
215   With only 80,000 lines of /usr/share/dict/linux.words, the following
216   would use 100GB of RSS and take 3 minutes. With the fix, it used less
217   than 400MB and took less than one second:
218     head -80000 /usr/share/dict/linux.words > w; grep -vf w w
219   [Bug#43527 introduced in grep 3.4]
221 ** Build-related
223   "make dist" builds .tar.gz files again, as they are still used in
224   some barebones builds.
227 * Noteworthy changes in release 3.4 (2020-01-02) [stable]
229 ** New features
231   The new --no-ignore-case option causes grep to observe case
232   distinctions, overriding any previous -i (--ignore-case) option.
234 ** Bug fixes
236   '.' no longer matches some invalid byte sequences in UTF-8 locales.
237   [bug introduced in grep 2.7]
239   grep -Fw can no longer false match in non-UTF-8 multibyte locales
240   For example, this command would erroneously print its input line:
241     echo ab | LC_CTYPE=ja_JP.eucjp grep -Fw b
242   [Bug#38223 introduced in grep 2.28]
244   The exit status of 'grep -L' is no longer incorrect when standard
245   output is /dev/null.
246   [Bug#37716 introduced in grep 3.2]
248   A performance bug has been fixed when grep is given many patterns,
249   each with no back-reference.
250   [Bug#33249 introduced in grep 2.5]
252   A performance bug has been fixed for patterns like '01.2' that
253   cause grep to reorder tokens internally.
254   [Bug#34951 introduced in grep 3.2]
256 ** Build-related
258   The build procedure no longer relies on any already-built src/grep
259   that might be absent or broken.  Instead, it uses the system 'grep'
260   to bootstrap, and uses src/grep only to test the build.  On Solaris
261   /usr/bin/grep is broken, but you can install GNU or XPG4 'grep' from
262   the standard Solaris distribution before building GNU Grep yourself.
263   [bug introduced in grep 2.8]
266 * Noteworthy changes in release 3.3 (2018-12-20) [stable]
268 ** Bug fixes
270   Some uses of \b in the C locale and with the DFA matcher would fail, e.g.,
271   the following would print nothing (it should print the input line):
272     echo 123-x|LC_ALL=C grep '.\bx'
273   Using a multibyte locale, using certain regexp constructs (some ranges,
274   back-references), or forcing use of the PCRE matcher via --perl-regexp (-P)
275   would avoid the bug.
276   [bug introduced in grep 3.2]
279 * Noteworthy changes in release 3.2 (2018-12-20) [stable]
281 ** Changes in behavior
283   The --files-without-match (-L) option now causes grep to succeed
284   when a file is listed, instead of when a line is selected.  This
285   resembles what git-grep does.
287 ** Bug fixes
289   The --recursive (-r) option no longer fails on MS-Windows.
290   [bug introduced in grep 2.11]
292 ** Improvements
294   An over-30x performance improvement when many 'or'd expressions
295   share a common prefix, thanks to improvements in gnulib's dfa.c,
296   by Norihiro Tanaka.  See gnulib commits v0.1-2110-ge648401be,
297   v0.1-2111-g4299106ce, v0.1-2117-g617a60974
299   An additional 3-23% speed-up when searching large files, via
300   increased initial buffer size.
302   grep now diagnoses stack overflow.  Before grep-2.6, the included
303   regexp code would detect it.  Since 2.6, grep defaulted to using
304   glibc's regexp, which lost that capability.
307 * Noteworthy changes in release 3.1 (2017-07-02) [stable]
309 ** Improvements
311   grep '[0-9]' is now just as fast as grep '[[:digit:]]' when run
312   in a multi-byte locale.  Before, it was several times slower.
314 ** Changes in behavior
316   Context no longer excludes selected lines omitted because of -m.
317   For example, 'grep "^" -m1 -A1' now outputs the first two input
318   lines, not just the first line.  This fixes a glitch that has been
319   present since -m was added in grep 2.5.
321   The following changes affect only MS-Windows platforms.  First, the
322   --binary (-U) option now governs whether binary I/O is used, instead
323   of a heuristic that was sometimes incorrect.  Second, the
324   --unix-byte-offsets (-u) option now has no effect on MS-Windows too.
327 * Noteworthy changes in release 3.0 (2017-02-09) [stable]
329 ** Bug fixes
331   grep without -F no longer goes awry when given two or more patterns
332   that contain no special characters other than '\' and also contain a
333   subpattern like '\.' that escapes a character to make it ordinary.
334   [bug introduced in grep 2.28]
336   grep no longer fails to build on PCRE versions before 8.20.
337   [bug introduced in grep 2.28]
340 * Noteworthy changes in release 2.28 (2017-02-06) [stable]
342 ** Bug fixes
344   When grep -Fo finds matches of differing length, it could
345   mistakenly print a shorter one.  Now it prints a longest one.
346   [bug introduced in grep-2.26]
348   When standard output is /dev/null, grep no longer fails when
349   standard input is a file in the Linux /proc file system, or when
350   standard input is a pipe and standard output is in append mode.
351   [bugs introduced in grep-2.27]
353   Fix performance regression with multiple patterns, e.g., for -Fi in
354   a multi-byte locale, or for -Fw in a single-byte locale.
355   [bugs introduced in grep-2.19, grep-2.22 and grep-2.26]
357 ** Improvements
359   Improve performance for -E or -G pattern lists that are easily
360   converted to -F format.
363 * Noteworthy changes in release 2.27 (2016-12-06) [stable]
365 ** Bug fixes
367   grep no longer reports a false match in a multibyte, non-UTF8 locale
368   like zh_CN.gb18030, with a regular expression like ".*7" that just
369   happens to match the 4-byte representation of gb18030's \uC9, the
370   final byte of which is the digit "7".
371   [bug introduced in grep-2.19]
373   Unless an early-exit option like -q, -l, -L, -m, or -f /dev/null is
374   specified, grep now reads all of a non-seekable standard input,
375   even if this cannot affect grep's output or exit status.  This works
376   better with nonportable scripts that run "PROGRAM | grep PATTERN
377   >/dev/null" where PROGRAM dies when writing into a broken pipe.
378   [bug introduced in grep-2.26]
380   grep no longer mishandles ranges in nontrivial unibyte locales.
381   [bug introduced in grep-2.26]
383   grep -P no longer attempts multiline matches.  This works more
384   intuitively with unusual patterns, and means that grep -Pz no longer
385   rejects patterns containing ^ and $ and works when combined with -x.
386   [bugs introduced in grep-2.23] A downside is that grep -P is now
387   significantly slower, albeit typically still faster than pcregrep.
389   grep -m0 -L PAT FILE now outputs "FILE".  [bug introduced in grep-2.5]
391   To output ':' and tab-align the following character C, grep -T no
392   longer outputs tab-backspace-':'-C, an approach that has problems if
393   run inside an Emacs shell window.  [bug introduced in grep-2.5.2]
395   grep -T now uses worst-case widths of line numbers and byte offsets
396   instead of guessing widths that might not work with larger files.
397   [bug introduced in grep-2.5.2]
399   grep's use of getprogname no longer causes a build failure on HP-UX.
401 ** Improvements
403   grep no longer reads the input in a few more cases when it is easy
404   to see that matching cannot succeed, e.g., 'grep -f /dev/null'.
407 * Noteworthy changes in release 2.26 (2016-10-02) [stable]
409 ** Bug fixes
411   Grep no longer omits output merely because it follows an output line
412   suppressed due to encoding errors.  [bug introduced in grep-2.21]
414   In the Shift_JIS locale, grep no longer mistakenly matches in the
415   middle of a multibyte character. [bug present since "the beginning"]
417 ** Improvements
419   grep can be much faster now when standard output is /dev/null.
421   grep -F is now typically much faster when many patterns are given,
422   as it now uses the Aho-Corasick algorithm instead of the
423   Commentz-Walter algorithm in that case.
425   grep -iF is typically much faster in a multibyte locale, if the
426   pattern and its case counterparts contain only single byte characters.
428   grep with complicated expressions (e.g., back-references) and without
429   -i now uses the regex fastmap for better performance.
431   In multibyte locales, grep now handles leading "." in patterns more
432   efficiently.
434   grep now prints a "FILENAME:LINENO: " prefix when diagnosing an
435   invalid regular expression that was read from an '-f'-specified file.
438 * Noteworthy changes in release 2.25 (2016-04-21) [stable]
440 ** Bug fixes
442   In the C or POSIX locale, grep now treats all bytes as valid
443   characters even if the C runtime library says otherwise.  The
444   revised behavior is more compatible with the original intent of
445   POSIX, and the next release of POSIX will likely make this official.
446   [bug introduced in grep-2.23]
448   grep -Pz no longer mistakenly diagnoses patterns like [^a] that use
449   negated character classes. [bug introduced in grep-2.24]
451   grep -oz now uses null bytes, not newlines, to terminate output lines.
452   [bug introduced in grep-2.5]
454 ** Improvements
456   grep now outputs details more consistently when reporting a write error.
457   E.g., "grep: write error: No space left on device" rather than just
458   "grep: write error".
461 * Noteworthy changes in release 2.24 (2016-03-10) [stable]
463 ** Bug fixes
465   grep -z would match strings it should not.  To trigger the bug, you'd
466   have to use a regular expression including an anchor (^ or $) and a
467   feature like a range or a back-reference, causing grep to forego its DFA
468   matcher and resort to using re_search.  With a multibyte locale, that
469   matcher could mistakenly match a string containing a newline.
470   For example, this command:
471     printf 'a\nb\0' | LC_ALL=en_US.utf-8 grep -z '^[a-b]*b'
472   would mistakenly match and print all four input bytes.  After the fix,
473   there is no match, as expected.
474   [bug introduced in grep-2.7]
476   grep -Pz now diagnoses attempts to use patterns containing ^ and $,
477   instead of mishandling these patterns.  This problem seems to be
478   inherent to the PCRE API; removing this limitation is on PCRE's
479   maint/README wish list.  Patterns can continue to match literal ^
480   and $ by escaping them with \ (now needed even inside [...]).
481   [bug introduced in grep-2.5]
484 * Noteworthy changes in release 2.23 (2016-02-04) [stable]
486 ** Bug fixes
488   Binary files are now less likely to generate diagnostics and more
489   likely to yield text matches.  grep now reports "Binary file FOO
490   matches" and suppresses further output instead of outputting a line
491   containing an encoding error; hence grep can now report matching text
492   before a later binary match.  Formerly, grep reported FOO to be
493   binary when it found an encoding error in FOO before generating
494   output for FOO, which meant it never reported both matching text and
495   matching binary data; this was less useful for searching text
496   containing encoding errors in non-matching lines.
497   [bug introduced in grep-2.21]
499   grep -c no longer stops counting when finding binary data.
500   [bug introduced in grep-2.21]
502   grep no longer outputs encoding errors in unibyte locales.
503   For example, if the byte '\x81' is not a valid character in a
504   unibyte locale, grep treats the byte as binary data.
505   [bug introduced in grep-2.21]
507   grep -oP is no longer susceptible to an infinite loop when processing
508   invalid UTF8 just before a match.
509   [bug introduced in grep-2.22]
511   --exclude and related options are now matched against trailing
512   parts of command-line arguments, not against the entire arguments.
513   This partly reverts the --exclude-related change in 2.22.
514   [bug introduced in grep-2.22]
516   --line-buffer is no longer ineffective when combined with -l.
517   [bug introduced in grep-2.5]
519   -xw is now equivalent to -x more consistently, with -P and with backrefs.
520   [bug only partially fixed in grep-2.19]
523 * Noteworthy changes in release 2.22 (2015-11-01) [stable]
525 ** Improvements
527   Performance has improved for patterns containing very long strings,
528   reducing preprocessing time for an N-byte regexp from O(N^2) to
529   only slightly superlinear for most patterns.  Before, a command like
530   the following would take over a minute, but now, it takes less than
531   a second:
532   : | grep -f <(seq -s '' 99999)
534   When building grep, 'configure' now uses PCRE's pkg-config module for
535   configuration information, rather than attempting to guess it by hand.
537 ** Bug fixes
539   A DFA matcher bug made this command mistakenly print its input line:
540     echo axb | grep -E '^x|x$'
541   Likewise for this equivalent command:
542     echo axb | grep -e '^x' -e 'x$'
543   [bug introduced in grep-2.19 ]
545   grep no longer reads from uninitialized memory or from beyond the end
546   of the heap-allocated input buffer.  This fix addressed CVE-2015-1345.
547   [bug introduced in grep-2.19 ]
549   With -z, '.' and '[^x]' in a pattern now consistently match newline.
550   Previously, they sometimes matched newline, and sometimes did not.
551   [bug introduced in grep-2.4]
553   When the JIT stack is exhausted, grep -P now grows the stack rather
554   than reporting an internal PCRE error.
556   'grep -D skip PATTERN FILE' no longer hangs if FILE is a fifo.
557   [bug introduced in grep-2.12]
559   --exclude and related options are now matched against entire
560   command-line arguments, not against command-line components.
561   [bug introduced in grep-2.6]
563   Fix performance degradation of grep -Fw in unibyte locales.
564   [bug introduced in grep-2.19 ]
567 * Noteworthy changes in release 2.21 (2014-11-23) [stable]
569 ** Improvements
571   Performance has been greatly improved for searching files containing
572   holes, on platforms where lseek's SEEK_DATA flag works efficiently.
574   Performance has improved for rejecting data that cannot match even
575   the first part of a nontrivial pattern.
577   Performance has improved for very long strings in patterns.
579   If a file contains data improperly encoded for the current locale,
580   and this is discovered before any of the file's contents are output,
581   grep now treats the file as binary.
583   grep -P no longer reports an error and exits when given invalid UTF-8 data.
584   Instead, it considers the data to be non-matching.
586 ** Bug fixes
588   grep no longer mishandles patterns that contain \w or \W in multibyte
589   locales.
591   grep would fail to count newlines internally when operating in non-UTF8
592   multibyte locales, leading it to print potentially many lines that did
593   not match.  E.g., the command, "seq 10 | env LC_ALL=zh_CN src/grep -n .."
594   would print this:
595   1:1
596   2
597   3
598   4
599   5
600   6
601   7
602   8
603   9
604   10
605   implying that the match, "10" was on line 1.
606   [bug introduced in grep-2.19]
608   grep -F -x -o no longer prints an extra newline for each match.
609   [bug introduced in grep-2.19]
611   grep in a non-UTF8 multibyte locale could mistakenly match in the middle
612   of a multibyte character when using a '^'-anchored alternate in a pattern,
613   leading it to print non-matching lines.  [bug present since "the beginning"]
615   grep -F Y no longer fails to match in non-UTF8 multibyte locales like
616   Shift-JIS, when the input contains a 2-byte character, XY, followed by
617   the single-byte search pattern, Y.  grep would find the first, middle-
618   of-multibyte matching "Y", and then mistakenly advance an internal
619   pointer one byte too far, skipping over the target "Y" just after that.
620   [bug introduced in grep-2.19]
622   grep -E rejected unmatched ')', instead of treating it like '\)'.
623   [bug present since "the beginning"]
625   On NetBSD, grep -r no longer reports "Inappropriate file type or format"
626   when refusing to follow a symbolic link.
627   [bug introduced in grep-2.12]
629 ** Changes in behavior
631   The GREP_OPTIONS environment variable is now obsolescent, and grep
632   now warns if it is used.  Please use an alias or script instead.
634   In locales with multibyte character encodings other than UTF-8,
635   grep -P now reports an error and exits instead of misbehaving.
637   When searching binary data, grep now may treat non-text bytes as
638   line terminators.  This can boost performance significantly.
640   grep -z no longer automatically treats the byte '\200' as binary data.
642 * Noteworthy changes in release 2.20 (2014-06-03) [stable]
644 ** Bug fixes
646   grep --max-count=N FILE would no longer stop reading after the Nth match.
647   I.e., while grep would still print the correct output, it would continue
648   reading until end of input, and hence, potentially forever.
649   [bug introduced in grep-2.19]
651   A command like echo aa|grep -E 'a(b$|c$)' would mistakenly
652   report the input as a matched line.
653   [bug introduced in grep-2.19]
655 ** Changes in behavior
657   grep --exclude-dir='FOO/' now excludes the directory FOO.
658   Previously, the trailing slash meant the option was ineffective.
661 * Noteworthy changes in release 2.19 (2014-05-22) [stable]
663 ** Improvements
665   Performance has improved, typically by 10% and in some cases by a
666   factor of 200.  However, performance of grep -P in UTF-8 locales has
667   gotten worse as part of the fix for the crashes mentioned below.
669 ** Bug fixes
671   grep no longer mishandles patterns like [a-[.z.]], and no longer
672   mishandles patterns like [^a] in locales that have multicharacter
673   collating sequences so that [^a] can match a string of two characters.
675   grep no longer mishandles an empty pattern at the end of a pattern list.
676   [bug introduced in grep-2.5]
678   grep -C NUM now outputs separators consistently even when NUM is zero,
679   and similarly for grep -A NUM and grep -B NUM.
680   [bug present since "the beginning"]
682   grep -f no longer mishandles patterns containing NUL bytes.
683   [bug introduced in grep-2.11]
685   Plain grep, grep -E, and grep -F now treat encoding errors in patterns
686   the same way the GNU regular expression matcher treats them, with respect
687   to whether the errors can match parts of multibyte characters in data.
688   [bug present since "the beginning"]
690   grep -w no longer mishandles a potential match adjacent to a letter that
691   takes up two or more bytes in a multibyte encoding.
692   Similarly, the patterns '\<', '\>', '\b', and '\B' no longer
693   mishandle word-boundary matches in multibyte locales.
694   [bug present since "the beginning"]
696   grep -P now reports an error and exits when given invalid UTF-8 data.
697   Previously it was unreliable, and sometimes crashed or looped.
698   [bug introduced in grep-2.16]
700   grep -P now works with -w and -x and back-references. Before,
701   echo aa|grep -Pw '(.)\1' would fail to match, yet
702   echo aa|grep -Pw '(.)\2' would match.
704   grep -Pw now works like grep -w in that the matched string has to be
705   preceded and followed by non-word components or the beginning and end
706   of the line (as opposed to word boundaries before).  Before, this
707   echo a@@a| grep -Pw @@ would match, yet this
708   echo a@@a| grep -w @@ would not.  Now, they both fail to match,
709   per the documentation on how grep's -w works.
711   grep -i no longer mishandles patterns containing titlecase characters.
712   For example, in a locale containing the titlecase character
713   'Lj' (U+01C8 LATIN CAPITAL LETTER L WITH SMALL LETTER J),
714   'grep -i Lj' now matches both 'LJ' (U+01C7 LATIN CAPITAL LETTER LJ)
715   and 'lj' (U+01C9 LATIN SMALL LETTER LJ).
718 * Noteworthy changes in release 2.18 (2014-02-20) [stable]
720 ** Bug fixes
722   grep no longer mishandles patterns like [^^-~] in unibyte locales.
723   [bug introduced in grep-2.8]
725   grep -i in a multibyte, non-UTF8 locale could be up to 200 times slower
726   than in 2.16.  [bug introduced in grep-2.17]
729 * Noteworthy changes in release 2.17 (2014-02-17) [stable]
731 ** Improvements
733   grep -i in a multibyte locale is now typically 10 times faster
734   for patterns that do not contain \ or [.
736   grep (without -i) in a multibyte locale is now up to 7 times faster
737   when processing many matched lines.
739 ** Maintenance
741   grep's --mmap option was disabled in March of 2010, and began to
742   elicit a warning in January of 2012.  Now it is completely gone.
745 * Noteworthy changes in release 2.16 (2014-01-01) [stable]
747 ** Bug fixes
749   Fix gnulib-provided maint.mk so that the release procedure described
750   in README-release actually does what we want.  Before that fix, that
751   procedure resulted in a grep-2.15 tarball that would lead to a grep
752   binary whose --version-reported version number was 2.14.51...
754   The fix to make \s and \S work with multi-byte white space broke
755   the use of each shortcut whenever followed by a repetition operator.
756   For example, \s*, \s+, \s? and \s{3} would all malfunction in a
757   multi-byte locale.  [bug introduced in grep-2.15]
759   The fix to make grep -P work better with UTF-8 made it possible for
760   grep to evoke a larger set of PCRE errors, some of which could trigger
761   an abort.  E.g., this would abort:
762     printf '\x82'|LC_ALL=en_US.UTF-8 grep -P y
763   Now grep handles arbitrary PCRE errors.  [bug introduced in grep-2.15]
765   Handle very long lines (2GiB and longer) on systems with a deficient
766   read system call.
768 * Noteworthy changes in release 2.15 (2013-10-26) [stable]
770 ** Bug fixes
772   grep's \s and \S failed to work with multi-byte white space characters.
773   For example, \s would fail to match a non-breaking space, and this
774   would print nothing: printf '\xc2\xa0' | LC_ALL=en_US.UTF-8 grep '\s'
775   A related bug is that \S would mistakenly match an invalid multibyte
776   character.  For example, the following would match:
777     printf '\x82\n' | LC_ALL=en_US.UTF-8 grep '^\S$'
778   [bug present since grep-2.6]
780   grep -i would segfault on systems using UTF-16-based wchar_t (Cygwin)
781   when converting an input string containing certain 4-byte UTF-8
782   sequences to lower case.  The conversions to wchar_t and back to
783   a UTF-8 multibyte string did not take surrogate pairs into account.
784   [bug present since at least grep-2.6, though the segfault is new with 2.13]
786   grep -E would segfault when given a regexp like '([^.]*[M]){1,2}'
787   for any multibyte character M. [bug introduced in grep-2.6, which would
788   segfault, but 2.7 and 2.8 had no problem, and 2.9 through 2.14 would
789   hit a failed assertion. ]
791   grep -F would get stuck in an infinite loop when given a search string
792   that is an invalid byte sequence in the current locale and that matches
793   the bytes of the input twice on a line.  Now grep fails with exit status 1.
795   grep -P could misbehave.  While multi-byte mode is only supported by PCRE
796   with UTF-8 locales, grep did not activate it.  This would cause failures
797   to match multibyte characters against some regular expressions, especially
798   those including the '.' or '\p' metacharacters.
800 ** New features
802   grep -P can now use a just-in-time compiler to greatly speed up matches,
803   This feature is transparent to the user; no flag is required to enable
804   it.  It is only available if the corresponding support in the PCRE
805   library is detected when grep is compiled.
808 * Noteworthy changes in release 2.14 (2012-08-20) [stable]
810 ** Bug fixes
812   grep -i '^$' could exit 0 (i.e., report a match) in a multi-byte locale,
813   even though there was no match, and the command generated no output.
814   E.g., seq 2 | LC_ALL=en_US.utf8 grep -il '^$' would mistakenly print
815   "(standard input)".  Related, seq 9 | LC_ALL=en_US.utf8 grep -in '^$'
816   would print "2:4:6:8:10:12:14:16" and exit 0.  Now it prints nothing
817   and exits with status of 1.  [bug introduced in grep-2.6]
819   'grep' no longer falsely reports text files as being binary on file
820   systems that compress contents or that store tiny contents in metadata.
823 * Noteworthy changes in release 2.13 (2012-07-04) [stable]
825 ** Bug fixes
827   grep -i, in a multi-byte locale, when matching a line containing a character
828   like the UTF-8 Turkish I-with-dot (U+0130) (whose lower-case representation
829   occupies fewer bytes), would print an incomplete output line.
830   Similarly, with a matched line containing a character (e.g., the Latin
831   capital I in a Turkish UTF-8 locale), where the lower-case representation
832   occupies more bytes, grep could print garbage.
833   [bug introduced in grep-2.6]
835   --include and --exclude can again be combined, and again apply to
836   the command line, e.g., "grep --include='*.[ch]' --exclude='system.h'
837   PATTERN *" again reads all *.c and *.h files except for system.h.
838   [bug introduced in grep-2.6]
840 ** New features
842   'grep' without -z now treats a sparse file as binary, if it can
843   easily determine that the file is sparse.
845 ** Dropped features
847   Bootstrapping with Makefile.boot has been broken since grep 2.6,
848   and was removed.
851 * Noteworthy changes in release 2.12 (2012-04-23) [stable]
853 ** Bug fixes
855   "echo P|grep --devices=skip P" once again prints P, as it did in 2.10
856   [bug introduced in grep-2.11]
858   grep no longer segfaults with -r --exclude-dir and no file operand.
859   I.e., ":|grep -r --exclude-dir=D PAT" would segfault.
860   [bug introduced in grep-2.11]
862   Recursive grep now uses fts for directory traversal, so it can
863   handle much-larger directories without reporting things like "File
864   name too long", and it can run much faster when dealing with large
865   directory hierarchies. [bug present since the beginning]
867   grep -E 'a{1000000000}' now reports an overflow error rather than
868   silently acting like grep -E 'a\{1000000000}'.
870   grep -E 'a{,10}' was not treated equivalently to grep -E 'a{0,10}'.
872 ** New features
874   The -R option now has a long-option alias --dereference-recursive.
876 ** Changes in behavior
878   The -r (--recursive) option now follows only command-line symlinks.
879   Also, by default -r now reads a device only if it is named on the command
880   line; this can be overridden with --devices.  -R acts as before, so
881   use -R if you prefer the old behavior of following all symlinks and
882   defaulting to reading all devices.
885 * Noteworthy changes in release 2.11 (2012-03-02) [stable]
887 ** Bug fixes
889   grep no longer dumps core on lines whose lengths do not fit in 'int'.
890   (e.g., lines longer than 2 GiB on a typical 64-bit host).
891   Instead, grep either works as expected, or reports an error.
892   An error can occur if not enough main memory is available, or if the
893   GNU C library's regular expression functions cannot handle such long lines.
894   [bug present since "the beginning"]
896   The -m, -A, -B, and -C options no longer mishandle context line
897   counts that do not fit in 'int'.  Also, grep -c's counts are now
898   limited by the type 'intmax_t' (typically less than 2**63) rather
899   than 'int' (typically less than 2**31).
901   grep no longer silently suppresses errors when reading a directory
902   as if it were a text file.  For example, "grep x ." now reports a
903   read error on most systems; formerly, it ignored the error.
904   [bug introduced in grep-2.5]
906   grep now exits with status 2 if a directory loop is found,
907   instead of possibly exiting with status 0 or 1.
908   [bug introduced in grep-2.3]
910   The -s option now suppresses certain input error diagnostics that it
911   formerly failed to suppress.  These include errors when closing the
912   input, when lseeking the input, and when the input is also the output.
913   [bug introduced in grep-2.4]
915   On POSIX systems, commands like "grep PAT < FILE >> FILE"
916   now report an error instead of looping.
917   [bug present since "the beginning"]
919   The --include, --exclude, and --exclude-dir options now handle
920   command-line arguments more consistently.  --include and --exclude
921   apply only to non-directories and --exclude-dir applies only to
922   directories.  "-" (standard input) is never excluded, since it is
923   not a file name.
924   [bug introduced in grep-2.5]
926   grep no longer rejects "grep -qr . > out", i.e., when run with -q
927   and an input file is the same as the output file, since with -q
928   grep generates no output, so there is no risk of infinite loop or
929   of an output-affecting race condition.  Thus, the use of the following
930   options also disables the input-equals-output failure:
931     --max-count=N (-m) (for N >= 2)
932     --files-with-matches (-l)
933     --files-without-match (-L)
934   [bug introduced in grep-2.10]
936   grep no longer emits an error message and quits on MS-Windows when
937   invoked with the -r option.
939   grep no longer misinterprets some alternations involving anchors
940   (^, $, \<  \>  \B, \b).  For example, grep -E "(^|\B)a" no
941   longer reports a match for the string "x a".
942   [bug present since "the beginning"]
944 ** New features
946   If no file operand is given, and a command-line -r or equivalent
947   option is given, grep now searches the working directory.  Formerly
948   grep ignored the -r and searched standard input nonrecursively.
949   An -r found in GREP_OPTIONS does not have this new effect.
951   grep now supports color highlighting of matches on MS-Windows.
953 ** Changes in behavior
955   Use of the --mmap option now elicits a warning.  It has been a no-op
956   since March of 2010.
958   grep no longer diagnoses write errors repeatedly; it exits after
959   diagnosing the first write error.  This is better behavior when
960   writing to a dangling pipe.
962   Syntax errors in GREP_COLORS are now ignored, instead of sometimes
963   eliciting warnings.  This is more consistent with programs that
964   (e.g.) ignore errors in termcap entries.
966 * Noteworthy changes in release 2.10 (2011-11-16) [stable]
968 ** Bug fixes
970   grep no longer mishandles high-bit-set pattern bytes on systems
971   where "char" is a signed type. [bug appears to affect only MS-Windows]
973   On POSIX systems, grep now rejects a command like "grep -r pattern . > out",
974   in which the output file is also one of the inputs,
975   because it can result in an "infinite" disk-filling loop.
976   [bug present since "the beginning"]
978 ** Build-related
980   "make dist" no longer builds .tar.gz files.
981   xz is portable enough and in wide-enough use that distributing
982   only .tar.xz files is enough.
985 * Noteworthy changes in release 2.9 (2011-06-21) [stable]
987 ** Bug fixes
989   grep no longer clobbers heap for an ERE like '(^| )*( |$)'
990   [bug introduced in grep-2.6]
992   grep is faster on regular expressions that match multibyte characters
993   in brackets (such as '[áéíóú]').
995   echo c|grep '[c]' would fail for any c in 0x80..0xff, with a uni-byte
996   encoding for which the byte-to-wide-char mapping is nontrivial.  For
997   example, the ISO-88591 locales are not affected, but ru_RU.KOI8-R is.
998   [bug introduced in grep-2.6]
1000   grep -P no longer aborts when PCRE's backtracking limit is exceeded
1001   Before, echo aaaaaaaaaaaaaab |grep -P '((a+)*)+$' would abort.  Now,
1002   it diagnoses the problem and exits with status 2.
1005 * Noteworthy changes in release 2.8 (2011-05-13) [stable]
1007 ** Bug fixes
1009   echo c|grep '[c]' would fail for any c in 0x80..0xff, and in many locales.
1010   E.g., printf '\xff\n'|grep "$(printf '[\xff]')" || echo FAIL
1011   would print FAIL rather than the required matching line.
1012   [bug introduced in grep-2.6]
1014   grep's interpretation of range expression is now more consistent with
1015   that of other tools.  [bug present since multi-byte character set
1016   support was introduced in 2.5.2, though the steps needed to reproduce
1017   it changed in grep-2.6]
1019   grep erroneously returned with exit status 1 on some memory allocation
1020   failure. [bug present since "the beginning"]
1023 * Noteworthy changes in release 2.7 (2010-09-16) [stable]
1025 ** Bug fixes
1027   grep --include=FILE works once again, rather than working like --exclude=FILE
1028   [bug introduced in grep-2.6]
1030   Searching with grep -Fw for an empty string would not match an
1031   empty line. [bug present since "the beginning"]
1033   X{0,0} is implemented correctly.  It used to be a synonym of X{0,1}.
1034   [bug present since "the beginning"]
1036   In multibyte locales, regular expressions including back-references
1037   no longer exhibit quadratic complexity (i.e., they are orders
1038   of magnitude faster). [bug present since multi-byte character set
1039   support was introduced in 2.5.2]
1041   In UTF-8 locales, regular expressions including "." can be orders
1042   of magnitude faster.  For example, "grep ." is now twice as fast
1043   as "grep -v ^$", instead of being immensely slower.  It remains
1044   slow in other multibyte locales. [bug present since multi-byte
1045   character set support was introduced in 2.5.2]
1047   --mmap was meant to be ignored in 2.6.x, but it was instead
1048   removed by mistake.  [bug introduced in 2.6]
1050 ** New features
1052   grep now diagnoses (and fails with exit status 2) commonly mistyped
1053   regular expression like [:space:], [:digit:], etc.  Before, those were
1054   silently interpreted as [ac:eps] and [dgit:] respectively.  Virtually
1055   all who make that class of mistake should have used [[:space:]] or
1056   [[:digit:]].  This new behavior is disabled when the POSIXLY_CORRECT
1057   environment variable is set.
1059   On systems using glibc, grep can support equivalence classes.  However,
1060   whether they actually work depends on glibc's locale definitions.
1062 * Noteworthy changes in release 2.6.3 (2010-04-02) [stable]
1064 ** Bug fixes
1066   Searching with grep -F for an empty string in a multibyte locale
1067   would hang grep. [bug introduced in 2.6.2]
1069   PCRE support is once again detected on systems with <pcre/pcre.h>
1070   [bug introduced in 2.6.2]
1073 * Noteworthy changes in release 2.6.2 (2010-03-29) [stable]
1075 ** Bug fixes
1077   grep -F no longer mistakenly reports a match when searching
1078   for an incomplete prefix of a multibyte character.
1079   [bug present since "the beginning"]
1081   grep -F no longer goes into an infinite loop when it finds a match for an
1082   incomplete (non-prefix of a) multibyte character.  [bug introduced in 2.6]
1084   Using any of the --include or --exclude* options would cause a NULL
1085   dereference.  [bugs introduced in 2.6]
1087 ** Build-related
1089   configure no longer relies on pkg-config to detect PCRE support.
1092 * Noteworthy changes in release 2.6.1 (2010-03-25) [stable]
1094 ** Bug fixes
1096   Character classes could cause a segmentation fault if they included a
1097   multibyte character.  [bug introduced in 2.6]
1099   Character ranges would not work in single-byte character sets other
1100   than C (for example, ISO-8859-1 or KOI8-R) and some multi-byte locales.
1101   For example, this should print "1", but would find no match:
1102     $ echo 1 | env -i LC_COLLATE=en_US.UTF-8 grep '[0-9]'
1103   [bug introduced in 2.6]
1105   The output of grep was incorrect for whole-word (-w) matches if the
1106   patterns included a back-reference. [bug introduced in grep-2.5.2]
1108 ** Portability
1110   Avoid a link failure on Solaris 8.
1113 * Noteworthy changes in release 2.6 (2010-03-23) [stable]
1115 ** Speed improvements
1117   grep is much faster on multibyte character sets, especially (but not
1118   limited to) UTF-8 character sets.  The speed improvement is also very
1119   pronounced with case-insensitive matches.
1121 ** Bug fixes
1123   Character classes would malfunction in multi-byte locales when using grep -i.
1124   Examples which would print nothing for LC_ALL=en_US.UTF-8 include:
1125   - for ranges, echo Z | grep -i '[a-z]'
1126   - for single characters, echo Y | grep -i '[y]'
1127   - for character types, echo Y | grep -i '[[:lower:]]'
1129   grep -i -o would fail to report some matches; grep -i --color, while not
1130   missing any line containing a match, would fail to color some matches.
1132   grep would fail to report a match in a multibyte character set other than
1133   UTF-8, if another match occurred earlier in the line but started in the
1134   middle of a multibyte character.
1136   Various bugs in grep -P, caused by expressions such as [^b] or \S matching
1137   newlines, were fixed.  grep -P also supports the special sequences \Z and
1138   \z, and can be combined with the command-line option -z to perform searches
1139   on NUL-separated records.
1141   grep would mistakenly exit with status 1 upon error, rather than 2,
1142   as it is documented to do.
1144   Using options like -1 -2 or -1 -v -2 results in two lines of
1145   context (the last value that appears on the command line) instead
1146   twelve (the concatenation of all the values).  This is consistent
1147   with the behavior of options -A/-B/-C.
1149   Two new command-line options, --group-separator=ARGUMENT and
1150   --no-group-separator, enable further customization of the output
1151   when -A, -B or -C is being used.
1153 ** Other changes
1155   egrep accepts the -E option and fgrep accepts the -F option.  If egrep
1156   and fgrep are given another of the -E/-F/-G options, they print a more
1157   meaningful error message.
1159 * Noteworthy changes in release 2.5.4 (2009-02-10) [stable]
1161   - This is a bugfix release. No new features.
1163 Version 2.5.3
1164   - The new option --exclude-dir allows to specify a directory pattern that
1165     will be excluded from recursive grep.
1166   - Numerous bug fixes
1168 Version 2.5.1
1169   - This is a bugfix release. No new features.
1171 Version 2.5
1172   - The new option --label allows to specify a different name for input
1173     from stdin. See the man or info pages for details.
1175   - The internal lib/getopt* files are no longer used on systems providing
1176     getopt functionality in their libc (e.g. glibc 2.2.x).
1177     If you need the old getopt files, use --with-included-getopt.
1179   - The new option --only-matching (-o) will print only the part of matching
1180     lines that matches the pattern. This is useful, for example, to extract
1181     IP addresses from log files.
1183   - i18n bug fixed ([A-Z0-9] wouldn't match A in locales other than C on
1184     systems using recent glibc builds
1186   - GNU grep can now be built with autoconf 2.52.
1188   - The new option --devices controls how grep handles device files. Its usage
1189     is analogous to --directories.
1191   - The new option --line-buffered fflush on everyline.  There is a noticeable
1192     slow down when forcing line buffering.
1194   - Back-references are now local to the regex.
1195     grep -e '\(a\)\1' -e '\(b\)\1'
1196     The last backref \1 in the second expression refer to \(b\)
1198   - The new option --include=PATTERN will search only matching files
1199     when recursing in directories
1201   - The new option --exclude=PATTERN will skip matching files when
1202     recursing in directories.
1204   - The new option --color will use the environment variable GREP_COLOR
1205     (default is red) to highlight the matching string.
1206     --color takes an optional argument specifying when to colorize a line:
1207       --color=always, --color=tty, --color=never
1209   - The following changes are for POSIX conformance:
1211     . The -q or --quiet or --silent option now causes grep to exit
1212       with zero status when a input line is selected, even if an error
1213       also occurs.
1215     . The -s or --no-messages option no longer affects the exit status.
1217     . Bracket regular expressions like [a-z] are now locale-dependent.
1218       For example, many locales sort characters in dictionary order,
1219       and in these locales the regular expression [a-d] is not
1220       equivalent to [abcd]; it might be equivalent to [aBbCcDd], for
1221       example.  To obtain the traditional interpretation of bracket
1222       expressions, you can use the C locale by setting the LC_ALL
1223       environment variable to the value "C".
1225   - The -C or --context option now requires an argument, partly for
1226     consistency, and partly because POSIX recommends against
1227     optional arguments.
1229   - The new -P or --perl-regexp option tells grep to interpret the pattern as
1230     a Perl regular expression.
1232   - The new option --max-count=num makes grep stop reading a file after num
1233     matching lines.
1234     New option -m; equivalent to --max-count.
1236   - Translations for bg, ca, da, nb and tr have been added.
1238 Version 2.4.2
1240   - Added more check in configure to default the grep-${version}/src/regex.c
1241     instead of the one in GNU Lib C.
1243 Version 2.4.1
1245   - If the final byte of an input file is not a newline, grep now silently
1246     supplies one.
1248   - The new option --binary-files=TYPE makes grep assume that a binary input
1249     file is of type TYPE.
1250     --binary-files='binary' (the default) outputs a 1-line summary of matches.
1251     --binary-files='without-match' assumes binary files do not match.
1252     --binary-files='text' treats binary files as text
1253         (equivalent to the -a or --text option).
1255   - New option -I; equivalent to --binary-files='without-match'.
1257 Version 2.4:
1259   - egrep is now equivalent to 'grep -E' as required by POSIX,
1260     removing a longstanding source of confusion and incompatibility.
1261     'grep' is now more forgiving about stray '{'s, for backward
1262     compatibility with traditional egrep.
1264   - The lower bound of an interval is not optional.
1265     You must use an explicit zero, e.g. 'x{0,10}' instead of 'x{,10}'.
1266     (The old documentation incorrectly claimed that it was optional.)
1268   - The --revert-match option has been renamed to --invert-match.
1270   - The --fixed-regexp option has been renamed to --fixed-strings.
1272   - New option -H or --with-filename.
1274   - New option --mmap.  By default, GNU grep now uses read instead of mmap.
1275     This is faster on some hosts, and is safer on all.
1277   - The new option -z or --null-data causes 'grep' to treat a zero byte
1278     (the ASCII NUL character) as a line terminator in input data, and
1279     to treat newlines as ordinary data.
1281   - The new option -Z or --null causes 'grep' to output a zero byte
1282     instead of the normal separator after a file name.
1284   - These two options can be used with commands like 'find -print0',
1285     'perl -0', 'sort -z', and 'xargs -0' to process arbitrary file names,
1286     even those that contain newlines.
1288   - The environment variable GREP_OPTIONS specifies default options;
1289     e.g. GREP_OPTIONS='--directories=skip' reestablishes grep 2.1's
1290     behavior of silently skipping directories.
1292   - You can specify a matcher multiple times without error, e.g.
1293     'grep -E -E' or 'fgrep -F'.  It is still an error to specify
1294     conflicting matchers.
1296   - -u and -U are now allowed on non-DOS hosts, and have no effect.
1298   - Modifications of the tests scripts to go around the "Broken Pipe"
1299     errors from bash. See Bash FAQ.
1301   - New option -r or --recursive or --directories=recurse.
1302     (This option was also in grep 2.3, but wasn't announced here.)
1304   - --without-included-regex disable, was causing bogus reports .i.e
1305     doing more harm then good.
1307 Version 2.3:
1309   - When searching a binary file FOO, grep now just reports
1310     "Binary file FOO matches" instead of outputting binary data.
1311     This is typically more useful than the old behavior,
1312     and it is also more consistent with other utilities like 'diff'.
1313     A file is considered to be binary if it contains a NUL (i.e. zero) byte.
1315     The new -a or --text option causes 'grep' to assume that all
1316     input is text.  (This option has the same meaning as with 'diff'.)
1317     Use it if you want binary data in your output.
1319   - 'grep' now searches directories just like ordinary files; it no longer
1320     silently skips directories.  This is the traditional behavior of
1321     Unix text utilities (in particular, of traditional 'grep').
1322     Hence 'grep PATTERN DIRECTORY' should report
1323     "grep: DIRECTORY: Is a directory" on hosts where the operating system
1324     does not permit programs to read directories directly, and
1325     "grep: DIRECTORY: Binary file matches" (or nothing) otherwise.
1327     The new -d ACTION or --directories=ACTION option affects directory handling.
1328     '-d skip' causes 'grep' to silently skip directories, as in grep 2.1;
1329     '-d read' (the default) causes 'grep' to read directories if possible,
1330     as in earlier versions of grep.
1332   - The MS-DOS and Microsoft Windows ports now behave identically to the
1333     GNU and Unix ports with respect to binary files and directories.
1335 Version 2.2:
1337 Bug fix release.
1339   - Status error number fix.
1340   - Skipping directories removed.
1341   - Many typos fix.
1342   - -f /dev/null fix(not to consider as an empty pattern).
1343   - Checks for wctype/wchar.
1344   - -E was using the wrong matcher fix.
1345   - bug in regex char class fix
1346   - Fixes for DJGPP
1348 Version 2.1:
1350 This is a bug fix release(see Changelog) i.e. no new features.
1352   - More compliance to GNU standard.
1353   - Long options.
1354   - Internationalization.
1355   - Use automake/autoconf.
1356   - Directory hierarchy change.
1357   - Sigvec with -e on Linux corrected.
1358   - Sigvec with -f on Linux corrected.
1359   - Sigvec with the mmap() corrected.
1360   - Bug in kwset corrected.
1361   - -q, -L and -l stop on first match.
1362   - New and improve regex.[ch] from Ulrich Drepper.
1363   - New and improve dfa.[ch] from Arnold Robbins.
1364   - Prototypes for over zealous C compiler.
1365   - Not scanning a file, if it's a directory
1366     (cause problems on Sun).
1367   - Ported to MS-DOS/MS-Windows with DJGPP tools.
1369 See Changelog for the full story and proper credits.
1371 Version 2.0:
1373 The most important user visible change is that egrep and fgrep have
1374 disappeared as separate programs into the single grep program mandated
1375 by POSIX 1003.2.  New options -G, -E, and -F have been added,
1376 selecting grep, egrep, and fgrep behavior respectively.  For
1377 compatibility with historical practice, hard links named egrep and
1378 fgrep are also provided.  See the manual page for details.
1380 In addition, the regular expression facilities described in Posix
1381 draft 11.2 are now supported, except for internationalization features
1382 related to locale-dependent collating sequence information.
1384 There is a new option, -L, which is like -l except it lists
1385 files which don't contain matches.  The reason this option was
1386 added is because '-l -v' doesn't do what you expect.
1388 Performance has been improved; the amount of improvement is platform
1389 dependent, but (for example) grep 2.0 typically runs at least 30% faster
1390 than grep 1.6 on a DECstation using the MIPS compiler.  Where possible,
1391 grep now uses mmap() for file input; on a Sun 4 running SunOS 4.1 this
1392 may cut system time by as much as half, for a total reduction in running
1393 time by nearly 50%.  On machines that don't use mmap(), the buffering
1394 code has been rewritten to choose more favorable alignments and buffer
1395 sizes for read().
1397 Portability has been substantially cleaned up, and an automatic
1398 configure script is now provided.
1400 The internals have changed in ways too numerous to mention.
1401 People brave enough to reuse the DFA matcher in other programs
1402 will now have their bravery amply "rewarded", for the interface
1403 to that file has been completely changed.  Some changes were
1404 necessary to track the evolution of the regex package, and since
1405 I was changing it anyway I decided to do a general cleanup.
1407 ========================================================================
1408 Copyright (C) 1992, 1997-2002, 2004-2025 Free Software Foundation, Inc.
1410   Copying and distribution of this file, with or without modification,
1411   are permitted in any medium without royalty provided the copyright
1412   notice and this notice are preserved.
1414 Permission is granted to copy, distribute and/or modify this document
1415 under the terms of the GNU Free Documentation License, Version 1.3 or
1416 any later version published by the Free Software Foundation; with no
1417 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
1418 Texts.  A copy of the license is included in the "GNU Free
1419 Documentation License" file as part of this distribution.