开发者

using OR in egrep

开发者 https://www.devze.com 2023-02-16 10:45 出处:网络
How do I select only the lines those start with any digit or \"** SETTLE\" word with a few stars? Following will return the lines starting with number but do not return the lines with the word SETTLE

How do I select only the lines those start with any digit or "** SETTLE" word with a few stars? Following will return the lines starting with number but do not return the lines with the word SETTLE开发者_运维百科.

# cat somefile.txt | egrep "(^[0-9]|'^*************** SETTLE ')"


egrep "^(([0-9])|([*]{3,} SETTLE))"


$ egrep '^([0-9]|\**+ SETTLE )' somefile.txt
0

精彩评论

暂无评论...
验证码 换一张
取 消