Hello Kerim Can you please explain the following line from Commands.pm? my $tmp_vg = `pvdisplay $raid | grep "VG Name" | grep -o "vg[0-9]"`;
Does this really mean you only consider volume groups with a name of 'vg<digit>....' as valid values for $tmp_vg? This is how I would do it. Maybe there is something I'm missing. #!/usr/bin/perl use strict; use warnings; my $raid = shift; # ------------------- the code ------------------------- # fetch the pvdisplay output my @output = `pvdisplay $raid`; chomp @output; # iterate output, looking for volume group name my $tmp_vg; for my $line (@output) { if ($line =~ /\A \s+ VG[ ]Name \s+ (.+) \z/xms) { # found a matching line - extract vg name $tmp_vg = $1; } } defined $tmp_vg or croak("Unable to determine volume group for '$raid'"); # ------------------- the code ------------------------- print "$raid -> $tmp_vg\n"; bye thomas