On Fri, 1 Feb 2002, Jack Hodgson wrote:
> How is
> 
> $ grep -ir microsoft * | wc -l
> 
> different from
> 
> $ grep -irc microsoft *

  Ah.  Well, the former spawns a second process, and is thus much less
efficient than your version.  Other than that, I think they are about the
same.  ;-)

  As for *why* I did it that way, I must confess that while I've seen the
"-c" option of GNU grep before, I almost never use it.  There are a couple
factors in that.  One is that "-c" was not present in the version of "grep"
I first used (I think).

  But in a larger sense, I'm used to the Unix Way.  For this case, that
means I subscribe to the theory that a program should "Do one thing, and do
it well".  In other words, in my mind, "grep" finds things in files, and
"wc" counts things.

  For more on this, see "The Unix Philosophy":

        http://www.ntlug.org/~cbbrowne/unix.html
        http://hebb.cis.uoguelph.ca/~dave/27320/new/unixphil.html

  Unix is more than just an operating system: It is an approach to computing
in general.

-- 
Ben Scott <[EMAIL PROTECTED]>
| The opinions expressed in this message are those of the author and do not |
| necessarily represent the views or policy of any other person, entity or  |
| organization.  All information is provided without warranty of any kind.  |


*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************

Reply via email to