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