为什么使用这些"egrep,fgrep和rgrep"变体?被弃用了吗? [英] Why these variants of "egrep, fgrep, and rgrep" are deprecated?

查看:86
本文介绍了为什么使用这些"egrep,fgrep和rgrep"变体?被弃用了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

grep,egrep,fgrep,rgrep,pgrep 的说明如下所示:

说明

grep,egrep,fgrep,rgrep,pgrep-是类Unix操作中的命令 打印与图案匹配的线的系统. grep搜索 包含与给定PATTERN匹配的行的命名输入文件. 默认情况下,它打印匹配的行.

grep, egrep, fgrep, rgrep, pgrep - are commands in Unix-like operating systems that print lines matching a pattern. The grep searches the named input FILEs for lines containing a match to the given PATTERN. By default, it prints the matching lines.

此外,变体程序egrep,fgrep和rgrep相同 分别为grep -E,grep -F和grep -r.这些变体是 已弃用,但为了向后兼容而提供.

In addition, the variant programs egrep, fgrep, and rgrep are the same as grep -E, grep -F, and grep -r, respectively. These variants are deprecated, but are provided for backward compatibility.

为什么不推荐使用这些 egrep,fgrep和rgrep 变体?

Why these variants of egrep, fgrep, and rgrep are deprecated?

推荐答案

理论 来获取grep的POSIX描述:

It's answered in the Rationale for the POSIX description of grep:

此grep已通过向上兼容的方式进行了增强,以提供历史egrep和fgrep命令的确切功能. 标准开发人员的明确意图是将这三个组合并为一个命令.

This grep has been enhanced in an upwards-compatible way to provide the exact functionality of the historical egrep and fgrep commands as well. It was the clear intention of the standard developers to consolidate the three greps into a single command.

作为实现扩展,很可能会支持旧的egrep和fgrep命令很多年,从而允许历史应用程序不经修改即可运行.

The old egrep and fgrep commands are likely to be supported for many years to come as implementation extensions, allowing historical applications to operate unmodified.

历史实现通常会默默地忽略除-e和-f选项之一以外的所有选项,但是对于实际使用的是哪种规范却不一致.

Historical implementations usually silently ignored all but one of multiply-specified -e and -f options, but were not consistent as to which specification was actually used.

这篇关于为什么使用这些"egrep,fgrep和rgrep"变体?被弃用了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆