From owner-freebsd-current Fri Sep 22 05:06:50 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id FAA27407 for current-outgoing; Fri, 22 Sep 1995 05:06:50 -0700 Received: from vanuata.dcs.gla.ac.uk (vanuata.dcs.gla.ac.uk [130.209.240.50]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id FAA27393 for ; Fri, 22 Sep 1995 05:06:34 -0700 Message-Id: <199509221206.FAA27393@freefall.freebsd.org> Received: from seram.dcs.gla.ac.uk by vanuata.dcs.gla.ac.uk with LOCAL SMTP (PP); Fri, 22 Sep 1995 13:05:30 +0100 To: Wolfram Schneider cc: "Garrett A. Wollman" , current@freebsd.org Subject: Re: from(1) In-reply-to: Your message of "Thu, 21 Sep 1995 15:14:51 +0200." <199509211314.PAA05392@caramba.cs.tu-berlin.de> Date: Fri, 22 Sep 1995 13:05:21 +0100 From: Simon Marlow Sender: owner-current@freebsd.org Precedence: bulk Wolfram Schneider writes: > Garrett A. Wollman writes: > >< de> said: > > > >> - Option '-c' print a count of matching lines > > > >Use wc(1). > > > An option is better than a pipe I disagree entirely. The generality provided by pipes and pipe combinators far outweighs the slight performance gain by implementing the options directly. How many other programs are you going to add '-c' to? What about the programs where '-c' is already taken, and you have to use an inconsistent flag? In Un*x, to count lines, one uses wc(1). > a) in a perl script, a pipe force system to use sh -c > instead exec/fork If efficiency is that important, the Perl script should be counting the lines itself. This is trivial in Perl. > b) for aliases > > alias fb='from -tcs owner-freebsd-security' > > is simpler than [for bash] > fb () { > from -tcs owner-freebsd-security "$@" | wc -l > } > most people forget the "$@" A valid point, but this is a shell problem and not worth sacrificing the philosophy of an operating system for. Cheers, Simon -- Simon Marlow simonm@dcs.gla.ac.uk Research Assistant http://www.dcs.gla.ac.uk/~simonm/ finger for PGP public key