"S.P. Hoeke" <[EMAIL PROTECTED]> wrote:
> 
> Specifically I don't know how to "feed your log through" the awk line.
> Same goes for "feed the matchup output through any of the" scripts

You ``feed a file through'' a program when you arrange for the file to
be the input of the program. Three obvious ways of doing that are:

1. Input redirection:

   awk 'SCRIPT' < FILE

2. Pipes:

   cat FILE | awk 'SCRIPT'

3. Command line arguments:

   awk 'SCRIPT' FILE


Option #3 only works for programs which take a file as an argument, but
most programs do. For example, awk, perl, sed, grep, more, less, tail,
head, etc., all take a file as an argument. I have a silly personal
prejudice against using #3: for operating on a single file, I usually
use #1 instead; for operating on many files, I usually use #2 instead.

Using #2 for a single file will win you Don Libes's "Useless Use of Cat
Award". It wastes a whole process over solution #1. For multiple files,
however, #2 is a useful use of cat.

The fundamental concept of UNIX is the "filter". Any program which reads
from the standard input, does something, and writes to the standard output
is a filter. They can be assembled in "pipelines", which are probably
the single most powerful concept in UNIX (though probably originally a
MULTICS concept).

To advance out of newbie-hood, you need "The UNIX Programming Environment"
by Kernighan and Pike. Buy it, read it, live it. It's $34.00 US from
<http://www.us.buy.com/books/product.asp?sku=30014507>. Kernighan, by the
way, is the "K" in AWK, one of the authors of the C language, and one of
the inventors of UNIX.

Len.


--
The pitiful state of "secure code" is shocking. (Actually, I
just wrote an essay on the topic. Get a copy for yourself at:
<http://www.counterpane.com/pitfalls.html>.
                                        -- Bruce Schneier

Reply via email to