开发者

grep a file with a list of regular expressions

I have a large file of regular expressions, one per line. I would like to inverse grep another multi-line file against any regular expression that appears in the first file. Something like this:

grep -v fileWithManyRegu开发者_StackOverflowlarExpressions fileThatMightMatchSomeRegularExpressions

Is there an elegant method to do this aside from looping through every regular expression?


grep -v -f regexes.txt content.txt


At least with Gnu grep you can use --file=<filename> and all should be well.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜