Awk with reg. exp. question

David C. Miller dcm at moria.UUCP
Wed Mar 28 21:49:52 AEST 1990


>And now for the script of the error.
>
>awk: illegal primary in regular expression ^(|REPLY-TO|FROM|SENDER)[ \t]*: at REPLY-TO|FROM|SENDER)[ \t]*:
> source line number 2
> context is
>        /^(|REPLY-TO|FROM|SENDER)[ >>>  \t]*:/ <<<  {
>                                         ^
>                                         |
>                                         Is this the error?


No, awk got seriously confused by the start of the statement and flagged
the spot where it finally realized it was lost.  The pattern being
used is the first one, /^($FIELD)[ \t]*:/.

So the problem is with the arguments that this program is being called
with, in particular, one that reads "|reply-to|from|sender".  The case
of that may vary.  That argument should read "reply-to|from|sender".

Note the absence of the leading vertical bar.


>-----------------------------------------------------------------
>
>---Bob

---David
...!att!tsdiag!ka2qhd!moria!dcm



More information about the Comp.unix.questions mailing list