vic_DTLK
1 Nickel

Re: Extract a block of text with sed/awk/grep from symdev list -v output?

There's probably a better way to do this...

#!/usr/bin/perl

$INFILE = '/path_to_symdev_output';

open(symdev,"<$INFILE") or die "Failed opening $INFILE ($!)";

$found = 0;

while ($line = <symdev>) {

   if ($found == 1) {

        last if ($line =~ /Device Symmetrix Name :/);

        print $line;

   if ($line =~ /Device Symmetrix Name : 00DA/) {

       $found = 1;

       print $line;

   }

}