Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pattern not recoginized when set as multiline 1

Status
Not open for further replies.

demis001

Programmer
Aug 18, 2008
94
US
I am getting " unterminated pattern error" while I excute the script. If I write the pattern as single line on vi editor it will work but the script will be ugly.

$1~/^A|B|c|d|e|f|g|h/ THIS WILL WORK WITH OUT ANY PROBLEM
If I wrote the same line as:
$1~/^A|B

|C|D
|E|F
|G|h/

I will get an error. The line too long.

Help!
Dereje
 
In awk a RE cannot contain newlines...

You can write something like this but it's just about as ugly I guess:

[tt]
$1~/A|B/ ||
$1~/C|D/ ||
$1~/E|F/ ||
$1~/G|H/
[/tt]


HTH,

p5wizard
 
Thanks, better than the one I have, At least easy to read and edit

Dereje
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top