--- embedaddon/pcre/doc/pcregrep.1 2012/02/21 23:05:52 1.1 +++ embedaddon/pcre/doc/pcregrep.1 2012/10/09 09:19:17 1.1.1.2 @@ -1,4 +1,4 @@ -.TH PCREGREP 1 +.TH PCREGREP 1 "04 March 2012" "PCRE 8.31" .SH NAME pcregrep - a grep with Perl-compatible regular expressions. .SH SYNOPSIS @@ -95,6 +95,15 @@ appropriate support is not present, files are treated standard input is always so treated. . . +.SH "BINARY FILES" +.rs +.sp +By default, a file that contains a binary zero byte within the first 1024 bytes +is identified as a binary file, and is processed specially. (GNU grep also +identifies binary files in this manner.) See the \fB--binary-files\fP option +for a means of changing the way binary files are handled. +. +. .SH OPTIONS .rs .sp @@ -117,6 +126,10 @@ group of lines, unless they are in fact contiguous in of \fInumber\fP is expected to be relatively small. However, \fBpcregrep\fP guarantees to have up to 8K of following text available for context output. .TP +\fB-a\fP, \fB--text\fP +Treat binary files as text. This is equivalent to +\fB--binary-files\fP=\fItext\fP. +.TP \fB-B\fP \fInumber\fP, \fB--before-context=\fP\fInumber\fP Output \fInumber\fP lines of context before each matching line. If filenames and/or line numbers are being output, a hyphen separator is used instead of a @@ -125,6 +138,17 @@ group of lines, unless they are in fact contiguous in of \fInumber\fP is expected to be relatively small. However, \fBpcregrep\fP guarantees to have up to 8K of preceding text available for context output. .TP +\fB--binary-files=\fP\fIword\fP +Specify how binary files are to be processed. If the word is "binary" (the +default), pattern matching is performed on binary files, but the only output is +"Binary file matches" when a match succeeds. If the word is "text", +which is equivalent to the \fB-a\fP or \fB--text\fP option, binary files are +processed in the same way as any other file. In this case, when a match +succeeds, the output may be binary garbage, which can have nasty effects if +sent to a terminal. If the word is "without-match", which is equivalent to the +\fB-I\fP option, binary files are not processed at all; they are assumed not to +be of interest. +.TP \fB--buffer-size=\fP\fInumber\fP Set the parameter that controls how much memory is used for buffering files that are being scanned. @@ -224,12 +248,22 @@ each line of input. A data line is output if any of th filename can be given as "-" to refer to the standard input. When \fB-f\fP is used, patterns specified on the command line using \fB-e\fP may also be present; they are tested before the file's patterns. However, no other pattern -is taken from the command line; all arguments are treated as file names. There -is an overall maximum of 100 patterns. Trailing white space is removed from -each line, and blank lines are ignored. An empty file contains no patterns and -therefore matches nothing. See also the comments about multiple patterns versus -a single pattern with alternatives in the description of \fB-e\fP above. +is taken from the command line; all arguments are treated as the names of paths +to be searched. There is an overall maximum of 100 patterns. Trailing white +space is removed from each line, and blank lines are ignored. An empty file +contains no patterns and therefore matches nothing. See also the comments about +multiple patterns versus a single pattern with alternatives in the description +of \fB-e\fP above. .TP +\fB--file-list\fP=\fIfilename\fP +Read a list of files to be searched from the given file, one per line. Trailing +white space is removed from each line, and blank lines are ignored. These files +are searched before any others that may be listed on the command line. The +filename can be given as "-" to refer to the standard input. If \fB--file\fP +and \fB--file-list\fP are both specified as "-", patterns are read first. This +is useful only when the standard input is a terminal, from which further lines +(the list of files) can be read after an end-of-file indication. +.TP \fB--file-offsets\fP Instead of showing lines or parts of lines that match, show each match as an offset from the start of the file and a length, separated by a comma. In this @@ -255,6 +289,10 @@ If a line number is also being output, it follows the Output a help message, giving brief details of the command options and file type support, and then exit. .TP +\fB-I\fP +Treat binary files as never matching. This is equivalent to +\fB--binary-files\fP=\fIwithout-match\fP. +.TP \fB-i\fP, \fB--ignore-case\fP Ignore upper/lower case distinctions during comparisons. .TP @@ -483,13 +521,14 @@ convert this to an appropriate sequence if the output .rs .sp Many of the short and long forms of \fBpcregrep\fP's options are the same -as in the GNU \fBgrep\fP program (version 2.5.4). Any long option of the form +as in the GNU \fBgrep\fP program. Any long option of the form \fB--xxx-regexp\fP (GNU terminology) is also available as \fB--xxx-regex\fP -(PCRE terminology). However, the \fB--file-offsets\fP, \fB--include-dir\fP, -\fB--line-offsets\fP, \fB--locale\fP, \fB--match-limit\fP, \fB-M\fP, -\fB--multiline\fP, \fB-N\fP, \fB--newline\fP, \fB--recursion-limit\fP, -\fB-u\fP, and \fB--utf-8\fP options are specific to \fBpcregrep\fP, as is the -use of the \fB--only-matching\fP option with a capturing parentheses number. +(PCRE terminology). However, the \fB--file-list\fP, \fB--file-offsets\fP, +\fB--include-dir\fP, \fB--line-offsets\fP, \fB--locale\fP, \fB--match-limit\fP, +\fB-M\fP, \fB--multiline\fP, \fB-N\fP, \fB--newline\fP, +\fB--recursion-limit\fP, \fB-u\fP, and \fB--utf-8\fP options are specific to +\fBpcregrep\fP, as is the use of the \fB--only-matching\fP option with a +capturing parentheses number. .P Although most of the common options work the same way, a few are different in \fBpcregrep\fP. For example, the \fB--include\fP option's argument is a glob @@ -577,6 +616,6 @@ Cambridge CB2 3QH, England. .rs .sp .nf -Last updated: 06 September 2011 -Copyright (c) 1997-2011 University of Cambridge. +Last updated: 04 March 2012 +Copyright (c) 1997-2012 University of Cambridge. .fi