On Tue, Apr 03, 2001 at 01:47:37PM -0700, Rob Hudson wrote:
>
>Is there a way to grep twice?
>
>I often grep for words within a dir full of files and then want to
>grep through the results of the first grep, but don't know if you can
>grep the result of a grep without outputing it into a temp file.
>
>Did that sentence just sound like a greppin' grep of grep? or grep?!
>
>There is probably some solution with xargs or pipes and redirects, but
>I haven't been able to figure it out.
Sure, you can pipe into or from grep;
$ man -k man | wc -l
153
$ man -k man | grep ual | grep macro
man (7) - macros to format Reference Manual pages
The ouput of grep is just a stream of characters, like most other *NIX
futilities, so it can be piped, recursed, folded, spindled and mutilated
in all the usual ways.
--
"There are two major products that come out of Berkeley:
LSD and UNIX. We don't believe this to be a coincidence."
-Jeremy S. Anderson