<分区>
Solaris 中 grep -e pattern1 -e pattern2 "$file"
的等价物是什么?
在 Linux 中它运行良好。但在 Solaris 中,我得到了“grep: illegal option -- e 用法:grep -hblcnsviw 模式文件。 . ”错误。
有人可以帮忙吗?
<分区>
Solaris 中 grep -e pattern1 -e pattern2 "$file"
的等价物是什么?
在 Linux 中它运行良好。但在 Solaris 中,我得到了“grep: illegal option -- e 用法:grep -hblcnsviw 模式文件。 . ”错误。
有人可以帮忙吗?
最佳答案
代替:
# GNU grep only
grep -e pattern1 -e pattern2 file
...你可以使用:
# POSIX-compliant
grep -e 'pattern1
pattern2' file
关于linux - Solaris 中的 "grep -e pattern1 -e pattern2 <file> "相当于什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39709718/