Using grep for multiple search patterns

前端 未结 5 1837
春和景丽
春和景丽 2020-12-05 11:26

Consider I have the following stream of data:

BODY1
attrib1:  someval11
attrib2:  someval12
attrib3:  someval13

BODY2
attrib1:  someval21
attrib2:  someval2         


        
5条回答
  •  伪装坚强ぢ
    2020-12-05 11:51

    It depends on the shell you are into. grep -iw 'patter1\|patter2\|pattern3' works on bash shell where as it doesn't work on korn shell. For korn shell we might have to try grep -e pattern1 -e patter2 and so on.

提交回复
热议问题