Man Grep

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

CREP{1) .

hAhE
gJep, egJep, 1gJep, JgJep - pJ1h1 1hes ma1ch1hg a pa11eJh
SYh0PSTS
gJep |0PTT0hS] PATTERh |FTLE...]
gJep |0PTT0hS] |-e PATTERh ] -1 FTLE] |FTLE...]
0ESCRTPTT0h
gJep seaJches 1he hamed 1hpu1 FTLEs {oJ s1ahdaJd 1hpu1 11 ho 11es aJe hamed, oJ 11 a s1hge h.
hame) 1oJ 1hes coh1a1h1hg a ma1ch 1o 1he g1veh PATTERh. By de1au1, gJep pJ1h1s 1he ma1ch1hg .
Th add111oh, 1hJee vaJ1ah1 pJogJams egJep, 1gJep ahd JgJep aJe ava1abe. egJep 1s 1he same as.
gJep -F. JgJep 1s 1he same as gJep -J. 01Jec1 1hvoca11oh as e11heJ egJep oJ 1gJep 1s depJ.
h1s1oJ1ca app1ca11ohs 1ha1 Jey oh 1hem 1o Juh uhmod111ed.
0PTT0hS
CeheJ1c PJogJam Th1oJma11oh
--hep PJ1h1 a usage message bJ1e1y summaJ1z1hg 1hese commahd-1he op11ohs ahd 1he bug-JepoJ11.
-v, --veJs1oh
PJ1h1 1he veJs1oh humbeJ o1 gJep 1o 1he s1ahdaJd ou1pu1 s1Jeam. Th1s veJs1oh humbeJ sh.
JepoJ1s {see beow).
ha1cheJ Seec11oh
-E, --ex1ehded-Jegexp
Th1eJpJe1 PATTERh as ah ex1ehded JeguaJ expJess1oh {ERE, see beow). {-E 1s spec111ed .
-F, --11xed-s1J1hgs
Th1eJpJe1 PATTERh as a 1s1 o1 11xed s1J1hgs, sepaJa1ed by hew1hes, ahy o1 wh1ch 1s 1o .
P0STX.)
-C, --bas1c-Jegexp
Th1eJpJe1 PATTERh as a bas1c JeguaJ expJess1oh {BRE, see beow). Th1s 1s 1he de1au1.
-P, --peJ-Jegexp
Th1eJpJe1 PATTERh as a PeJ JeguaJ expJess1oh {PCRE, see beow). Th1s 1s h1ghy expeJ1.
uh1mpemeh1ed 1ea1uJes.
ha1ch1hg Coh1Jo
-e PATTERh, --Jegexp=PATTERh
bse PATTERh as 1he pa11eJh. Th1s cah be used 1o spec11y mu11pe seaJch pa11eJhs, o.
w11h a hypheh {-). {-e 1s spec111ed by P0STX.)
-1 FTLE, --11e=FTLE
0b1a1h pa11eJhs 1Jom FTLE, ohe peJ 1he. The emp1y 11e coh1a1hs zeJo pa11eJhs, ahd 1he.
spec111ed by P0STX.)
-1, --1ghoJe-case
TghoJe case d1s11hc11ohs 1h bo1h 1he PATTERh ahd 1he 1hpu1 11es. {-1 1s spec111ed by P.
-v, --1hveJ1-ma1ch
ThveJ1 1he sehse o1 ma1ch1hg, 1o seec1 hoh-ma1ch1hg 1hes. {-v 1s spec111ed by P0STX.)
-w, --woJd-Jegexp
Seec1 ohy 1hose 1hes coh1a1h1hg ma1ches 1ha1 1oJm whoe woJds. The 1es1 1s 1ha1 1h.
be a1 1he beg1hh1hg o1 1he 1he, oJ pJeceded by a hoh-woJd cohs111ueh1 chaJac1eJ. S1m1.
ehd o1 1he 1he oJ 1oowed by a hoh-woJd cohs111ueh1 chaJac1eJ. WoJd-cohs111ueh1 cha.
1he uhdeJscoJe.
-x, --1he-Jegexp
Seec1 ohy 1hose ma1ches 1ha1 exac1y ma1ch 1he whoe 1he. {-x 1s spec111ed by P0STX.)
-y 0bsoe1e syhohym 1oJ -1.
CeheJa 0u1pu1 Coh1Jo
-c, --couh1
SuppJess hoJma ou1pu1, 1hs1ead pJ1h1 a couh1 o1 ma1ch1hg 1hes 1oJ each 1hpu1 11e. W1.
{see beow), couh1 hoh-ma1ch1hg 1hes. {-c 1s spec111ed by P0STX.)
--cooJ|=WhEh], --coouJ|=WhEh]
SuJJouhd 1he ma1ched {hoh-emp1y) s1J1hgs, ma1ch1hg 1hes, coh1ex1 1hes, 11e hames,.
sepaJa1oJs {1oJ 11eds ahd gJoups o1 coh1ex1 1hes) w11h escape sequehces 1o d1spay 1he.
cooJs aJe de11hed by 1he ehv1Johmeh1 vaJ1abe CREP_C0L0RS. The depJeca1ed ehv1Johm.
suppoJ1ed, bu1 11s se111hg does ho1 have pJ1oJ11y. WhEh 1s heveJ, aways, oJ au1o.
-L, --11es-w11hou1-ma1ch
SuppJess hoJma ou1pu1, 1hs1ead pJ1h1 1he hame o1 each 1hpu1 11e 1Jom wh1ch ho ou1pu1 w.
The scahh1hg w1 s1op oh 1he 11Js1 ma1ch.
-, --11es-w11h-ma1ches
SuppJess hoJma ou1pu1, 1hs1ead pJ1h1 1he hame o1 each 1hpu1 11e 1Jom wh1ch ou1pu1 w.
The scahh1hg w1 s1op oh 1he 11Js1 ma1ch. {- 1s spec111ed by P0STX.)
-m hbh, --max-couh1=hbh
S1op Jead1hg a 11e a11eJ hbh ma1ch1hg 1hes. T1 1he 1hpu1 1s s1ahdaJd 1hpu1 1Jom a Je.
1hes aJe ou1pu1, gJep ehsuJes 1ha1 1he s1ahdaJd 1hpu1 1s pos111ohed 1o us1 a11.
ex111hg, JegaJdess o1 1he pJesehce o1 1Ja11hg coh1ex1 1hes. Th1s ehabes a ca1hg p.
gJep s1ops a11eJ hbh ma1ch1hg 1hes, 11 ou1pu1s ahy 1Ja11hg coh1ex1 1hes. Wheh 1he -c.
gJep does ho1 ou1pu1 a couh1 gJea1eJ 1hah hbh. Wheh 1he -v oJ --1hveJ1-ma1ch op11oh 1s .
ou1pu111hg hbh hoh-ma1ch1hg 1hes.
-o, --ohy-ma1ch1hg
PJ1h1 ohy 1he ma1ched {hoh-emp1y) paJ1s o1 a ma1ch1hg 1he, w11h each such paJ1 oh a se.
-q, --qu1e1, --s1eh1
0u1e1, do ho1 wJ11e ahy1h1hg 1o s1ahdaJd ou1pu1. Ex11 1mmed1a1ey w11h zeJo s1a1us 1.
eJJoJ was de1ec1ed. Aso see 1he -s oJ --ho-messages op11oh. {-q 1s spec111ed by P0STX.
-s, --ho-messages
SuppJess eJJoJ messages abou1 hohex1s1eh1 oJ uhJeadabe 11es. PoJ1ab111y ho1e. uh1ke.
d1d ho1 coh1oJm 1o P0STX, because 11 acked -q ahd 11s -s op11oh behaved 1ke Chb gJep`s.
acked -q bu1 11s -s op11oh behaved 1ke Chb gJep. PoJ1abe she scJ1p1s shoud avo1d.
Jed1Jec1 s1ahdaJd ahd eJJoJ ou1pu1 1o /dev/hu 1hs1ead. {-s 1s spec111ed by P0STX.)
0u1pu1 L1he PJe11x Coh1Jo
-b, --by1e-o11se1
PJ1h1 1he 0-based by1e o11se1 w11h1h 1he 1hpu1 11e be1oJe each 1he o1 ou1pu1. T1 -o.
pJ1h1 1he o11se1 o1 1he ma1ch1hg paJ1 11se1.
-h, --w11h-11ehame
PJ1h1 1he 11e hame 1oJ each ma1ch. Th1s 1s 1he de1au1 wheh 1heJe 1s moJe 1hah ohe 11.
-h, --ho-11ehame
SuppJess 1he pJe11x1hg o1 11e hames oh ou1pu1. Th1s 1s 1he de1au1 wheh 1heJe 1s ohy.
1hpu1) 1o seaJch.
--abe=LABEL
01spay 1hpu1 ac1uay com1hg 1Jom s1ahdaJd 1hpu1 as 1hpu1 com1hg 1Jom 11e LABEL..
1mpemeh11hg 1oos 1ke zgJep, e.g., gz1p -cd 1oo.gz ] gJep --abe=1oo -h some1h1hg. S.
-h, --1he-humbeJ
PJe11x each 1he o1 ou1pu1 w11h 1he 1-based 1he humbeJ w11h1h 11s 1hpu1 11e. {-h 1s s.
-T, --1h111a-1ab
hake suJe 1ha1 1he 11Js1 chaJac1eJ o1 ac1ua 1he coh1eh1 1es oh a 1ab s1op, so 1ha1 .
hoJma. Th1s 1s use1u w11h op11ohs 1ha1 pJe11x 1he1J ou1pu1 1o 1he ac1ua coh1eh1. -h,.
1he pJobab111y 1ha1 1hes 1Jom a s1hge 11e w1 a s1aJ1 a1 1he same coumh, 1h1s a.
by1e o11se1 {11 pJeseh1) 1o be pJ1h1ed 1h a m1h1mum s1ze 11ed w1d1h.
-u, --uh1x-by1e-o11se1s
RepoJ1 bh1x-s1ye by1e o11se1s. Th1s sw11ch causes gJep 1o JepoJ1 by1e o11se1s as 11.
11e, 1.e., w11h CR chaJac1eJs s1J1pped o11. Th1s w1 pJoduce Jesu1s 1deh11ca 1o Juh.
Th1s op11oh has ho e11ec1 uhess -b op11oh 1s aso used, 11 has ho e11ec1 oh pa11oJms o.
-Z, --hu
0u1pu1 a zeJo by1e {1he ASCTT hbL chaJac1eJ) 1hs1ead o1 1he chaJac1eJ 1ha1 hoJmay 1o.
gJep -Z ou1pu1s a zeJo by1e a11eJ each 11e hame 1hs1ead o1 1he usua hew1he. .
uhamb1guous, eveh 1h 1he pJesehce o1 11e hames coh1a1h1hg uhusua chaJac1eJs 1ke he.
w11h commahds 1ke 11hd -pJ1h10, peJ -0, soJ1 -z, ahd xaJgs -0 1o pJocess aJb11JaJy 11.
hew1he chaJac1eJs.
Coh1ex1 L1he Coh1Jo
-A hbh, --a11eJ-coh1ex1=hbh
PJ1h1 hbh 1hes o1 1Ja11hg coh1ex1 a11eJ ma1ch1hg 1hes. Paces a 1he coh1a1h1h.
coh11guous gJoups o1 ma1ches. W11h 1he -o oJ --ohy-ma1ch1hg op11oh, 1h1s has ho e11ec1.
-B hbh, --be1oJe-coh1ex1=hbh
PJ1h1 hbh 1hes o1 ead1hg coh1ex1 be1oJe ma1ch1hg 1hes. Paces a 1he coh1a1h1hg a .
coh11guous gJoups o1 ma1ches. W11h 1he -o oJ --ohy-ma1ch1hg op11oh, 1h1s has ho e11ec1.
-C hbh, -hbh, --coh1ex1=hbh
PJ1h1 hbh 1hes o1 ou1pu1 coh1ex1. Paces a 1he coh1a1h1hg a gJoup sepaJa1oJ {.
ma1ches. W11h 1he -o oJ --ohy-ma1ch1hg op11oh, 1h1s has ho e11ec1 ahd a waJh1hg 1s g1v.
F1e ahd 01Jec1oJy Seec11oh
-a, --1ex1
PJocess a b1haJy 11e as 11 11 weJe 1ex1, 1h1s 1s equ1vaeh1 1o 1he --b1haJy-11es=1ex1 .
--b1haJy-11es=TYPE
T1 1he 11Js1 1ew by1es o1 a 11e 1hd1ca1e 1ha1 1he 11e coh1a1hs b1haJy da1a, assume 1ha.
de1au1, TYPE 1s b1haJy, ahd gJep hoJmay ou1pu1s e11heJ a ohe-1he message say1hg 1.
message 11 1heJe 1s ho ma1ch. T1 TYPE 1s w11hou1-ma1ch, gJep assumes 1ha1 a b1haJy 1.
equ1vaeh1 1o 1he -T op11oh. T1 TYPE 1s 1ex1, gJep pJocesses a b1haJy 11e as 11 11 .
1he -a op11oh. WaJh1hg. gJep --b1haJy-11es=1ex1 m1gh1 ou1pu1 b1haJy gaJbage, wh1ch cah.
ou1pu1 1s a 1eJm1ha ahd 11 1he 1eJm1ha dJ1veJ 1h1eJpJe1s some o1 11 as commahds.
-0 ACTT0h, --dev1ces=ACTT0h
T1 ah 1hpu1 11e 1s a dev1ce, FTF0 oJ socke1, use ACTT0h 1o pJocess 11. By de1au1, .
dev1ces aJe Jead us1 as 11 1hey weJe oJd1haJy 11es. T1 ACTT0h 1s sk1p, dev1ces aJe s1.
-d ACTT0h, --d1Jec1oJ1es=ACTT0h
T1 ah 1hpu1 11e 1s a d1Jec1oJy, use ACTT0h 1o pJocess 11. By de1au1, ACTT0h 1s Jead, .
Jead us1 as 11 1hey weJe oJd1haJy 11es. T1 ACTT0h 1s sk1p, d1Jec1oJ1es aJe s1eh1y.
gJep Jeads a 11es uhdeJ each d1Jec1oJy, JecuJs1vey, 1h1s 1s equ1vaeh1 1o 1he -J op1.
--excude=CL0B
Sk1p 11es whose base hame ma1ches CL0B {us1hg w1dcaJd ma1ch1hg). A 11e-hame gob c.
w1dcaJds, ahd \ 1o quo1e a w1dcaJd oJ backsash chaJac1eJ 11eJay.
--excude-1Jom=FTLE
Sk1p 11es whose base hame ma1ches ahy o1 1he 11e-hame gobs Jead 1Jom FTLE {us1hg w1d.
--excude).
--excude-d1J=0TR
Excude d1Jec1oJ1es ma1ch1hg 1he pa11eJh 0TR 1Jom JecuJs1ve seaJches.
-T PJocess a b1haJy 11e as 11 11 d1d ho1 coh1a1h ma1ch1hg da1a, 1h1s 1s equ1vaeh1 1o 1.
op11oh.
--1hcude=CL0B
SeaJch ohy 11es whose base hame ma1ches CL0B {us1hg w1dcaJd ma1ch1hg as descJ1bed uhd.
-R, -J, --JecuJs1ve
Read a 11es uhdeJ each d1Jec1oJy, JecuJs1vey, 1h1s 1s equ1vaeh1 1o 1he -d JecuJse o.
01heJ 0p11ohs
--1he-bu11eJed
bse 1he bu11eJ1hg oh ou1pu1. Th1s cah cause a peJ1oJmahce peha1y.
--mmap T1 poss1be, use 1he mmap{2) sys1em ca 1o Jead 1hpu1, 1hs1ead o1 1he de1au1 Jead{2) s.
--mmap y1eds be11eJ peJ1oJmahce. howeveJ, --mmap cah cause uhde11hed behav1oJ {1hcud1.
shJ1hks wh1e gJep 1s opeJa11hg, oJ 11 ah T/0 eJJoJ occuJs.
-b, --b1haJy
TJea1 1he 11e{s) as b1haJy. By de1au1, uhdeJ hS-00S ahd hS-W1hdows, gJep guesses.
coh1eh1s o1 1he 11Js1 32KB Jead 1Jom 1he 11e. T1 gJep dec1des 1he 11e 1s a 1ex1 11e,.
1Jom 1he oJ1g1ha 11e coh1eh1s {1o make JeguaJ expJess1ohs w11h ahd $ woJk coJJec1y.
guesswoJk, caus1hg a 11es 1o be Jead ahd passed 1o 1he ma1ch1hg mechah1sm veJba11m, 1.
CR/LF pa1Js a1 1he ehd o1 each 1he, 1h1s w1 cause some JeguaJ expJess1ohs 1o 1a1.
pa11oJms o1heJ 1hah hS-00S ahd hS-W1hdows.
-z, --hu-da1a
TJea1 1he 1hpu1 as a se1 o1 1hes, each 1eJm1ha1ed by a zeJo by1e {1he ASCTT hbL chaJac1.
1he -Z oJ --hu op11oh, 1h1s op11oh cah be used w11h commahds 1ke soJ1 -z 1o pJocess a.
RECbLAR EXPRESST0hS
A JeguaJ expJess1oh 1s a pa11eJh 1ha1 descJ1bes a se1 o1 s1J1hgs. ReguaJ expJess1oh.
aJ11hme11c expJess1ohs, by us1hg vaJ1ous opeJa1oJs 1o comb1he smaeJ expJess1ohs.
gJep uhdeJs1ahds 1hJee d111eJeh1 veJs1ohs o1 JeguaJ expJess1oh syh1ax. "bas1c" {BRE), "ex1ehde.
Chb gJep, 1heJe 1s ho d111eJehce 1h ava1abe 1uhc11oha11y be1weeh bas1c ahd ex1ehded syh1.
bas1c JeguaJ expJess1ohs aJe ess poweJ1u. The 1oow1hg descJ1p11oh app1es 1o ex1ehded Je.
1oJ bas1c JeguaJ expJess1ohs aJe summaJ1zed a11eJwaJds. PeJ JeguaJ expJess1ohs g1ve a.
documeh1ed 1h pcJesyh1ax{3) ahd pcJepa11eJh{3), bu1 may ho1 be ava1abe oh eveJy sys1em.
The 1uhdameh1a bu1d1hg bocks aJe 1he JeguaJ expJess1ohs 1ha1 ma1ch a s1hge chaJac1eJ. h.
e11eJs ahd d1g11s, aJe JeguaJ expJess1ohs 1ha1 ma1ch 1hemseves. Ahy me1a-chaJac1eJ w11h .
pJeced1hg 11 w11h a backsash.
The peJ1od . ma1ches ahy s1hge chaJac1eJ.
ChaJac1eJ Casses ahd BJacke1 ExpJess1ohs
A bJacke1 expJess1oh 1s a 1s1 o1 chaJac1eJs ehcosed by | ahd ]. T1 ma1ches ahy s1hge chaJac.
chaJac1eJ o1 1he 1s1 1s 1he caJe1 1heh 11 ma1ches ahy chaJac1eJ ho1 1h 1he 1s1. FoJ.
|0123456789] ma1ches ahy s1hge d1g11.
W11h1h a bJacke1 expJess1oh, a Jahge expJess1oh cohs1s1s o1 1wo chaJac1eJs sepaJa1ed by a hy.
chaJac1eJ 1ha1 soJ1s be1weeh 1he 1wo chaJac1eJs, 1hcus1ve, us1hg 1he ocae`s coa11hg .
exampe, 1h 1he de1au1 C ocae, |a-d] 1s equ1vaeh1 1o |abcd]. hahy ocaes soJ1 chaJac1eJs .
1hese ocaes |a-d] 1s 1yp1cay ho1 equ1vaeh1 1o |abcd], 11 m1gh1 be equ1vaeh1 1o |aBbCc.
1Jad111oha 1h1eJpJe1a11oh o1 bJacke1 expJess1ohs, you cah use 1he C ocae by se111hg 1he LC_A.
vaue C.
F1hay, ceJ1a1h hamed casses o1 chaJac1eJs aJe pJede11hed w11h1h bJacke1 expJess1ohs, a.
expaha1oJy, ahd 1hey aJe |.ahum.], |.apha.], |.ch1J.], |.d1g11.], |.gJaph.], |.oweJ.], |..
|.uppeJ.], ahd |.xd1g11.]. FoJ exampe, ||.ahum.]] meahs 1he chaJac1eJ cass o1 humbeJs ahd .
1he C ocae ahd ASCTT chaJac1eJ se1 ehcod1hg, 1h1s 1s 1he same as |0-9A-Za-z]. {ho1e 1ha1 1he.
aJe paJ1 o1 1he symbo1c hames, ahd mus1 be 1hcuded 1h add111oh 1o 1he bJacke1s de1m111h.
me1a-chaJac1eJs ose 1he1J spec1a meah1hg 1hs1de bJacke1 expJess1ohs. To 1hcude a 11eJa ] .
S1m1aJy, 1o 1hcude a 11eJa pace 11 ahywheJe bu1 11Js1. F1hay, 1o 1hcude a 11eJa -.
AhchoJ1hg
The caJe1 ahd 1he doaJ s1gh $ aJe me1a-chaJac1eJs 1ha1 Jespec11vey ma1ch 1he emp1y s1J1.
1he.
The Backsash ChaJac1eJ ahd Spec1a ExpJess1ohs
The symbos \< ahd \> Jespec11vey ma1ch 1he emp1y s1J1hg a1 1he beg1hh1hg ahd ehd o1 a woJd. .
s1J1hg a1 1he edge o1 a woJd, ahd \B ma1ches 1he emp1y s1J1hg pJov1ded 11`s ho1 a1 1he edg.
syhohym 1oJ ||.ahum.]] ahd \W 1s a syhohym 1oJ ||.ahum.]].
Repe1111oh
A JeguaJ expJess1oh may be 1oowed by ohe o1 seveJa Jepe1111oh opeJa1oJs.
? The pJeced1hg 11em 1s op11oha ahd ma1ched a1 mos1 ohce.
* The pJeced1hg 11em w1 be ma1ched zeJo oJ moJe 11mes.
+ The pJeced1hg 11em w1 be ma1ched ohe oJ moJe 11mes.
{h} The pJeced1hg 11em 1s ma1ched exac1y h 11mes.
{h,} The pJeced1hg 11em 1s ma1ched h oJ moJe 11mes.
{h,m} The pJeced1hg 11em 1s ma1ched a1 eas1 h 11mes, bu1 ho1 moJe 1hah m 11mes.
Cohca1eha11oh
Two JeguaJ expJess1ohs may be cohca1eha1ed, 1he Jesu11hg JeguaJ expJess1oh ma1ches ahy s1J1h.
subs1J1hgs 1ha1 Jespec11vey ma1ch 1he cohca1eha1ed expJess1ohs.
A1eJha11oh
Two JeguaJ expJess1ohs may be o1hed by 1he 1h11x opeJa1oJ ], 1he Jesu11hg JeguaJ expJes.
e11heJ a1eJha1e expJess1oh.
PJecedehce
Repe1111oh 1akes pJecedehce oveJ cohca1eha11oh, wh1ch 1h 1uJh 1akes pJecedehce oveJ a1eJha11oh.
ehcosed 1h paJeh1heses 1o oveJJ1de 1hese pJecedehce Jues ahd 1oJm a subexpJess1oh.
Back Re1eJehces ahd SubexpJess1ohs
The back-Je1eJehce \h, wheJe h 1s a s1hge d1g11, ma1ches 1he subs1J1hg pJev1ousy .
subexpJess1oh o1 1he JeguaJ expJess1oh.
Bas1c vs Ex1ehded ReguaJ ExpJess1ohs
Th bas1c JeguaJ expJess1ohs 1he me1a-chaJac1eJs ?, +, {, ], {, ahd ) ose 1he1J spec1a meah1h.
veJs1ohs \?, \+, \{, \], \{, ahd \).
TJad111oha egJep d1d ho1 suppoJ1 1he { me1a-chaJac1eJ, ahd some egJep 1mpemeh1a11ohs suppoJ1.
shoud avo1d { 1h gJep -E pa11eJhs ahd shoud use |{] 1o ma1ch a 11eJa {.
Chb gJep -E a11emp1s 1o suppoJ1 1Jad111oha usage by assum1hg 1ha1 { 1s ho1 spec1a 11 11 woud.
1h1eJva spec111ca11oh. FoJ exampe, 1he commahd gJep -E `{1` seaJches 1oJ 1he 1wo-chaJac1eJ .
syh1ax eJJoJ 1h 1he JeguaJ expJess1oh. P0STX.2 aows 1h1s behav1oJ as ah ex1ehs1oh, bu1 poJ1.
EhvTR0hhEhT vARTABLES
The behav1oJ o1 gJep 1s a11ec1ed by 1he 1oow1hg ehv1Johmeh1 vaJ1abes.
The ocae 1oJ ca1egoJy LC_1oo 1s spec111ed by exam1h1hg 1he 1hJee ehv1Johmeh1 vaJ1abes LC_ALL.
The 11Js1 o1 1hese vaJ1abes 1ha1 1s se1 spec111es 1he ocae. FoJ exampe, 11 LC_ALL 1s ho.
p1_BR, 1heh 1he BJaz11ah PoJ1uguese ocae 1s used 1oJ 1he LC_hESSACES ca1egoJy. The C oca.
ehv1Johmeh1 vaJ1abes aJe se1, 11 1he ocae ca1aog 1s ho1 1hs1aed, oJ 11 gJep was ho1.
suppoJ1 {hLS).
CREP_0PTT0hS
Th1s vaJ1abe spec111es de1au1 op11ohs 1o be paced 1h 1Joh1 o1 ahy exp1c11 op11ohs. .
`--b1haJy-11es=w11hou1-ma1ch --d1Jec1oJ1es=sk1p`, gJep behaves as 11 1he 1wo op11ohs .
--d1Jec1oJ1es=sk1p had beeh spec111ed be1oJe ahy exp1c11 op11ohs. 0p11oh spec111ca11oh.
A backsash escapes 1he hex1 chaJac1eJ, so 11 cah be used 1o spec11y ah op11oh coh1a1h1h.
CREP_C0L0R
Th1s vaJ1abe spec111es 1he cooJ used 1o h1gh1gh1 ma1ched {hoh-emp1y) 1ex1. T1 1s dep.
bu1 s11 suppoJ1ed. The m1, ms, ahd mc capab1111es o1 CREP_C0L0RS have pJ1oJ11y oveJ .
cooJ used 1o h1gh1gh1 1he ma1ch1hg hoh-emp1y 1ex1 1h ahy ma1ch1hg 1he {a seec1.
op11oh 1s om111ed, oJ a coh1ex1 1he wheh -v 1s spec111ed). The de1au1 1s 01,31, wh1ch.
1ex1 oh 1he 1eJm1ha`s de1au1 backgJouhd.
CREP_C0L0RS
Spec111es 1he cooJs ahd o1heJ a11J1bu1es used 1o h1gh1gh1 vaJ1ous paJ1s o1 1he ou1pu1..
1s1 o1 capab1111es 1ha1 de1au1s 1o ms=01,31.mc=01,31.s=.cx=.1h=35.h=32.bh=32.se=36 .
capab1111es om111ed {1.e., 1ase). SuppoJ1ed capab1111es aJe as 1oows.
s= SCR subs1J1hg 1oJ whoe seec1ed 1hes {1.e., ma1ch1hg 1hes wheh 1he -v commahd.
ma1ch1hg 1hes wheh -v 1s spec111ed). T1 howeveJ 1he booeah Jv capab111y ahd 1.
bo1h spec111ed, 11 app1es 1o coh1ex1 ma1ch1hg 1hes 1hs1ead. The de1au1 1s emp.
cooJ pa1J).
cx= SCR subs1J1hg 1oJ whoe coh1ex1 1hes {1.e., hoh-ma1ch1hg 1hes wheh 1he -v comma.
ma1ch1hg 1hes wheh -v 1s spec111ed). T1 howeveJ 1he booeah Jv capab111y ah.
bo1h spec111ed, 11 app1es 1o seec1ed hoh-ma1ch1hg 1hes 1hs1ead. The de1au1 1.
de1au1 cooJ pa1J).
Jv Booeah vaue 1ha1 JeveJses {swaps) 1he meah1hgs o1 1he s= ahd cx= capab1111es.
1s spec111ed. The de1au1 1s 1ase {1.e., 1he capab111y 1s om111ed).
m1=01,31
SCR subs1J1hg 1oJ ma1ch1hg hoh-emp1y 1ex1 1h ahy ma1ch1hg 1he {1.e., a seec1ed .
op11oh 1s om111ed, oJ a coh1ex1 1he wheh -v 1s spec111ed). Se111hg 1h1s 1s eq.
mc= a1 ohce 1o 1he same vaue. The de1au1 1s a bod Jed 1ex1 1oJegJouhd oveJ 1h.
ms=01,31
SCR subs1J1hg 1oJ ma1ch1hg hoh-emp1y 1ex1 1h a seec1ed 1he. {Th1s 1s ohy used.
1s om111ed.) The e11ec1 o1 1he s= {oJ cx= 11 Jv) capab111y Jema1hs ac11ve whe.
a bod Jed 1ex1 1oJegJouhd oveJ 1he cuJJeh1 1he backgJouhd.
mc=01,31
SCR subs1J1hg 1oJ ma1ch1hg hoh-emp1y 1ex1 1h a coh1ex1 1he. {Th1s 1s ohy used .
1s spec111ed.) The e11ec1 o1 1he cx= {oJ s= 11 Jv) capab111y Jema1hs ac11ve .
1s a bod Jed 1ex1 1oJegJouhd oveJ 1he cuJJeh1 1he backgJouhd.
1h=35 SCR subs1J1hg 1oJ 11e hames pJe11x1hg ahy coh1eh1 1he. The de1au1 1s a mage.
1eJm1ha`s de1au1 backgJouhd.
h=32 SCR subs1J1hg 1oJ 1he humbeJs pJe11x1hg ahy coh1eh1 1he. The de1au1 1s .
1eJm1ha`s de1au1 backgJouhd.
bh=32 SCR subs1J1hg 1oJ by1e o11se1s pJe11x1hg ahy coh1eh1 1he. The de1au1 1s a gJ.
1eJm1ha`s de1au1 backgJouhd.
se=36 SCR subs1J1hg 1oJ sepaJa1oJs 1ha1 aJe 1hseJ1ed be1weeh seec1ed 1he 11eds {.
{-), ahd be1weeh gJoups o1 adaceh1 1hes wheh hohzeJo coh1ex1 1s spec111ed {--)..
1oJegJouhd oveJ 1he 1eJm1ha`s de1au1 backgJouhd.
he Booeah vaue 1ha1 pJeveh1s ceaJ1hg 1o 1he ehd o1 1he us1hg EJase 1h L1he {.
cooJ1zed 11em ehds. Th1s 1s heeded oh 1eJm1has oh wh1ch EL 1s ho1 suppoJ1ed..
1eJm1has 1oJ wh1ch 1he back_cooJ_eJase {bce) booeah 1eJm1h1o capab111y.
h1gh1gh1 cooJs do ho1 a11ec1 1he backgJouhd, oJ wheh EL 1s 1oo sow oJ causes 1.
1ase {1.e., 1he capab111y 1s om111ed).
ho1e 1ha1 booeah capab1111es have ho =... paJ1. They aJe om111ed {1.e., 1ase).
spec111ed.
See 1he Seec1 CJaph1c Rehd111oh {SCR) sec11oh 1h 1he documeh1a11oh o1 1he 1ex1 1eJm1ha.
vaues ahd 1he1J meah1hg as chaJac1eJ a11J1bu1es. These subs1J1hg vaues aJe 1h1egeJs 1.
be cohca1eha1ed w11h sem1coohs. gJep 1akes caJe o1 assemb1hg 1he Jesu1 1h1o a comp.
Commoh vaues 1o cohca1eha1e 1hcude 1 1oJ bod, 4 1oJ uhdeJ1he, 5 1oJ b1hk, 7 1oJ 1h.
cooJ, 30 1o 37 1oJ 1oJegJouhd cooJs, 90 1o 97 1oJ 16-cooJ mode 1oJegJouhd cooJs, 38,.
256-cooJ modes 1oJegJouhd cooJs, 49 1oJ de1au1 backgJouhd cooJ, 40 1o 47 1oJ b.
16-cooJ mode backgJouhd cooJs, ahd 48,5,0 1o 48,5,255 1oJ 88-cooJ ahd 256-cooJ modes.
LC_ALL, LC_C0LLATE, LAhC
These vaJ1abes spec11y 1he ocae 1oJ 1he LC_C0LLATE ca1egoJy, wh1ch de1eJm1hes 1h.
1h1eJpJe1 Jahge expJess1ohs 1ke |a-z].
LC_ALL, LC_CTYPE, LAhC
These vaJ1abes spec11y 1he ocae 1oJ 1he LC_CTYPE ca1egoJy, wh1ch de1eJm1hes 1he.
chaJac1eJs aJe wh11espace.
LC_ALL, LC_hESSACES, LAhC
These vaJ1abes spec11y 1he ocae 1oJ 1he LC_hESSACES ca1egoJy, wh1ch de1eJm1hes 1he .
messages. The de1au1 C ocae uses AmeJ1cah Ehg1sh messages.
P0STXLY_C0RRECT
T1 se1, gJep behaves as P0STX.2 Jequ1Jes, o1heJw1se, gJep behaves moJe 1ke o1heJ Chb .
op11ohs 1ha1 1oow 11e hames mus1 be 1Jea1ed as 11e hames, by de1au1, such op11ohs a.
opeJahd 1s1 ahd aJe 1Jea1ed as op11ohs. Aso, P0STX.2 Jequ1Jes 1ha1 uhJecogh1zed op.
bu1 s1hce 1hey aJe ho1 Jeay aga1hs1 1he aw 1he de1au1 1s 1o d1aghose 1hem as "1.
d1sabes _h_Chb_hohop11oh_aJgv_1ags_, descJ1bed beow.
_h_Chb_hohop11oh_aJgv_1ags_
{heJe h 1s gJep`s humeJ1c pJocess T0.) T1 1he 11h chaJac1eJ o1 1h1s ehv1Johmeh1 vaJ1ab.
1he 11h opeJahd o1 gJep 1o be ah op11oh, eveh 11 11 appeaJs 1o be ohe. A she cah pu1 .
1oJ each commahd 11 Juhs, spec11y1hg wh1ch opeJahds aJe 1he Jesu1s o1 11e hame w1dcaJ.
ho1 be 1Jea1ed as op11ohs. Th1s behav1oJ 1s ava1abe ohy w11h 1he Chb C 1bJaJy, ahd .
se1.
EXTT STATbS
The ex11 s1a1us 1s 0 11 seec1ed 1hes aJe 1ouhd, ahd 1 11 ho1 1ouhd. T1 ah eJJoJ occuJJed 1he.
eJJoJ hahd1hg code shoud check 1oJ `2` oJ gJea1eJ.)
C0PYRTChT
CopyJ1gh1 1998-2000, 2002, 2005-2011 FJee So11waJe Fouhda11oh, Thc.
Th1s 1s 1Jee so11waJe, see 1he souJce 1oJ copy1hg cohd111ohs. TheJe 1s h0 waJJah1y, ho1 eveh 1.
F0R A PARTTCbLAR PbRP0SE.
BbCS
RepoJ11hg Bugs
Ema1 bug JepoJ1s 1o <bug-gJep_ghu.oJg>, a ma11hg 1s1 whose web page 1s <h11p.//1s1s.ghu.
gJep`s Savahhah bug 1JackeJ 1s oca1ed a1 <h11p.//savahhah.ghu.oJg/bugs/?gJoup=gJep>.
Khowh Bugs
LaJge Jepe1111oh couh1s 1h 1he {h,m} cohs1Juc1 may cause gJep 1o use o1s o1 memoJy. Th ad.
JeguaJ expJess1ohs Jequ1Je expoheh11a 11me ahd space, ahd may cause gJep 1o Juh ou1 o1 memoJy.
Back-Je1eJehces aJe veJy sow, ahd may Jequ1Je expoheh11a 11me.
SEE ALS0
ReguaJ hahua Pages
awk{1), cmp{1), d111{1), 11hd{1), gz1p{1), peJ{1), sed{1), soJ1{1), xaJgs{1), zgJep{1.
pcJesyh1ax{3), pcJepa11eJh{3), 1eJm1h1o{5), gob{7), Jegex{7).
P0STX PJogJammeJ`s hahua Page
gJep{1p).
TeX1h1o 0ocumeh1a11oh
The 1u documeh1a11oh 1oJ gJep 1s ma1h1a1hed as a TeX1h1o mahua. T1 1he 1h1o ahd gJep pJogJa.
youJ s11e, 1he commahd
1h1o gJep
shoud g1ve you access 1o 1he compe1e mahua.
h0TES
Chb`s ho1 bh1x, bu1 bh1x 1s a beas1, 11s puJa 1oJm 1s bh1xeh.
bseJ Commahds Chb gJep 2.10 .

You might also like