>On 5/15/06, Smith, Derek <[EMAIL PROTECTED]> wrote:
> I tried an push @mir2 => (unless /lv\d+/i, `lvdisplay $lv`); in place
of
> the third push
>
> But that gave me an error: Uncaught exception from user code:
>
> syntax error at HPUX_verify_system.pl line 127, near "(unless"
> Yes; that's a syntax error. Did you mean something like this, perhaps?
> push @mir2,
> grep !/\|v\d+/i, # select lines that don't match pattern
> `vddisplay $lv`;
>
>
************************************************************************
****
Thank you Tom... your input is always appreciated!
Tried your solution but I think you mis-typed as I only need the string
as an example "/dev/vg00/lvol#"
But the problem is LV Name /dev/vg00/lvol# is considered one array
element and on one line.
Have been working on this for about an hour tonight and cannot get
it....Ahhhmmmm
my (%hash,@mir,@mir2) = ();
my ($key2,$value2) = 0;
foreach my $lv (@lvs) {
push @mir => (grep /mirror/i, `lvdisplay $lv`);
#push @mir2 => (grep /lvol\d+/i, `lvdisplay $lv`);
push @mir2 => (split /lv name/i, grep /lvol\d+/i, `lvdisplay
$lv`); ## and tried w/out 2nd grep just using split.
#chomp (@mir,@mir2);
}
#%hash = (@mir,@mir2);
#while (($key2,$value2) = each %hash) {
# print "$key2\t:$value2";
#}
print @mir; print "\nsecond array\n";
print @mir2;
__DATA__
I tried to use split but now and getting the output so then I added
another grep but that returned all 1's in the array.
Without the 2nd grep output and it is getting rid of "LV Name"
second array
--- Logical volumes ---
/dev/vg00/lvol3
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 512
Current LE 64
Allocated PE 128
Stripes 0
Stripe Size (Kbytes) 0
Bad block off
Allocation strict/contiguous
IO Timeout (Seconds) default
With the 2nd grep output
second array
11111111
Cardinal Health -- Working together. For life. (sm)
_________________________________________________
This message is for the designated recipient only and may contain privileged,
proprietary, or otherwise private information. If you have received it in
error, please notify the sender immediately and delete the original. Any other
use of the email by you is prohibited.
Dansk - Deutsch - Espanol - Francais - Italiano - Japanese - Nederlands - Norsk
- Portuguese - Svenska: www.cardinalhealth.com/legal/email