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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loop

Status
Not open for further replies.

lambros

Programmer
Oct 10, 2002
42
0
0
US
Hi,

at the moment I am writing some code; such as follows....

How can I get the following code to process until I find every line containing Test, at the moment the prog. is working sequentially - ie from top to bottow, which I don't want...

{
i=1
while( $0 ~ /TEST/){
print FNR > "/tmp/list1"
getline < &quot;/tmp/list1&quot;
list1 = $0
print list1
i++
}


L.
 
what do you want ??
grep TEST filename | reverse > output
write a reverse-prg, sun-bsd OS have one
i can post you a reverse-prg. -----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top