考虑我有以下数据流:
BODY1
attrib1: someval11
attrib2: someval12
attrib3: someval13
BODY2
attrib1: someval21
attrib2: someval22
attrib3: someval23
BODY3
attrib1: someval31
attrib2: someval32
attrib3: someval33
我只想为每个 BODY 提取attrib1 和 attrib3,即
attrib1: someval11
attrib3: someval13
attrib1: someval21
attrib3: someval23
attrib1: someval31
attrib3: someval33
我试过了
grep 'attrib1\|attrib3'
,根据这个网站,但没有返回任何内容。 grep attrib1
并grep attrib2
返回数据,但仅针对指定的单个模式。