Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script for find plex in Symmetrix

Status
Not open for further replies.

Currando

ISP
Feb 13, 2001
25
ES
Hello all;

I have a problem with a script in AWK, I need find two ocurrences in a piece of exit of a command. When I run the command "vxprint -Aht" the exit of the command is similar to this:

v ofiu03-L02
pl ofiu03-P03
sd d64t0-02
pl ofiu03-P04
sd d64t1-02

v ofiu03-L03
pl ofiu03-P05
sd d65t0-02
pl ofiu03-P06
sd d65t1-02

v ofiu04
pl ofiu04-04
sv ofiu04-S03
sv ofiu04-S04

v ofiu04-L03
pl ofiu04-P05
sd d66t0-02
pl ofiu04-P06
sd d66d1-02

The first that I need is separate each of the volume (a volume start with the letter "v" in the first field and end with white line) once separate each of this volumen, I need know which of this have two or more lines with "pl" in the first field. For each of this volume that have two or more "pl" I need that the script show me which volume name is (but this is not important).

Can anybody help me please, I have a very big problem in my job for this.

Thanks in advance for your time

Regards

Currando
 
this might be a start:

nawk -f plex.awk plex.txt

#------------------ plex.awk
$1 == "v" {
if (plNum > 1)
printf("Multiple pl's for v=[%s]\n", vValue);
vValue=$2
plNum=0;
next;
}

$1 == "pl" { plNum++ }

END {
if (plNum > 1)
printf("Multiple pl's for v=[%s]\n", vValue);
}
vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top