Trying to read data multiple times


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Trying to read data multiple times
# 1  
Old 12-06-2006
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

In PErl script: need to read the data one file and generate multiple files based on the data

We have the data looks like below in a log file. I want to generat files based on the string between two hash(#) symbol like below Source: #ext1#test1.tale2 drop #ext1#test11.tale21 drop #ext1#test123.tale21 drop #ext2#test1.tale21 drop #ext2#test12.tale21 drop #ext3#test11.tale21 drop... (5 Replies)
Discussion started by: Sanjeev G
5 Replies

2. Shell Programming and Scripting

Read multiple text files and copy data to csv

hi i need to extract lines from multiple files to a csv file. for example, i have these 3 files file1.txt date:29dec1980 caller:91245824255 called:8127766 file2.txt date:11apr2014 caller:9155584558 called:8115478 file3.txt date:25jun2015 caller:445225552 called:8117485 (30 Replies)
Discussion started by: lp.descamps
30 Replies

3. UNIX for Dummies Questions & Answers

Extracting data between specific lines, multiple times

I need help extracting specific lines in a text file. The file looks like this: POSITION TOTAL-FORCE (eV/Angst) ----------------------------------------------------------------------------------- 1.86126 1.86973 1.86972 ... (14 Replies)
Discussion started by: captainalright
14 Replies

4. Shell Programming and Scripting

Read multiple files, parse data and append to a file

Hi..Can anyone suggest a simple way of achieving this. I have several files which ends with extension .vcf . I will give example with two files In the below files, we are interested in File 1: 38 107 C 3 T 6 C/T 38 241 C 4 T 5 C/T 38 247 T 4 C 5 T/C 38 259 T 3 C 6 T/C... (8 Replies)
Discussion started by: empyrean
8 Replies

5. UNIX for Dummies Questions & Answers

how to read how many times same result occurs?

Is there a way to read how many times each result occurs in a list, say the list.txt has the results: a c d a f c a d e and I need to know how many times each of them occurs such as : a=3 c=2 ..etc. (5 Replies)
Discussion started by: Iifa
5 Replies

6. Shell Programming and Scripting

need help using one variable multiple times

I apologize for the title but I am not even sure myself what to call this. I am going to use an example of a pizza delivery. I need to make an interactive script that allows users to order a certain number of pizzas, and then choose what they want on each pizza. Here is my code so far.... ... (1 Reply)
Discussion started by: cstadnyk1
1 Replies

7. Shell Programming and Scripting

Running Multiple Times ?

hey mates, I was wondering if someone could assist me with this one, I have couple scripts that I would like to invoke from .sh ( One after another ) Script1 Script2 Script3 Is it possible to run script 2 after script one finished running ? And again start script 3 after script 2... (6 Replies)
Discussion started by: NDxiak
6 Replies

8. Shell Programming and Scripting

Doing one thing multiple times

Hi, I wrote a awk line here: awk 'BEGIN {OFS="\t"} {print $0, int(rand()*($2-$1 + 1) + $1) }' filename Basically what it does is that it takes the start (column 1) and stop (column 2) and generates a random # in between start and stop. I want to take this a step further and have it... (2 Replies)
Discussion started by: phil_heath
2 Replies

9. Shell Programming and Scripting

Read the data from multiple files and sum the value

Hi all, I have a requirement where i have to read multiple files using Shell Script in Korn Shell. each file will have the 3rd line as the amount field, i have to read this amount field and sum it for all the files. any idea on how to achieve this?? (i think i can achieve it using a loop,... (9 Replies)
Discussion started by: nvuradi
9 Replies

10. Shell Programming and Scripting

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... (1 Reply)
Discussion started by: coachr
1 Replies
Login or Register to Ask a Question
Padre::Sync(3pm)					User Contributed Perl Documentation					  Padre::Sync(3pm)

NAME
Padre::Sync - Utility functions for handling remote Configuration Syncing DESCRIPTION
The "Padre::Sync" class contains logic for communicating with a remote Madre::Sync server. This class interacts with the Padre::Wx::Dialog::Sync class for user interface display. METHODS
"new" The constructor returns a new "Padre::Sync" object, but you should normally access it via the main Padre object: my $manager = Padre->ide->config_sync; First argument should be a Padre object. "main" A convenience method to get to the main window. "config" A convenience method to get to the config object "ua" A convenience method to get to the useragent object "register" Attempts to register a user account with the information provided on the Sync server. Parameters: a list of key value pairs to be interpreted as POST parameters Returns error string if user state is already logged in or serverside error occurs. "login" Will log in to remote Sync server using given credentials. State will be updated if login successful. "logout" If currently logged in, will log the Sync session out from the server. State will be updated. "server_delete" Given a logged in session, will attempt to delete the config currently stored on the Sync server (if one currently exists). Will fail if not logged in. "local_to_server" Given a logged in session, will attempt to place the current local config to the Sync server. "server_to_local" Given a logged in session, will replace the local config with what is stored on the server. TODO: is validation of config before replacement required? "english_status" Will return a string explaining current state of Sync dependent on $self->{state} SEE ALSO
Padre, Padre::Config COPYRIGHT &; LICENSE Copyright 2008-2012 The Padre development team as listed in Padre.pm. This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself. perl v5.14.2 2012-06-27 Padre::Sync(3pm)