CVSROOT: /webcvs/grep Module name: grep Changes by: Jim Meyering <meyering> 14/05/23 05:40:03
Index: grep.html =================================================================== RCS file: /webcvs/grep/grep/manual/grep.html,v retrieving revision 1.17 retrieving revision 1.18 diff -u -b -r1.17 -r1.18 --- grep.html 21 Feb 2014 17:16:45 -0000 1.17 +++ grep.html 23 May 2014 05:39:56 -0000 1.18 @@ -1,8 +1,8 @@ <html lang="en"> <head> -<title>GNU Grep 2.18</title> -<meta http-equiv="Content-Type" content="text/html"> -<meta name="description" content="GNU Grep 2.18"> +<title>GNU Grep 2.19</title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<meta name="description" content="GNU Grep 2.19"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="top" href="#Top"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> @@ -33,7 +33,7 @@ --></style> </head> <body> -<h1 class="settitle">GNU Grep 2.18</h1> +<h1 class="settitle">GNU Grep 2.19</h1> <div class="contents"> <h2>Table of Contents</h2> <ul> @@ -91,11 +91,11 @@ <p><samp><span class="command">grep</span></samp> prints lines that contain a match for a pattern. - <p>This manual is for version 2.18 of GNU Grep. + <p>This manual is for version 2.19 of GNU Grep. <p>This manual is for <samp><span class="command">grep</span></samp>, a pattern matching engine. - <p>Copyright © 1999-2002, 2005, 2008-2014 Free Software Foundation, + <p>Copyright © 1999–2002, 2005, 2008–2014 Free Software Foundation, Inc. <blockquote> @@ -249,8 +249,20 @@ The empty file contains zero patterns, and therefore matches nothing. (<samp><span class="option">-f</span></samp> is specified by POSIX.) - <br><dt><samp><span class="option">-i</span></samp><dt><samp><span class="option">-y</span></samp><dt><samp><span class="option">--ignore-case</span></samp><dd><a name="index-g_t_002di-13"></a><a name="index-g_t_002dy-14"></a><a name="index-g_t_002d_002dignore_002dcase-15"></a><a name="index-case-insensitive-search-16"></a>Ignore case distinctions in both the pattern and the input files. -<samp><span class="option">-y</span></samp> is an obsolete synonym that is provided for compatibility. + <br><dt><samp><span class="option">-i</span></samp><dt><samp><span class="option">-y</span></samp><dt><samp><span class="option">--ignore-case</span></samp><dd><a name="index-g_t_002di-13"></a><a name="index-g_t_002dy-14"></a><a name="index-g_t_002d_002dignore_002dcase-15"></a><a name="index-case-insensitive-search-16"></a>Ignore case distinctions, so that characters that differ only in case +match each other. Although this is straightforward when letters +differ in case only via lowercase-uppercase pairs, the behavior is +unspecified in other situations. For example, uppercase “S” has an +unusual lowercase counterpart “Å¿” (Unicode character U+017F, LATIN +SMALL LETTER LONG S) in many locales, and it is unspecified whether +this unusual character matches “S” or “s” even though uppercasing +it yields “S”. Another example: the lowercase German letter “Ô +(U+00DF, LATIN SMALL LETTER SHARP S) is normally capitalized as the +two-character string “SS” but it does not match “SS”, and it might +not match the uppercase letter “Ẕ (U+1E9E, LATIN CAPITAL LETTER +SHARP S) even though lowercasing the latter yields the former. + + <p><samp><span class="option">-y</span></samp> is an obsolete synonym that is provided for compatibility. (<samp><span class="option">-i</span></samp> is specified by POSIX.) <br><dt><samp><span class="option">-v</span></samp><dt><samp><span class="option">--invert-match</span></samp><dd><a name="index-g_t_002dv-17"></a><a name="index-g_t_002d_002dinvert_002dmatch-18"></a><a name="index-invert-matching-19"></a><a name="index-print-non_002dmatching-lines-20"></a>Invert the sense of matching, to select non-matching lines. @@ -469,11 +481,10 @@ <br><dt><samp><span class="option">-C </span><var>num</var></samp><dt><samp><span class="option">-</span><var>num</var></samp><dt><samp><span class="option">--context=</span><var>num</var></samp><dd><a name="index-g_t_002dC-84"></a><a name="index-g_t_002d_002dcontext-85"></a><a name="index-g_t_002d_0040var_007bnum_007d-86"></a><a name="index-context-87"></a>Print <var>num</var> lines of leading and trailing output context. <br><dt><samp><span class="option">--group-separator=</span><var>string</var></samp><dd><a name="index-g_t_002d_002dgroup_002dseparator-88"></a><a name="index-group-separator-89"></a>When <samp><span class="option">-A</span></samp>, <samp><span class="option">-B</span></samp> or <samp><span class="option">-C</span></samp> are in use, -print <var>string</var> instead of <samp><span class="option">--</span></samp> around disjoint groups -of lines. +print <var>string</var> instead of <samp><span class="option">--</span></samp> between groups of lines. <br><dt><samp><span class="option">--no-group-separator</span></samp><dd><a name="index-g_t_002d_002dgroup_002dseparator-90"></a><a name="index-group-separator-91"></a>When <samp><span class="option">-A</span></samp>, <samp><span class="option">-B</span></samp> or <samp><span class="option">-C</span></samp> are in use, -print disjoint groups of lines adjacent to each other. +do not print a separator between groups of lines. </dl> @@ -486,23 +497,22 @@ <li>Context (i.e., non-matching) lines use ‘<samp><span class="samp">-</span></samp>’ instead. - <li>When no context is specified, + <li>When context is not specified, matching lines are simply output one right after another. - <li>When nonzero context is specified, + <li>When context is specified, lines that are adjacent in the input form a group and are output one right after another, while -a separator appears by default between disjoint groups on a line -of its own and without any prefix. +by default a separator appears between non-adjacent groups. <li>The default separator -is ‘<samp><span class="samp">--</span></samp>’, however whether to include it and its appearance +is a ‘<samp><span class="samp">--</span></samp>’ line; its presence and appearance can be changed with the options above. <li>Each group may contain several matching lines when they are close enough to each other -that two otherwise adjacent but divided groups connect -and can just merge into a single contiguous one. +that two adjacent groups connect and can merge into a single +contiguous one. </ul> <div class="node"> @@ -1429,20 +1439,16 @@ <p>Standard grep cannot do this, as it is fundamentally line-based. Therefore, merely using the <code>[:space:]</code> character class does not -match newlines in the way you might expect. However, if your grep is -compiled with Perl patterns enabled, the Perl ‘<samp><span class="samp">s</span></samp>’ -modifier (which makes <code>.</code> match newlines) can be used: +match newlines in the way you might expect. - <pre class="example"> printf 'foo\nbar\n' | grep -P '(?s)foo.*?bar' -</pre> <p>With the GNU <samp><span class="command">grep</span></samp> option <code>-z</code> (see <a href="#File-and-Directory-Selection">File and Directory Selection</a>), the input is terminated by null bytes. Thus, -you can match newlines in the input, but the output will be the whole -file, so this is really only useful to determine if the pattern is -present: +you can match newlines in the input, but typically if there is a match +the entire input is output, so this usage is often combined with +output-suppressing options like <samp><span class="option">-q</span></samp>, e.g.: <pre class="example"> printf 'foo\nbar\n' | grep -z -q 'foo[[:space:]]\+bar' </pre> - <p>Failing either of those options, you need to transform the input + <p>If this does not suffice, you can transform the input before giving it to <samp><span class="command">grep</span></samp>, or turn to <samp><span class="command">awk</span></samp>, <samp><span class="command">sed</span></samp>, <samp><span class="command">perl</span></samp>, or many other utilities that are designed to operate across lines. @@ -2261,3 +2267,10 @@ </body></html> +<!-- + +Local Variables: +coding: utf-8 +End: + +-->
