Xref: utzoo comp.unix.questions:20987 comp.unix.wizards:21228 comp.unix.i386:3863 Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!tut.cis.ohio-state.edu!att!tsdiag!ka2qhd!moria!dcm From: dcm@moria.UUCP (David C. Miller) Newsgroups: comp.unix.questions,comp.unix.wizards,comp.unix.i386 Subject: Re: Awk with reg. exp. question Message-ID: <111@moria.UUCP> Date: 28 Mar 90 11:49:52 GMT References: <1031@fiver.UUCP> Followup-To: comp.unix.questions Organization: The Black Chasm Lines: 28 >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