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 gkittelson 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
US
hi, this is my script....

/Failure/ {var=$1; gsub(/\[/, "",var); gsub(/\//, "\\/",var)
; flo[1]=var; print flo[1]

}
{

for (i in flo)
if ($0 ~ flo[1] && /end/)
print
else
print "not happening"
}

It seems to be working fine apart from the fact that when I am at this line;

if ($0 ~ flo && /end/)

it searches at the wrong place, it - it doesn't go to the start of the input file to look for if ($0 ~ flo && /end/); it looks from the point I find;
/Failure/....

How can I fix this? Any help will be welcome...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top