Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/gzip zgrep(1): suppress the prefixing of filename on...



details:   https://anonhg.NetBSD.org/src/rev/373dc07bc47f
branches:  trunk
changeset: 809376:373dc07bc47f
user:      nakayama <nakayama%NetBSD.org@localhost>
date:      Mon Jul 06 12:05:40 2015 +0000

description:
zgrep(1): suppress the prefixing of filename on output when only
one file is specified to match the grep(1)'s output.

diffstat:

 usr.bin/gzip/zgrep |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r cbf687421665 -r 373dc07bc47f usr.bin/gzip/zgrep
--- a/usr.bin/gzip/zgrep        Mon Jul 06 10:24:59 2015 +0000
+++ b/usr.bin/gzip/zgrep        Mon Jul 06 12:05:40 2015 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: zgrep,v 1.8 2013/07/25 12:25:23 pgoyette Exp $
+# $NetBSD: zgrep,v 1.9 2015/07/06 12:05:40 nakayama Exp $
 #
 # Copyright (c) 2003 Thomas Klausner.
 #
@@ -113,7 +113,7 @@
     ${zcat} -fq - | ${grep} ${grep_args} -- "${pattern}" -
 else
     # ... on all files given on the command line
-    if [ ${silent} -lt 1 ]; then
+    if [ ${silent} -lt 1 -a $# -gt 1 ]; then
        grep_args="-H ${grep_args}"
     fi
     while [ $# -gt 0 ]



Home | Main Index | Thread Index | Old Index