forked from docker-mailserver/docker-mailserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcase
More file actions
395 lines (294 loc) · 34.2 KB
/
case
File metadata and controls
395 lines (294 loc) · 34.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
GREP(1) General Commands Manual GREP(1)
NNAAMMEE
grep, egrep, fgrep, rgrep - print lines matching a pattern
SSYYNNOOPPSSIISS
ggrreepp [_O_P_T_I_O_N_S] _P_A_T_T_E_R_N [_F_I_L_E...]
ggrreepp [_O_P_T_I_O_N_S] [--ee _P_A_T_T_E_R_N]... [--ff _F_I_L_E]... [_F_I_L_E...]
DDEESSCCRRIIPPTTIIOONN
ggrreepp searches the named input _F_I_L_Es for lines containing a match to the given _P_A_T_T_E_R_N. If no files are specified, or if the file “--” is given, ggrreepp searches
standard input. By default, ggrreepp prints the matching lines.
In addition, the variant programs eeggrreepp, ffggrreepp and rrggrreepp are the same as ggrreepp --EE, ggrreepp --FF, and ggrreepp --rr, respectively. These variants are deprecated, but are
provided for backward compatibility.
OOPPTTIIOONNSS
GGeenneerriicc PPrrooggrraamm IInnffoorrmmaattiioonn
----hheellpp Output a usage message and exit.
--VV, ----vveerrssiioonn
Output the version number of ggrreepp and exit.
MMaattcchheerr SSeelleeccttiioonn
--EE, ----eexxtteennddeedd--rreeggeexxpp
Interpret _P_A_T_T_E_R_N as an extended regular expression (ERE, see below).
--FF, ----ffiixxeedd--ssttrriinnggss
Interpret _P_A_T_T_E_R_N as a list of fixed strings (instead of regular expressions), separated by newlines, any of which is to be matched.
--GG, ----bbaassiicc--rreeggeexxpp
Interpret _P_A_T_T_E_R_N as a basic regular expression (BRE, see below). This is the default.
--PP, ----ppeerrll--rreeggeexxpp
Interpret the pattern as a Perl-compatible regular expression (PCRE). This is highly experimental and ggrreepp --PP may warn of unimplemented features.
MMaattcchhiinngg CCoonnttrrooll
--ee _P_A_T_T_E_R_N, ----rreeggeexxpp==_P_A_T_T_E_R_N
Use _P_A_T_T_E_R_N as the pattern. If this option is used multiple times or is combined with the --ff (----ffiillee) option, search for all patterns given. This option can
be used to protect a pattern beginning with “-”.
--ff _F_I_L_E, ----ffiillee==_F_I_L_E
Obtain patterns from _F_I_L_E, one per line. If this option is used multiple times or is combined with the --ee (----rreeggeexxpp) option, search for all patterns given.
The empty file contains zero patterns, and therefore matches nothing.
--ii, ----iiggnnoorree--ccaassee
Ignore case distinctions in both the _P_A_T_T_E_R_N and the input files.
--vv, ----iinnvveerrtt--mmaattcchh
Invert the sense of matching, to select non-matching lines.
--ww, ----wwoorrdd--rreeggeexxpp
Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or
preceded by a non-word constituent character. Similarly, it must be either at the end of the line or followed by a non-word constituent character. Word-
constituent characters are letters, digits, and the underscore.
--xx, ----lliinnee--rreeggeexxpp
Select only those matches that exactly match the whole line. For a regular expression pattern, this is like parenthesizing the pattern and then surrounding
it with ^^ and $$.
--yy Obsolete synonym for --ii.
GGeenneerraall OOuuttppuutt CCoonnttrrooll
--cc, ----ccoouunntt
Suppress normal output; instead print a count of matching lines for each input file. With the --vv, ----iinnvveerrtt--mmaattcchh option (see below), count non-matching
lines.
----ccoolloorr[==_W_H_E_N], ----ccoolloouurr[==_W_H_E_N]
Surround the matched (non-empty) strings, matching lines, context lines, file names, line numbers, byte offsets, and separators (for fields and groups of
context lines) with escape sequences to display them in color on the terminal. The colors are defined by the environment variable GGRREEPP__CCOOLLOORRSS. The
deprecated environment variable GGRREEPP__CCOOLLOORR is still supported, but its setting does not have priority. _W_H_E_N is nneevveerr, aallwwaayyss, or aauuttoo.
--LL, ----ffiilleess--wwiitthhoouutt--mmaattcchh
Suppress normal output; instead print the name of each input file from which no output would normally have been printed. The scanning will stop on the first
match.
--ll, ----ffiilleess--wwiitthh--mmaattcchheess
Suppress normal output; instead print the name of each input file from which output would normally have been printed. The scanning will stop on the first
match.
--mm _N_U_M, ----mmaaxx--ccoouunntt==_N_U_M
Stop reading a file after _N_U_M matching lines. If the input is standard input from a regular file, and _N_U_M matching lines are output, ggrreepp ensures that the
standard input is positioned to just after the last matching line before exiting, regardless of the presence of trailing context lines. This enables a
calling process to resume a search. When ggrreepp stops after _N_U_M matching lines, it outputs any trailing context lines. When the --cc or ----ccoouunntt option is also
used, ggrreepp does not output a count greater than _N_U_M. When the --vv or ----iinnvveerrtt--mmaattcchh option is also used, ggrreepp stops after outputting _N_U_M non-matching lines.
--oo, ----oonnllyy--mmaattcchhiinngg
Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line.
--qq, ----qquuiieett, ----ssiilleenntt
Quiet; do not write anything to standard output. Exit immediately with zero status if any match is found, even if an error was detected. Also see the --ss or
----nnoo--mmeessssaaggeess option.
--ss, ----nnoo--mmeessssaaggeess
Suppress error messages about nonexistent or unreadable files.
OOuuttppuutt LLiinnee PPrreeffiixx CCoonnttrrooll
--bb, ----bbyyttee--ooffffsseett
Print the 0-based byte offset within the input file before each line of output. If --oo (----oonnllyy--mmaattcchhiinngg) is specified, print the offset of the matching part
itself.
--HH, ----wwiitthh--ffiilleennaammee
Print the file name for each match. This is the default when there is more than one file to search.
--hh, ----nnoo--ffiilleennaammee
Suppress the prefixing of file names on output. This is the default when there is only one file (or only standard input) to search.
----llaabbeell==_L_A_B_E_L
Display input actually coming from standard input as input coming from file _L_A_B_E_L. This is especially useful when implementing tools like zzggrreepp, e.g., ggzziipp
--ccdd ffoooo..ggzz || ggrreepp ----llaabbeell==ffoooo --HH ssoommeetthhiinngg. See also the --HH option.
--nn, ----lliinnee--nnuummbbeerr
Prefix each line of output with the 1-based line number within its input file.
--TT, ----iinniittiiaall--ttaabb
Make sure that the first character of actual line content lies on a tab stop, so that the alignment of tabs looks normal. This is useful with options that
prefix their output to the actual content: --HH,--nn, and --bb. In order to improve the probability that lines from a single file will all start at the same
column, this also causes the line number and byte offset (if present) to be printed in a minimum size field width.
--uu, ----uunniixx--bbyyttee--ooffffsseettss
Report Unix-style byte offsets. This switch causes ggrreepp to report byte offsets as if the file were a Unix-style text file, i.e., with CR characters stripped
off. This will produce results identical to running ggrreepp on a Unix machine. This option has no effect unless --bb option is also used; it has no effect on
platforms other than MS-DOS and MS-Windows.
--ZZ, ----nnuullll
Output a zero byte (the ASCII NNUULL character) instead of the character that normally follows a file name. For example, ggrreepp --llZZ outputs a zero byte after each
file name instead of the usual newline. This option makes the output unambiguous, even in the presence of file names containing unusual characters like
newlines. This option can be used with commands like ffiinndd --pprriinntt00, ppeerrll --00, ssoorrtt --zz, and xxaarrggss --00 to process arbitrary file names, even those that contain
newline characters.
CCoonntteexxtt LLiinnee CCoonnttrrooll
--AA _N_U_M, ----aafftteerr--ccoonntteexxtt==_N_U_M
Print _N_U_M lines of trailing context after matching lines. Places a line containing a group separator (----) between contiguous groups of matches. With the --oo
or ----oonnllyy--mmaattcchhiinngg option, this has no effect and a warning is given.
--BB _N_U_M, ----bbeeffoorree--ccoonntteexxtt==_N_U_M
Print _N_U_M lines of leading context before matching lines. Places a line containing a group separator (----) between contiguous groups of matches. With the --oo
or ----oonnllyy--mmaattcchhiinngg option, this has no effect and a warning is given.
--CC _N_U_M, --_N_U_M, ----ccoonntteexxtt==_N_U_M
Print _N_U_M lines of output context. Places a line containing a group separator (----) between contiguous groups of matches. With the --oo or ----oonnllyy--mmaattcchhiinngg
option, this has no effect and a warning is given.
FFiillee aanndd DDiirreeccttoorryy SSeelleeccttiioonn
--aa, ----tteexxtt
Process a binary file as if it were text; this is equivalent to the ----bbiinnaarryy--ffiilleess==tteexxtt option.
----bbiinnaarryy--ffiilleess==_T_Y_P_E
If the first few bytes of a file indicate that the file contains binary data, assume that the file is of type _T_Y_P_E. By default, _T_Y_P_E is bbiinnaarryy, and ggrreepp
normally outputs either a one-line message saying that a binary file matches, or no message if there is no match. If _T_Y_P_E is wwiitthhoouutt--mmaattcchh, ggrreepp assumes that
a binary file does not match; this is equivalent to the --II option. If _T_Y_P_E is tteexxtt, ggrreepp processes a binary file as if it were text; this is equivalent to
the --aa option. When processing binary data, ggrreepp may treat non-text bytes as line terminators; for example, the pattern '..' (period) might not match a null
byte, as the null byte might be treated as a line terminator. _W_a_r_n_i_n_g_: ggrreepp ----bbiinnaarryy--ffiilleess==tteexxtt might output binary garbage, which can have nasty side
effects if the output is a terminal and if the terminal driver interprets some of it as commands.
--DD _A_C_T_I_O_N, ----ddeevviicceess==_A_C_T_I_O_N
If an input file is a device, FIFO or socket, use _A_C_T_I_O_N to process it. By default, _A_C_T_I_O_N is rreeaadd, which means that devices are read just as if they were
ordinary files. If _A_C_T_I_O_N is sskkiipp, devices are silently skipped.
--dd _A_C_T_I_O_N, ----ddiirreeccttoorriieess==_A_C_T_I_O_N
If an input file is a directory, use _A_C_T_I_O_N to process it. By default, _A_C_T_I_O_N is rreeaadd, i.e., read directories just as if they were ordinary files. If _A_C_T_I_O_N
is sskkiipp, silently skip directories. If _A_C_T_I_O_N is rreeccuurrssee, read all files under each directory, recursively, following symbolic links only if they are on the
command line. This is equivalent to the --rr option.
----eexxcclluuddee==_G_L_O_B
Skip files whose base name matches _G_L_O_B (using wildcard matching). A file-name glob can use **, ??, and [[...]] as wildcards, and \\ to quote a wildcard or
backslash character literally.
----eexxcclluuddee--ffrroomm==_F_I_L_E
Skip files whose base name matches any of the file-name globs read from _F_I_L_E (using wildcard matching as described under ----eexxcclluuddee).
----eexxcclluuddee--ddiirr==_D_I_R
Exclude directories matching the pattern _D_I_R from recursive searches.
--II Process a binary file as if it did not contain matching data; this is equivalent to the ----bbiinnaarryy--ffiilleess==wwiitthhoouutt--mmaattcchh option.
----iinncclluuddee==_G_L_O_B
Search only files whose base name matches _G_L_O_B (using wildcard matching as described under ----eexxcclluuddee).
--rr, ----rreeccuurrssiivvee
Read all files under each directory, recursively, following symbolic links only if they are on the command line. Note that if no file operand is given, grep
searches the working directory. This is equivalent to the --dd rreeccuurrssee option.
--RR, ----ddeerreeffeerreennccee--rreeccuurrssiivvee
Read all files under each directory, recursively. Follow all symbolic links, unlike --rr.
OOtthheerr OOppttiioonnss
----lliinnee--bbuuffffeerreedd
Use line buffering on output. This can cause a performance penalty.
--UU, ----bbiinnaarryy
Treat the file(s) as binary. By default, under MS-DOS and MS-Windows, ggrreepp guesses the file type by looking at the contents of the first 32KB read from the
file. If ggrreepp decides the file is a text file, it strips the CR characters from the original file contents (to make regular expressions with ^^ and $$ work
correctly). Specifying --UU overrules this guesswork, causing all files to be read and passed to the matching mechanism verbatim; if the file is a text file
with CR/LF pairs at the end of each line, this will cause some regular expressions to fail. This option has no effect on platforms other than MS-DOS and MS-
Windows.
--zz, ----nnuullll--ddaattaa
Treat the input as a set of lines, each terminated by a zero byte (the ASCII NNUULL character) instead of a newline. Like the --ZZ or ----nnuullll option, this option
can be used with commands like ssoorrtt --zz to process arbitrary file names.
RREEGGUULLAARR EEXXPPRREESSSSIIOONNSS
A regular expression is a pattern that describes a set of strings. Regular expressions are constructed analogously to arithmetic expressions, by using various
operators to combine smaller expressions.
ggrreepp understands three different versions of regular expression syntax: “basic” (BRE), “extended” (ERE) and “perl” (PCRE). In GNU ggrreepp, there is no difference in
available functionality between basic and extended syntaxes. In other implementations, basic regular expressions are less powerful. The following description
applies to extended regular expressions; differences for basic regular expressions are summarized afterwards. Perl-compatible regular expressions give additional
functionality, and are documented in pcresyntax(3) and pcrepattern(3), but work only if PCRE is available in the system.
The fundamental building blocks are the regular expressions that match a single character. Most characters, including all letters and digits, are regular
expressions that match themselves. Any meta-character with special meaning may be quoted by preceding it with a backslash.
The period .. matches any single character.
CChhaarraacctteerr CCllaasssseess aanndd BBrraacckkeett EExxpprreessssiioonnss
A _b_r_a_c_k_e_t _e_x_p_r_e_s_s_i_o_n is a list of characters enclosed by [[ and ]]. It matches any single character in that list; if the first character of the list is the caret ^^
then it matches any character _n_o_t in the list. For example, the regular expression [[00112233445566778899]] matches any single digit.
Within a bracket expression, a _r_a_n_g_e _e_x_p_r_e_s_s_i_o_n consists of two characters separated by a hyphen. It matches any single character that sorts between the two
characters, inclusive, using the locale's collating sequence and character set. For example, in the default C locale, [[aa--dd]] is equivalent to [[aabbccdd]]. Many locales
sort characters in dictionary order, and in these locales [[aa--dd]] is typically not equivalent to [[aabbccdd]]; it might be equivalent to [[aaBBbbCCccDDdd]], for example. To obtain
the traditional interpretation of bracket expressions, you can use the C locale by setting the LLCC__AALLLL environment variable to the value CC.
Finally, certain named classes of characters are predefined within bracket expressions, as follows. Their names are self explanatory, and they are [[::aallnnuumm::]],
[[::aallpphhaa::]], [[::ccnnttrrll::]], [[::ddiiggiitt::]], [[::ggrraapphh::]], [[::lloowweerr::]], [[::pprriinntt::]], [[::ppuunncctt::]], [[::ssppaaccee::]], [[::uuppppeerr::]], and [[::xxddiiggiitt::]].. For example, [[[[::aallnnuumm::]]]] means the character
class of numbers and letters in the current locale. In the C locale and ASCII character set encoding, this is the same as [[00--99AA--ZZaa--zz]]. (Note that the brackets in
these class names are part of the symbolic names, and must be included in addition to the brackets delimiting the bracket expression.) Most meta-characters lose
their special meaning inside bracket expressions. To include a literal ]] place it first in the list. Similarly, to include a literal ^^ place it anywhere but first.
Finally, to include a literal -- place it last.
AAnncchhoorriinngg
The caret ^^ and the dollar sign $$ are meta-characters that respectively match the empty string at the beginning and end of a line.
TThhee BBaacckkssllaasshh CChhaarraacctteerr aanndd SSppeecciiaall EExxpprreessssiioonnss
The symbols \\<< and \\>> respectively match the empty string at the beginning and end of a word. The symbol \\bb matches the empty string at the edge of a word, and \\BB
matches the empty string provided it's _n_o_t at the edge of a word. The symbol \\ww is a synonym for [[__[[::aallnnuumm::]]]] and \\WW is a synonym for [[^^__[[::aallnnuumm::]]]].
RReeppeettiittiioonn
A regular expression may be followed by one of several repetition operators:
?? The preceding item is optional and matched at most once.
** The preceding item will be matched zero or more times.
++ The preceding item will be matched one or more times.
{{_n}} The preceding item is matched exactly _n times.
{{_n,,}} The preceding item is matched _n or more times.
{{,,_m}} The preceding item is matched at most _m times. This is a GNU extension.
{{_n,,_m}} The preceding item is matched at least _n times, but not more than _m times.
CCoonnccaatteennaattiioonn
Two regular expressions may be concatenated; the resulting regular expression matches any string formed by concatenating two substrings that respectively match the
concatenated expressions.
AAlltteerrnnaattiioonn
Two regular expressions may be joined by the infix operator ||; the resulting regular expression matches any string matching either alternate expression.
PPrreecceeddeennccee
Repetition takes precedence over concatenation, which in turn takes precedence over alternation. A whole expression may be enclosed in parentheses to override these
precedence rules and form a subexpression.
BBaacckk RReeffeerreenncceess aanndd SSuubbeexxpprreessssiioonnss
The back-reference \\_n, where _n is a single digit, matches the substring previously matched by the _nth parenthesized subexpression of the regular expression.
BBaassiicc vvss EExxtteennddeedd RReegguullaarr EExxpprreessssiioonnss
In basic regular expressions the meta-characters ??, ++, {{, ||, ((, and )) lose their special meaning; instead use the backslashed versions \\??, \\++, \\{{, \\||, \\((, and \\)).
EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS
The behavior of ggrreepp is affected by the following environment variables.
The locale for category LLCC___f_o_o is specified by examining the three environment variables LLCC__AALLLL, LLCC___f_o_o, LLAANNGG, in that order. The first of these variables that is
set specifies the locale. For example, if LLCC__AALLLL is not set, but LLCC__MMEESSSSAAGGEESS is set to pptt__BBRR, then the Brazilian Portuguese locale is used for the LLCC__MMEESSSSAAGGEESS
category. The C locale is used if none of these environment variables are set, if the locale catalog is not installed, or if ggrreepp was not compiled with national
language support (NLS).
GGRREEPP__OOPPTTIIOONNSS
This variable specifies default options to be placed in front of any explicit options. As this causes problems when writing portable scripts, this feature
will be removed in a future release of ggrreepp, and ggrreepp warns if it is used. Please use an alias or script instead.
GGRREEPP__CCOOLLOORR
This variable specifies the color used to highlight matched (non-empty) text. It is deprecated in favor of GGRREEPP__CCOOLLOORRSS, but still supported. The mmtt, mmss, and
mmcc capabilities of GGRREEPP__CCOOLLOORRSS have priority over it. It can only specify the color used to highlight the matching non-empty text in any matching line (a
selected line when the --vv command-line option is omitted, or a context line when --vv is specified). The default is 0011;;3311, which means a bold red foreground
text on the terminal's default background.
GGRREEPP__CCOOLLOORRSS
Specifies the colors and other attributes used to highlight various parts of the output. Its value is a colon-separated list of capabilities that defaults to
mmss==0011;;3311::mmcc==0011;;3311::ssll==::ccxx==::ffnn==3355::llnn==3322::bbnn==3322::ssee==3366 with the rrvv and nnee boolean capabilities omitted (i.e., false). Supported capabilities are as follows.
ssll== SGR substring for whole selected lines (i.e., matching lines when the --vv command-line option is omitted, or non-matching lines when --vv is specified).
If however the boolean rrvv capability and the --vv command-line option are both specified, it applies to context matching lines instead. The default is
empty (i.e., the terminal's default color pair).
ccxx== SGR substring for whole context lines (i.e., non-matching lines when the --vv command-line option is omitted, or matching lines when --vv is specified).
If however the boolean rrvv capability and the --vv command-line option are both specified, it applies to selected non-matching lines instead. The default
is empty (i.e., the terminal's default color pair).
rrvv Boolean value that reverses (swaps) the meanings of the ssll== and ccxx== capabilities when the --vv command-line option is specified. The default is false
(i.e., the capability is omitted).
mmtt==0011;;3311
SGR substring for matching non-empty text in any matching line (i.e., a selected line when the --vv command-line option is omitted, or a context line
when --vv is specified). Setting this is equivalent to setting both mmss== and mmcc== at once to the same value. The default is a bold red text foreground
over the current line background.
mmss==0011;;3311
SGR substring for matching non-empty text in a selected line. (This is only used when the --vv command-line option is omitted.) The effect of the ssll==
(or ccxx== if rrvv) capability remains active when this kicks in. The default is a bold red text foreground over the current line background.
mmcc==0011;;3311
SGR substring for matching non-empty text in a context line. (This is only used when the --vv command-line option is specified.) The effect of the ccxx==
(or ssll== if rrvv) capability remains active when this kicks in. The default is a bold red text foreground over the current line background.
ffnn==3355 SGR substring for file names prefixing any content line. The default is a magenta text foreground over the terminal's default background.
llnn==3322 SGR substring for line numbers prefixing any content line. The default is a green text foreground over the terminal's default background.
bbnn==3322 SGR substring for byte offsets prefixing any content line. The default is a green text foreground over the terminal's default background.
ssee==3366 SGR substring for separators that are inserted between selected line fields (::), between context line fields, (--), and between groups of adjacent lines
when nonzero context is specified (----). The default is a cyan text foreground over the terminal's default background.
nnee Boolean value that prevents clearing to the end of line using Erase in Line (EL) to Right (\\3333[[KK) each time a colorized item ends. This is needed on
terminals on which EL is not supported. It is otherwise useful on terminals for which the bbaacckk__ccoolloorr__eerraassee (bbccee) boolean terminfo capability does not
apply, when the chosen highlight colors do not affect the background, or when EL is too slow or causes too much flicker. The default is false (i.e.,
the capability is omitted).
Note that boolean capabilities have no ==... part. They are omitted (i.e., false) by default and become true when specified.
See the Select Graphic Rendition (SGR) section in the documentation of the text terminal that is used for permitted values and their meaning as character
attributes. These substring values are integers in decimal representation and can be concatenated with semicolons. ggrreepp takes care of assembling the result
into a complete SGR sequence (\\3333[[...mm). Common values to concatenate include 11 for bold, 44 for underline, 55 for blink, 77 for inverse, 3399 for default
foreground color, 3300 to 3377 for foreground colors, 9900 to 9977 for 16-color mode foreground colors, 3388;;55;;00 to 3388;;55;;225555 for 88-color and 256-color modes foreground
colors, 4499 for default background color, 4400 to 4477 for background colors, 110000 to 110077 for 16-color mode background colors, and 4488;;55;;00 to 4488;;55;;225555 for 88-color
and 256-color modes background colors.
LLCC__AALLLL, LLCC__CCOOLLLLAATTEE, LLAANNGG
These variables specify the locale for the LLCC__CCOOLLLLAATTEE category, which determines the collating sequence used to interpret range expressions like [[aa--zz]].
LLCC__AALLLL, LLCC__CCTTYYPPEE, LLAANNGG
These variables specify the locale for the LLCC__CCTTYYPPEE category, which determines the type of characters, e.g., which characters are whitespace.
LLCC__AALLLL, LLCC__MMEESSSSAAGGEESS, LLAANNGG
These variables specify the locale for the LLCC__MMEESSSSAAGGEESS category, which determines the language that ggrreepp uses for messages. The default C locale uses
American English messages.
PPOOSSIIXXLLYY__CCOORRRREECCTT
If set, ggrreepp behaves as POSIX requires; otherwise, ggrreepp behaves more like other GNU programs. POSIX requires that options that follow file names must be
treated as file names; by default, such options are permuted to the front of the operand list and are treated as options. Also, POSIX requires that
unrecognized options be diagnosed as “illegal”, but since they are not really against the law the default is to diagnose them as “invalid”. PPOOSSIIXXLLYY__CCOORRRREECCTT
also disables ___N__GGNNUU__nnoonnooppttiioonn__aarrggvv__ffllaaggss__, described below.
___N__GGNNUU__nnoonnooppttiioonn__aarrggvv__ffllaaggss__
(Here _N is ggrreepp's numeric process ID.) If the _ith character of this environment variable's value is 11, do not consider the _ith operand of ggrreepp to be an
option, even if it appears to be one. A shell can put this variable in the environment for each command it runs, specifying which operands are the results of
file name wildcard expansion and therefore should not be treated as options. This behavior is available only with the GNU C library, and only when
PPOOSSIIXXLLYY__CCOORRRREECCTT is not set.
EEXXIITT SSTTAATTUUSS
Normally the exit status is 0 if a line is selected, 1 if no lines were selected, and 2 if an error occurred. However, if the --qq or ----qquuiieett or ----ssiilleenntt is used and
a line is selected, the exit status is 0 even if an error occurred.
CCOOPPYYRRIIGGHHTT
Copyright 1998-2000, 2002, 2005-2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
BBUUGGSS
RReeppoorrttiinngg BBuuggss
Email bug reports to the bug-reporting address ⟨bug-grep@gnu.org⟩. An email archive ⟨http://lists.gnu.org/mailman/listinfo/bug-grep⟩ and a bug tracker ⟨http://
debbugs.gnu.org/cgi/pkgreport.cgi?package=grep⟩ are available.
KKnnoowwnn BBuuggss
Large repetition counts in the {{_n,,_m}} construct may cause ggrreepp to use lots of memory. In addition, certain other obscure regular expressions require exponential time
and space, and may cause ggrreepp to run out of memory.
Back-references are very slow, and may require exponential time.
SSEEEE AALLSSOO
RReegguullaarr MMaannuuaall PPaaggeess
awk(1), cmp(1), diff(1), find(1), gzip(1), perl(1), sed(1), sort(1), xargs(1), zgrep(1), read(2), pcre(3), pcresyntax(3), pcrepattern(3), terminfo(5), glob(7),
regex(7).
PPOOSSIIXX PPrrooggrraammmmeerr''ss MMaannuuaall PPaaggee
grep(1p).
FFuullll DDooccuummeennttaattiioonn
A complete manual ⟨http://www.gnu.org/software/grep/manual/⟩ is available. If the iinnffoo and ggrreepp programs are properly installed at your site, the command
iinnffoo ggrreepp
should give you access to the complete manual.
NNOOTTEESS
This man page is maintained only fitfully; the full documentation is often more up-to-date.
User Commands GNU grep 2.25 GREP(1)