#!/usr/bin/perl use strict; $/ = "}"; while ( my $block = <DATA>) { print $block if ( $block !~ /\b\Q192.168.1.1\E\b/ ); } __DATA__ define host{ use windows-server host_name serverA hostgroups 060202 alias 060202 contact_groups yu address 192.168.1.1 } define host{ use windows-server host_name serverA hostgroups 060202 alias 060202 contact_groups yu address 192.168.1.11 }
In reply to Re: how to remove matched multi lines
by bichonfrise74
in thread how to remove matched multi lines
by cxfcxf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |