Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Sep 2002 04:22:42 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        "David O'Brien" <obrien@FreeBSD.org>
Cc:        Akinori MUSHA <knu@iDaemons.org>, Kris Kennaway <kris@obsecurity.org>, Maxim Sobolev <sobomax@FreeBSD.org>, <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org>
Subject:   Re: cvs commit: src/etc newsyslog.conf
Message-ID:  <20020914040438.J11410-100000@gamplex.bde.org>
In-Reply-To: <20020913172606.GB41890@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 13 Sep 2002, David O'Brien wrote:

> On Fri, Sep 13, 2002 at 11:15:56PM +1000, Bruce Evans wrote:
> > > I'd note that our zgrep(1) does not support bz2 files nor have we
> > > something called bzgrep(1).  It is a mess that you can't do a grep
> > > over uncompressed files, gzip'd files and bzip2'd files at once.
> >
> > Similarly for "less *".
>
> $ echo $LESSOPEN
> LESSOPEN='|lesspipe.sh  %s'
> $ cat lesspipe.sh
> #! /bin/sh
>
> case "$1" in
> 	*.Z)	uncompress -c $1	2>/dev/null
> 			;;
> 	*.gz)	gzip -d -c $1	2>/dev/null
> 			;;
> 	*.bz2)	bzip2 -d -c $1	2>/dev/null
> 			;;
> esac

Like I said, it is a mess.  The above costs an extra shell process and
an extra uncompression process _per file_.  To make it actually work,
it would need another process per file to run file(1).  The above fails
to handle *.tz, *.tgz, *.tbz and *.whonoz, and mishandles files that
happen to have these extensions without actually being compressed.

zgrep handles all gzipped and plain files correctly using no extra
processes, no matter what the file extensions are.  However, it fails
to handle compress(1)'ed files, and bzipped files...

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020914040438.J11410-100000>