grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to grep/manual/html_node/General-Output-Control.html,v


From: Jim Meyering
Subject: Changes to grep/manual/html_node/General-Output-Control.html,v
Date: Sat, 3 Sep 2022 15:33:16 -0400 (EDT)

CVSROOT:        /webcvs/grep
Module name:    grep
Changes by:     Jim Meyering <meyering> 22/09/03 15:33:15

Index: html_node/General-Output-Control.html
===================================================================
RCS file: /webcvs/grep/grep/manual/html_node/General-Output-Control.html,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- html_node/General-Output-Control.html       14 Aug 2021 20:46:40 -0000      
1.32
+++ html_node/General-Output-Control.html       3 Sep 2022 19:33:14 -0000       
1.33
@@ -5,7 +5,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <!-- This manual is for grep, a pattern matching engine.
 
-Copyright (C) 1999-2002, 2005, 2008-2021 Free Software Foundation,
+Copyright (C) 1999-2002, 2005, 2008-2022 Free Software Foundation,
 Inc.
 
 Permission is granted to copy, distribute and/or modify this document
@@ -14,10 +14,10 @@
 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
 Texts.  A copy of the license is included in the section entitled
 "GNU Free Documentation License". -->
-<title>General Output Control (GNU Grep 3.7)</title>
+<title>General Output Control (GNU Grep 3.8)</title>
 
-<meta name="description" content="General Output Control (GNU Grep 3.7)">
-<meta name="keywords" content="General Output Control (GNU Grep 3.7)">
+<meta name="description" content="General Output Control (GNU Grep 3.8)">
+<meta name="keywords" content="General Output Control (GNU Grep 3.8)">
 <meta name="resource-type" content="document">
 <meta name="distribution" content="global">
 <meta name="Generator" content="makeinfo">
@@ -78,7 +78,7 @@
 <dt><span><samp>--colour[=<var>WHEN</var>]</samp></span></dt>
 <dd><span id="index-_002d_002dcolour"></span>
 <span id="index-highlight_002c-color_002c-colour"></span>
-<p>Surround the matched (non-empty) strings, matching lines, context lines,
+<p>Surround matched non-empty strings, matching lines, context lines,
 file names, line numbers, byte offsets, and separators (for fields and
 groups of context lines) with escape sequences to display them in color
 on the terminal.
@@ -86,11 +86,14 @@
 and default to 
&lsquo;<samp>ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36</samp>&rsquo;
 for bold red matched text, magenta file names, green line numbers,
 green byte offsets, cyan separators, and default terminal colors otherwise.
-The deprecated environment variable <code>GREP_COLOR</code> is still supported,
-but its setting does not have priority;
-it defaults to &lsquo;<samp>01;31</samp>&rsquo; (bold red)
-which only covers the color for matched text.
-<var>WHEN</var> is &lsquo;<samp>never</samp>&rsquo;, 
&lsquo;<samp>always</samp>&rsquo;, or &lsquo;<samp>auto</samp>&rsquo;.
+See <a href="Environment-Variables.html">Environment Variables</a>.
+</p>
+<p><var>WHEN</var> is &lsquo;<samp>always</samp>&rsquo; to use colors, 
&lsquo;<samp>never</samp>&rsquo; to not use
+colors, or &lsquo;<samp>auto</samp>&rsquo; to use colors if standard output is 
associated
+with a terminal device and the <code>TERM</code> environment variable&rsquo;s 
value
+suggests that the terminal supports colors.
+Plain <samp>--color</samp> is treated like <samp>--color=auto</samp>;
+if no <samp>--color</samp> option is given, the default is 
<samp>--color=never</samp>.
 </p>
 </dd>
 <dt id='index-_002dL'><span><samp>-L</samp><a href='#index-_002dL' 
class='copiable-anchor'> &para;</a></span></dt>
@@ -118,7 +121,11 @@
 <dd><span id="index-_002d_002dmax_002dcount"></span>
 <span id="index-max_002dcount"></span>
 <p>Stop after the first <var>num</var> selected lines.
-If the input is standard input from a regular file,
+If <var>num</var> is zero, <code>grep</code> stops right away without reading 
input.
+A <var>num</var> of -1 is treated as infinity and <code>grep</code>
+does not stop; this is the default.
+</p>
+<p>If the input is standard input from a regular file,
 and <var>num</var> selected lines are output,
 <code>grep</code> ensures that the standard input is positioned
 just after the last selected line before exiting,
@@ -158,7 +165,7 @@
 <dt><span><samp>--only-matching</samp></span></dt>
 <dd><span id="index-_002d_002donly_002dmatching"></span>
 <span id="index-only-matching"></span>
-<p>Print only the matched (non-empty) parts of matching lines,
+<p>Print only the matched non-empty parts of matching lines,
 with each such part on a separate output line.
 Output lines use the same delimiters as input, and delimiters are null
 bytes if <samp>-z</samp> (<samp>--null-data</samp>) is also used (see <a 
href="Other-Options.html">Other Options</a>).
@@ -174,6 +181,9 @@
 Exit immediately with zero status if any match is found,
 even if an error was detected.
 Also see the <samp>-s</samp> or <samp>--no-messages</samp> option.
+Portability note: Solaris 10 <code>grep</code> lacks <samp>-q</samp>;
+portable shell scripts typically can redirect standard output to
+<samp>/dev/null</samp> instead of using <samp>-q</samp>.
 (<samp>-q</samp> is specified by POSIX.)
 </p>
 </dd>
@@ -182,31 +192,12 @@
 <dd><span id="index-_002d_002dno_002dmessages"></span>
 <span id="index-suppress-error-messages"></span>
 <p>Suppress error messages about nonexistent or unreadable files.
-Portability note:
-unlike GNU <code>grep</code>,
-7th Edition Unix <code>grep</code> did not conform to POSIX,
-because it lacked <samp>-q</samp>
-and its <samp>-s</samp> option behaved like
-GNU <code>grep</code>&rsquo;s <samp>-q</samp> option.<a id="DOCF1" 
href="#FOOT1"><sup>1</sup></a>
-USG-style <code>grep</code> also lacked <samp>-q</samp>
-but its <samp>-s</samp> option behaved like GNU <code>grep</code>&rsquo;s.
-Portable shell scripts should avoid both
-<samp>-q</samp> and <samp>-s</samp> and should redirect
-standard and error output to <samp>/dev/null</samp> instead.
 (<samp>-s</samp> is specified by POSIX.)
 </p>
 </dd>
 </dl>
 
 </div>
-<div class="footnote">
-<hr>
-<h4 class="footnotes-heading">Footnotes</h4>
-
-<h5><a id="FOOT1" href="#DOCF1">(1)</a></h5>
-<p>Of course, 7th Edition
-Unix predated POSIX by several years!</p>
-</div>
 <hr>
 <div class="header">
 <p>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]