Date: Thu, 25 Nov 2004 12:47:10 +0100 From: David Landgren <david@landgren.net> To: freebsd-questions@freebsd.org Subject: Re: Finding options for ports Message-ID: <41A5C63E.60101@landgren.net> In-Reply-To: <44d5ydiv2e.fsf@be-well.ilk.org> References: <Pine.BSI.4.58L.0411151215270.18509@vp4.netgate.net> <200411151324.09969.ringworm@inbox.lv> <20041115184642.337300c8@dolphin.local.net> <A4643C469A4770D21E7AA266@utd49554.utdallas.edu> <44d5ydiv2e.fsf@be-well.ilk.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[cc list trimmed] Lowell Gilbert wrote: > Paul Schmehl <pauls@utdallas.edu> writes: > > >>--On Monday, November 15, 2004 06:46:42 PM -0600 "Conrad J. Sabatier" >><conrads@cox.net> wrote: >> >>>This is a useless use of "cat". You could accomplish the same thing >>>with: >>> >>>grep WITH Makefile >> >>When there are ten different ways to skin a cat, what makes one way >>inherently better than another? > > > Efficiency. > Using cat(1) spins off a subprocess. > > http://sial.org/howto/shell/useless-cat/ > ooh, just saw this message while catching up on the list. <rant> This is a pet peeve of mine. Yeah, sure it spins off another sub-process, but who's counting? A more important issue is that of comfort. Your comfort. If you have a number of strings that you want to grep for, it's much more cumbersome to work back past the files at the end of the command line to change the grep target string. grep foo somefile grep bar somefile Assuming bask, you have to step over 'somefile' with some whacky Esc-B combo in order to ^W zap the 'foo' field. Contrast this with: cat somefile | grep foo cat somefile | grep bar In this second case, you can recall the command and ^W to zap the token immediately, and replace it with bar. Much less typing effort. The different strings you grep with, the more you save. And then once you've grepped what you want, you might then replace the grep by sed, awk, wc or whatever. (Yes, I know about ^old^new, but that is even more cumbersome that Esc-B). Let the damned computer burn another process. That's what it's good at! </rant> David
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41A5C63E.60101>