xref: /netbsd-src/external/gpl2/grep/dist/doc/grep.texi (revision fb69a85ab0bac94047f5be60bf0f33641f617669)
1\input texinfo  @c -*-texinfo-*-
2@c $NetBSD: grep.texi,v 1.2 2016/01/10 22:16:40 christos Exp $
3@c %**start of header
4@setfilename grep.info
5@settitle grep, print lines matching a pattern
6@c %**end of header
7
8@c This file has the new style title page commands.
9@c Run `makeinfo' rather than `texinfo-format-buffer'.
10
11@c smallbook
12
13@c tex
14@c \overfullrule=0pt
15@c end tex
16
17@include version.texi
18
19@c Combine indices.
20@syncodeindex ky cp
21@syncodeindex pg cp
22@syncodeindex tp cp
23
24@defcodeindex op
25@syncodeindex op fn
26@syncodeindex vr fn
27
28@ifinfo
29@direntry
30* grep: (grep).                 print lines matching a pattern.
31@end direntry
32This file documents @command{grep}, a pattern matching engine.
33
34
35Published by the Free Software Foundation,
3659 Temple Place - Suite 330
37Boston, MA 02111-1307, USA
38
39@c man begin COPYRIGHT
40Copyright @copyright{} 2000, 2001 Free Software Foundation, Inc.
41
42Permission is granted to make and distribute verbatim copies of
43this manual provided the copyright notice and this permission notice
44are preserved on all copies.
45
46@ignore
47Permission is granted to process this file through TeX and print the
48results, provided the printed document carries a copying permission
49notice identical to this one except for the removal of this paragraph
50(this paragraph not being relevant to the printed manual).
51
52@end ignore
53Permission is granted to copy, distribute and/or modify this document
54under the terms of the GNU Free Documentation License, Version 1.1 or
55any later version published by the Free Software Foundation; with the
56Invariant Sections being ``GNU General Public License'' and ``GNU Free
57Documentation License'', with no Front-Cover Texts, and with no
58Back-Cover Texts.  A copy of the license is included in the section
59entitled ``GNU Free Documentation License'' (@pxref{Copying}).
60@c man end
61@end ifinfo
62
63@setchapternewpage off
64
65@titlepage
66@title grep, searching for a pattern
67@subtitle version @value{VERSION}, @value{UPDATED}
68@author Alain Magloire et al.
69
70@page
71@vskip 0pt plus 1filll
72Copyright @copyright{} 2000, 2001 Free Software Foundation, Inc.
73
74@sp 2
75Published by the Free Software Foundation, @*
7659 Temple Place - Suite 330, @*
77Boston, MA 02111-1307, USA
78
79Permission is granted to copy, distribute and/or modify this document
80under the terms of the GNU Free Documentation License, Version 1.1 or
81any later version published by the Free Software Foundation; with the
82Invariant Sections being ``GNU General Public License'' and ``GNU Free
83Documentation License'', with no Front-Cover Texts, and with no
84Back-Cover Texts.  A copy of the license is included in the section
85entitled ``GNU Free Documentation License''.
86@end titlepage
87
88
89@ifnottex
90@node Top
91@top Grep
92
93@command{grep} searches for lines matching a pattern.
94
95This document was produced for version @value{VERSION} of @sc{gnu}
96@command{grep}.
97@end ifnottex
98
99@menu
100* Introduction::                Introduction.
101* Invoking::                    Invoking @command{grep}; description of options.
102* Diagnostics::                 Exit status returned by @command{grep}.
103* Grep Programs::               @command{grep} programs.
104* Regular Expressions::         Regular Expressions.
105* Usage::                       Examples.
106* Reporting Bugs::              Reporting Bugs.
107* Copying::                     License terms.
108* Concept Index::               A menu with all the topics in this manual.
109* Index::                       A menu with all @command{grep} commands
110                                 and command-line options.
111@end menu
112
113
114@node Introduction, Invoking, Top, Top
115@chapter Introduction
116
117@cindex Searching for a pattern.
118
119@command{grep} searches the input files
120for lines containing a match to a given
121pattern list.  When it finds a match in a line, it copies the line to standard
122output (by default), or does whatever other sort of output you have requested
123with options.
124
125Though @command{grep} expects to do the matching on text,
126it has no limits on input line length other than available memory,
127and it can match arbitrary characters within a line.
128If the final byte of an input file is not a newline,
129@command{grep} silently supplies one.
130Since newline is also a separator for the list of patterns, there
131is no way to match newline characters in a text.
132
133@node Invoking
134@chapter Invoking @command{grep}
135
136@command{grep} comes with a rich set of options from @sc{posix.2} and @sc{gnu}
137extensions.
138
139@table @samp
140
141@item -c
142@itemx --count
143@opindex -c
144@opindex --count
145@cindex counting lines
146Suppress normal output; instead print a count of matching
147lines for each input file.  With the @samp{-v}, @samp{--invert-match} option,
148count non-matching lines.
149
150@item -e @var{pattern}
151@itemx --regexp=@var{pattern}
152@opindex -e
153@opindex --regexp=@var{pattern}
154@cindex pattern list
155Use @var{pattern} as the pattern; useful to protect patterns
156beginning with a @samp{-}.
157
158@item -f @var{file}
159@itemx --file=@var{file}
160@opindex -f
161@opindex --file
162@cindex pattern from file
163Obtain patterns from @var{file}, one per line.  The empty
164file contains zero patterns, and therefore matches nothing.
165
166@item -i
167@itemx --ignore-case
168@opindex -i
169@opindex --ignore-case
170@cindex case insensitive search
171Ignore case distinctions in both the pattern and the input files.
172
173@item -l
174@itemx --files-with-matches
175@opindex -l
176@opindex --files-with-matches
177@cindex names of matching files
178Suppress normal output; instead print the name of each input
179file from which output would normally have been printed.
180The scanning of every file will stop on the first match.
181
182@item -n
183@itemx --line-number
184@opindex -n
185@opindex --line-number
186@cindex line numbering
187Prefix each line of output with the line number within its input file.
188
189@item -o
190@itemx --only-matching
191@opindex -o
192@opindex --only-matching
193@cindex only matching
194Print only the part of matching lines that actually matches @var{pattern}.
195
196@item -q
197@itemx --quiet
198@itemx --silent
199@opindex -q
200@opindex --quiet
201@opindex --silent
202@cindex quiet, silent
203Quiet; do not write anything to standard output.  Exit immediately with
204zero status if any match is found, even if an error was detected.  Also
205see the @samp{-s} or @samp{--no-messages} option.
206
207@item -s
208@itemx --no-messages
209@opindex -s
210@opindex --no-messages
211@cindex suppress error messages
212Suppress error messages about nonexistent or unreadable files.
213Portability note: unlike @sc{gnu} @command{grep}, traditional
214@command{grep} did not conform to @sc{posix.2}, because traditional
215@command{grep} lacked a @samp{-q} option and its @samp{-s} option behaved
216like @sc{gnu} @command{grep}'s @samp{-q} option.  Shell scripts intended
217to be portable to traditional @command{grep} should avoid both
218@samp{-q} and @samp{-s} and should redirect
219output to @file{/dev/null} instead.
220
221@item -v
222@itemx --invert-match
223@opindex -v
224@opindex --invert-match
225@cindex invert matching
226@cindex print non-matching lines
227Invert the sense of matching, to select non-matching lines.
228
229@item -x
230@itemx --line-regexp
231@opindex -x
232@opindex --line-regexp
233@cindex match the whole line
234Select only those matches that exactly match the whole line.
235
236@end table
237
238@section @sc{gnu} Extensions
239
240@table @samp
241
242@item -A @var{num}
243@itemx --after-context=@var{num}
244@opindex -A
245@opindex --after-context
246@cindex after context
247@cindex context lines, after match
248Print @var{num} lines of trailing context after matching lines.
249
250@item -B @var{num}
251@itemx --before-context=@var{num}
252@opindex -B
253@opindex --before-context
254@cindex before context
255@cindex context lines, before match
256Print @var{num} lines of leading context before matching lines.
257
258@item -C @var{num}
259@itemx --context=@var{num}
260@opindex -C
261@opindex --context
262@cindex context
263Print @var{num} lines of output context.
264
265@item --colour[=@var{WHEN}]
266@itemx --color[=@var{WHEN}]
267@opindex --colour
268@cindex highlight, color, colour
269The matching string is surrounded by the marker specify in @var{GREP_COLOR}.
270@var{WHEN} may be `never', `always', or `auto'.
271
272@item -@var{num}
273@opindex -NUM
274Same as @samp{--context=@var{num}} lines of leading and trailing
275context.  However, grep will never print any given line more than once.
276
277
278@item -V
279@itemx --version
280@opindex -V
281@opindex --version
282@cindex Version, printing
283Print the version number of @command{grep} to the standard output stream.
284This version number should be included in all bug reports.
285
286@item --help
287@opindex --help
288@cindex Usage summary, printing
289Print a usage message briefly summarizing these command-line options
290and the bug-reporting address, then exit.
291
292@itemx --binary-files=@var{type}
293@opindex --binary-files
294@cindex binary files
295If the first few bytes of a file indicate that the file contains binary
296data, assume that the file is of type @var{type}.  By default,
297@var{type} is @samp{binary}, and @command{grep} normally outputs either
298a one-line message saying that a binary file matches, or no message if
299there is no match.  If @var{type} is @samp{without-match},
300@command{grep} assumes that a binary file does not match;
301this is equivalent to the @samp{-I} option.  If @var{type}
302is @samp{text}, @command{grep} processes a binary file as if it were
303text; this is equivalent to the @samp{-a} option.
304@emph{Warning:} @samp{--binary-files=text} might output binary garbage,
305which can have nasty side effects if the output is a terminal and if the
306terminal driver interprets some of it as commands.
307
308@item -b
309@itemx --byte-offset
310@opindex -b
311@opindex --byte-offset
312@cindex byte offset
313Print the byte offset within the input file before each line of output.
314When @command{grep} runs on @sc{ms-dos} or MS-Windows, the printed
315byte offsets
316depend on whether the @samp{-u} (@samp{--unix-byte-offsets}) option is
317used; see below.
318
319@item -D @var{action}
320@itemx --devices=@var{action}
321@opindex -D
322@opindex --devices
323@cindex device search
324If an input file is a device, FIFO or socket, use @var{action} to process it.
325By default, @var{action} is @samp{read}, which means that devices are
326read just as if they were ordinary files.
327If @var{action} is @samp{skip}, devices, FIFOs and sockets are silently
328skipped.
329
330@item -d @var{action}
331@itemx --directories=@var{action}
332@opindex -d
333@opindex --directories
334@cindex directory search
335If an input file is a directory, use @var{action} to process it.
336By default, @var{action} is @samp{read}, which means that directories are
337read just as if they were ordinary files (some operating systems
338and filesystems disallow this, and will cause @command{grep} to print error
339messages for every directory or silently skip them). If @var{action} is
340@samp{skip}, directories are silently skipped.  If @var{action} is
341@samp{recurse}, @command{grep} reads all files under each directory,
342recursively; this is equivalent to the @samp{-r} option.
343
344@item -H
345@itemx --with-filename
346@opindex -H
347@opindex --With-filename
348@cindex with filename prefix
349Print the filename for each match.
350
351@item -h
352@itemx --no-filename
353@opindex -h
354@opindex --no-filename
355@cindex no filename prefix
356Suppress the prefixing of filenames on output when multiple files are searched.
357
358@item --line-buffered
359@opindex --line-buffered
360@cindex line buffering
361Set the line buffering policy, this can be a performance penalty.
362
363@item --label=@var{LABEL}
364@opindex --label
365@cindex changing name of standard input
366Displays input actually coming from standard input as input coming from file
367@var{LABEL}. This is especially useful for tools like zgrep, e.g.
368@command{gzip -cd foo.gz |grep --label=foo something}
369
370@item -L
371@itemx --files-without-match
372@opindex -L
373@opindex --files-without-match
374@cindex files which don't match
375Suppress normal output; instead print the name of each input
376file from which no output would normally have been printed.
377The scanning of every file will stop on the first match.
378
379@item -a
380@itemx --text
381@opindex -a
382@opindex --text
383@cindex suppress binary data
384@cindex binary files
385Process a binary file as if it were text; this is equivalent to the
386@samp{--binary-files=text} option.
387
388@item -I
389Process a binary file as if it did not contain matching data; this is
390equivalent to the @samp{--binary-files=without-match} option.
391
392@item -w
393@itemx --word-regexp
394@opindex -w
395@opindex --word-regexp
396@cindex matching whole words
397Select only those lines containing matches that form
398whole words.  The test is that the matching substring
399must either be at the beginning of the line, or preceded
400by a non-word constituent character.  Similarly,
401it must be either at the end of the line or followed by
402a non-word constituent character.  Word-constituent
403characters are letters, digits, and the underscore.
404
405@item -r
406@itemx -R
407@itemx --recursive
408@opindex -r
409@opindex --recursive
410@cindex recursive search
411@cindex searching directory trees
412For each directory mentioned in the command line, read and process all
413files in that directory, recursively.  This is the same as the
414@samp{--directories=recurse} option.
415
416@item --include=@var{file_pattern}
417@opindex --include
418@cindex include files
419@cindex searching directory trees
420When processing directories recursively, only files matching @var{file_pattern}
421will be search.
422
423@item --exclude=@var{file_pattern}
424@opindex --exclude
425@cindex exclude files
426@cindex searching directory trees
427When processing directories recursively, skip files matching @var{file_pattern}.
428
429@item -m @var{num}
430@itemx --max-count=@var{num}
431@opindex -m
432@opindex --max-count
433@cindex max-count
434Stop reading a file after @var{num} matching lines.  If the input is
435standard input from a regular file, and @var{num} matching lines are
436output, @command{grep} ensures that the standard input is positioned to
437just after the last matching line before exiting, regardless of the
438presence of trailing context lines.  This enables a calling process
439to resume a search.  For example, the following shell script makes use
440of it:
441
442@example
443while grep -m 1 PATTERN
444do
445  echo xxxx
446done < FILE
447@end example
448
449But the following probably will not work because a pipe is not a regular
450file:
451
452@example
453# This probably will not work.
454cat FILE |
455while grep -m 1 PATTERN
456do
457  echo xxxx
458done
459@end example
460
461When @command{grep} stops after NUM matching lines, it outputs
462any trailing context lines. Since context does not include matching
463lines, @command{grep} will stop when it encounters another matching line.
464When the @samp{-c} or @samp{--count} option is also used,
465@command{grep} does not output a count greater than @var{num}.
466When the @samp{-v} or @samp{--invert-match} option is
467also used, @command{grep} stops after outputting @var{num}
468non-matching lines.
469
470@item -y
471@opindex -y
472@cindex case insensitive search, obsolete option
473Obsolete synonym for @samp{-i}.
474
475@item -U
476@itemx --binary
477@opindex -U
478@opindex --binary
479@cindex DOS/Windows binary files
480@cindex binary files, DOS/Windows
481Treat the file(s) as binary.  By default, under @sc{ms-dos}
482and MS-Windows, @command{grep} guesses the file type by looking
483at the contents of the first 32kB read from the file.
484If @command{grep} decides the file is a text file, it strips the
485@code{CR} characters from the original file contents (to make
486regular expressions with @code{^} and @code{$} work correctly).
487Specifying @samp{-U} overrules this guesswork, causing all
488files to be read and passed to the matching mechanism
489verbatim; if the file is a text file with @code{CR/LF} pairs
490at the end of each line, this will cause some regular
491expressions to fail.  This option has no effect on platforms other than
492@sc{ms-dos} and MS-Windows.
493
494@item -u
495@itemx --unix-byte-offsets
496@opindex -u
497@opindex --unix-byte-offsets
498@cindex DOS byte offsets
499@cindex byte offsets, on DOS/Windows
500Report Unix-style byte offsets.  This switch causes
501@command{grep} to report byte offsets as if the file were Unix style
502text file, i.e., the byte offsets ignore the @code{CR} characters which were
503stripped.  This will produce results identical to running @command{grep} on
504a Unix machine.  This option has no effect unless @samp{-b}
505option is also used; it has no effect on platforms other than @sc{ms-dos} and
506MS-Windows.
507
508@item --mmap
509@opindex --mmap
510@cindex memory mapped input
511If possible, use the @code{mmap} system call to read input, instead of
512the default @code{read} system call.  In some situations, @samp{--mmap}
513yields better performance.  However, @samp{--mmap} can cause undefined
514behavior (including core dumps) if an input file shrinks while
515@command{grep} is operating, or if an I/O error occurs.
516
517@item -Z
518@itemx --null
519@opindex -Z
520@opindex --null
521@cindex zero-terminated file names
522Output a zero byte (the @sc{ascii} @code{NUL} character) instead of the
523character that normally follows a file name.  For example, @samp{grep
524-lZ} outputs a zero byte after each file name instead of the usual
525newline.  This option makes the output unambiguous, even in the presence
526of file names containing unusual characters like newlines.  This option
527can be used with commands like @samp{find -print0}, @samp{perl -0},
528@samp{sort -z}, and @samp{xargs -0} to process arbitrary file names,
529even those that contain newline characters.
530
531@item -z
532@itemx --null-data
533@opindex -z
534@opindex --null-data
535@cindex zero-terminated lines
536Treat the input as a set of lines, each terminated by a zero byte (the
537@sc{ascii} @code{NUL} character) instead of a newline.  Like the @samp{-Z}
538or @samp{--null} option, this option can be used with commands like
539@samp{sort -z} to process arbitrary file names.
540
541@end table
542
543Several additional options control which variant of the @command{grep}
544matching engine is used.  @xref{Grep Programs}.
545
546@section Environment Variables
547
548Grep's behavior is affected by the following environment variables.
549
550A locale @code{LC_@var{foo}} is specified by examining the three
551environment variables @env{LC_ALL}, @env{LC_@var{foo}}, and @env{LANG},
552in that order.  The first of these variables that is set specifies the
553locale.  For example, if @env{LC_ALL} is not set, but @env{LC_MESSAGES}
554is set to @samp{pt_BR}, then Brazilian Portuguese is used for the
555@code{LC_MESSAGES} locale.  The C locale is used if none of these
556environment variables are set, or if the locale catalog is not
557installed, or if @command{grep} was not compiled with national language
558support (@sc{nls}).
559
560@cindex environment variables
561
562@table @env
563
564@item GREP_OPTIONS
565@vindex GREP_OPTIONS
566@cindex default options environment variable
567This variable specifies default options to be placed in front of any
568explicit options.  For example, if @code{GREP_OPTIONS} is
569@samp{--binary-files=without-match --directories=skip}, @command{grep}
570behaves as if the two options @samp{--binary-files=without-match} and
571@samp{--directories=skip} had been specified before
572any explicit options.  Option specifications are separated by
573whitespace.  A backslash escapes the next character, so it can be used to
574specify an option containing whitespace or a backslash.
575
576@item GREP_COLOR
577@vindex GREP_COLOR
578@cindex highlight markers
579This variable specifies the surrounding markers use to highlight the matching
580text.  The default is control ascii red.
581
582@item LC_ALL
583@itemx LC_COLLATE
584@itemx LANG
585@vindex LC_ALL
586@vindex LC_COLLATE
587@vindex LANG
588@cindex character type
589@cindex national language support
590@cindex NLS
591These variables specify the @code{LC_COLLATE} locale, which determines
592the collating sequence used to interpret range expressions like
593@samp{[a-z]}.
594
595@item LC_ALL
596@itemx LC_CTYPE
597@itemx LANG
598@vindex LC_ALL
599@vindex LC_CTYPE
600@vindex LANG
601@cindex character type
602@cindex national language support
603@cindex NLS
604These variables specify the @code{LC_CTYPE} locale, which determines the
605type of characters, e.g., which characters are whitespace.
606
607@item LC_ALL
608@itemx LC_MESSAGES
609@itemx LANG
610@vindex LC_ALL
611@vindex LC_MESSAGES
612@vindex LANG
613@cindex language of messages
614@cindex message language
615@cindex national language support
616@cindex NLS
617@cindex translation of message language
618These variables specify the @code{LC_MESSAGES} locale, which determines
619the language that @command{grep} uses for messages.  The default C
620locale uses American English messages.
621
622@item POSIXLY_CORRECT
623@vindex POSIXLY_CORRECT
624If set, @command{grep} behaves as @sc{posix.2} requires; otherwise,
625@command{grep} behaves more like other @sc{gnu} programs.  @sc{posix.2}
626requires that options that
627follow file names must be treated as file names; by default, such
628options are permuted to the front of the operand list and are treated as
629options.  Also, @sc{posix.2} requires that unrecognized options be
630diagnosed as
631``illegal'', but since they are not really against the law the default
632is to diagnose them as ``invalid''.  @code{POSIXLY_CORRECT} also
633disables @code{_@var{N}_GNU_nonoption_argv_flags_}, described below.
634
635@item _@var{N}_GNU_nonoption_argv_flags_
636@vindex _@var{N}_GNU_nonoption_argv_flags_
637(Here @code{@var{N}} is @command{grep}'s numeric process ID.)  If the
638@var{i}th character of this environment variable's value is @samp{1}, do
639not consider the @var{i}th operand of @command{grep} to be an option, even if
640it appears to be one.  A shell can put this variable in the environment
641for each command it runs, specifying which operands are the results of
642file name wildcard expansion and therefore should not be treated as
643options.  This behavior is available only with the @sc{gnu} C library, and
644only when @code{POSIXLY_CORRECT} is not set.
645
646@end table
647
648@node Diagnostics
649@chapter Diagnostics
650
651Normally, exit status is 0 if selected lines are found and 1 otherwise.
652But the exit status is 2 if an error occurred, unless the @option{-q} or
653@option{--quiet} or @option{--silent} option is used and a selected line
654is found.
655
656@node Grep Programs
657@chapter @command{grep} programs
658
659@command{grep} searches the named input files (or standard input if no
660files are named, or the file name @file{-} is given) for lines containing
661a match to the given pattern.  By default, @command{grep} prints the
662matching lines.  There are four major variants of @command{grep},
663controlled by the following options.
664
665@table @samp
666
667@item -G
668@itemx --basic-regexp
669@opindex -G
670@opindex --basic-regexp
671@cindex matching basic regular expressions
672Interpret the pattern as a basic regular expression.  This is the default.
673
674@item -E
675@itemx --extended-regexp
676@opindex -E
677@opindex --extended-regexp
678@cindex matching extended regular expressions
679Interpret the pattern as an extended regular expression.
680
681@item -F
682@itemx --fixed-strings
683@opindex -F
684@opindex --fixed-strings
685@cindex matching fixed strings
686Interpret the pattern as a list of fixed strings, separated
687by newlines, any of which is to be matched.
688
689@item -P
690@itemx --perl-regexp
691@opindex -P
692@opindex --perl-regexp
693@cindex matching Perl regular expressions
694Interpret the pattern as a Perl regular expression.
695
696@end table
697
698In addition, two variant programs @sc{egrep} and @sc{fgrep} are available.
699@sc{egrep} is the same as @samp{grep -E}.  @sc{fgrep} is the
700same as @samp{grep -F}.
701
702@node Regular Expressions
703@chapter Regular Expressions
704@cindex regular expressions
705
706A @dfn{regular expression} is a pattern that describes a set of strings.
707Regular expressions are constructed analogously to arithmetic expressions,
708by using various operators to combine smaller expressions.
709@command{grep} understands two different versions of regular expression
710syntax: ``basic''(BRE) and ``extended''(ERE).  In @sc{gnu} @command{grep},
711there is no difference in available functionality using either syntax.
712In other implementations, basic regular expressions are less powerful.
713The following description applies to extended regular expressions;
714differences for basic regular expressions are summarized afterwards.
715
716The fundamental building blocks are the regular expressions that match
717a single character.  Most characters, including all letters and digits,
718are regular expressions that match themselves.  Any metacharacter
719with special meaning may be quoted by preceding it with a backslash.
720
721A regular expression may be followed by one of several
722repetition operators:
723
724@table @samp
725
726@item .
727@opindex .
728@cindex dot
729@cindex period
730The period @samp{.} matches any single character.
731
732@item ?
733@opindex ?
734@cindex question mark
735@cindex match sub-expression at most once
736The preceding item is optional and will be matched at most once.
737
738@item *
739@opindex *
740@cindex asterisk
741@cindex match sub-expression zero or more times
742The preceding item will be matched zero or more times.
743
744@item +
745@opindex +
746@cindex plus sign
747The preceding item will be matched one or more times.
748
749@item @{@var{n}@}
750@opindex @{n@}
751@cindex braces, one argument
752@cindex match sub-expression n times
753The preceding item is matched exactly @var{n} times.
754
755@item @{@var{n},@}
756@opindex @{n,@}
757@cindex braces, second argument omitted
758@cindex match sub-expression n or more times
759The preceding item is matched n or more times.
760
761@item @{@var{n},@var{m}@}
762@opindex @{n,m@}
763@cindex braces, two arguments
764The preceding item is matched at least @var{n} times, but not more than
765@var{m} times.
766
767@end table
768
769Two regular expressions may be concatenated; the resulting regular
770expression matches any string formed by concatenating two substrings
771that respectively match the concatenated subexpressions.
772
773Two regular expressions may be joined by the infix operator @samp{|}; the
774resulting regular expression matches any string matching either subexpression.
775
776Repetition takes precedence over concatenation, which in turn
777takes precedence over alternation.  A whole subexpression may be
778enclosed in parentheses to override these precedence rules.
779
780@section Character Class
781
782@cindex bracket expression
783@cindex character class
784A @dfn{bracket expression} is a list of characters enclosed by @samp{[} and
785@samp{]}.  It matches any single character in that list; if the first
786character of the list is the caret @samp{^}, then it matches any character
787@strong{not} in the list.  For example, the regular expression
788@samp{[0123456789]} matches any single digit.
789
790@cindex range expression
791Within a bracket expression, a @dfn{range expression} consists of two
792characters separated by a hyphen.  It matches any single character that
793sorts between the two characters, inclusive, using the locale's
794collating sequence and character set.  For example, in the default C
795locale, @samp{[a-d]} is equivalent to @samp{[abcd]}.  Many locales sort
796characters in dictionary order, and in these locales @samp{[a-d]} is
797typically not equivalent to @samp{[abcd]}; it might be equivalent to
798@samp{[aBbCcDd]}, for example.  To obtain the traditional interpretation
799of bracket expressions, you can use the C locale by setting the
800@env{LC_ALL} environment variable to the value @samp{C}.
801
802Finally, certain named classes of characters are predefined within
803bracket expressions, as follows.
804Their interpretation depends on the @code{LC_CTYPE} locale; the
805interpretation below is that of the C locale, which is the default
806if no @code{LC_CTYPE} locale is specified.
807
808@cindex classes of characters
809@cindex character classes
810@table @samp
811
812@item [:alnum:]
813@opindex alnum
814@cindex alphanumeric characters
815Alphanumeric characters:
816@samp{[:alpha:]} and @samp{[:digit:]}.
817
818@item [:alpha:]
819@opindex alpha
820@cindex alphabetic characters
821Alphabetic characters:
822@samp{[:lower:]} and @samp{[:upper:]}.
823
824@item [:blank:]
825@opindex blank
826@cindex blank characters
827Blank characters:
828space and tab.
829
830@item [:cntrl:]
831@opindex cntrl
832@cindex control characters
833Control characters.  In @sc{ascii}, these characters have octal codes 000
834through 037, and 177 (@code{DEL}).  In other character sets, these are
835the equivalent characters, if any.
836
837@item [:digit:]
838@opindex digit
839@cindex digit characters
840@cindex numeric characters
841Digits: @code{0 1 2 3 4 5 6 7 8 9}.
842
843@item [:graph:]
844@opindex graph
845@cindex graphic characters
846Graphical characters:
847@samp{[:alnum:]} and @samp{[:punct:]}.
848
849@item [:lower:]
850@opindex lower
851@cindex lower-case letters
852Lower-case letters:
853@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}.
854
855@item [:print:]
856@opindex print
857@cindex printable characters
858Printable characters:
859@samp{[:alnum:]}, @samp{[:punct:]}, and space.
860
861@item [:punct:]
862@opindex punct
863@cindex punctuation characters
864Punctuation characters:
865@code{!@: " # $ % & ' ( ) * + , - .@: / : ; < = > ?@: @@ [ \ ] ^ _ ` @{ | @} ~}.
866
867@item [:space:]
868@opindex space
869@cindex space characters
870@cindex whitespace characters
871Space characters:
872tab, newline, vertical tab, form feed, carriage return, and space.
873
874@item [:upper:]
875@opindex upper
876@cindex upper-case letters
877Upper-case letters:
878@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}.
879
880@item [:xdigit:]
881@opindex xdigit
882@cindex xdigit class
883@cindex hexadecimal digits
884Hexadecimal digits:
885@code{0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f}.
886
887@end table
888For example, @samp{[[:alnum:]]} means @samp{[0-9A-Za-z]}, except the latter
889depends upon the C locale and the @sc{ascii} character
890encoding, whereas the former is independent of locale and character set.
891(Note that the brackets in these class names are
892part of the symbolic names, and must be included in addition to
893the brackets delimiting the bracket list.)
894
895Most metacharacters lose their special meaning inside lists.
896
897@table @samp
898@item ]
899ends the list if it's not the first list item.  So, if you want to make
900the @samp{]} character a list item, you must put it first.
901
902@item [.
903represents the open collating symbol.
904
905@item .]
906represents the close collating symbol.
907
908@item [=
909represents the open equivalence class.
910
911@item =]
912represents the close equivalence class.
913
914@item [:
915represents the open character class followed by a valid character class name.
916
917@item :]
918represents the close character class followed by a valid character class name.
919
920@item -
921represents the range if it's not first or last in a list or the ending point
922of a range.
923
924@item ^
925represents the characters not in the list.  If you want to make the @samp{^}
926character a list item, place it anywhere but first.
927
928@end table
929
930@section Backslash Character
931@cindex backslash
932
933The @samp{\} when followed by certain ordinary characters take a special
934meaning :
935
936@table @samp
937
938@item @samp{\b}
939Match the empty string at the edge of a word.
940
941@item @samp{\B}
942Match the empty string provided it's not at the edge of a word.
943
944@item @samp{\<}
945Match the empty string at the beginning of word.
946
947@item @samp{\>}
948Match the empty string at the end of word.
949
950@item @samp{\w}
951Match word constituent, it is a synonym for @samp{[[:alnum:]]}.
952
953@item @samp{\W}
954Match non word constituent, it is a synonym for @samp{[^[:alnum:]]}.
955
956@end table
957
958For example , @samp{\brat\b} matches the separate word @samp{rat},
959@samp{c\Brat\Be} matches @samp{crate}, but @samp{dirty \Brat} doesn't
960match @samp{dirty rat}.
961
962@section Anchoring
963@cindex anchoring
964
965The caret @samp{^} and the dollar sign @samp{$} are metacharacters that
966respectively match the empty string at the beginning and end of a line.
967
968@section Back-reference
969@cindex back-reference
970
971The back-reference @samp{\@var{n}}, where @var{n} is a single digit, matches
972the substring previously matched by the @var{n}th parenthesized subexpression
973of the regular expression. For example, @samp{(a)\1} matches @samp{aa}.
974When use with alternation if the group does not participate in the match, then
975the back-reference makes the whole match fail.  For example, @samp{a(.)|b\1}
976will not match @samp{ba}.  When multiple regular expressions are given with
977@samp{-e} or from a file @samp{-f file}, the back-referecences are local to
978each expression.
979
980@section Basic vs Extended
981@cindex basic regular expressions
982
983In basic regular expressions the metacharacters @samp{?}, @samp{+},
984@samp{@{}, @samp{|}, @samp{(}, and @samp{)} lose their special meaning;
985instead use the backslashed versions @samp{\?}, @samp{\+}, @samp{\@{},
986@samp{\|}, @samp{\(}, and @samp{\)}.
987
988@cindex interval specifications
989Traditional @command{egrep} did not support the @samp{@{} metacharacter,
990and some @command{egrep} implementations support @samp{\@{} instead, so
991portable scripts should avoid @samp{@{} in @samp{egrep} patterns and
992should use @samp{[@{]} to match a literal @samp{@{}.
993
994@sc{gnu} @command{egrep} attempts to support traditional usage by
995assuming that @samp{@{} is not special if it would be the start of an
996invalid interval specification.  For example, the shell command
997@samp{egrep '@{1'} searches for the two-character string @samp{@{1}
998instead of reporting a syntax error in the regular expression.
999@sc{posix.2} allows this behavior as an extension, but portable scripts
1000should avoid it.
1001
1002@node Usage
1003@chapter Usage
1004
1005@cindex Usage, examples
1006Here is an example shell command that invokes @sc{gnu} @command{grep}:
1007
1008@example
1009grep -i 'hello.*world' menu.h main.c
1010@end example
1011
1012@noindent
1013This lists all lines in the files @file{menu.h} and @file{main.c} that
1014contain the string @samp{hello} followed by the string @samp{world};
1015this is because @samp{.*} matches zero or more characters within a line.
1016@xref{Regular Expressions}.  The @samp{-i} option causes @command{grep}
1017to ignore case, causing it to match the line @samp{Hello, world!}, which
1018it would not otherwise match.  @xref{Invoking}, for more details about
1019how to invoke @command{grep}.
1020
1021@cindex Using @command{grep}, Q&A
1022@cindex FAQ about @command{grep} usage
1023Here are some common questions and answers about @command{grep} usage.
1024
1025@enumerate
1026
1027@item
1028How can I list just the names of matching files?
1029
1030@example
1031grep -l 'main' *.c
1032@end example
1033
1034@noindent
1035lists the names of all C files in the current directory whose contents
1036mention @samp{main}.
1037
1038@item
1039How do I search directories recursively?
1040
1041@example
1042grep -r 'hello' /home/gigi
1043@end example
1044
1045@noindent
1046searches for @samp{hello} in all files under the directory
1047@file{/home/gigi}.  For more control of which files are searched, use
1048@command{find}, @command{grep} and @command{xargs}.  For example,
1049the following command searches only C files:
1050
1051@smallexample
1052find /home/gigi -name '*.c' -print | xargs grep 'hello' /dev/null
1053@end smallexample
1054
1055This differs from the command:
1056
1057@example
1058grep -r 'hello' *.c
1059@end example
1060
1061which merely looks for @samp{hello} in all files in the current
1062directory whose names end in @samp{.c}.  Here the @option{-r} is
1063probably unnecessary, as recursion occurs only in the unlikely event
1064that one of @samp{.c} files is a directory.
1065
1066@item
1067What if a pattern has a leading @samp{-}?
1068
1069@example
1070grep -e '--cut here--' *
1071@end example
1072
1073@noindent
1074searches for all lines matching @samp{--cut here--}.  Without @samp{-e},
1075@command{grep} would attempt to parse @samp{--cut here--} as a list of
1076options.
1077
1078@item
1079Suppose I want to search for a whole word, not a part of a word?
1080
1081@example
1082grep -w 'hello' *
1083@end example
1084
1085@noindent
1086searches only for instances of @samp{hello} that are entire words; it
1087does not match @samp{Othello}.  For more control, use @samp{\<} and
1088@samp{\>} to match the start and end of words.  For example:
1089
1090@example
1091grep 'hello\>' *
1092@end example
1093
1094@noindent
1095searches only for words ending in @samp{hello}, so it matches the word
1096@samp{Othello}.
1097
1098@item
1099How do I output context around the matching lines?
1100
1101@example
1102grep -C 2 'hello' *
1103@end example
1104
1105@noindent
1106prints two lines of context around each matching line.
1107
1108@item
1109How do I force grep to print the name of the file?
1110
1111Append @file{/dev/null}:
1112
1113@example
1114grep 'eli' /etc/passwd /dev/null
1115@end example
1116
1117gets you:
1118
1119@smallexample
1120/etc/passwd:eli:DNGUTF58.IMe.:98:11:Eli Smith:/home/do/eli:/bin/bash
1121@end smallexample
1122
1123@item
1124Why do people use strange regular expressions on @command{ps} output?
1125
1126@example
1127ps -ef | grep '[c]ron'
1128@end example
1129
1130If the pattern had been written without the square brackets, it would
1131have matched not only the @command{ps} output line for @command{cron},
1132but also the @command{ps} output line for @command{grep}.
1133Note that some platforms @command{ps} limit the ouput to the width
1134of the screen, grep does not have any limit on the length of a line
1135except the available memory.
1136
1137@item
1138Why does @command{grep} report ``Binary file matches''?
1139
1140If @command{grep} listed all matching ``lines'' from a binary file, it
1141would probably generate output that is not useful, and it might even
1142muck up your display.  So @sc{gnu} @command{grep} suppresses output from
1143files that appear to be binary files.  To force @sc{gnu} @command{grep}
1144to output lines even from files that appear to be binary, use the
1145@samp{-a} or @samp{--binary-files=text} option.  To eliminate the
1146``Binary file matches'' messages, use the @samp{-I} or
1147@samp{--binary-files=without-match} option.
1148
1149@item
1150Why doesn't @samp{grep -lv} print nonmatching file names?
1151
1152@samp{grep -lv} lists the names of all files containing one or more
1153lines that do not match.  To list the names of all files that contain no
1154matching lines, use the @samp{-L} or @samp{--files-without-match}
1155option.
1156
1157@item
1158I can do @sc{or} with @samp{|}, but what about @sc{and}?
1159
1160@example
1161grep 'paul' /etc/motd | grep 'franc,ois'
1162@end example
1163
1164@noindent
1165finds all lines that contain both @samp{paul} and @samp{franc,ois}.
1166
1167@item
1168How can I search in both standard input and in files?
1169
1170Use the special file name @samp{-}:
1171
1172@example
1173cat /etc/passwd | grep 'alain' - /etc/motd
1174@end example
1175
1176@item
1177@cindex palindromes
1178How to express palindromes in a regular expression?
1179
1180It can be done by using the back referecences, for example a palindrome
1181of 4 chararcters can be written in BRE.
1182
1183@example
1184grep -w -e '\(.\)\(.\).\2\1' file
1185@end example
1186
1187It matches the word "radar" or "civic".
1188
1189Guglielmo Bondioni proposed a single RE that finds all the palindromes up to 19
1190characters long.
1191
1192@example
1193egrep -e '^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\9\8\7\6\5\4\3\2\1$' file
1194@end example
1195
1196Note this is done by using GNU ERE extensions, it might not be portable on
1197other greps.
1198
1199@item
1200Why are my expressions whith the vertical bar fail?
1201
1202@example
1203/bin/echo "ba" | egrep '(a)\1|(b)\1'
1204@end example
1205
1206The first alternate branch fails then the first group was not in the match
1207this will make the second alternate branch fails.  For example, "aaba" will
1208match, the first group participate in the match and can be reuse in the
1209second branch.
1210
1211@item
1212What do @command{grep, fgrep, egrep} stand for ?
1213
1214grep comes from the way line editing was done on Unix.  For example,
1215@command{ed} uses this syntax to print a list of matching lines on the screen.
1216
1217@example
1218global/regular expression/print
1219g/re/p
1220@end example
1221
1222@command{fgrep} stands for Fixed @command{grep}, @command{egrep} Extended
1223@command{grep}.
1224
1225@end enumerate
1226
1227@node Reporting Bugs, Copying, Usage, Top
1228@chapter Reporting bugs
1229
1230@cindex Bugs, reporting
1231Email bug reports to @email{bug-grep@@gnu.org}.
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