CVSROOT: /webcvs/grep Module name: grep Changes by: Jim Meyering <meyering> 16/02/05 00:44:53
Index: html_node/grep-Programs.html =================================================================== RCS file: /webcvs/grep/grep/manual/html_node/grep-Programs.html,v retrieving revision 1.21 retrieving revision 1.22 diff -u -b -r1.21 -r1.22 --- html_node/grep-Programs.html 2 Nov 2015 02:54:37 -0000 1.21 +++ html_node/grep-Programs.html 5 Feb 2016 00:44:53 -0000 1.22 @@ -1,87 +1,140 @@ -<html lang="en"> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<!-- This manual is for grep, a pattern matching engine. + +Copyright (C) 1999-2002, 2005, 2008-2016 Free Software Foundation, +Inc. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with no +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". --> +<!-- Created by GNU Texinfo 6.0, http://www.gnu.org/software/texinfo/ --> <head> -<title>grep Programs - GNU Grep 2.22</title> +<title>GNU Grep 2.23: grep Programs</title> + +<meta name="description" content="GNU Grep 2.23: grep Programs"> +<meta name="keywords" content="GNU Grep 2.23: grep Programs"> +<meta name="resource-type" content="document"> +<meta name="distribution" content="global"> +<meta name="Generator" content="makeinfo"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> -<meta name="description" content="GNU Grep 2.22"> -<meta name="generator" content="makeinfo 4.13"> -<link title="Top" rel="start" href="index.html#Top"> -<link rel="up" href="Invoking.html#Invoking" title="Invoking"> -<link rel="prev" href="Exit-Status.html#Exit-Status" title="Exit Status"> -<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> +<link href="index.html#Top" rel="start" title="Top"> +<link href="Index.html#Index" rel="index" title="Index"> +<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> +<link href="Invoking.html#Invoking" rel="up" title="Invoking"> +<link href="Regular-Expressions.html#Regular-Expressions" rel="next" title="Regular Expressions"> +<link href="Exit-Status.html#Exit-Status" rel="prev" title="Exit Status"> +<style type="text/css"> <!-- -This manual is for `grep', a pattern matching engine. +a.summary-letter {text-decoration: none} +blockquote.indentedblock {margin-right: 0em} +blockquote.smallindentedblock {margin-right: 0em; font-size: smaller} +blockquote.smallquotation {font-size: smaller} +div.display {margin-left: 3.2em} +div.example {margin-left: 3.2em} +div.lisp {margin-left: 3.2em} +div.smalldisplay {margin-left: 3.2em} +div.smallexample {margin-left: 3.2em} +div.smalllisp {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} +pre.smalldisplay {font-family: inherit; font-size: smaller} +pre.smallexample {font-size: smaller} +pre.smallformat {font-family: inherit; font-size: smaller} +pre.smalllisp {font-size: smaller} +span.nocodebreak {white-space: nowrap} +span.nolinebreak {white-space: nowrap} +span.roman {font-family: serif; font-weight: normal} +span.sansserif {font-family: sans-serif; font-weight: normal} +ul.no-bullet {list-style: none} +--> +</style> +<link rel="stylesheet" type="text/css" href="/software/gnulib/manual.css"> -Copyright (C) 1999-2002, 2005, 2008-2015 Free Software Foundation, -Inc. - Permission is granted to copy, distribute and/or modify this - document under the terms of the GNU Free Documentation License, - Version 1.3 or any later version published by the Free Software - Foundation; with no 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''. - --> -<meta http-equiv="Content-Style-Type" content="text/css"> -<style type="text/css"><!-- - pre.display { font-family:inherit } - pre.format { font-family:inherit } - pre.smalldisplay { font-family:inherit; font-size:smaller } - pre.smallformat { font-family:inherit; font-size:smaller } - pre.smallexample { font-size:smaller } - pre.smalllisp { font-size:smaller } - span.sc { font-variant:small-caps } - span.roman { font-family:serif; font-weight:normal; } - span.sansserif { font-family:sans-serif; font-weight:normal; } ---></style> -<link rel="stylesheet" type="text/css" href="/software/gnulib/manual.css"> </head> -<body> -<div class="node"> + +<body lang="en"> <a name="grep-Programs"></a> +<div class="header"> <p> -Previous: <a rel="previous" accesskey="p" href="Exit-Status.html#Exit-Status">Exit Status</a>, -Up: <a rel="up" accesskey="u" href="Invoking.html#Invoking">Invoking</a> -<hr> +Previous: <a href="Exit-Status.html#Exit-Status" accesskey="p" rel="prev">Exit Status</a>, Up: <a href="Invoking.html#Invoking" accesskey="u" rel="up">Invoking</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p> </div> +<hr> +<a name="grep-Programs-1"></a> +<h3 class="section">2.4 <code>grep</code> Programs</h3> +<a name="index-grep-programs"></a> +<a name="index-variants-of-grep"></a> -<h3 class="section">2.4 <samp><span class="command">grep</span></samp> Programs</h3> - -<p><a name="index-g_t_0040command_007bgrep_007d-programs-178"></a><a name="index-variants-of-_0040command_007bgrep_007d-179"></a> -<samp><span class="command">grep</span></samp> searches the named input files +<p><code>grep</code> searches the named input files for lines containing a match to the given pattern. -By default, <samp><span class="command">grep</span></samp> prints the matching lines. -A file named <samp><span class="file">-</span></samp> stands for standard input. -If no input is specified, <samp><span class="command">grep</span></samp> searches the working -directory <samp><span class="file">.</span></samp> if given a command-line option specifying -recursion; otherwise, <samp><span class="command">grep</span></samp> searches standard input. -There are four major variants of <samp><span class="command">grep</span></samp>, +By default, <code>grep</code> prints the matching lines. +A file named <samp>-</samp> stands for standard input. +If no input is specified, <code>grep</code> searches the working +directory <samp>.</samp> if given a command-line option specifying +recursion; otherwise, <code>grep</code> searches standard input. +There are four major variants of <code>grep</code>, controlled by the following options. - - <dl> -<dt><samp><span class="option">-G</span></samp><dt><samp><span class="option">--basic-regexp</span></samp><dd><a name="index-g_t_002dG-180"></a><a name="index-g_t_002d_002dbasic_002dregexp-181"></a><a name="index-matching-basic-regular-expressions-182"></a>Interpret the pattern as a basic regular expression (BRE). +</p> +<dl compact="compact"> +<dt><samp>-G</samp></dt> +<dt><samp>--basic-regexp</samp></dt> +<dd><a name="index-_002dG"></a> +<a name="index-_002d_002dbasic_002dregexp"></a> +<a name="index-matching-basic-regular-expressions"></a> +<p>Interpret the pattern as a basic regular expression (BRE). This is the default. - - <br><dt><samp><span class="option">-E</span></samp><dt><samp><span class="option">--extended-regexp</span></samp><dd><a name="index-g_t_002dE-183"></a><a name="index-g_t_002d_002dextended_002dregexp-184"></a><a name="index-matching-extended-regular-expressions-185"></a>Interpret the pattern as an extended regular expression (ERE). -(<samp><span class="option">-E</span></samp> is specified by POSIX.) - - <br><dt><samp><span class="option">-F</span></samp><dt><samp><span class="option">--fixed-strings</span></samp><dd><a name="index-g_t_002dF-186"></a><a name="index-g_t_002d_002dfixed_002dstrings-187"></a><a name="index-matching-fixed-strings-188"></a>Interpret the pattern as a list of fixed strings, separated -by newlines, any of which is to be matched. -(<samp><span class="option">-F</span></samp> is specified by POSIX.) - - <br><dt><samp><span class="option">-P</span></samp><dt><samp><span class="option">--perl-regexp</span></samp><dd><a name="index-g_t_002dP-189"></a><a name="index-g_t_002d_002dperl_002dregexp-190"></a><a name="index-matching-Perl-regular-expressions-191"></a>Interpret the pattern as a Perl regular expression. +</p> +</dd> +<dt><samp>-E</samp></dt> +<dt><samp>--extended-regexp</samp></dt> +<dd><a name="index-_002dE"></a> +<a name="index-_002d_002dextended_002dregexp"></a> +<a name="index-matching-extended-regular-expressions"></a> +<p>Interpret the pattern as an extended regular expression (ERE). +(<samp>-E</samp> is specified by POSIX.) +</p> +</dd> +<dt><samp>-F</samp></dt> +<dt><samp>--fixed-strings</samp></dt> +<dd><a name="index-_002dF"></a> +<a name="index-_002d_002dfixed_002dstrings"></a> +<a name="index-matching-fixed-strings"></a> +<p>Interpret the pattern as a list of fixed strings (instead of regular +expressions), separated by newlines, any of which is to be matched. +(<samp>-F</samp> is specified by POSIX.) +</p> +</dd> +<dt><samp>-P</samp></dt> +<dt><samp>--perl-regexp</samp></dt> +<dd><a name="index-_002dP"></a> +<a name="index-_002d_002dperl_002dregexp"></a> +<a name="index-matching-Perl-regular-expressions"></a> +<p>Interpret the pattern as a Perl regular expression. This is highly experimental and -‘<samp><span class="samp">grep -P</span></samp>’ may warn of unimplemented features. - - </dl> - - <p>In addition, -two variant programs <samp><span class="command">egrep</span></samp> and <samp><span class="command">fgrep</span></samp> are available. -<samp><span class="command">egrep</span></samp> is the same as ‘<samp><span class="samp">grep -E</span></samp>’. -<samp><span class="command">fgrep</span></samp> is the same as ‘<samp><span class="samp">grep -F</span></samp>’. +‘<samp>grep -P</samp>’ may warn of unimplemented features. +</p> +</dd> +</dl> + +<p>In addition, +two variant programs <code>egrep</code> and <code>fgrep</code> are available. +<code>egrep</code> is the same as ‘<samp>grep -E</samp>’. +<code>fgrep</code> is the same as ‘<samp>grep -F</samp>’. Direct invocation as either -<samp><span class="command">egrep</span></samp> or <samp><span class="command">fgrep</span></samp> is deprecated, +<code>egrep</code> or <code>fgrep</code> is deprecated, but is provided to allow historical applications that rely on them to run unmodified. +</p> + + - </body></html> +</body> +</html>
