home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue2 / SDL.ARC / !gcc / docs / grep < prev    next >
Encoding:
Text File  |  2004-09-05  |  87.0 KB  |  1,927 lines

  1. This is /home/riscos/gcc33/!gcc/docs/grep, produced by makeinfo version
  2. 4.7 from doc/grep.texi.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * grep: (grep).                   print lines matching a pattern.
  6. END-INFO-DIR-ENTRY
  7.    This file documents `grep', a pattern matching engine.
  8.  
  9.    Published by the Free Software Foundation, 59 Temple Place - Suite
  10. 330 Boston, MA 02111-1307, USA
  11.  
  12.    Copyright (C) 2000, 2001 Free Software Foundation, Inc.
  13.  
  14.    Permission is granted to make and distribute verbatim copies of this
  15. manual provided the copyright notice and this permission notice are
  16. preserved on all copies.
  17.  
  18.    Permission is granted to copy, distribute and/or modify this document
  19. under the terms of the GNU Free Documentation License, Version 1.1 or
  20. any later version published by the Free Software Foundation; with the
  21. Invariant Sections being "GNU General Public License" and "GNU Free
  22. Documentation License", with no Front-Cover Texts, and with no
  23. Back-Cover Texts.  A copy of the license is included in the section
  24. entitled "GNU Free Documentation License" (*note Copying::).
  25.  
  26. 
  27. File: grep,  Node: Top,  Next: Introduction,  Up: (dir)
  28.  
  29. Grep
  30. ****
  31.  
  32. `grep' searches for lines matching a pattern.
  33.  
  34.    This document was produced for version 2.5 of GNU `grep'.
  35.  
  36. * Menu:
  37.  
  38. * Introduction::                Introduction.
  39. * Invoking::                    Invoking `grep'; description of options.
  40. * Diagnostics::                 Exit status returned by `grep'.
  41. * Grep Programs::               `grep' programs.
  42. * Regular Expressions::         Regular Expressions.
  43. * Usage::                       Examples.
  44. * Reporting Bugs::              Reporting Bugs.
  45. * Copying::                     License terms.
  46. * Concept Index::               A menu with all the topics in this manual.
  47. * Index::                       A menu with all `grep' commands
  48.                                  and command-line options.
  49.  
  50. 
  51. File: grep,  Node: Introduction,  Next: Invoking,  Prev: Top,  Up: Top
  52.  
  53. 1 Introduction
  54. **************
  55.  
  56. `grep' searches the input files for lines containing a match to a given
  57. pattern list.  When it finds a match in a line, it copies the line to
  58. standard output (by default), or does whatever other sort of output you
  59. have requested with options.
  60.  
  61.    Though `grep' expects to do the matching on text, it has no limits
  62. on input line length other than available memory, and it can match
  63. arbitrary characters within a line.  If the final byte of an input file
  64. is not a newline, `grep' silently supplies one.  Since newline is also
  65. a separator for the list of patterns, there is no way to match newline
  66. characters in a text.
  67.  
  68. 
  69. File: grep,  Node: Invoking,  Next: Diagnostics,  Prev: Introduction,  Up: Top
  70.  
  71. 2 Invoking `grep'
  72. *****************
  73.  
  74. `grep' comes with a rich set of options from POSIX.2 and GNU extensions.
  75.  
  76. `-c'
  77. `--count'
  78.      Suppress normal output; instead print a count of matching lines
  79.      for each input file.  With the `-v', `--invert-match' option,
  80.      count non-matching lines.
  81.  
  82. `-e PATTERN'
  83. `--regexp=PATTERN'
  84.      Use PATTERN as the pattern; useful to protect patterns beginning
  85.      with a `-'.
  86.  
  87. `-f FILE'
  88. `--file=FILE'
  89.      Obtain patterns from FILE, one per line.  The empty file contains
  90.      zero patterns, and therefore matches nothing.
  91.  
  92. `-i'
  93. `--ignore-case'
  94.      Ignore case distinctions in both the pattern and the input files.
  95.  
  96. `-l'
  97. `--files-with-matches'
  98.      Suppress normal output; instead print the name of each input file
  99.      from which output would normally have been printed.  The scanning
  100.      of every file will stop on the first match.
  101.  
  102. `-n'
  103. `--line-number'
  104.      Prefix each line of output with the line number within its input
  105.      file.
  106.  
  107. `-o'
  108. `--only-matching'
  109.      Print only the part of matching lines that actually matches
  110.      PATTERN.
  111.  
  112. `-q'
  113. `--quiet'
  114. `--silent'
  115.      Quiet; do not write anything to standard output.  Exit immediately
  116.      with zero status if any match is found, even if an error was
  117.      detected.  Also see the `-s' or `--no-messages' option.
  118.  
  119. `-s'
  120. `--no-messages'
  121.      Suppress error messages about nonexistent or unreadable files.
  122.      Portability note: unlike GNU `grep', traditional `grep' did not
  123.      conform to POSIX.2, because traditional `grep' lacked a `-q'
  124.      option and its `-s' option behaved like GNU `grep''s `-q' option.
  125.      Shell scripts intended to be portable to traditional `grep' should
  126.      avoid both `-q' and `-s' and should redirect output to `/dev/null'
  127.      instead.
  128.  
  129. `-v'
  130. `--invert-match'
  131.      Invert the sense of matching, to select non-matching lines.
  132.  
  133. `-x'
  134. `--line-regexp'
  135.      Select only those matches that exactly match the whole line.
  136.  
  137.  
  138. 2.1 GNU Extensions
  139. ==================
  140.  
  141. `-A NUM'
  142. `--after-context=NUM'
  143.      Print NUM lines of trailing context after matching lines.
  144.  
  145. `-B NUM'
  146. `--before-context=NUM'
  147.      Print NUM lines of leading context before matching lines.
  148.  
  149. `-C NUM'
  150. `--context=NUM'
  151.      Print NUM lines of output context.
  152.  
  153. `--colour[=WHEN]'
  154. `--color[=WHEN]'
  155.      The matching string is surrounded by the marker specify in
  156.      GREP_COLOR.  WHEN may be `never', `always', or `auto'.
  157.  
  158. `-NUM'
  159.      Same as `--context=NUM' lines of leading and trailing context.
  160.      However, grep will never print any given line more than once.
  161.  
  162. `-V'
  163. `--version'
  164.      Print the version number of `grep' to the standard output stream.
  165.      This version number should be included in all bug reports.
  166.  
  167. `--help'
  168.      Print a usage message briefly summarizing these command-line
  169.      options and the bug-reporting address, then exit.
  170.  
  171. `--binary-files=TYPE'
  172.      If the first few bytes of a file indicate that the file contains
  173.      binary data, assume that the file is of type TYPE.  By default,
  174.      TYPE is `binary', and `grep' normally outputs either a one-line
  175.      message saying that a binary file matches, or no message if there
  176.      is no match.  If TYPE is `without-match', `grep' assumes that a
  177.      binary file does not match; this is equivalent to the `-I' option.
  178.      If TYPE is `text', `grep' processes a binary file as if it were
  179.      text; this is equivalent to the `-a' option.  _Warning:_
  180.      `--binary-files=text' might output binary garbage, which can have
  181.      nasty side effects if the output is a terminal and if the terminal
  182.      driver interprets some of it as commands.
  183.  
  184. `-b'
  185. `--byte-offset'
  186.      Print the byte offset within the input file before each line of
  187.      output.  When `grep' runs on MS-DOS or MS-Windows, the printed
  188.      byte offsets depend on whether the `-u' (`--unix-byte-offsets')
  189.      option is used; see below.
  190.  
  191. `-D ACTION'
  192. `--devices=ACTION'
  193.      If an input file is a device, FIFO or socket, use ACTION to
  194.      process it.  By default, ACTION is `read', which means that
  195.      devices are read just as if they were ordinary files.  If ACTION
  196.      is `skip', devices, FIFOs and sockets are silently skipped.
  197.  
  198. `-d ACTION'
  199. `--directories=ACTION'
  200.      If an input file is a directory, use ACTION to process it.  By
  201.      default, ACTION is `read', which means that directories are read
  202.      just as if they were ordinary files (some operating systems and
  203.      filesystems disallow this, and will cause `grep' to print error
  204.      messages for every directory or silently skip them). If ACTION is
  205.      `skip', directories are silently skipped.  If ACTION is `recurse',
  206.      `grep' reads all files under each directory, recursively; this is
  207.      equivalent to the `-r' option.
  208.  
  209. `-H'
  210. `--with-filename'
  211.      Print the filename for each match.
  212.  
  213. `-h'
  214. `--no-filename'
  215.      Suppress the prefixing of filenames on output when multiple files
  216.      are searched.
  217.  
  218. `--line-buffered'
  219.      Set the line buffering policy, this can be a performance penality.
  220.  
  221. `--label=LABEL'
  222.      Displays input actually coming from standard input as input coming
  223.      from file LABEL. This is especially useful for tools like zgrep,
  224.      e.g.  `gzip -cd foo.gz |grep --label=foo something'
  225.  
  226. `-L'
  227. `--files-without-match'
  228.      Suppress normal output; instead print the name of each input file
  229.      from which no output would normally have been printed.  The
  230.      scanning of every file will stop on the first match.
  231.  
  232. `-a'
  233. `--text'
  234.      Process a binary file as if it were text; this is equivalent to the
  235.      `--binary-files=text' option.
  236.  
  237. `-I'
  238.      Process a binary file as if it did not contain matching data; this
  239.      is equivalent to the `--binary-files=without-match' option.
  240.  
  241. `-w'
  242. `--word-regexp'
  243.      Select only those lines containing matches that form whole words.
  244.      The test is that the matching substring must either be at the
  245.      beginning of the line, or preceded by a non-word constituent
  246.      character.  Similarly, it must be either at the end of the line or
  247.      followed by a non-word constituent character.  Word-constituent
  248.      characters are letters, digits, and the underscore.
  249.  
  250. `-r'
  251. `-R'
  252. `--recursive'
  253.      For each directory mentioned in the command line, read and process
  254.      all files in that directory, recursively.  This is the same as the
  255.      `--directories=recurse' option.
  256.  
  257. `--include=FILE_PATTERN'
  258.      When processing directories recursively, only files matching
  259.      FILE_PATTERN will be search.
  260.  
  261. `--exclude=FILE_PATTERN'
  262.      When processing directories recursively, skip files matching
  263.      FILE_PATTERN.
  264.  
  265. `-m NUM'
  266. `--max-count=NUM'
  267.      Stop reading a file after NUM matching lines.  If the input is
  268.      standard input from a regular file, and NUM matching lines are
  269.      output, `grep' ensures that the standard input is positioned to
  270.      just after the last matching line before exiting, regardless of the
  271.      presence of trailing context lines.  This enables a calling process
  272.      to resume a search.  For example, the following shell script makes
  273.      use of it:
  274.  
  275.           while grep -m 1 PATTERN
  276.           do
  277.             echo xxxx
  278.           done < FILE
  279.  
  280.      But the following probably will not work because a pipe is not a
  281.      regular file:
  282.  
  283.           # This probably will not work.
  284.           cat FILE |
  285.           while grep -m 1 PATTERN
  286.           do
  287.             echo xxxx
  288.           done
  289.  
  290.      When `grep' stops after NUM matching lines, it outputs any
  291.      trailing context lines. Since context does not include matching
  292.      lines, `grep' will stop when it encounters another matching line.
  293.      When the `-c' or `--count' option is also used, `grep' does not
  294.      output a count greater than NUM.  When the `-v' or
  295.      `--invert-match' option is also used, `grep' stops after
  296.      outputting NUM non-matching lines.
  297.  
  298. `-y'
  299.      Obsolete synonym for `-i'.
  300.  
  301. `-U'
  302. `--binary'
  303.      Treat the file(s) as binary.  By default, under MS-DOS and
  304.      MS-Windows, `grep' guesses the file type by looking at the
  305.      contents of the first 32kB read from the file.  If `grep' decides
  306.      the file is a text file, it strips the `CR' characters from the
  307.      original file contents (to make regular expressions with `^' and
  308.      `$' work correctly).  Specifying `-U' overrules this guesswork,
  309.      causing all files to be read and passed to the matching mechanism
  310.      verbatim; if the file is a text file with `CR/LF' pairs at the end
  311.      of each line, this will cause some regular expressions to fail.
  312.      This option has no effect on platforms other than MS-DOS and
  313.      MS-Windows.
  314.  
  315. `-u'
  316. `--unix-byte-offsets'
  317.      Report Unix-style byte offsets.  This switch causes `grep' to
  318.      report byte offsets as if the file were Unix style text file,
  319.      i.e., the byte offsets ignore the `CR' characters which were
  320.      stripped.  This will produce results identical to running `grep' on
  321.      a Unix machine.  This option has no effect unless `-b' option is
  322.      also used; it has no effect on platforms other than MS-DOS and
  323.      MS-Windows.
  324.  
  325. `--mmap'
  326.      If possible, use the `mmap' system call to read input, instead of
  327.      the default `read' system call.  In some situations, `--mmap'
  328.      yields better performance.  However, `--mmap' can cause undefined
  329.      behavior (including core dumps) if an input file shrinks while
  330.      `grep' is operating, or if an I/O error occurs.
  331.  
  332. `-Z'
  333. `--null'
  334.      Output a zero byte (the ASCII `NUL' character) instead of the
  335.      character that normally follows a file name.  For example, `grep
  336.      -lZ' outputs a zero byte after each file name instead of the usual
  337.      newline.  This option makes the output unambiguous, even in the
  338.      presence of file names containing unusual characters like
  339.      newlines.  This option can be used with commands like `find
  340.      -print0', `perl -0', `sort -z', and `xargs -0' to process
  341.      arbitrary file names, even those that contain newline characters.
  342.  
  343. `-z'
  344. `--null-data'
  345.      Treat the input as a set of lines, each terminated by a zero byte
  346.      (the ASCII `NUL' character) instead of a newline.  Like the `-Z'
  347.      or `--null' option, this option can be used with commands like
  348.      `sort -z' to process arbitrary file names.
  349.  
  350.  
  351.    Several additional options control which variant of the `grep'
  352. matching engine is used.  *Note Grep Programs::.
  353.  
  354. 2.2 Environment Variables
  355. =========================
  356.  
  357. Grep's behavior is affected by the following environment variables.
  358.  
  359.    A locale `LC_FOO' is specified by examining the three environment
  360. variables `LC_ALL', `LC_FOO', and `LANG', in that order.  The first of
  361. these variables that is set specifies the locale.  For example, if
  362. `LC_ALL' is not set, but `LC_MESSAGES' is set to `pt_BR', then
  363. Brazilian Portuguese is used for the `LC_MESSAGES' locale.  The C
  364. locale is used if none of these environment variables are set, or if
  365. the locale catalog is not installed, or if `grep' was not compiled with
  366. national language support (NLS).
  367.  
  368. `GREP_OPTIONS'
  369.      This variable specifies default options to be placed in front of
  370.      any explicit options.  For example, if `GREP_OPTIONS' is
  371.      `--binary-files=without-match --directories=skip', `grep' behaves
  372.      as if the two options `--binary-files=without-match' and
  373.      `--directories=skip' had been specified before any explicit
  374.      options.  Option specifications are separated by whitespace.  A
  375.      backslash escapes the next character, so it can be used to specify
  376.      an option containing whitespace or a backslash.
  377.  
  378. `GREP_COLOR'
  379.      This variable specifies the surrounding markers use to highlight
  380.      the matching text.  The default is control ascii red.
  381.  
  382. `LC_ALL'
  383. `LC_COLLATE'
  384. `LANG'
  385.      These variables specify the `LC_COLLATE' locale, which determines
  386.      the collating sequence used to interpret range expressions like
  387.      `[a-z]'.
  388.  
  389. `LC_ALL'
  390. `LC_CTYPE'
  391. `LANG'
  392.      These variables specify the `LC_CTYPE' locale, which determines the
  393.      type of characters, e.g., which characters are whitespace.
  394.  
  395. `LC_ALL'
  396. `LC_MESSAGES'
  397. `LANG'
  398.      These variables specify the `LC_MESSAGES' locale, which determines
  399.      the language that `grep' uses for messages.  The default C locale
  400.      uses American English messages.
  401.  
  402. `POSIXLY_CORRECT'
  403.      If set, `grep' behaves as POSIX.2 requires; otherwise, `grep'
  404.      behaves more like other GNU programs.  POSIX.2 requires that
  405.      options that follow file names must be treated as file names; by
  406.      default, such options are permuted to the front of the operand
  407.      list and are treated as options.  Also, POSIX.2 requires that
  408.      unrecognized options be diagnosed as "illegal", but since they are
  409.      not really against the law the default is to diagnose them as
  410.      "invalid".  `POSIXLY_CORRECT' also disables
  411.      `_N_GNU_nonoption_argv_flags_', described below.
  412.  
  413. `_N_GNU_nonoption_argv_flags_'
  414.      (Here `N' is `grep''s numeric process ID.)  If the Ith character
  415.      of this environment variable's value is `1', do not consider the
  416.      Ith operand of `grep' to be an option, even if it appears to be
  417.      one.  A shell can put this variable in the environment for each
  418.      command it runs, specifying which operands are the results of file
  419.      name wildcard expansion and therefore should not be treated as
  420.      options.  This behavior is available only with the GNU C library,
  421.      and only when `POSIXLY_CORRECT' is not set.
  422.  
  423.  
  424. 
  425. File: grep,  Node: Diagnostics,  Next: Grep Programs,  Prev: Invoking,  Up: Top
  426.  
  427. 3 Diagnostics
  428. *************
  429.  
  430. Normally, exit status is 0 if selected lines are found and 1 otherwise.
  431. But the exit status is 2 if an error occurred, unless the `-q' or
  432. `--quiet' or `--silent' option is used and a selected line is found.
  433.  
  434. 
  435. File: grep,  Node: Grep Programs,  Next: Regular Expressions,  Prev: Diagnostics,  Up: Top
  436.  
  437. 4 `grep' programs
  438. *****************
  439.  
  440. `grep' searches the named input files (or standard input if no files
  441. are named, or the file name `-' is given) for lines containing a match
  442. to the given pattern.  By default, `grep' prints the matching lines.
  443. There are four major variants of `grep', controlled by the following
  444. options.
  445.  
  446. `-G'
  447. `--basic-regexp'
  448.      Interpret the pattern as a basic regular expression.  This is the
  449.      default.
  450.  
  451. `-E'
  452. `--extended-regexp'
  453.      Interpret the pattern as an extended regular expression.
  454.  
  455. `-F'
  456. `--fixed-strings'
  457.      Interpret the pattern as a list of fixed strings, separated by
  458.      newlines, any of which is to be matched.
  459.  
  460. `-P'
  461. `--perl-regexp'
  462.      Interpret the pattern as a Perl regular expression.
  463.  
  464.  
  465.    In addition, two variant programs EGREP and FGREP are available.
  466. EGREP is the same as `grep -E'.  FGREP is the same as `grep -F'.
  467.  
  468. 
  469. File: grep,  Node: Regular Expressions,  Next: Usage,  Prev: Grep Programs,  Up: Top
  470.  
  471. 5 Regular Expressions
  472. *********************
  473.  
  474. A "regular expression" is a pattern that describes a set of strings.
  475. Regular expressions are constructed analogously to arithmetic
  476. expressions, by using various operators to combine smaller expressions.
  477. `grep' understands two different versions of regular expression syntax:
  478. "basic"(BRE) and "extended"(ERE).  In GNU `grep', there is no
  479. difference in available functionality using either syntax.  In other
  480. implementations, basic regular expressions are less powerful.  The
  481. following description applies to extended regular expressions;
  482. differences for basic regular expressions are summarized afterwards.
  483.  
  484.    The fundamental building blocks are the regular expressions that
  485. match a single character.  Most characters, including all letters and
  486. digits, are regular expressions that match themselves.  Any
  487. metacharacter with special meaning may be quoted by preceding it with a
  488. backslash.
  489.  
  490.    A regular expression may be followed by one of several repetition
  491. operators:
  492.  
  493. `.'
  494.      The period `.' matches any single character.
  495.  
  496. `?'
  497.      The preceding item is optional and will be matched at most once.
  498.  
  499. `*'
  500.      The preceding item will be matched zero or more times.
  501.  
  502. `+'
  503.      The preceding item will be matched one or more times.
  504.  
  505. `{N}'
  506.      The preceding item is matched exactly N times.
  507.  
  508. `{N,}'
  509.      The preceding item is matched n or more times.
  510.  
  511. `{N,M}'
  512.      The preceding item is matched at least N times, but not more than
  513.      M times.
  514.  
  515.  
  516.    Two regular expressions may be concatenated; the resulting regular
  517. expression matches any string formed by concatenating two substrings
  518. that respectively match the concatenated subexpressions.
  519.  
  520.    Two regular expressions may be joined by the infix operator `|'; the
  521. resulting regular expression matches any string matching either
  522. subexpression.
  523.  
  524.    Repetition takes precedence over concatenation, which in turn takes
  525. precedence over alternation.  A whole subexpression may be enclosed in
  526. parentheses to override these precedence rules.
  527.  
  528. 5.1 Character Class
  529. ===================
  530.  
  531. A "bracket expression" is a list of characters enclosed by `[' and `]'.
  532. It matches any single character in that list; if the first character
  533. of the list is the caret `^', then it matches any character *not* in
  534. the list.  For example, the regular expression `[0123456789]' matches
  535. any single digit.
  536.  
  537.    Within a bracket expression, a "range expression" consists of two
  538. characters separated by a hyphen.  It matches any single character that
  539. sorts between the two characters, inclusive, using the locale's
  540. collating sequence and character set.  For example, in the default C
  541. locale, `[a-d]' is equivalent to `[abcd]'.  Many locales sort
  542. characters in dictionary order, and in these locales `[a-d]' is
  543. typically not equivalent to `[abcd]'; it might be equivalent to
  544. `[aBbCcDd]', for example.  To obtain the traditional interpretation of
  545. bracket expressions, you can use the C locale by setting the `LC_ALL'
  546. environment variable to the value `C'.
  547.  
  548.    Finally, certain named classes of characters are predefined within
  549. bracket expressions, as follows.  Their interpretation depends on the
  550. `LC_CTYPE' locale; the interpretation below is that of the C locale,
  551. which is the default if no `LC_CTYPE' locale is specified.
  552.  
  553. `[:alnum:]'
  554.      Alphanumeric characters: `[:alpha:]' and `[:digit:]'.
  555.  
  556. `[:alpha:]'
  557.      Alphabetic characters: `[:lower:]' and `[:upper:]'.
  558.  
  559. `[:blank:]'
  560.      Blank characters: space and tab.
  561.  
  562. `[:cntrl:]'
  563.      Control characters.  In ASCII, these characters have octal codes
  564.      000 through 037, and 177 (`DEL').  In other character sets, these
  565.      are the equivalent characters, if any.
  566.  
  567. `[:digit:]'
  568.      Digits: `0 1 2 3 4 5 6 7 8 9'.
  569.  
  570. `[:graph:]'
  571.      Graphical characters: `[:alnum:]' and `[:punct:]'.
  572.  
  573. `[:lower:]'
  574.      Lower-case letters: `a b c d e f g h i j k l m n o p q r s t u v w
  575.      x y z'.
  576.  
  577. `[:print:]'
  578.      Printable characters: `[:alnum:]', `[:punct:]', and space.
  579.  
  580. `[:punct:]'
  581.      Punctuation characters: `! " # $ % & ' ( ) * + , - . / : ; < = > ?
  582.      @ [ \ ] ^ _ ` { | } ~'.
  583.  
  584. `[:space:]'
  585.      Space characters: tab, newline, vertical tab, form feed, carriage
  586.      return, and space.
  587.  
  588. `[:upper:]'
  589.      Upper-case letters: `A B C D E F G H I J K L M N O P Q R S T U V W
  590.      X Y Z'.
  591.  
  592. `[:xdigit:]'
  593.      Hexadecimal digits: `0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f'.
  594.  
  595.    For example, `[[:alnum:]]' means `[0-9A-Za-z]', except the latter
  596. depends upon the C locale and the ASCII character encoding, whereas the
  597. former is independent of locale and character set.  (Note that the
  598. brackets in these class names are part of the symbolic names, and must
  599. be included in addition to the brackets delimiting the bracket list.)
  600.  
  601.    Most metacharacters lose their special meaning inside lists.
  602.  
  603. `]'
  604.      ends the list if it's not the first list item.  So, if you want to
  605.      make the `]' character a list item, you must put it first.
  606.  
  607. `[.'
  608.      represents the open collating symbol.
  609.  
  610. `.]'
  611.      represents the close collating symbol.
  612.  
  613. `[='
  614.      represents the open equivalence class.
  615.  
  616. `=]'
  617.      represents the close equivalence class.
  618.  
  619. `[:'
  620.      represents the open character class followed by a valid character
  621.      class name.
  622.  
  623. `:]'
  624.      represents the close character class followed by a valid character
  625.      class name.
  626.  
  627. `-'
  628.      represents the range if it's not first or last in a list or the
  629.      ending point of a range.
  630.  
  631. `^'
  632.      represents the characters not in the list.  If you want to make
  633.      the `^' character a list item, place it anywhere but first.
  634.  
  635.  
  636. 5.2 Backslash Character
  637. =======================
  638.  
  639. The `\' when followed by certain ordinary characters take a special
  640. meaning :
  641.  
  642. ``\b''
  643.      Match the empty string at the edge of a word.
  644.  
  645. ``\B''
  646.      Match the empty string provided it's not at the edge of a word.
  647.  
  648. ``\<''
  649.      Match the empty string at the beginning of word.
  650.  
  651. ``\>''
  652.      Match the empty string at the end of word.
  653.  
  654. ``\w''
  655.      Match word constituent, it is a synonym for `[[:alnum:]]'.
  656.  
  657. ``\W''
  658.      Match non word constituent, it is a synonym for `[^[:alnum:]]'.
  659.  
  660.  
  661.    For example , `\brat\b' matches the separate word `rat', `c\Brat\Be'
  662. matches `crate', but `dirty \Brat' doesn't match `dirty rat'.
  663.  
  664. 5.3 Anchoring
  665. =============
  666.  
  667. The caret `^' and the dollar sign `$' are metacharacters that
  668. respectively match the empty string at the beginning and end of a line.
  669.  
  670. 5.4 Back-reference
  671. ==================
  672.  
  673. The back-reference `\N', where N is a single digit, matches the
  674. substring previously matched by the Nth parenthesized subexpression of
  675. the regular expression. For example, `(a)\1' matches `aa'.  When use
  676. with alternation if the group does not participate in the match, then
  677. the back-reference makes the whole match fail.  For example, `a(.)|b\1'
  678. will not match `ba'.  When multiple regular expressions are given with
  679. `-e' or from a file `-f file', the back-referecences are local to each
  680. expression.
  681.  
  682. 5.5 Basic vs Extended
  683. =====================
  684.  
  685. In basic regular expressions the metacharacters `?', `+', `{', `|',
  686. `(', and `)' lose their special meaning; instead use the backslashed
  687. versions `\?', `\+', `\{', `\|', `\(', and `\)'.
  688.  
  689.    Traditional `egrep' did not support the `{' metacharacter, and some
  690. `egrep' implementations support `\{' instead, so portable scripts
  691. should avoid `{' in `egrep' patterns and should use `[{]' to match a
  692. literal `{'.
  693.  
  694.    GNU `egrep' attempts to support traditional usage by assuming that
  695. `{' is not special if it would be the start of an invalid interval
  696. specification.  For example, the shell command `egrep '{1'' searches
  697. for the two-character string `{1' instead of reporting a syntax error
  698. in the regular expression.  POSIX.2 allows this behavior as an
  699. extension, but portable scripts should avoid it.
  700.  
  701. 
  702. File: grep,  Node: Usage,  Next: Reporting Bugs,  Prev: Regular Expressions,  Up: Top
  703.  
  704. 6 Usage
  705. *******
  706.  
  707. Here is an example shell command that invokes GNU `grep':
  708.  
  709.      grep -i 'hello.*world' menu.h main.c
  710.  
  711. This lists all lines in the files `menu.h' and `main.c' that contain
  712. the string `hello' followed by the string `world'; this is because `.*'
  713. matches zero or more characters within a line.  *Note Regular
  714. Expressions::.  The `-i' option causes `grep' to ignore case, causing
  715. it to match the line `Hello, world!', which it would not otherwise
  716. match.  *Note Invoking::, for more details about how to invoke `grep'.
  717.  
  718.    Here are some common questions and answers about `grep' usage.
  719.  
  720.   1. How can I list just the names of matching files?
  721.  
  722.           grep -l 'main' *.c
  723.  
  724.      lists the names of all C files in the current directory whose
  725.      contents mention `main'.
  726.  
  727.   2. How do I search directories recursively?
  728.  
  729.           grep -r 'hello' /home/gigi
  730.  
  731.      searches for `hello' in all files under the directory
  732.      `/home/gigi'.  For more control of which files are searched, use
  733.      `find', `grep' and `xargs'.  For example, the following command
  734.      searches only C files:
  735.  
  736.           find /home/gigi -name '*.c' -print | xargs grep 'hello' /dev/null
  737.  
  738.      This differs from the command:
  739.  
  740.           grep -r 'hello' *.c
  741.  
  742.      which merely looks for `hello' in all files in the current
  743.      directory whose names end in `.c'.  Here the `-r' is probably
  744.      unnecessary, as recursion occurs only in the unlikely event that
  745.      one of `.c' files is a directory.
  746.  
  747.   3. What if a pattern has a leading `-'?
  748.  
  749.           grep -e '--cut here--' *
  750.  
  751.      searches for all lines matching `--cut here--'.  Without `-e',
  752.      `grep' would attempt to parse `--cut here--' as a list of options.
  753.  
  754.   4. Suppose I want to search for a whole word, not a part of a word?
  755.  
  756.           grep -w 'hello' *
  757.  
  758.      searches only for instances of `hello' that are entire words; it
  759.      does not match `Othello'.  For more control, use `\<' and `\>' to
  760.      match the start and end of words.  For example:
  761.  
  762.           grep 'hello\>' *
  763.  
  764.      searches only for words ending in `hello', so it matches the word
  765.      `Othello'.
  766.  
  767.   5. How do I output context around the matching lines?
  768.  
  769.           grep -C 2 'hello' *
  770.  
  771.      prints two lines of context around each matching line.
  772.  
  773.   6. How do I force grep to print the name of the file?
  774.  
  775.      Append `/dev/null':
  776.  
  777.           grep 'eli' /etc/passwd /dev/null
  778.  
  779.      gets you:
  780.  
  781.           /etc/passwd:eli:DNGUTF58.IMe.:98:11:Eli Smith:/home/do/eli:/bin/bash
  782.  
  783.   7. Why do people use strange regular expressions on `ps' output?
  784.  
  785.           ps -ef | grep '[c]ron'
  786.  
  787.      If the pattern had been written without the square brackets, it
  788.      would have matched not only the `ps' output line for `cron', but
  789.      also the `ps' output line for `grep'.  Note that some platforms
  790.      `ps' limit the ouput to the width of the screen, grep does not
  791.      have any limit on the length of a line except the available memory.
  792.  
  793.   8. Why does `grep' report "Binary file matches"?
  794.  
  795.      If `grep' listed all matching "lines" from a binary file, it would
  796.      probably generate output that is not useful, and it might even
  797.      muck up your display.  So GNU `grep' suppresses output from files
  798.      that appear to be binary files.  To force GNU `grep' to output
  799.      lines even from files that appear to be binary, use the `-a' or
  800.      `--binary-files=text' option.  To eliminate the "Binary file
  801.      matches" messages, use the `-I' or `--binary-files=without-match'
  802.      option.
  803.  
  804.   9. Why doesn't `grep -lv' print nonmatching file names?
  805.  
  806.      `grep -lv' lists the names of all files containing one or more
  807.      lines that do not match.  To list the names of all files that
  808.      contain no matching lines, use the `-L' or `--files-without-match'
  809.      option.
  810.  
  811.  10. I can do OR with `|', but what about AND?
  812.  
  813.           grep 'paul' /etc/motd | grep 'franc,ois'
  814.  
  815.      finds all lines that contain both `paul' and `franc,ois'.
  816.  
  817.  11. How can I search in both standard input and in files?
  818.  
  819.      Use the special file name `-':
  820.  
  821.           cat /etc/passwd | grep 'alain' - /etc/motd
  822.  
  823.  12. How to express palindromes in a regular expression?
  824.  
  825.      It can be done by using the back referecences, for example a
  826.      palindrome of 4 chararcters can be written in BRE.
  827.  
  828.           grep -w -e '\(.\)\(.\).\2\1' file
  829.  
  830.      It matches the word "radar" or "civic".
  831.  
  832.      Guglielmo Bondioni proposed a single RE that finds all the
  833.      palindromes up to 19 characters long.
  834.  
  835.           egrep -e '^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\9\8\7\6\5\4\3\2\1$' file
  836.  
  837.      Note this is done by using GNU ERE extensions, it might not be
  838.      portable on other greps.
  839.  
  840.  13. Why are my expressions whith the vertical bar fail?
  841.  
  842.           /bin/echo "ba" | egrep '(a)\1|(b)\1'
  843.  
  844.      The first alternate branch fails then the first group was not in
  845.      the match this will make the second alternate branch fails.  For
  846.      example, "aaba" will match, the first group participate in the
  847.      match and can be reuse in the second branch.
  848.  
  849.  14. What do `grep, fgrep, egrep' stand for ?
  850.  
  851.      grep comes from the way line editing was done on Unix.  For
  852.      example, `ed' uses this syntax to print a list of matching lines
  853.      on the screen.
  854.  
  855.           global/regular expression/print
  856.           g/re/p
  857.  
  858.      `fgrep' stands for Fixed `grep', `egrep' Extended `grep'.
  859.  
  860.  
  861. 
  862. File: grep,  Node: Reporting Bugs,  Next: Copying,  Prev: Usage,  Up: Top
  863.  
  864. 7 Reporting bugs
  865. ****************
  866.  
  867. Email bug reports to <bug-gnu-utils@gnu.org>.  Be sure to include the
  868. word "grep" somewhere in the "Subject:" field.
  869.  
  870.    Large repetition counts in the `{n,m}' construct may cause `grep' to
  871. use lots of memory.  In addition, certain other obscure regular
  872. expressions require exponential time and space, and may cause grep to
  873. run out of memory.  Back-references are very slow, and may require
  874. exponential time.
  875.  
  876. 
  877. File: grep,  Node: Copying,  Next: GNU General Public License,  Prev: Reporting Bugs,  Up: Top
  878.  
  879. 8 Copying
  880. *********
  881.  
  882. GNU grep is licensed under the GNU GPL, which makes it "free software".
  883.  
  884.    Please note that "free" in "free software" refers to liberty, not
  885. price.  As some GNU project advocates like to point out, think of "free
  886. speech" rather than "free beer".  The exact and legally binding
  887. distribution terms are spelled out below; in short, you have the right
  888. (freedom) to run and change grep and distribute it to other people, and
  889. even--if you want--charge money for doing either.  The important
  890. restriction is that you have to grant your recipients the same rights
  891. and impose the same restrictions.
  892.  
  893.    This method of licensing software is also known as "open source"
  894. because, among other things, it makes sure that all recipients will
  895. receive the source code along with the program, and be able to improve
  896. it.  The GNU project prefers the term "free software" for reasons
  897. outlined at
  898. `http://www.gnu.org/philosophy/free-software-for-freedom.html'.
  899.  
  900.    The exact license terms are defined by this paragraph and the GNU
  901. General Public License it refers to:
  902.  
  903.      GNU grep is free software; you can redistribute it and/or modify it
  904.      under the terms of the GNU General Public License as published by
  905.      the Free Software Foundation; either version 2 of the License, or
  906.      (at your option) any later version.
  907.  
  908.      GNU grep is distributed in the hope that it will be useful, but
  909.      WITHOUT ANY WARRANTY; without even the implied warranty of
  910.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  911.      General Public License for more details.
  912.  
  913.      A copy of the GNU General Public License is included as part of
  914.      this manual; if you did not receive it, write to the Free Software
  915.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  916.  
  917.    In addition to this, this manual is free in the same sense:
  918.  
  919.      Permission is granted to copy, distribute and/or modify this
  920.      document under the terms of the GNU Free Documentation License,
  921.      Version 1.1 or any later version published by the Free Software
  922.      Foundation; with the Invariant Sections being "GNU General Public
  923.      License" and "GNU Free Documentation License", with no Front-Cover
  924.      Texts, and with no Back-Cover Texts.  A copy of the license is
  925.      included in the section entitled "GNU Free Documentation License".
  926.  
  927.    The full texts of the GNU General Public License and of the GNU Free
  928. Documentation License are available below.
  929.  
  930. * Menu:
  931.  
  932. * GNU General Public License:: GNU GPL
  933. * GNU Free Documentation License:: GNU FDL
  934.  
  935. 
  936. File: grep,  Node: GNU General Public License,  Next: GNU Free Documentation License,  Prev: Copying,  Up: Copying
  937.  
  938. 8.1 GNU General Public License
  939. ==============================
  940.  
  941.                          Version 2, June 1991
  942.      Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  943.      675 Mass Ave, Cambridge, MA 02139, USA
  944.  
  945.      Everyone is permitted to copy and distribute verbatim copies
  946.      of this license document, but changing it is not allowed.
  947.  
  948. Preamble
  949. ========
  950.  
  951. The licenses for most software are designed to take away your freedom
  952. to share and change it.  By contrast, the GNU General Public License is
  953. intended to guarantee your freedom to share and change free
  954. software--to make sure the software is free for all its users.  This
  955. General Public License applies to most of the Free Software
  956. Foundation's software and to any other program whose authors commit to
  957. using it.  (Some other Free Software Foundation software is covered by
  958. the GNU Library General Public License instead.)  You can apply it to
  959. your programs, too.
  960.  
  961.    When we speak of free software, we are referring to freedom, not
  962. price.  Our General Public Licenses are designed to make sure that you
  963. have the freedom to distribute copies of free software (and charge for
  964. this service if you wish), that you receive source code or can get it
  965. if you want it, that you can change the software or use pieces of it in
  966. new free programs; and that you know you can do these things.
  967.  
  968.    To protect your rights, we need to make restrictions that forbid
  969. anyone to deny you these rights or to ask you to surrender the rights.
  970. These restrictions translate to certain responsibilities for you if you
  971. distribute copies of the software, or if you modify it.
  972.  
  973.    For example, if you distribute copies of such a program, whether
  974. gratis or for a fee, you must give the recipients all the rights that
  975. you have.  You must make sure that they, too, receive or can get the
  976. source code.  And you must show them these terms so they know their
  977. rights.
  978.  
  979.    We protect your rights with two steps: (1) copyright the software,
  980. and (2) offer you this license which gives you legal permission to copy,
  981. distribute and/or modify the software.
  982.  
  983.    Also, for each author's protection and ours, we want to make certain
  984. that everyone understands that there is no warranty for this free
  985. software.  If the software is modified by someone else and passed on, we
  986. want its recipients to know that what they have is not the original, so
  987. that any problems introduced by others will not reflect on the original
  988. authors' reputations.
  989.  
  990.    Finally, any free program is threatened constantly by software
  991. patents.  We wish to avoid the danger that redistributors of a free
  992. program will individually obtain patent licenses, in effect making the
  993. program proprietary.  To prevent this, we have made it clear that any
  994. patent must be licensed for everyone's free use or not licensed at all.
  995.  
  996.    The precise terms and conditions for copying, distribution and
  997. modification follow.
  998.  
  999.     TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  1000.   1. This License applies to any program or other work which contains a
  1001.      notice placed by the copyright holder saying it may be distributed
  1002.      under the terms of this General Public License.  The "Program",
  1003.      below, refers to any such program or work, and a "work based on
  1004.      the Program" means either the Program or any derivative work under
  1005.      copyright law: that is to say, a work containing the Program or a
  1006.      portion of it, either verbatim or with modifications and/or
  1007.      translated into another language.  (Hereinafter, translation is
  1008.      included without limitation in the term "modification".)  Each
  1009.      licensee is addressed as "you".
  1010.  
  1011.      Activities other than copying, distribution and modification are
  1012.      not covered by this License; they are outside its scope.  The act
  1013.      of running the Program is not restricted, and the output from the
  1014.      Program is covered only if its contents constitute a work based on
  1015.      the Program (independent of having been made by running the
  1016.      Program).  Whether that is true depends on what the Program does.
  1017.  
  1018.   2. You may copy and distribute verbatim copies of the Program's
  1019.      source code as you receive it, in any medium, provided that you
  1020.      conspicuously and appropriately publish on each copy an appropriate
  1021.      copyright notice and disclaimer of warranty; keep intact all the
  1022.      notices that refer to this License and to the absence of any
  1023.      warranty; and give any other recipients of the Program a copy of
  1024.      this License along with the Program.
  1025.  
  1026.      You may charge a fee for the physical act of transferring a copy,
  1027.      and you may at your option offer warranty protection in exchange
  1028.      for a fee.
  1029.  
  1030.   3. You may modify your copy or copies of the Program or any portion
  1031.      of it, thus forming a work based on the Program, and copy and
  1032.      distribute such modifications or work under the terms of Section 1
  1033.      above, provided that you also meet all of these conditions:
  1034.  
  1035.        a. You must cause the modified files to carry prominent notices
  1036.           stating that you changed the files and the date of any change.
  1037.  
  1038.        b. You must cause any work that you distribute or publish, that
  1039.           in whole or in part contains or is derived from the Program
  1040.           or any part thereof, to be licensed as a whole at no charge
  1041.           to all third parties under the terms of this License.
  1042.  
  1043.        c. If the modified program normally reads commands interactively
  1044.           when run, you must cause it, when started running for such
  1045.           interactive use in the most ordinary way, to print or display
  1046.           an announcement including an appropriate copyright notice and
  1047.           a notice that there is no warranty (or else, saying that you
  1048.           provide a warranty) and that users may redistribute the
  1049.           program under these conditions, and telling the user how to
  1050.           view a copy of this License.  (Exception: if the Program
  1051.           itself is interactive but does not normally print such an
  1052.           announcement, your work based on the Program is not required
  1053.           to print an announcement.)
  1054.  
  1055.      These requirements apply to the modified work as a whole.  If
  1056.      identifiable sections of that work are not derived from the
  1057.      Program, and can be reasonably considered independent and separate
  1058.      works in themselves, then this License, and its terms, do not
  1059.      apply to those sections when you distribute them as separate
  1060.      works.  But when you distribute the same sections as part of a
  1061.      whole which is a work based on the Program, the distribution of
  1062.      the whole must be on the terms of this License, whose permissions
  1063.      for other licensees extend to the entire whole, and thus to each
  1064.      and every part regardless of who wrote it.
  1065.  
  1066.      Thus, it is not the intent of this section to claim rights or
  1067.      contest your rights to work written entirely by you; rather, the
  1068.      intent is to exercise the right to control the distribution of
  1069.      derivative or collective works based on the Program.
  1070.  
  1071.      In addition, mere aggregation of another work not based on the
  1072.      Program with the Program (or with a work based on the Program) on
  1073.      a volume of a storage or distribution medium does not bring the
  1074.      other work under the scope of this License.
  1075.  
  1076.   4. You may copy and distribute the Program (or a work based on it,
  1077.      under Section 2) in object code or executable form under the terms
  1078.      of Sections 1 and 2 above provided that you also do one of the
  1079.      following:
  1080.  
  1081.        a. Accompany it with the complete corresponding machine-readable
  1082.           source code, which must be distributed under the terms of
  1083.           Sections 1 and 2 above on a medium customarily used for
  1084.           software interchange; or,
  1085.  
  1086.        b. Accompany it with a written offer, valid for at least three
  1087.           years, to give any third party, for a charge no more than your
  1088.           cost of physically performing source distribution, a complete
  1089.           machine-readable copy of the corresponding source code, to be
  1090.           distributed under the terms of Sections 1 and 2 above on a
  1091.           medium customarily used for software interchange; or,
  1092.  
  1093.        c. Accompany it with the information you received as to the offer
  1094.           to distribute corresponding source code.  (This alternative is
  1095.           allowed only for noncommercial distribution and only if you
  1096.           received the program in object code or executable form with
  1097.           such an offer, in accord with Subsection b above.)
  1098.  
  1099.      The source code for a work means the preferred form of the work for
  1100.      making modifications to it.  For an executable work, complete
  1101.      source code means all the source code for all modules it contains,
  1102.      plus any associated interface definition files, plus the scripts
  1103.      used to control compilation and installation of the executable.
  1104.      However, as a special exception, the source code distributed need
  1105.      not include anything that is normally distributed (in either
  1106.      source or binary form) with the major components (compiler,
  1107.      kernel, and so on) of the operating system on which the executable
  1108.      runs, unless that component itself accompanies the executable.
  1109.  
  1110.      If distribution of executable or object code is made by offering
  1111.      access to copy from a designated place, then offering equivalent
  1112.      access to copy the source code from the same place counts as
  1113.      distribution of the source code, even though third parties are not
  1114.      compelled to copy the source along with the object code.
  1115.  
  1116.   5. You may not copy, modify, sublicense, or distribute the Program
  1117.      except as expressly provided under this License.  Any attempt
  1118.      otherwise to copy, modify, sublicense or distribute the Program is
  1119.      void, and will automatically terminate your rights under this
  1120.      License.  However, parties who have received copies, or rights,
  1121.      from you under this License will not have their licenses
  1122.      terminated so long as such parties remain in full compliance.
  1123.  
  1124.   6. You are not required to accept this License, since you have not
  1125.      signed it.  However, nothing else grants you permission to modify
  1126.      or distribute the Program or its derivative works.  These actions
  1127.      are prohibited by law if you do not accept this License.
  1128.      Therefore, by modifying or distributing the Program (or any work
  1129.      based on the Program), you indicate your acceptance of this
  1130.      License to do so, and all its terms and conditions for copying,
  1131.      distributing or modifying the Program or works based on it.
  1132.  
  1133.   7. Each time you redistribute the Program (or any work based on the
  1134.      Program), the recipient automatically receives a license from the
  1135.      original licensor to copy, distribute or modify the Program
  1136.      subject to these terms and conditions.  You may not impose any
  1137.      further restrictions on the recipients' exercise of the rights
  1138.      granted herein.  You are not responsible for enforcing compliance
  1139.      by third parties to this License.
  1140.  
  1141.   8. If, as a consequence of a court judgment or allegation of patent
  1142.      infringement or for any other reason (not limited to patent
  1143.      issues), conditions are imposed on you (whether by court order,
  1144.      agreement or otherwise) that contradict the conditions of this
  1145.      License, they do not excuse you from the conditions of this
  1146.      License.  If you cannot distribute so as to satisfy simultaneously
  1147.      your obligations under this License and any other pertinent
  1148.      obligations, then as a consequence you may not distribute the
  1149.      Program at all.  For example, if a patent license would not permit
  1150.      royalty-free redistribution of the Program by all those who
  1151.      receive copies directly or indirectly through you, then the only
  1152.      way you could satisfy both it and this License would be to refrain
  1153.      entirely from distribution of the Program.
  1154.  
  1155.      If any portion of this section is held invalid or unenforceable
  1156.      under any particular circumstance, the balance of the section is
  1157.      intended to apply and the section as a whole is intended to apply
  1158.      in other circumstances.
  1159.  
  1160.      It is not the purpose of this section to induce you to infringe any
  1161.      patents or other property right claims or to contest validity of
  1162.      any such claims; this section has the sole purpose of protecting
  1163.      the integrity of the free software distribution system, which is
  1164.      implemented by public license practices.  Many people have made
  1165.      generous contributions to the wide range of software distributed
  1166.      through that system in reliance on consistent application of that
  1167.      system; it is up to the author/donor to decide if he or she is
  1168.      willing to distribute software through any other system and a
  1169.      licensee cannot impose that choice.
  1170.  
  1171.      This section is intended to make thoroughly clear what is believed
  1172.      to be a consequence of the rest of this License.
  1173.  
  1174.   9. If the distribution and/or use of the Program is restricted in
  1175.      certain countries either by patents or by copyrighted interfaces,
  1176.      the original copyright holder who places the Program under this
  1177.      License may add an explicit geographical distribution limitation
  1178.      excluding those countries, so that distribution is permitted only
  1179.      in or among countries not thus excluded.  In such case, this
  1180.      License incorporates the limitation as if written in the body of
  1181.      this License.
  1182.  
  1183.  10. The Free Software Foundation may publish revised and/or new
  1184.      versions of the General Public License from time to time.  Such
  1185.      new versions will be similar in spirit to the present version, but
  1186.      may differ in detail to address new problems or concerns.
  1187.  
  1188.      Each version is given a distinguishing version number.  If the
  1189.      Program specifies a version number of this License which applies
  1190.      to it and "any later version", you have the option of following
  1191.      the terms and conditions either of that version or of any later
  1192.      version published by the Free Software Foundation.  If the Program
  1193.      does not specify a version number of this License, you may choose
  1194.      any version ever published by the Free Software Foundation.
  1195.  
  1196.  11. If you wish to incorporate parts of the Program into other free
  1197.      programs whose distribution conditions are different, write to the
  1198.      author to ask for permission.  For software which is copyrighted
  1199.      by the Free Software Foundation, write to the Free Software
  1200.      Foundation; we sometimes make exceptions for this.  Our decision
  1201.      will be guided by the two goals of preserving the free status of
  1202.      all derivatives of our free software and of promoting the sharing
  1203.      and reuse of software generally.
  1204.  
  1205.                                 NO WARRANTY
  1206.  12. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
  1207.      WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
  1208.      LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  1209.      HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
  1210.      WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
  1211.      NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  1212.      FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE
  1213.      QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  1214.      PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  1215.      SERVICING, REPAIR OR CORRECTION.
  1216.  
  1217.  13. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  1218.      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
  1219.      MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
  1220.      LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
  1221.      INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
  1222.      INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
  1223.      DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
  1224.      OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
  1225.      OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
  1226.      ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  1227.  
  1228.                       END OF TERMS AND CONDITIONS
  1229. How to Apply These Terms to Your New Programs
  1230. =============================================
  1231.  
  1232. If you develop a new program, and you want it to be of the greatest
  1233. possible use to the public, the best way to achieve this is to make it
  1234. free software which everyone can redistribute and change under these
  1235. terms.
  1236.  
  1237.    To do so, attach the following notices to the program.  It is safest
  1238. to attach them to the start of each source file to most effectively
  1239. convey the exclusion of warranty; and each file should have at least
  1240. the "copyright" line and a pointer to where the full notice is found.
  1241.  
  1242.      ONE LINE TO GIVE THE PROGRAM'S NAME AND AN IDEA OF WHAT IT DOES.
  1243.      Copyright (C) 19YY  NAME OF AUTHOR
  1244.  
  1245.      This program is free software; you can redistribute it and/or
  1246.      modify it under the terms of the GNU General Public License
  1247.      as published by the Free Software Foundation; either version 2
  1248.      of the License, or (at your option) any later version.
  1249.  
  1250.      This program is distributed in the hope that it will be useful,
  1251.      but WITHOUT ANY WARRANTY; without even the implied warranty of
  1252.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1253.      GNU General Public License for more details.
  1254.  
  1255.      You should have received a copy of the GNU General Public License
  1256.      along with this program; if not, write to the Free Software
  1257.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1258.  
  1259.    Also add information on how to contact you by electronic and paper
  1260. mail.
  1261.  
  1262.    If the program is interactive, make it output a short notice like
  1263. this when it starts in an interactive mode:
  1264.  
  1265.      Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR
  1266.      Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
  1267.      type `show w'.  This is free software, and you are welcome
  1268.      to redistribute it under certain conditions; type `show c'
  1269.      for details.
  1270.  
  1271.    The hypothetical commands `show w' and `show c' should show the
  1272. appropriate parts of the General Public License.  Of course, the
  1273. commands you use may be called something other than `show w' and `show
  1274. c'; they could even be mouse-clicks or menu items--whatever suits your
  1275. program.
  1276.  
  1277.    You should also get your employer (if you work as a programmer) or
  1278. your school, if any, to sign a "copyright disclaimer" for the program,
  1279. if necessary.  Here is a sample; alter the names:
  1280.  
  1281.      Yoyodyne, Inc., hereby disclaims all copyright
  1282.      interest in the program `Gnomovision'
  1283.      (which makes passes at compilers) written
  1284.      by James Hacker.
  1285.  
  1286.      SIGNATURE OF TY COON, 1 April 1989
  1287.      Ty Coon, President of Vice
  1288.  
  1289.    This General Public License does not permit incorporating your
  1290. program into proprietary programs.  If your program is a subroutine
  1291. library, you may consider it more useful to permit linking proprietary
  1292. applications with the library.  If this is what you want to do, use the
  1293. GNU Library General Public License instead of this License.
  1294.  
  1295. 
  1296. File: grep,  Node: GNU Free Documentation License,  Next: Concept Index,  Prev: GNU General Public License,  Up: Copying
  1297.  
  1298. 8.2 GNU Free Documentation License
  1299. ==================================
  1300.  
  1301.                         Version 1.1, March 2000
  1302.      Copyright (C) 2000  Free Software Foundation, Inc.
  1303.      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  1304.  
  1305.      Everyone is permitted to copy and distribute verbatim copies
  1306.      of this license document, but changing it is not allowed.
  1307.  
  1308.  
  1309.   0. PREAMBLE
  1310.  
  1311.      The purpose of this License is to make a manual, textbook, or other
  1312.      written document "free" in the sense of freedom: to assure everyone
  1313.      the effective freedom to copy and redistribute it, with or without
  1314.      modifying it, either commercially or noncommercially.  Secondarily,
  1315.      this License preserves for the author and publisher a way to get
  1316.      credit for their work, while not being considered responsible for
  1317.      modifications made by others.
  1318.  
  1319.      This License is a kind of "copyleft", which means that derivative
  1320.      works of the document must themselves be free in the same sense.
  1321.      It complements the GNU General Public License, which is a copyleft
  1322.      license designed for free software.
  1323.  
  1324.      We have designed this License in order to use it for manuals for
  1325.      free software, because free software needs free documentation: a
  1326.      free program should come with manuals providing the same freedoms
  1327.      that the software does.  But this License is not limited to
  1328.      software manuals; it can be used for any textual work, regardless
  1329.      of subject matter or whether it is published as a printed book.
  1330.      We recommend this License principally for works whose purpose is
  1331.      instruction or reference.
  1332.  
  1333.  
  1334.   1. APPLICABILITY AND DEFINITIONS
  1335.  
  1336.      This License applies to any manual or other work that contains a
  1337.      notice placed by the copyright holder saying it can be distributed
  1338.      under the terms of this License.  The "Document", below, refers to
  1339.      any such manual or work.  Any member of the public is a licensee,
  1340.      and is addressed as "you".
  1341.  
  1342.      A "Modified Version" of the Document means any work containing the
  1343.      Document or a portion of it, either copied verbatim, or with
  1344.      modifications and/or translated into another language.
  1345.  
  1346.      A "Secondary Section" is a named appendix or a front-matter
  1347.      section of the Document that deals exclusively with the
  1348.      relationship of the publishers or authors of the Document to the
  1349.      Document's overall subject (or to related matters) and contains
  1350.      nothing that could fall directly within that overall subject.
  1351.      (For example, if the Document is in part a textbook of
  1352.      mathematics, a Secondary Section may not explain any mathematics.)
  1353.      The relationship could be a matter of historical connection with
  1354.      the subject or with related matters, or of legal, commercial,
  1355.      philosophical, ethical or political position regarding them.
  1356.  
  1357.      The "Invariant Sections" are certain Secondary Sections whose
  1358.      titles are designated, as being those of Invariant Sections, in
  1359.      the notice that says that the Document is released under this
  1360.      License.
  1361.  
  1362.      The "Cover Texts" are certain short passages of text that are
  1363.      listed, as Front-Cover Texts or Back-Cover Texts, in the notice
  1364.      that says that the Document is released under this License.
  1365.  
  1366.      A "Transparent" copy of the Document means a machine-readable copy,
  1367.      represented in a format whose specification is available to the
  1368.      general public, whose contents can be viewed and edited directly
  1369.      and straightforwardly with generic text editors or (for images
  1370.      composed of pixels) generic paint programs or (for drawings) some
  1371.      widely available drawing editor, and that is suitable for input to
  1372.      text formatters or for automatic translation to a variety of
  1373.      formats suitable for input to text formatters.  A copy made in an
  1374.      otherwise Transparent file format whose markup has been designed
  1375.      to thwart or discourage subsequent modification by readers is not
  1376.      Transparent.  A copy that is not "Transparent" is called "Opaque".
  1377.  
  1378.      Examples of suitable formats for Transparent copies include plain
  1379.      ASCII without markup, Texinfo input format, LaTeX input format,
  1380.      SGML or XML using a publicly available DTD, and
  1381.      standard-conforming simple HTML designed for human modification.
  1382.      Opaque formats include PostScript, PDF, proprietary formats that
  1383.      can be read and edited only by proprietary word processors, SGML
  1384.      or XML for which the DTD and/or processing tools are not generally
  1385.      available, and the machine-generated HTML produced by some word
  1386.      processors for output purposes only.
  1387.  
  1388.      The "Title Page" means, for a printed book, the title page itself,
  1389.      plus such following pages as are needed to hold, legibly, the
  1390.      material this License requires to appear in the title page.  For
  1391.      works in formats which do not have any title page as such, "Title
  1392.      Page" means the text near the most prominent appearance of the
  1393.      work's title, preceding the beginning of the body of the text.
  1394.  
  1395.   2. VERBATIM COPYING
  1396.  
  1397.      You may copy and distribute the Document in any medium, either
  1398.      commercially or noncommercially, provided that this License, the
  1399.      copyright notices, and the license notice saying this License
  1400.      applies to the Document are reproduced in all copies, and that you
  1401.      add no other conditions whatsoever to those of this License.  You
  1402.      may not use technical measures to obstruct or control the reading
  1403.      or further copying of the copies you make or distribute.  However,
  1404.      you may accept compensation in exchange for copies.  If you
  1405.      distribute a large enough number of copies you must also follow
  1406.      the conditions in section 3.
  1407.  
  1408.      You may also lend copies, under the same conditions stated above,
  1409.      and you may publicly display copies.
  1410.  
  1411.   3. COPYING IN QUANTITY
  1412.  
  1413.      If you publish printed copies of the Document numbering more than
  1414.      100, and the Document's license notice requires Cover Texts, you
  1415.      must enclose the copies in covers that carry, clearly and legibly,
  1416.      all these Cover Texts: Front-Cover Texts on the front cover, and
  1417.      Back-Cover Texts on the back cover.  Both covers must also clearly
  1418.      and legibly identify you as the publisher of these copies.  The
  1419.      front cover must present the full title with all words of the
  1420.      title equally prominent and visible.  You may add other material
  1421.      on the covers in addition.  Copying with changes limited to the
  1422.      covers, as long as they preserve the title of the Document and
  1423.      satisfy these conditions, can be treated as verbatim copying in
  1424.      other respects.
  1425.  
  1426.      If the required texts for either cover are too voluminous to fit
  1427.      legibly, you should put the first ones listed (as many as fit
  1428.      reasonably) on the actual cover, and continue the rest onto
  1429.      adjacent pages.
  1430.  
  1431.      If you publish or distribute Opaque copies of the Document
  1432.      numbering more than 100, you must either include a
  1433.      machine-readable Transparent copy along with each Opaque copy, or
  1434.      state in or with each Opaque copy a publicly-accessible
  1435.      computer-network location containing a complete Transparent copy
  1436.      of the Document, free of added material, which the general
  1437.      network-using public has access to download anonymously at no
  1438.      charge using public-standard network protocols.  If you use the
  1439.      latter option, you must take reasonably prudent steps, when you
  1440.      begin distribution of Opaque copies in quantity, to ensure that
  1441.      this Transparent copy will remain thus accessible at the stated
  1442.      location until at least one year after the last time you
  1443.      distribute an Opaque copy (directly or through your agents or
  1444.      retailers) of that edition to the public.
  1445.  
  1446.      It is requested, but not required, that you contact the authors of
  1447.      the Document well before redistributing any large number of
  1448.      copies, to give them a chance to provide you with an updated
  1449.      version of the Document.
  1450.  
  1451.   4. MODIFICATIONS
  1452.  
  1453.      You may copy and distribute a Modified Version of the Document
  1454.      under the conditions of sections 2 and 3 above, provided that you
  1455.      release the Modified Version under precisely this License, with
  1456.      the Modified Version filling the role of the Document, thus
  1457.      licensing distribution and modification of the Modified Version to
  1458.      whoever possesses a copy of it.  In addition, you must do these
  1459.      things in the Modified Version:
  1460.  
  1461.      A. Use in the Title Page (and on the covers, if any) a title
  1462.      distinct    from that of the Document, and from those of previous
  1463.      versions    (which should, if there were any, be listed in the
  1464.      History section    of the Document).  You may use the same title
  1465.      as a previous version    if the original publisher of that version
  1466.      gives permission.
  1467.      B. List on the Title Page, as authors, one or more persons or
  1468.      entities    responsible for authorship of the modifications in the
  1469.      Modified    Version, together with at least five of the principal
  1470.      authors of the    Document (all of its principal authors, if it
  1471.      has less than five).
  1472.      C. State on the Title page the name of the publisher of the
  1473.      Modified Version, as the publisher.
  1474.      D. Preserve all the copyright notices of the Document.
  1475.      E. Add an appropriate copyright notice for your modifications
  1476.      adjacent to the other copyright notices.
  1477.      F. Include, immediately after the copyright notices, a license
  1478.      notice    giving the public permission to use the Modified Version
  1479.      under the    terms of this License, in the form shown in the
  1480.      Addendum below.
  1481.      G. Preserve in that license notice the full lists of Invariant
  1482.      Sections    and required Cover Texts given in the Document's
  1483.      license notice.
  1484.      H. Include an unaltered copy of this License.
  1485.      I. Preserve the section entitled "History", and its title, and add
  1486.      to    it an item stating at least the title, year, new authors, and
  1487.        publisher of the Modified Version as given on the Title Page.
  1488.      If    there is no section entitled "History" in the Document,
  1489.      create one    stating the title, year, authors, and publisher of
  1490.      the Document as    given on its Title Page, then add an item
  1491.      describing the Modified    Version as stated in the previous
  1492.      sentence.
  1493.      J. Preserve the network location, if any, given in the Document for
  1494.        public access to a Transparent copy of the Document, and
  1495.      likewise    the network locations given in the Document for
  1496.      previous versions    it was based on.  These may be placed in the
  1497.      "History" section.     You may omit a network location for a work
  1498.      that was published at    least four years before the Document
  1499.      itself, or if the original    publisher of the version it refers
  1500.      to gives permission.
  1501.      K. In any section entitled "Acknowledgements" or "Dedications",
  1502.      preserve the section's title, and preserve in the section all the
  1503.       substance and tone of each of the contributor acknowledgements
  1504.      and/or dedications given therein.
  1505.      L. Preserve all the Invariant Sections of the Document,
  1506.      unaltered in their text and in their titles.  Section numbers
  1507.      or the equivalent are not considered part of the section titles.
  1508.      M. Delete any section entitled "Endorsements".  Such a section
  1509.      may not be included in the Modified Version.
  1510.      N. Do not retitle any existing section as "Endorsements"    or to
  1511.      conflict in title with any Invariant Section.
  1512.  
  1513.      If the Modified Version includes new front-matter sections or
  1514.      appendices that qualify as Secondary Sections and contain no
  1515.      material copied from the Document, you may at your option
  1516.      designate some or all of these sections as invariant.  To do this,
  1517.      add their titles to the list of Invariant Sections in the Modified
  1518.      Version's license notice.  These titles must be distinct from any
  1519.      other section titles.
  1520.  
  1521.      You may add a section entitled "Endorsements", provided it contains
  1522.      nothing but endorsements of your Modified Version by various
  1523.      parties-for example, statements of peer review or that the text has
  1524.      been approved by an organization as the authoritative definition
  1525.      of a standard.
  1526.  
  1527.      You may add a passage of up to five words as a Front-Cover Text,
  1528.      and a passage of up to 25 words as a Back-Cover Text, to the end
  1529.      of the list of Cover Texts in the Modified Version.  Only one
  1530.      passage of Front-Cover Text and one of Back-Cover Text may be
  1531.      added by (or through arrangements made by) any one entity.  If the
  1532.      Document already includes a cover text for the same cover,
  1533.      previously added by you or by arrangement made by the same entity
  1534.      you are acting on behalf of, you may not add another; but you may
  1535.      replace the old one, on explicit permission from the previous
  1536.      publisher that added the old one.
  1537.  
  1538.      The author(s) and publisher(s) of the Document do not by this
  1539.      License give permission to use their names for publicity for or to
  1540.      assert or imply endorsement of any Modified Version.
  1541.  
  1542.   5. COMBINING DOCUMENTS
  1543.  
  1544.      You may combine the Document with other documents released under
  1545.      this License, under the terms defined in section 4 above for
  1546.      modified versions, provided that you include in the combination
  1547.      all of the Invariant Sections of all of the original documents,
  1548.      unmodified, and list them all as Invariant Sections of your
  1549.      combined work in its license notice.
  1550.  
  1551.      The combined work need only contain one copy of this License, and
  1552.      multiple identical Invariant Sections may be replaced with a single
  1553.      copy.  If there are multiple Invariant Sections with the same name
  1554.      but different contents, make the title of each such section unique
  1555.      by adding at the end of it, in parentheses, the name of the
  1556.      original author or publisher of that section if known, or else a
  1557.      unique number.  Make the same adjustment to the section titles in
  1558.      the list of Invariant Sections in the license notice of the
  1559.      combined work.
  1560.  
  1561.      In the combination, you must combine any sections entitled
  1562.      "History" in the various original documents, forming one section
  1563.      entitled "History"; likewise combine any sections entitled
  1564.      "Acknowledgements", and any sections entitled "Dedications".  You
  1565.      must delete all sections entitled "Endorsements."
  1566.  
  1567.   6. COLLECTIONS OF DOCUMENTS
  1568.  
  1569.      You may make a collection consisting of the Document and other
  1570.      documents released under this License, and replace the individual
  1571.      copies of this License in the various documents with a single copy
  1572.      that is included in the collection, provided that you follow the
  1573.      rules of this License for verbatim copying of each of the
  1574.      documents in all other respects.
  1575.  
  1576.      You may extract a single document from such a collection, and
  1577.      distribute it individually under this License, provided you insert
  1578.      a copy of this License into the extracted document, and follow
  1579.      this License in all other respects regarding verbatim copying of
  1580.      that document.
  1581.  
  1582.   7. AGGREGATION WITH INDEPENDENT WORKS
  1583.  
  1584.      A compilation of the Document or its derivatives with other
  1585.      separate and independent documents or works, in or on a volume of
  1586.      a storage or distribution medium, does not as a whole count as a
  1587.      Modified Version of the Document, provided no compilation
  1588.      copyright is claimed for the compilation.  Such a compilation is
  1589.      called an "aggregate", and this License does not apply to the
  1590.      other self-contained works thus compiled with the Document, on
  1591.      account of their being thus compiled, if they are not themselves
  1592.      derivative works of the Document.
  1593.  
  1594.      If the Cover Text requirement of section 3 is applicable to these
  1595.      copies of the Document, then if the Document is less than one
  1596.      quarter of the entire aggregate, the Document's Cover Texts may be
  1597.      placed on covers that surround only the Document within the
  1598.      aggregate.  Otherwise they must appear on covers around the whole
  1599.      aggregate.
  1600.  
  1601.   8. TRANSLATION
  1602.  
  1603.      Translation is considered a kind of modification, so you may
  1604.      distribute translations of the Document under the terms of section
  1605.      4.  Replacing Invariant Sections with translations requires special
  1606.      permission from their copyright holders, but you may include
  1607.      translations of some or all Invariant Sections in addition to the
  1608.      original versions of these Invariant Sections.  You may include a
  1609.      translation of this License provided that you also include the
  1610.      original English version of this License.  In case of a
  1611.      disagreement between the translation and the original English
  1612.      version of this License, the original English version will prevail.
  1613.  
  1614.   9. TERMINATION
  1615.  
  1616.      You may not copy, modify, sublicense, or distribute the Document
  1617.      except as expressly provided for under this License.  Any other
  1618.      attempt to copy, modify, sublicense or distribute the Document is
  1619.      void, and will automatically terminate your rights under this
  1620.      License.  However, parties who have received copies, or rights,
  1621.      from you under this License will not have their licenses
  1622.      terminated so long as such parties remain in full compliance.
  1623.  
  1624.  10. FUTURE REVISIONS OF THIS LICENSE
  1625.  
  1626.      The Free Software Foundation may publish new, revised versions of
  1627.      the GNU Free Documentation License from time to time.  Such new
  1628.      versions will be similar in spirit to the present version, but may
  1629.      differ in detail to address new problems or concerns.  See
  1630.      http://www.gnu.org/copyleft/.
  1631.  
  1632.      Each version of the License is given a distinguishing version
  1633.      number.  If the Document specifies that a particular numbered
  1634.      version of this License "or any later version" applies to it, you
  1635.      have the option of following the terms and conditions either of
  1636.      that specified version or of any later version that has been
  1637.      published (not as a draft) by the Free Software Foundation.  If
  1638.      the Document does not specify a version number of this License,
  1639.      you may choose any version ever published (not as a draft) by the
  1640.      Free Software Foundation.
  1641.  
  1642.  
  1643. ADDENDUM: How to use this License for your documents
  1644. ====================================================
  1645.  
  1646. To use this License in a document you have written, include a copy of
  1647. the License in the document and put the following copyright and license
  1648. notices just after the title page:
  1649.  
  1650.  
  1651.        Copyright (C)  YEAR  YOUR NAME.
  1652.        Permission is granted to copy, distribute and/or modify this document
  1653.        under the terms of the GNU Free Documentation License, Version 1.1
  1654.        or any later version published by the Free Software Foundation;
  1655.        with the Invariant Sections being LIST THEIR TITLES, with the
  1656.        Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
  1657.        A copy of the license is included in the section entitled ``GNU
  1658.        Free Documentation License''.
  1659. If you have no Invariant Sections, write "with no Invariant
  1660. Sections" instead of saying which ones are invariant.  If you have no
  1661. Front-Cover Texts, write "no Front-Cover Texts" instead of "Front-Cover
  1662. Texts being LIST"; likewise for Back-Cover Texts.
  1663.  
  1664.    If your document contains nontrivial examples of program code, we
  1665. recommend releasing these examples in parallel under your choice of
  1666. free software license, such as the GNU General Public License, to
  1667. permit their use in free software.
  1668.  
  1669. 
  1670. File: grep,  Node: Concept Index,  Next: Index,  Prev: GNU Free Documentation License,  Up: Top
  1671.  
  1672. Concept Index
  1673. *************
  1674.  
  1675. This is a general index of all issues discussed in this manual, with the
  1676. exception of the `grep' commands and command-line options.
  1677.  
  1678. [index]
  1679. * Menu:
  1680.  
  1681. * after context:                         Invoking.            (line  75)
  1682. * alphabetic characters:                 Regular Expressions. (line  89)
  1683. * alphanumeric characters:               Regular Expressions. (line  86)
  1684. * anchoring:                             Regular Expressions. (line 199)
  1685. * asterisk:                              Regular Expressions. (line  32)
  1686. * back-reference:                        Regular Expressions. (line 205)
  1687. * backslash:                             Regular Expressions. (line 171)
  1688. * basic regular expressions:             Regular Expressions. (line 217)
  1689. * before context:                        Invoking.            (line  79)
  1690. * binary files:                          Invoking.            (line 104)
  1691. * binary files, DOS/Windows:             Invoking.            (line 235)
  1692. * blank characters:                      Regular Expressions. (line  92)
  1693. * braces, one argument:                  Regular Expressions. (line  38)
  1694. * braces, second argument omitted:       Regular Expressions. (line  41)
  1695. * braces, two arguments:                 Regular Expressions. (line  44)
  1696. * bracket expression:                    Regular Expressions. (line  63)
  1697. * Bugs, reporting:                       Reporting Bugs.      (line   6)
  1698. * byte offset:                           Invoking.            (line 118)
  1699. * byte offsets, on DOS/Windows:          Invoking.            (line 249)
  1700. * case insensitive search:               Invoking.            (line  26)
  1701. * case insensitive search, obsolete option: Invoking.         (line 231)
  1702. * changing name of standard input:       Invoking.            (line 154)
  1703. * character class:                       Regular Expressions. (line  63)
  1704. * character classes:                     Regular Expressions. (line  85)
  1705. * character type:                        Invoking.            (line 317)
  1706. * classes of characters:                 Regular Expressions. (line  85)
  1707. * context:                               Invoking.            (line  83)
  1708. * context lines, after match:            Invoking.            (line  75)
  1709. * context lines, before match:           Invoking.            (line  79)
  1710. * control characters:                    Regular Expressions. (line  95)
  1711. * Copying:                               Copying.             (line   6)
  1712. * counting lines:                        Invoking.            (line  10)
  1713. * default options environment variable:  Invoking.            (line 301)
  1714. * device search:                         Invoking.            (line 125)
  1715. * digit characters:                      Regular Expressions. (line 100)
  1716. * directory search:                      Invoking.            (line 132)
  1717. * DOS byte offsets:                      Invoking.            (line 249)
  1718. * DOS/Windows binary files:              Invoking.            (line 235)
  1719. * dot:                                   Regular Expressions. (line  26)
  1720. * environment variables:                 Invoking.            (line 300)
  1721. * exclude files:                         Invoking.            (line 194)
  1722. * FAQ about grep usage:                  Usage.               (line  17)
  1723. * FDL, GNU Free Documentation License:   GNU Free Documentation License.
  1724.                                                               (line   7)
  1725. * files which don't match:               Invoking.            (line 160)
  1726. * GPL, GNU General Public License:       GNU General Public License.
  1727.                                                               (line   7)
  1728. * graphic characters:                    Regular Expressions. (line 103)
  1729. * hexadecimal digits:                    Regular Expressions. (line 125)
  1730. * highlight markers:                     Invoking.            (line 311)
  1731. * highlight, color, colour:              Invoking.            (line  87)
  1732. * include files:                         Invoking.            (line 190)
  1733. * interval specifications:               Regular Expressions. (line 221)
  1734. * invert matching:                       Invoking.            (line  63)
  1735. * language of messages:                  Invoking.            (line 330)
  1736. * line buffering:                        Invoking.            (line 151)
  1737. * line numbering:                        Invoking.            (line  36)
  1738. * lower-case letters:                    Regular Expressions. (line 106)
  1739. * match sub-expression at most once:     Regular Expressions. (line  29)
  1740. * match sub-expression n or more times:  Regular Expressions. (line  41)
  1741. * match sub-expression n times:          Regular Expressions. (line  38)
  1742. * match sub-expression zero or more times: Regular Expressions.
  1743.                                                               (line  32)
  1744. * match the whole line:                  Invoking.            (line  67)
  1745. * matching basic regular expressions:    Grep Programs.       (line  14)
  1746. * matching extended regular expressions: Grep Programs.       (line  19)
  1747. * matching fixed strings:                Grep Programs.       (line  23)
  1748. * matching Perl regular expressions:     Grep Programs.       (line  28)
  1749. * matching whole words:                  Invoking.            (line 175)
  1750. * max-count:                             Invoking.            (line 199)
  1751. * memory mapped input:                   Invoking.            (line 258)
  1752. * message language:                      Invoking.            (line 330)
  1753. * names of matching files:               Invoking.            (line  30)
  1754. * national language support:             Invoking.            (line 317)
  1755. * NLS:                                   Invoking.            (line 317)
  1756. * no filename prefix:                    Invoking.            (line 147)
  1757. * no warranty:                           GNU General Public License.
  1758.                                                               (line 271)
  1759. * numeric characters:                    Regular Expressions. (line 100)
  1760. * only matching:                         Invoking.            (line  41)
  1761. * palindromes:                           Usage.               (line 122)
  1762. * pattern from file:                     Invoking.            (line  21)
  1763. * pattern list:                          Invoking.            (line  16)
  1764. * period:                                Regular Expressions. (line  26)
  1765. * plus sign:                             Regular Expressions. (line  35)
  1766. * print non-matching lines:              Invoking.            (line  63)
  1767. * printable characters:                  Regular Expressions. (line 110)
  1768. * punctuation characters:                Regular Expressions. (line 113)
  1769. * question mark:                         Regular Expressions. (line  29)
  1770. * quiet, silent:                         Invoking.            (line  47)
  1771. * range expression:                      Regular Expressions. (line  69)
  1772. * recursive search:                      Invoking.            (line 185)
  1773. * regular expressions:                   Regular Expressions. (line   6)
  1774. * searching directory trees:             Invoking.            (line 185)
  1775. * Searching for a pattern.:              Introduction.        (line   6)
  1776. * space characters:                      Regular Expressions. (line 117)
  1777. * suppress binary data:                  Invoking.            (line 166)
  1778. * suppress error messages:               Invoking.            (line  53)
  1779. * translation of message language:       Invoking.            (line 330)
  1780. * upper-case letters:                    Regular Expressions. (line 121)
  1781. * Usage summary, printing:               Invoking.            (line 100)
  1782. * Usage, examples:                       Usage.               (line   6)
  1783. * Using grep, Q&A:                       Usage.               (line  17)
  1784. * Version, printing:                     Invoking.            (line  96)
  1785. * whitespace characters:                 Regular Expressions. (line 117)
  1786. * with filename prefix:                  Invoking.            (line 143)
  1787. * xdigit class:                          Regular Expressions. (line 125)
  1788. * zero-terminated file names:            Invoking.            (line 266)
  1789. * zero-terminated lines:                 Invoking.            (line 277)
  1790.  
  1791. 
  1792. File: grep,  Node: Index,  Prev: Concept Index,  Up: Top
  1793.  
  1794. Index
  1795. *****
  1796.  
  1797. This is an alphabetical list of all `grep' commands, command-line
  1798. options, and environment variables.
  1799.  
  1800. [index]
  1801. * Menu:
  1802.  
  1803. * *:                                     Regular Expressions. (line  32)
  1804. * +:                                     Regular Expressions. (line  35)
  1805. * --after-context:                       Invoking.            (line  75)
  1806. * --basic-regexp:                        Grep Programs.       (line  14)
  1807. * --before-context:                      Invoking.            (line  79)
  1808. * --binary:                              Invoking.            (line 235)
  1809. * --binary-files:                        Invoking.            (line 104)
  1810. * --byte-offset:                         Invoking.            (line 118)
  1811. * --colour:                              Invoking.            (line  87)
  1812. * --context:                             Invoking.            (line  83)
  1813. * --count:                               Invoking.            (line  10)
  1814. * --devices:                             Invoking.            (line 125)
  1815. * --directories:                         Invoking.            (line 132)
  1816. * --exclude:                             Invoking.            (line 194)
  1817. * --extended-regexp:                     Grep Programs.       (line  19)
  1818. * --file:                                Invoking.            (line  21)
  1819. * --files-with-matches:                  Invoking.            (line  30)
  1820. * --files-without-match:                 Invoking.            (line 160)
  1821. * --fixed-strings:                       Grep Programs.       (line  23)
  1822. * --help:                                Invoking.            (line 100)
  1823. * --ignore-case:                         Invoking.            (line  26)
  1824. * --include:                             Invoking.            (line 190)
  1825. * --invert-match:                        Invoking.            (line  63)
  1826. * --label:                               Invoking.            (line 154)
  1827. * --line-buffered:                       Invoking.            (line 151)
  1828. * --line-number:                         Invoking.            (line  36)
  1829. * --line-regexp:                         Invoking.            (line  67)
  1830. * --max-count:                           Invoking.            (line 199)
  1831. * --mmap:                                Invoking.            (line 258)
  1832. * --no-filename:                         Invoking.            (line 147)
  1833. * --no-messages:                         Invoking.            (line  53)
  1834. * --null:                                Invoking.            (line 266)
  1835. * --null-data:                           Invoking.            (line 277)
  1836. * --only-matching:                       Invoking.            (line  41)
  1837. * --perl-regexp:                         Grep Programs.       (line  28)
  1838. * --quiet:                               Invoking.            (line  47)
  1839. * --recursive:                           Invoking.            (line 185)
  1840. * --regexp=PATTERN:                      Invoking.            (line  16)
  1841. * --silent:                              Invoking.            (line  47)
  1842. * --text:                                Invoking.            (line 166)
  1843. * --unix-byte-offsets:                   Invoking.            (line 249)
  1844. * --version:                             Invoking.            (line  96)
  1845. * --With-filename:                       Invoking.            (line 143)
  1846. * --word-regexp:                         Invoking.            (line 175)
  1847. * -a:                                    Invoking.            (line 166)
  1848. * -A:                                    Invoking.            (line  75)
  1849. * -b:                                    Invoking.            (line 118)
  1850. * -B:                                    Invoking.            (line  79)
  1851. * -C:                                    Invoking.            (line  83)
  1852. * -c:                                    Invoking.            (line  10)
  1853. * -d:                                    Invoking.            (line 132)
  1854. * -D:                                    Invoking.            (line 125)
  1855. * -E:                                    Grep Programs.       (line  19)
  1856. * -e:                                    Invoking.            (line  16)
  1857. * -F:                                    Grep Programs.       (line  23)
  1858. * -f:                                    Invoking.            (line  21)
  1859. * -G:                                    Grep Programs.       (line  14)
  1860. * -h:                                    Invoking.            (line 147)
  1861. * -H:                                    Invoking.            (line 143)
  1862. * -i:                                    Invoking.            (line  26)
  1863. * -L:                                    Invoking.            (line 160)
  1864. * -l:                                    Invoking.            (line  30)
  1865. * -m:                                    Invoking.            (line 199)
  1866. * -n:                                    Invoking.            (line  36)
  1867. * -NUM:                                  Invoking.            (line  91)
  1868. * -o:                                    Invoking.            (line  41)
  1869. * -P:                                    Grep Programs.       (line  28)
  1870. * -q:                                    Invoking.            (line  47)
  1871. * -r:                                    Invoking.            (line 185)
  1872. * -s:                                    Invoking.            (line  53)
  1873. * -u:                                    Invoking.            (line 249)
  1874. * -U:                                    Invoking.            (line 235)
  1875. * -V:                                    Invoking.            (line  96)
  1876. * -v:                                    Invoking.            (line  63)
  1877. * -w:                                    Invoking.            (line 175)
  1878. * -x:                                    Invoking.            (line  67)
  1879. * -y:                                    Invoking.            (line 231)
  1880. * -z:                                    Invoking.            (line 277)
  1881. * -Z:                                    Invoking.            (line 266)
  1882. * .:                                     Regular Expressions. (line  26)
  1883. * ?:                                     Regular Expressions. (line  29)
  1884. * _N_GNU_nonoption_argv_flags_:          Invoking.            (line 346)
  1885. * alnum:                                 Regular Expressions. (line  86)
  1886. * alpha:                                 Regular Expressions. (line  89)
  1887. * blank:                                 Regular Expressions. (line  92)
  1888. * cntrl:                                 Regular Expressions. (line  95)
  1889. * digit:                                 Regular Expressions. (line 100)
  1890. * graph:                                 Regular Expressions. (line 103)
  1891. * GREP_COLOR:                            Invoking.            (line 311)
  1892. * GREP_OPTIONS:                          Invoking.            (line 301)
  1893. * LANG:                                  Invoking.            (line 317)
  1894. * LC_ALL:                                Invoking.            (line 317)
  1895. * LC_COLLATE:                            Invoking.            (line 317)
  1896. * LC_CTYPE:                              Invoking.            (line 324)
  1897. * LC_MESSAGES:                           Invoking.            (line 330)
  1898. * lower:                                 Regular Expressions. (line 106)
  1899. * POSIXLY_CORRECT:                       Invoking.            (line 335)
  1900. * print:                                 Regular Expressions. (line 110)
  1901. * punct:                                 Regular Expressions. (line 113)
  1902. * space:                                 Regular Expressions. (line 117)
  1903. * upper:                                 Regular Expressions. (line 121)
  1904. * xdigit:                                Regular Expressions. (line 125)
  1905. * {n,m}:                                 Regular Expressions. (line  44)
  1906. * {n,}:                                  Regular Expressions. (line  41)
  1907. * {n}:                                   Regular Expressions. (line  38)
  1908.  
  1909.  
  1910. 
  1911. Tag Table:
  1912. Node: Top1064
  1913. Node: Introduction1873
  1914. Node: Invoking2596
  1915. Node: Diagnostics15997
  1916. Node: Grep Programs16317
  1917. Node: Regular Expressions17284
  1918. Node: Usage25144
  1919. Node: Reporting Bugs30571
  1920. Node: Copying31093
  1921. Node: GNU General Public License33733
  1922. Node: GNU Free Documentation License52901
  1923. Node: Concept Index72637
  1924. Node: Index80860
  1925. 
  1926. End Tag Table
  1927.