0

i have following code:

egrep -v "(^/\*\!40101.*\*/;$|^/\*\!50001.*\*/;$)"

that will working fine to skip text like this:

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
/*!50001 DROP TABLE IF EXISTS `some_table_name`*/;

however if i have text like this:

/*!50001 CREATE TABLE `some_table_name` (
  `id` int(11),
  `field1` char(30),
  `field2` char(30),
) ENGINE=MyISAM */;

it failed to skip it. Any idea?

What i want is:

if there is a text

Start with : /*!40101
End with : */;

or

if there is a text

Start with : /*!50001
End with : */;

I want to skip whole line, or whole block of it. Any idea how to do that?

Teddybugs
  • 1,232
  • 1
  • 12
  • 37

1 Answers1

0

Your regex skips everything that starts 40101 or 50001 up to the end of the line but not onto the next line. It doesn't look like egrep supports multiline matching.

Spaceghost
  • 6,835
  • 3
  • 28
  • 42