开发者

Comparing with a Blacklist and saving the output

开发者 https://www.devze.com 2023-02-03 21:51 出处:网络
I have 2 text files, the source list, and a \"black list\", which it\'ll compare against the source list (case insensitive) and if any lines is detected with any of the blacklist lines, make a \"3rd l

I have 2 text files, the source list, and a "black list", which it'll compare against the source list (case insensitive) and if any lines is detected with any of the blacklist lines, make a "3rd list" (output) of the offending items and line numbers (of the source file).

Sour开发者_如何学编程ce List Example:

*cat
##dog
.pig
$qwer
|cup|
*coke*
^clock^


Give this a try:

grep -Finf blklst srclst
0

精彩评论

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

关注公众号