comparison - grep -v 在 Solaris 10 中不起作用

标签 comparison grep

我有两个文件:

文件 1 包含

Roger 
Roger
Bob
Bob
Elliot
Matt

文件 2 包含

Roger
Bob

我需要比较两个文件,并将不匹配的文件(Elliot 和 Matt)重定向到另一个文件。

我在 Solaris 10 中尝试了以下方法,但它不起作用,但在 Linux 中工作正常:

grep -v File2 File1

任何帮助将不胜感激,因为我已经在这个问题上浪费了很多时间。

谢谢

最佳答案

如果您像我一样在 Solaris 11 上有 /usr/xpg4/bin/grep :

$ cat /tmp/file
Roger 
Roger
Bob
Bob
Elliot
Matt

$ cat /tmp/filter
Roger
Bob

$ /usr/xpg4/bin/grep -f /tmp/filter -v /tmp/file
Elliot
Matt

关于comparison - grep -v 在 Solaris 10 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13056537/

相关文章:

linux - Grep 在 "S+"状态启动

bash - 修改引号内的内容,BASH

python - 为什么不使用 "is"比较来代替原始类型的 "=="?

c# - base64编码图片的快速对比

bash - 如何使用 bash 脚本在文件中输出第一行 curl 结果

linux - Ubuntu bash 脚本重用输入变量

bash - Grep 跨 Hadoop 文件系统中的多个文件

image - 类似的图像搜索软件(如 TinEye)

c++ - 关于在 C/C++ 中比较整数和 float / double

scheme - eq?在 Racket 中表现与 eq 不同?在 Guile 中还是在 Common Lisp 中是 eq?