diff options
author | wosch <wosch@FreeBSD.org> | 1997-12-21 19:15:12 +0000 |
---|---|---|
committer | wosch <wosch@FreeBSD.org> | 1997-12-21 19:15:12 +0000 |
commit | 05604036c1fb48d8724db559aeb981813b41afa8 (patch) | |
tree | b1ad5de571a8dfab66f5e6a8beadb0ceae3a37ca /gnu/usr.bin/grep | |
parent | 7fb46d49218076b8a6b7f0ddeb7afd3d18187df8 (diff) | |
download | FreeBSD-src-05604036c1fb48d8724db559aeb981813b41afa8.zip FreeBSD-src-05604036c1fb48d8724db559aeb981813b41afa8.tar.gz |
When called as `zgrep', the -Z argument is assumed. Make a
link from zgrep to grep.
Pointed out by: Tim Vanderhoek <hoek@hwcn.org> and
Mike Smith <mike@smith.net.au>
Diffstat (limited to 'gnu/usr.bin/grep')
-rw-r--r-- | gnu/usr.bin/grep/Makefile | 6 | ||||
-rw-r--r-- | gnu/usr.bin/grep/grep.1 | 7 | ||||
-rw-r--r-- | gnu/usr.bin/grep/grep.c | 6 |
3 files changed, 17 insertions, 2 deletions
diff --git a/gnu/usr.bin/grep/Makefile b/gnu/usr.bin/grep/Makefile index 40aafc0..a6ab6a1 100644 --- a/gnu/usr.bin/grep/Makefile +++ b/gnu/usr.bin/grep/Makefile @@ -1,5 +1,6 @@ -# $Id$ +# $Id: Makefile,v 1.10 1997/12/20 18:46:06 wosch Exp $ +CFLAGS=-g GREP_LIBZ= YES GREP_FTS= YES @@ -20,6 +21,9 @@ LDADD+= -lgnuregex LDADD+= -lz DPADD+= ${LIBZ} CFLAGS+= -DHAVE_LIBZ=1 +LINKS+= ${BINDIR}/grep ${BINDIR}/zgrep \ + ${BINDIR}/grep ${BINDIR}/zegrep \ + ${BINDIR}/grep ${BINDIR}/zfgrep .endif .if defined(GREP_FTS) && !empty(GREP_FTS) CFLAGS+= -DHAVE_FTS=1 diff --git a/gnu/usr.bin/grep/grep.1 b/gnu/usr.bin/grep/grep.1 index 75a15a7..6f5c48a 100644 --- a/gnu/usr.bin/grep/grep.1 +++ b/gnu/usr.bin/grep/grep.1 @@ -1,6 +1,6 @@ .TH GREP 1 "1992 September 10" "GNU Project" .SH NAME -grep, egrep, fgrep \- print lines matching a pattern +grep, egrep, fgrep, zgrep \- print lines matching a pattern .SH SYNOPSIS .B grep [\-[AB] num] @@ -59,6 +59,11 @@ and is compatible with the historical Unix .B Fgrep is the same as .BR "grep\ \-F" . +When called as +.BR zgrep , +the +.BR \-Z +option is assumed. .PD .LP All variants of diff --git a/gnu/usr.bin/grep/grep.c b/gnu/usr.bin/grep/grep.c index 82a8403..9a0fe05 100644 --- a/gnu/usr.bin/grep/grep.c +++ b/gnu/usr.bin/grep/grep.c @@ -725,6 +725,12 @@ main(argc, argv) #if HAVE_FTS > 0 Rflag = Hflag = Pflag = Lflag = 0; #endif +#if HAVE_LIBZ > 0 + if (*prog == 'z') { + prog++; + Zflag = 1; + } +#endif while ((opt = getopt(argc, argv, GETOPT_STD/**/GETOPT_FTS/**/GETOPT_Z)) != -1) |