![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Running same script multiple times concurrently... | ckhowe | Shell Programming and Scripting | 4 | 12-12-2007 06:39 PM |
| Crons executed multiple times. | shorty | UNIX for Dummies Questions & Answers | 2 | 03-14-2007 12:05 PM |
| Trying to read data multiple times | coachr | Shell Programming and Scripting | 0 | 12-06-2006 02:11 PM |
| Prevent file from being mailed multiple times from a job | Sree_2503 | Shell Programming and Scripting | 2 | 11-14-2006 12:47 PM |
| matching multiple times in same line | oldtrash | Shell Programming and Scripting | 2 | 04-28-2004 06:57 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Trying to read data multiple times
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. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|