Consider I have the following stream of data:
BODY1
attrib1: someval11
attrib2: someval12
attrib3: someval13
BODY2
attrib1: someval21
attrib2: someval22
attrib3: someval23
BODY3
attrib1: someval31
attrib2: someval32
attrib3: someval33
I want to extract only attrib1 and attrib3 for each BODY, i.e.
attrib1: someval11
attrib3: someval13
attrib1: someval21
attrib3: someval23
attrib1: someval31
attrib3: someval33
I tried
grep 'attrib1|attrib3'
, according to this site but that returned nothing. grep attrib1
and grep attrib2
do return data but just for the single pattern specified.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…