CVSROOT: /webcvs/grep Module name: grep Changes by: Jim Meyering <meyering> 23/03/22 22:55:22
Index: html_node/Context-Line-Control.html =================================================================== RCS file: /webcvs/grep/grep/manual/html_node/Context-Line-Control.html,v retrieving revision 1.33 retrieving revision 1.34 diff -u -b -r1.33 -r1.34 --- html_node/Context-Line-Control.html 3 Sep 2022 19:33:14 -0000 1.33 +++ html_node/Context-Line-Control.html 23 Mar 2023 02:55:21 -0000 1.34 @@ -1,11 +1,11 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!DOCTYPE html> <html> -<!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ --> +<!-- Created by GNU Texinfo 7.0dev, https://www.gnu.org/software/texinfo/ --> <head> <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-2022 Free Software Foundation, +Copyright © 1999-2002, 2005, 2008-2023 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>Context Line Control (GNU Grep 3.8)</title> +<title>Context Line Control (GNU Grep 3.10)</title> -<meta name="description" content="Context Line Control (GNU Grep 3.8)"> -<meta name="keywords" content="Context Line Control (GNU Grep 3.8)"> +<meta name="description" content="Context Line Control (GNU Grep 3.10)"> +<meta name="keywords" content="Context Line Control (GNU Grep 3.10)"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="makeinfo"> @@ -31,21 +31,9 @@ <link href="Output-Line-Prefix-Control.html" rel="prev" title="Output Line Prefix Control"> <style type="text/css"> <!-- -a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em} -a.summary-letter {text-decoration: none} -blockquote.indentedblock {margin-right: 0em} -div.display {margin-left: 3.2em} -div.example {margin-left: 3.2em} -kbd {font-style: oblique} -pre.display {font-family: inherit} -pre.format {font-family: inherit} -pre.menu-comment {font-family: serif} -pre.menu-preformatted {font-family: serif} -span.nolinebreak {white-space: nowrap} -span.roman {font-family: initial; font-weight: normal} -span.sansserif {font-family: sans-serif; font-weight: normal} -span:hover a.copiable-anchor {visibility: visible} -ul.no-bullet {list-style: none} +a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em} +span:hover a.copiable-link {visibility: visible} +ul.mark-bullet {list-style-type: disc} --> </style> <link rel="stylesheet" type="text/css" href="https://www.gnu.org/software/gnulib/manual.css"> @@ -54,84 +42,89 @@ </head> <body lang="en"> -<div class="subsection" id="Context-Line-Control"> -<div class="header"> +<div class="subsection-level-extent" id="Context-Line-Control"> +<div class="nav-panel"> <p> Next: <a href="File-and-Directory-Selection.html" accesskey="n" rel="next">File and Directory Selection</a>, Previous: <a href="Output-Line-Prefix-Control.html" accesskey="p" rel="prev">Output Line Prefix Control</a>, Up: <a href="Command_002dline-Options.html" accesskey="u" rel="up">Command-line Options</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html" title="Index" rel="index">Index</a>]</p> </div> <hr> -<span id="Context-Line-Control-1"></span><h4 class="subsection">2.1.5 Context Line Control</h4> +<h4 class="subsection" id="Context-Line-Control-1"><span>2.1.5 Context Line Control<a class="copiable-link" href="#Context-Line-Control-1"> ¶</a></span></h4> -<span id="index-context-lines-1"></span> -<p><em>Context lines</em> are non-matching lines that are near a matching line. +<a class="index-entry-id" id="index-context-lines-1"></a> +<p><em class="dfn">Context lines</em> are non-matching lines that are near a matching line. They are output only if one of the following options are used. Regardless of how these options are set, -<code>grep</code> never outputs any given line more than once. -If the <samp>-o</samp> (<samp>--only-matching</samp>) option is specified, +<code class="command">grep</code> never outputs any given line more than once. +If the <samp class="option">-o</samp> (<samp class="option">--only-matching</samp>) option is specified, these options have no effect and a warning is given upon their use. </p> -<dl compact="compact"> -<dt id='index-_002dA'><span><samp>-A <var>num</var></samp><a href='#index-_002dA' class='copiable-anchor'> ¶</a></span></dt> -<dt><span><samp>--after-context=<var>num</var></samp></span></dt> -<dd><span id="index-_002d_002dafter_002dcontext"></span> -<span id="index-after-context"></span> -<span id="index-context-lines_002c-after-match"></span> -<p>Print <var>num</var> lines of trailing context after matching lines. +<dl class="table"> +<dt><samp class="option">-A <var class="var">num</var></samp></dt> +<dt><samp class="option">--after-context=<var class="var">num</var></samp></dt> +<dd><a class="index-entry-id" id="index-_002dA"></a> +<a class="index-entry-id" id="index-_002d_002dafter_002dcontext"></a> +<a class="index-entry-id" id="index-after-context"></a> +<a class="index-entry-id" id="index-context-lines_002c-after-match"></a> +<p>Print <var class="var">num</var> lines of trailing context after matching lines. </p> </dd> -<dt id='index-_002dB'><span><samp>-B <var>num</var></samp><a href='#index-_002dB' class='copiable-anchor'> ¶</a></span></dt> -<dt><span><samp>--before-context=<var>num</var></samp></span></dt> -<dd><span id="index-_002d_002dbefore_002dcontext"></span> -<span id="index-before-context"></span> -<span id="index-context-lines_002c-before-match"></span> -<p>Print <var>num</var> lines of leading context before matching lines. +<dt><samp class="option">-B <var class="var">num</var></samp></dt> +<dt><samp class="option">--before-context=<var class="var">num</var></samp></dt> +<dd><a class="index-entry-id" id="index-_002dB"></a> +<a class="index-entry-id" id="index-_002d_002dbefore_002dcontext"></a> +<a class="index-entry-id" id="index-before-context"></a> +<a class="index-entry-id" id="index-context-lines_002c-before-match"></a> +<p>Print <var class="var">num</var> lines of leading context before matching lines. </p> </dd> -<dt id='index-_002dC'><span><samp>-C <var>num</var></samp><a href='#index-_002dC' class='copiable-anchor'> ¶</a></span></dt> -<dt><span><samp>-<var>num</var></samp></span></dt> -<dt><span><samp>--context=<var>num</var></samp></span></dt> -<dd><span id="index-_002d_002dcontext"></span> -<span id="index-_002dnum"></span> -<span id="index-context-lines-2"></span> -<p>Print <var>num</var> lines of leading and trailing output context. +<dt><samp class="option">-C <var class="var">num</var></samp></dt> +<dt><samp class="option">-<var class="var">num</var></samp></dt> +<dt><samp class="option">--context=<var class="var">num</var></samp></dt> +<dd><a class="index-entry-id" id="index-_002dC"></a> +<a class="index-entry-id" id="index-_002d_002dcontext"></a> +<a class="index-entry-id" id="index-_002dnum"></a> +<a class="index-entry-id" id="index-context-lines-2"></a> +<p>Print <var class="var">num</var> lines of leading and trailing output context. </p> </dd> -<dt id='index-_002d_002dgroup_002dseparator'><span><samp>--group-separator=<var>string</var></samp><a href='#index-_002d_002dgroup_002dseparator' class='copiable-anchor'> ¶</a></span></dt> -<dd><span id="index-group-separator"></span> -<p>When <samp>-A</samp>, <samp>-B</samp> or <samp>-C</samp> are in use, -print <var>string</var> instead of <samp>--</samp> between groups of lines. +<dt><samp class="option">--group-separator=<var class="var">string</var></samp></dt> +<dd><a class="index-entry-id" id="index-_002d_002dgroup_002dseparator"></a> +<a class="index-entry-id" id="index-group-separator"></a> +<p>When <samp class="option">-A</samp>, <samp class="option">-B</samp> or <samp class="option">-C</samp> are in use, +print <var class="var">string</var> instead of <samp class="option">--</samp> between groups of lines. </p> </dd> -<dt id='index-_002d_002dgroup_002dseparator-1'><span><samp>--no-group-separator</samp><a href='#index-_002d_002dgroup_002dseparator-1' class='copiable-anchor'> ¶</a></span></dt> -<dd><span id="index-group-separator-1"></span> -<p>When <samp>-A</samp>, <samp>-B</samp> or <samp>-C</samp> are in use, +<dt><samp class="option">--no-group-separator</samp></dt> +<dd><a class="index-entry-id" id="index-_002d_002dgroup_002dseparator-1"></a> +<a class="index-entry-id" id="index-group-separator-1"></a> +<p>When <samp class="option">-A</samp>, <samp class="option">-B</samp> or <samp class="option">-C</samp> are in use, do not print a separator between groups of lines. </p> </dd> </dl> -<p>Here are some points about how <code>grep</code> chooses +<p>Here are some points about how <code class="command">grep</code> chooses the separator to print between prefix fields and line content: </p> -<ul> -<li> Matching lines normally use ‘<samp>:</samp>’ as a separator +<ul class="itemize mark-bullet"> +<li>Matching lines normally use ‘<samp class="samp">:</samp>’ as a separator between prefix fields and actual line content. -</li><li> Context (i.e., non-matching) lines use ‘<samp>-</samp>’ instead. +</li><li>Context (i.e., non-matching) lines use ‘<samp class="samp">-</samp>’ instead. -</li><li> When context is not specified, +</li><li>When context is not specified, matching lines are simply output one right after another. -</li><li> When context is specified, +</li><li>When context is specified, lines that are adjacent in the input form a group and are output one right after another, while by default a separator appears between non-adjacent groups. -</li><li> The default separator -is a ‘<samp>--</samp>’ line; its presence and appearance +</li><li>The default separator +is a ‘<samp class="samp">--</samp>’ line; its presence and appearance can be changed with the options above. -</li><li> Each group may contain +</li><li>Each group may contain several matching lines when they are close enough to each other that two adjacent groups connect and can merge into a single contiguous one. @@ -139,7 +132,7 @@ </div> <hr> -<div class="header"> +<div class="nav-panel"> <p> Next: <a href="File-and-Directory-Selection.html">File and Directory Selection</a>, Previous: <a href="Output-Line-Prefix-Control.html">Output Line Prefix Control</a>, Up: <a href="Command_002dline-Options.html">Command-line Options</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html" title="Index" rel="index">Index</a>]</p> </div>
