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