【问题标题】:How to make grep list strings not found in a file如何在文件中找不到 grep 列表字符串
【发布时间】:2014-04-10 09:12:26
【问题描述】:

我有一个文件中的字符串列表,并希望 grep 在另一个文件中搜索它们并仅打印未找到的字符串。有可能吗?

【问题讨论】:

    标签: grep


    【解决方案1】:
    while read string
    do
        if ! grep -q "$string" "$other_file"
        then echo "$string"
        fi
    done < "$file"
    

    【讨论】:

      猜你喜欢
      • 2018-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-22
      • 1970-01-01
      • 2015-04-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多