The -h option is not working in xzgrep/zgrep

Solution Unverified - Updated -

Issue

  • The option -h does not work with xzgrep and zgrep
  • It shall suppress the filenames as it does with grep.
  • According to man page, the output of xzgrep with -h option shall be as without filename prefix.
  -h, --no-filename         suppress the file name prefix on output
      --label=LABEL         use LABEL as the standard input file name prefix
  • zgrep -h does not work in Red Hat Enterprise Linux 6
[root@host root]# zgrep -h foo f1 f2
f1:foo
f2:foo

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • xzgrep [Packaged via xz. Problem is seen with both RHEL 5 and RHEL 6]
  • zgrep [problem is only noticed with RHEL 6. Packaged via gzip 1.3.12-18.el6 ]

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content