For Programmers: Free Programming Magazines  


Home > Archive > AWK > December 2006 > Need help with reading until one field in multiple records all go to zero in AWK









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Need help with reading until one field in multiple records all go to zero in AWK
ray.steinert@mainline.com

2006-12-13, 4:08 pm

I am developing a script to automate Global Mirroring on IBM DS8100's.
Part of the process is to establish a global copy and wait until the
paired LUN's Out of Sync tracks goes to zero. I can issue a command to
display the ouput and am trying to use AWK to read the appropriate
field. I am simulating the command output (since I can't do it live) by
capturing the output to a file and then reading the file. My problem is
I haven't figured out how to use getline to read the file multiple
times. Here is what I'm attempting:

while ( EndofRout > 0 ) {
NR = 1
while ( (getline < "/tmp/output.orig") > 0 ) {
OutSyncTrack[NR] = $7
NR++
} # end of while getline to build OutSyncTrack array
#
#
for ( x = 1; x <= NR; ++x ) {
EndofRout = 0
print "EndofRout is " EndofRout
if ( OutSyncTrack[x] != 0 )
EndofRout = 1
continue
}
}

The field $7 starts off as a high number then gradually goes to zero. I
can simulate this by editing the file, but my problem is that it is
only reading the file once even though $7 is not zero. Any help will be
greatly appreciated. Thanks in advance.

Kees Nuyt

2006-12-13, 4:08 pm

On Wed, 13 Dec 2006 21:08:02 +0100, "news.t-online.de"
<suregeonde@yahoo.de> wrote:

[snip]

>with IBMs OS MVS or now zOS, one of the real OSes
>around, if not the only real OS.


You just touched my sweet spot :))
Don't rule out Fujitsu Siemens' BS2000/OSD.
Same capabilities, reliability and security, but much more
structured, and easier and less expensive to administrate.
Ok, I'm biased, I'm the BOFH of one of those systems.
My humble apologies for this OT posting.
--
( Kees
)
c[_] Demagogue: One who preaches a doctrine he knows to be
untrue to men he knows to be idiots. (H.L. Mencken) (#215)
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com