teamassociated has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; my (%map,@tmp,$line,$vhost,$next_line); open (MAP, "-|", "/usr/ios/cli/ioscli lsmap -all") or die $!; while (<MAP>) { next if $_ =~ /^$/; next if $_ =~ /--.*/; next if $_ =~ /^SVSA.?/; #push @tmp, (split(" ", $vh, 0 )); if ( /^vhost/i ) { my $pos = tell $fh; my $next_line = <$fh>; seek $fh, $pos, 0; } } __OUT__ vhost0 U9117.MMD.218A8B7-V2-C2 0x0000000 +b VTD vtscsi0 Status Available LUN 0x8100000000000000 Backing device l02duapofdev_r1.58ff94782d7c325acc49a8dd9c04bb1e Physloc Mirrored N/A vhost1 U9117.MMD.218A8B7-V2-C12 0x0000000 +3 VTD NO VIRTUAL TARGET DEVICE FOUND vhost2 U9117.MMD.218A8B7-V2-C13 0x0000000 +4 VTD NO VIRTUAL TARGET DEVICE FOUND vhost8 U9117.MMD.218A8B7-V1-C19 0x0000000 +a VTD vtscsi36 Status Available LUN 0x8100000000000000 Backing device l02dudbofqa2_a1.45b2b49e9b5d2e2a54279a67fab75306 Physloc Mirrored N/A VTD vtscsi37 Status Available LUN 0x8200000000000000 Backing device l02dudbofqa2_r1.0d0657fb7a38e5afe50956bc8fedfb2e Physloc Mirrored N/A __DISCARD__ vhost1 U9117.MMD.218A8B7-V2-C12 0x0000000 +3 VTD NO VIRTUAL TARGET DEVICE FOUND vhost2 U9117.MMD.218A8B7-V2-C13 0x0000000 +4 VTD NO VIRTUAL TARGET DEVICE FOUND
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: discard lines after match
by Laurent_R (Canon) on Nov 10, 2014 at 21:49 UTC | |
|
Re: discard lines after match
by boftx (Deacon) on Nov 10, 2014 at 20:22 UTC |