use "zcat -fq" not just plain "zcat". this lets zgrep work on non

compressed files (as reported by simonb) as well as not printing
random warnings that zgrep isn't ready to handle.
This commit is contained in:
mrg 2004-05-25 07:09:09 +00:00
parent 53c625655c
commit 9b954397e0
1 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: zgrep,v 1.3 2004/04/27 09:18:16 jdolecek Exp $
# $NetBSD: zgrep,v 1.4 2004/05/25 07:09:09 mrg Exp $
#
# Copyright (c) 2003 Thomas Klausner.
#
@ -101,12 +101,12 @@ fi
if [ $# -lt 1 ]
then
# ... on stdin
${zcat} - | ${grep} ${grep_args} "${pattern}" -
${zcat} -fq - | ${grep} ${grep_args} "${pattern}" -
else
# ... on all files given on the command line
while [ $# -gt 0 ]
do
${zcat} -- "$1" | ${grep} -H --label="${1}" "${pattern}" ${grep_args} -
${zcat} -fq -- "$1" | ${grep} -H --label="${1}" "${pattern}" ${grep_args} -
shift
done
fi