From owner-cvs-all Fri Sep 13 11:18:33 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 79E9637B400; Fri, 13 Sep 2002 11:18:26 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id E5E3443E4A; Fri, 13 Sep 2002 11:18:20 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id EAA04554; Sat, 14 Sep 2002 04:18:17 +1000 Date: Sat, 14 Sep 2002 04:22:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: "David O'Brien" Cc: Akinori MUSHA , Kris Kennaway , Maxim Sobolev , , Subject: Re: cvs commit: src/etc newsyslog.conf In-Reply-To: <20020913172606.GB41890@dragon.nuxi.com> Message-ID: <20020914040438.J11410-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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