• Home
  • Raw
  • Download

Lines Matching +full:if +full:- +full:no +full:- +full:files +full:- +full:found

3 pcre2grep - a grep with Perl-compatible regular expressions.
10 \fBpcre2grep\fP searches files for character patterns, in the same way as other
16 for a quick-reference summary of pattern syntax, or
31 because they are interpreted by the shell, and indeed quotes are required if a
35 pattern to be matched when neither \fB-e\fP nor \fB-f\fP is present.
37 arguments are treated as path names. At least one of \fB-e\fP, \fB-f\fP, or an
40 If no files are specified, \fBpcre2grep\fP reads the standard input. The
44 pcre2grep some-pattern file1 - file3
46 By default, input files are searched line by line. Each line that matches a
47 pattern is copied to the standard output, and if there is more than one file,
50 example, the \fB-M\fP option makes it possible to search for strings that span
51 line boundaries. What defines a line boundary is controlled by the \fB-N\fP
52 (\fB--newline\fP) option. The \fB-h\fP and \fB-H\fP options control whether or
53 not file names are shown, and the \fB-Z\fP option changes the file name
56 The amount of memory used for buffering files that are being scanned is
57 controlled by parameters that can be set by the \fB--buffer-size\fP and
58 \fB--max-buffer-size\fP options. The first of these sets the size of buffer
59 that is obtained at the start of processing. If an input file contains very
61 extending the buffer, up to the limit specified by \fB--max-buffer-size\fP. The
63 built; if nothing is specified, the defaults are set to 20KiB and 1MiB
64 respectively. An error occurs if a line is too long and the buffer can no
68 allow for buffering "before" and "after" lines. If the buffer size is too
71 Patterns can be no longer than 8KiB or BUFSIZ bytes, whichever is the greater.
73 (specified by the use of \fB-e\fP and/or \fB-f\fP), each pattern is applied to
74 each line in the order in which they are defined, except that all the \fB-e\fP
75 patterns are tried before the \fB-f\fP patterns.
77 By default, as soon as one pattern matches a line, no further patterns are
78 considered. However, if \fB--colour\fP (or \fB--color\fP) is used to colour the
79 matching substrings, or if \fB--only-matching\fP, \fB--file-offsets\fP,
80 \fB--line-offsets\fP, or \fB--output\fP is used to output only the part of the
82 different. In this situation, all the patterns are applied to the line. If
84 subject is processed; if there is more than one match at that position, the one
85 with the longest matching substring is processed; if the matching substrings
86 are equal, the first match found is processed.
89 later matches on the same line can be found. Note, however, that an overlapping
104 The \fB--locale\fP option can be used to override this.
107 .SH "SUPPORT FOR COMPRESSED FILES"
110 Compile-time options for \fBpcre2grep\fP can set it up to use \fBlibz\fP or
111 \fBlibbz2\fP for reading compressed files whose names end in \fB.gz\fP or
114 \fB--help\fP option. If the appropriate support is not present, all files are
115 treated as plain text. The standard input is always so treated. If a file with
118 \fB--line-buffered\fP option is ignored.
121 .SH "BINARY FILES"
125 is identified as a binary file, and is processed specially. However, if the
127 zero, the test for a binary file is not applied. See the \fB--binary-files\fP
128 option for a means of changing the way binary files are handled.
136 from a file via the \fB-f\fP option may contain binary zeros.
143 example, both the \fB-H\fP and \fB-l\fP options affect the printing of file
145 effect. Similarly, except where noted below, if an option is given twice, the
149 \fB--\fP
150 This terminates the list of options. It is useful if the next item on the
154 \fB-A\fP \fInumber\fP, \fB--after-context=\fP\fInumber\fP
156 lines are output if the next match or the end of the file is reached, or if the
157 processing buffer size has been set too small. If file names and/or line
159 context lines (the \fB-Z\fP option can be used to change the file name
160 terminator to a zero byte). A line containing "--" is output between each group
162 \fInumber\fP is expected to be relatively small. When \fB-c\fP is used,
163 \fB-A\fP is ignored.
165 \fB-a\fP, \fB--text\fP
166 Treat binary files as text. This is equivalent to
167 \fB--binary-files\fP=\fItext\fP.
169 \fB--allow-lookaround-bsk\fP
174 \fB-B\fP \fInumber\fP, \fB--before-context=\fP\fInumber\fP
176 lines are output if the previous match or the start of the file is within
177 \fInumber\fP lines, or if the processing buffer size has been set too small. If
179 instead of a colon for the context lines (the \fB-Z\fP option can be used to
180 change the file name terminator to a zero byte). A line containing "--" is
183 \fB-c\fP is used, \fB-B\fP is ignored.
185 \fB--binary-files=\fP\fIword\fP
186 Specify how binary files are to be processed. If the word is "binary" (the
187 default), pattern matching is performed on binary files, but the only output is
188 "Binary file <name> matches" when a match succeeds. If the word is "text",
189 which is equivalent to the \fB-a\fP or \fB--text\fP option, binary files are
191 succeeds, the output may be binary garbage, which can have nasty effects if
192 sent to a terminal. If the word is "without-match", which is equivalent to the
193 \fB-I\fP option, binary files are not processed at all; they are assumed not to
197 \fB--buffer-size=\fP\fInumber\fP
199 processing for buffering files that are being scanned. See also
200 \fB--max-buffer-size\fP below.
202 \fB-C\fP \fInumber\fP, \fB--context=\fP\fInumber\fP
204 This is equivalent to setting both \fB-A\fP and \fB-B\fP to the same value.
206 \fB-c\fP, \fB--count\fP
207 Do not output lines from the files that are being scanned; instead output the
208 number of lines that would have been shown, either because they matched, or, if
209 \fB-v\fP is set, because they failed to match. By default, this count is
210 exactly the same as the number of lines that would have been output, but if the
211 \fB-M\fP (multiline) option is used (without \fB-v\fP), there may be more
214 If no lines are selected, the number zero is output. If several files are are
215 being scanned, a count is output for each of them and the \fB-t\fP option can
216 be used to cause a total to be output at the end. However, if the
217 \fB--files-with-matches\fP option is also used, only those files whose counts
218 are greater than zero are listed. When \fB-c\fP is used, the \fB-A\fP,
219 \fB-B\fP, and \fB-C\fP options are ignored.
221 \fB--colour\fP, \fB--color\fP
222 If this option is given without any data, it is equivalent to "--colour=auto".
226 \fB--colour=\fP\fIvalue\fP, \fB--color=\fP\fIvalue\fP
228 a pattern should be coloured in the output. It is ignored if
229 \fB--file-offsets\fP, \fB--line-offsets\fP, or \fB--output\fP is set. By
230 default, output is not coloured. The value for the \fB--colour\fP option (which
232 case, colouring happens only if the standard output is connected to a terminal.
239 PCREGREP_COLOR, which are checked in that order. If none of these are set,
243 followed by two semicolon-separated colours, terminated by the end of the
244 string or by a colon. If GREP_COLORS does not start with "ms=" or "mt=" it is
251 make sense. If no relevant environment variable is set, the default is "1;31",
254 \fB-D\fP \fIaction\fP, \fB--devices=\fP\fIaction\fP
259 \fB-d\fP \fIaction\fP, \fB--directories=\fP\fIaction\fP
261 Valid values are "read" (the default in non-Windows environments, for
262 compatibility with GNU grep), "recurse" (equivalent to the \fB-r\fP option), or
264 "read" case, directories are read as if they were ordinary files. In some
266 end-of-file; in others it may provoke an error.
268 \fB--depth-limit\fP=\fInumber\fP
269 See \fB--match-limit\fP below.
271 \fB-e\fP \fIpattern\fP, \fB--regex=\fP\fIpattern\fP, \fB--regexp=\fP\fIpattern\fP
274 single pattern that starts with a hyphen. When \fB-e\fP is used, no argument
276 names. There is no limit to the number of patterns. They are applied to each
279 If \fB-f\fP is used with \fB-e\fP, the command line patterns are matched first,
283 \fB--exclude\fP=\fIpattern\fP
284 Files (but not directories) whose names match the pattern are skipped without
285 being processed. This applies to all files, whether listed on the command line,
286 obtained from \fB--file-list\fP, or by scanning a directory. The pattern is a
288 file name, not the entire path. The \fB-F\fP, \fB-w\fP, and \fB-x\fP options do
290 to specify multiple patterns. If a file name matches both an \fB--include\fP
291 and an \fB--exclude\fP pattern, it is excluded. There is no short form for this
294 \fB--exclude-from=\fP\fIfilename\fP
295 Treat each non-empty line of the file as the data for an \fB--exclude\fP
297 system's default. The \fB--newline\fP option has no effect on this option. This
298 option may be given more than once in order to specify a number of files to
301 \fB--exclude-dir\fP=\fIpattern\fP
303 whatever the setting of the \fB--recursive\fP option. This applies to all
305 \fB--file-list\fP, or by scanning a parent directory. The pattern is a PCRE2
307 name, not the entire path. The \fB-F\fP, \fB-w\fP, and \fB-x\fP options do not
309 specify more than one pattern. If a directory matches both \fB--include-dir\fP
310 and \fB--exclude-dir\fP, it is excluded. There is no short form for this
313 \fB-F\fP, \fB--fixed-strings\fP
314 Interpret each data-matching pattern as a list of fixed strings, separated by
316 this purpose is controlled by the \fB--newline\fP option. The \fB-w\fP (match
317 as a word) and \fB-x\fP (match whole line) options can be used with \fB-F\fP.
318 They apply to each of the fixed strings. A line is selected if any of the fixed
319 strings are found in it (subject to \fB-w\fP or \fB-x\fP, if present). This
321 files; it does not apply to patterns specified by any of the \fB--include\fP or
322 \fB--exclude\fP options.
324 \fB-f\fP \fIfilename\fP, \fB--file=\fP\fIfilename\fP
326 command line, no delimiters should be used. What constitutes a newline when
328 \fB--newline\fP option has no effect on this option. Trailing white space is
329 removed from each line, and blank lines are ignored. An empty file contains no
333 If this option is given more than once, all the specified files are read. A
334 data line is output if any of the patterns match it. A file name can be given
335 as "-" to refer to the standard input. When \fB-f\fP is used, patterns
336 specified on the command line using \fB-e\fP may also be present; they are
337 matched before the file's patterns. However, no pattern is taken from the
340 \fB--file-list\fP=\fIfilename\fP
341 Read a list of files and/or directories that are to be scanned from the given
345 on the command line. The file name can be given as "-" to refer to the standard
346 input. If \fB--file\fP and \fB--file-list\fP are both specified as "-",
348 terminal, from which further lines (the list of files) can be read after an
349 end-of-file indication. If this option is given more than once, all the
350 specified files are read.
352 \fB--file-offsets\fP
355 mode, \fB--colour\fP has no effect, and no context is shown. That is, the
356 \fB-A\fP, \fB-B\fP, and \fB-C\fP options are ignored. If there is more than one
358 exclusive with \fB--output\fP, \fB--line-offsets\fP, and \fB--only-matching\fP.
360 \fB-H\fP, \fB--with-filename\fP
364 context lines, a hyphen separator is used. The \fB-Z\fP option can be used to
365 change the terminator to a zero byte. If a line number is also being output,
366 it follows the file name. When the \fB-M\fP option causes a pattern to match
368 overrides any previous \fB-h\fP, \fB-l\fP, or \fB-L\fP options.
370 \fB-h\fP, \fB--no-filename\fP
371 Suppress the output file names when searching multiple files. File names are
372 normally shown when multiple files are searched. By default, for matching
374 separator is used. The \fB-Z\fP option can be used to change the terminator to
375 a zero byte. If a line number is also being output, it follows the file name.
376 This option overrides any previous \fB-H\fP, \fB-L\fP, or \fB-l\fP options.
378 \fB--heap-limit\fP=\fInumber\fP
379 See \fB--match-limit\fP below.
381 \fB--help\fP
386 \fB-I\fP
387 Ignore binary files. This is equivalent to
388 \fB--binary-files\fP=\fIwithout-match\fP.
390 \fB-i\fP, \fB--ignore-case\fP
393 \fB--include\fP=\fIpattern\fP
394 If any \fB--include\fP patterns are specified, the only files that are
396 \fB--exclude\fP pattern. This option does not affect directories, but it
397 applies to all files, whether listed on the command line, obtained from
398 \fB--file-list\fP, or by scanning a directory. The pattern is a PCRE2 regular
400 the entire path. The \fB-F\fP, \fB-w\fP, and \fB-x\fP options do not apply to
401 this pattern. The option may be given any number of times. If a file name
402 matches both an \fB--include\fP and an \fB--exclude\fP pattern, it is excluded.
403 There is no short form for this option.
405 \fB--include-from=\fP\fIfilename\fP
406 Treat each non-empty line of the file as the data for an \fB--include\fP
408 default. The \fB--newline\fP option has no effect on this option. This option
409 may be given any number of times; all the files are read.
411 \fB--include-dir\fP=\fIpattern\fP
412 If any \fB--include-dir\fP patterns are specified, the only directories that
414 an \fB--exclude-dir\fP pattern. This applies to all directories, whether listed
415 on the command line, obtained from \fB--file-list\fP, or by scanning a parent
417 the final component of the directory name, not the entire path. The \fB-F\fP,
418 \fB-w\fP, and \fB-x\fP options do not apply to this pattern. The option may be
419 given any number of times. If a directory matches both \fB--include-dir\fP and
420 \fB--exclude-dir\fP, it is excluded. There is no short form for this option.
422 \fB-L\fP, \fB--files-without-match\fP
423 Instead of outputting lines from the files, just output the names of the files
425 output once, on a separate line by default, but if the \fB-Z\fP option is set,
427 previous \fB-H\fP, \fB-h\fP, or \fB-l\fP options.
429 \fB-l\fP, \fB--files-with-matches\fP
430 Instead of outputting lines from the files, just output the names of the files
432 a separate line, but if the \fB-Z\fP option is set, they are separated by zero
434 is found in a file. However, if the \fB-c\fP (count) option is also used,
435 matching continues in order to obtain the correct count, and those files that
437 with \fB-c\fP is a way of suppressing the listing of files with no matches that
438 occurs with \fB-c\fP on its own. This option overrides any previous \fB-H\fP,
439 \fB-h\fP, or \fB-L\fP options.
441 \fB--label\fP=\fIname\fP
443 are being output. If not supplied, "(standard input)" is used. There is no
446 \fB--line-buffered\fP
447 When this option is given, non-compressed input is read and processed line by
450 terminal, which is currently possible only in Unix-like environments or
454 However, its use will affect performance, and the \fB-M\fP (multiline) option
456 \fB--line-buffered\fP is ignored.
458 \fB--line-offsets\fP
461 number is terminated by a colon (as usual; see the \fB-n\fP option), and the
462 offset and length are separated by a comma. In this mode, \fB--colour\fP has no
463 effect, and no context is shown. That is, the \fB-A\fP, \fB-B\fP, and \fB-C\fP
464 options are ignored. If there is more than one match in a line, each of them is
465 shown separately. This option is mutually exclusive with \fB--output\fP,
466 \fB--file-offsets\fP, and \fB--only-matching\fP.
468 \fB--locale\fP=\fIlocale-name\fP
470 the value in the \fBLC_ALL\fP or \fBLC_CTYPE\fP environment variables. If no
472 used. There is no short form for this option.
474 \fB-M\fP, \fB--multiline\fP
478 used with \fB-M\fP may usefully contain literal newline characters and internal
481 started, and the last line is the line in which the match ended. If the matched
483 If \fB-v\fP is set, none of the lines in a multi-line match are output. Once a
492 pcre2grep -M 'regular\es+expression' <file>
496 well as possibly handling a two-character newline sequence.
500 large processing buffer, this should not be a problem, but the \fB-M\fP option
501 does not work when input is read line by line (see \fB--line-buffered\fP.)
503 \fB-m\fP \fInumber\fP, \fB--max-count\fP=\fInumber\fP
504 Stop processing after finding \fInumber\fP matching lines, or non-matching
505 lines if \fB-v\fP is also set. Any trailing context lines are output after the
507 for this purpose. If this limit is reached when reading the standard input from
509 If \fB-c\fP is also set, the count that is output is never greater than
510 \fInumber\fP. This option has no effect if used with \fB-L\fP, \fB-l\fP, or
511 \fB-q\fP, or when just checking for a match in a binary file.
513 \fB--match-limit\fP=\fInumber\fP
518 The \fB--match-limit\fP option provides a means of limiting computing resource
522 counter that is incremented each time around its main processing loop. If the
523 value set by \fB--match-limit\fP is reached, an error occurs.
525 The \fB--heap-limit\fP option specifies, as a number of kibibytes (units of
528 The \fB--depth-limit\fP option limits the depth of nested backtracking points,
532 limit acts varies from pattern to pattern. This limit is of use only if it is
533 set smaller than \fB--match-limit\fP.
535 There are no short forms for these options. The default limits can be set
536 when the PCRE2 library is compiled; if they are not specified, the defaults
539 \fB--max-buffer-size\fP=\fInumber\fP
541 set by \fB--buffer-size\fP. The maximum buffer size is silently forced to be no
544 \fB-N\fP \fInewline-type\fP, \fB--newline\fP=\fInewline-type\fP
545 Six different conventions for indicating the ends of lines in scanned files are
548 pcre2grep -N CRLF 'some pattern' <file>
550 The newline type may be specified in upper, lower, or mixed case. If the
552 types are the single-character sequences CR (carriage return) and LF
553 (linefeed), the two-character sequence CRLF, an "anycrlf" type, which
560 When the PCRE2 library is built, a default line-ending sequence is specified.
564 This option makes it possible to use \fBpcre2grep\fP to scan files that have
565 come from other environments without having to modify their line endings. If
568 not apply to files specified by the \fB-f\fP, \fB--exclude-from\fP, or
569 \fB--include-from\fP options, which are expected to use the operating system's
572 \fB-n\fP, \fB--line-number\fP
574 for matching lines or a hyphen for context lines. If the file name is also
575 being output, it precedes the line number. When the \fB-M\fP option causes a
577 number. This option is forced if \fB--line-offsets\fP is used.
579 \fB--no-jit\fP
580 If the PCRE2 library is built with support for just-in-time compiling (which
586 \fB-O\fP \fItext\fP, \fB--output\fP=\fItext\fP
588 the text specified in this option, followed by an operating-system standard
589 newline. In this mode, \fB--colour\fP has no effect, and no context is shown.
590 That is, the \fB-A\fP, \fB-B\fP, and \fB-C\fP options are ignored. The
591 \fB--newline\fP option has no effect on this option, which is mutually
592 exclusive with \fB--only-matching\fP, \fB--file-offsets\fP, and
593 \fB--line-offsets\fP. However, like \fB--only-matching\fP, if there is more
601 decimal number; zero substitutes the whole match. If the number is greater than
602 the number of capturing substrings, or if the capture is unset, the replacement
621 \fB-o\fP, \fB--only-matching\fP
623 line. In this mode, no context is shown. That is, the \fB-A\fP, \fB-B\fP, and
624 \fB-C\fP options are ignored. If there is more than one match in a line, each
625 of them is shown separately, on a separate line of output. If \fB-o\fP is
626 combined with \fB-v\fP (invert the sense of the match to find non-matching
627 lines), no output is generated, but the return code is set appropriately. If
630 otherwise empty line. This option is mutually exclusive with \fB--output\fP,
631 \fB--file-offsets\fP and \fB--line-offsets\fP.
633 \fB-o\fP\fInumber\fP, \fB--only-matching\fP=\fInumber\fP
636 limit can be changed via the \fB--om-capture\fP option. A pattern may contain
638 limit can be accessed by \fB-o\fP. An error occurs if the number specified by
639 \fB-o\fP is greater than the limit.
641 -o0 is the same as \fB-o\fP without a number. Because these options can be
642 given without an argument (see above), if an argument is present, it must be
643 given in the same shell item, for example, -o3 or --only-matching=2. The
644 comments given for the non-argument case above also apply to this option. If
651 -o3 -o1 -o3 causes the substrings matched by capturing parentheses 3 and 1 and
652 then 3 again to be output. By default, there is no separator (but see the next
655 \fB--om-capture\fP=\fInumber\fP
656 Set the number of capturing parentheses that can be accessed by \fB-o\fP. The
659 \fB--om-separator\fP=\fItext\fP
660 Specify a separating string for multiple occurrences of \fB-o\fP. The default
663 \fB-q\fP, \fB--quiet\fP
665 status indicates whether or not any matches were found.
667 \fB-r\fP, \fB--recursive\fP
668 If any given path is a directory, recursively scan the files it contains,
669 taking note of any \fB--include\fP and \fB--exclude\fP settings. By default, a
671 immediate end-of-file. This option is a shorthand for setting the \fB-d\fP
674 \fB--recursion-limit\fP=\fInumber\fP
675 This is an obsolete synonym for \fB--depth-limit\fP. See \fB--match-limit\fP
678 \fB-s\fP, \fB--no-messages\fP
679 Suppress error messages about non-existent or unreadable files. Such files are
680 quietly skipped. However, the return code is still 2, even if matches were
681 found in other files.
683 \fB-t\fP, \fB--total-count\fP
684 This option is useful when scanning more than one file. If used on its own,
685 \fB-t\fP suppresses all output except for a grand total number of matching
686 lines (or non-matching lines if \fB-v\fP is used) in all the files. If \fB-t\fP
687 is used with \fB-c\fP, a grand total is output except when the previous output
689 is listed. If file names are being output, the grand total is preceded by
690 "TOTAL:". Otherwise, it appears as just another number. The \fB-t\fP option is
691 ignored when used with \fB-L\fP (list files without matches), because the grand
694 \fB-u\fP, \fB--utf\fP
695 Operate in UTF-8 mode. This option is available only if PCRE2 has been compiled
696 with UTF-8 support. All patterns (including those for any \fB--exclude\fP and
697 \fB--include\fP options) and all lines that are scanned must be valid strings
698 of UTF-8 characters. If an invalid UTF-8 string is encountered, an error
701 \fB-U\fP, \fB--utf-allow-invalid\fP
702 As \fB--utf\fP, but in addition subject lines may contain invalid UTF-8 code
704 themselves, however, must still be valid UTF-8 strings. This facility allows
705 valid UTF-8 strings to be sought within arbitrary byte sequences in executable
706 or other binary files. For more details about matching in non-valid UTF-8
713 \fB-V\fP, \fB--version\fP
718 \fB-v\fP, \fB--invert-match\fP
720 the patterns are the ones that are found. When this option is set, options such
721 as \fB--only-matching\fP and \fB--output\fP, which specify parts of a match
724 \fB-w\fP, \fB--word-regex\fP, \fB--word-regexp\fP
729 files; it does not apply to patterns specified by any of the \fB--include\fP or
730 \fB--exclude\fP options.
732 \fB-x\fP, \fB--line-regex\fP, \fB--line-regexp\fP
737 matched against the contents of files; it does not apply to patterns specified
738 by any of the \fB--include\fP or \fB--exclude\fP options.
740 \fB-Z\fP, \fB--null\fP
741 Terminate files names in the regular output with a zero byte (the NUL
752 by the \fB--locale\fP option. If no locale is set, the PCRE2 library's default
759 The \fB-N\fP (\fB--newline\fP) option allows \fBpcre2grep\fP to scan files with
761 way scanned files are processed. It does not affect the interpretation of files
762 specified by the \fB-f\fP, \fB--file-list\fP, \fB--exclude-from\fP, or
763 \fB--include-from\fP options.
765 Any parts of the scanned input files that are written to the standard output
766 are copied with whatever newline sequences they have in the input. However, if
768 sequence, a newline sequence is added. If the newline setting is CR, LF, CRLF
786 \fB--xxx-regexp\fP (GNU terminology) is also available as \fB--xxx-regex\fP
787 (PCRE2 terminology). However, the \fB--depth-limit\fP, \fB--file-list\fP,
788 \fB--file-offsets\fP, \fB--heap-limit\fP, \fB--include-dir\fP,
789 \fB--line-offsets\fP, \fB--locale\fP, \fB--match-limit\fP, \fB-M\fP,
790 \fB--multiline\fP, \fB-N\fP, \fB--newline\fP, \fB--om-separator\fP,
791 \fB--output\fP, \fB-u\fP, \fB--utf\fP, \fB-U\fP, and \fB--utf-allow-invalid\fP
793 \fB--only-matching\fP option with a capturing parentheses number.
796 \fBpcre2grep\fP. For example, the \fB--include\fP option's argument is a glob
797 for GNU \fBgrep\fP, but a regular expression for \fBpcre2grep\fP. If both the
798 \fB-c\fP and \fB-l\fP options are given, GNU grep lists only file names,
809 -f/some/file
810 -f /some/file
812 The exception is the \fB-o\fP option, which may appear with or without data.
813 Because of this, if data is present, it must follow immediately in the same
814 item, for example -o3.
820 --file=/some/file
821 --file /some/file
823 Note, however, that if you want to supply a file name beginning with ~ as data
828 The exceptions to the above are the \fB--colour\fP (or \fB--color\fP) and
829 \fB--only-matching\fP options, for which the data is optional. If one of these
831 character. Otherwise \fBpcre2grep\fP will assume that it has no data.
841 for callouts by running it with the \fB--help\fP option. If callout support is
862 zero-terminated string, which means it should not contain any internal binary
864 escape processing as text from the \fB--output\fP (\fB-O\fP) option (see
868 character) causes the callout to be ignored. No terminator is added to the
869 output string, so if you want a newline, you must include it explicitly using
874 Matching continues normally after the string is output. If you want to see only
884 where \fBlib$spawn()\fP is used, and for any Unix-like environment where
895 started by a dollar character. These are the same as for the \fB--output\fP
896 (\fB-O\fP) option documented above, except that $0 cannot insert the matched
898 is inserted. If you need a literal dollar or pipe character in any
901 echo -e "abcde\en12345" | pcre2grep \e
903 (?C"/bin/echo|Arg1: [$1] [$2] [$3]|Arg2: $|${1}$| ($4)")()' -
913 are zero-terminated strings. This means that binary zero characters in the
917 If running the program fails for any reason (including the non-existence of the
927 repeats, for example: (a+)*\ed when matched against a line of a's with no final
929 in these circumstances. If this happens, \fBpcre2grep\fP outputs an error
930 message and the line that caused the problem to the standard error stream. If
933 The \fB--match-limit\fP option of \fBpcre2grep\fP can be used to set the
935 memory used during matching; see the discussion of \fB--heap-limit\fP and
936 \fB--depth-limit\fP above.
942 Exit status is 0 if any matches were found, 1 if no matches were found, and 2
943 for syntax errors, overlong lines, non-existent or inaccessible files (even if
944 matches were found in other files) or too many matching errors. Using the
945 \fB-s\fP option to suppress error messages about inaccessible files does not
974 Copyright (c) 1997-2022 University of Cambridge.