Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

LSVGMembers

by bpoag (Monk)
on Jun 29, 2006 at 17:12 UTC ( [id://558387]=sourcecode: print w/replies, xml ) Need Help??
Category: AIX
Author/Contact Info Bowie J. Poag (bpoag@comcast.net)
Description: LSVGMembers is a simple script that produces a plain-English report of what logical volumes belong to what volume groups on an AIX box.
#!/usr/bin/perl
##
## LSVGMembers written 062606:1051 by BJP
##
## LSVGMembers displays what logical volumes belong to each volume gro
+up on a system.
##

@vgList = `lsvg`;

print "\nLSVGMembers: Spinning up..\n";

foreach $item (@vgList)
{
  $counter=0;
  chomp($item);
  print "LSVGMembers: \"$item\" encompasses ";

  @vgMembers=split(/\s+/,`lsvg -l $item | grep -v POINT\$ | grep -v $i
+tem: | cut -d" " -f1`);

  foreach $lv (@vgMembers)
  {
    print "$lv"; 
    $counter++;  

    if ($counter<@vgMembers)
    {
      print ", ";
    }

    else
    {
      print ".";
    }

    if ($counter+1==@vgMembers)
    {
      print "and ";
    }
  }

  print "\n";
}

print "LSVGMembers: Spinning down..\n\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: sourcecode [id://558387]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2025-11-13 11:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (68 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.