Thought I'd post this question as it may be of
interest to other SCSH'ers. I want to parse
Apache log files (I know, I know, ...) with SCSH
and it seems to me that the SCSH awk macro is the
way to go. I am a little confused at the exact
specification of how awk works. It says that
each matching clause is executed (unlike cond) and
that each one must return a number of values equal
to the number of state variables.
Now, after you have parsed a line and are scanning the
clauses, if you find one that matches, do you
then execute it, rebind (or SET!) the state variables,
and continue scanning clauses (so subsequent clauses
see the new state)? or do you go back
to the top?
I never intend to learn the UNIX awk function, so I
don't know what the ``usual'' behavior is.
Another question while I'm here. How would you
construct a pipeline in SCSH that piped output
from a single program into two other programs. I
want to do this:
cat foo ------> wc -l
|---> grep something --------> wc -l
|-----> cut --> sort --> uniq
etc. etc. and I don't want to create temp files in between
because the disk thrashing on this moby file would
kill the machine. Can this even be done in Unix? or is this
yet another example of ``no one would ever want to have
that functionality, so I won't implement it''.
Thanks for your time.