linux - Solaris 中的 "grep -e pattern1 -e pattern2 <file> "相当于什么?

标签 linux grep solaris

<分区>

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/

相关文章:

perl - 当我无法在目标主机上安装模块时,如何创建可移植的 perl?

python memcache搜索字符串

c - 如何在 Linux 的 C 语言中检查 IP 地址是否可达

bash - 在 Ubuntu 上查找并删除 DOS 行结尾

regex - 用于匹配文件中的 ip 地址的 Grep 正则表达式

linux - 从 linux 到 Solaris 的无密码 ssh 适用于 oracle 用户但不适用于 ftpuser

bash - 在 solaris 上规范化路径名

linux - 什么决定了一个进程可用的虚拟地址空间的大小?

直接从新信号处理程序调用默认信号处理程序

linux - 如何将 Parallel Grep 的输出附加到文件中?