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!

my script....

Status
Not open for further replies.

lambros

Programmer
Oct 10, 2002
42
US
Hi,

this is part of my script, it does not work, however I believe most of it is there...

{
if ($0 ~ /Error/){
ping = $1
gsub(/\[/, "", var)
gsub(/\//, "\\/", vat);
reg[++arrr]=var


for ( p in reg )
if ($0 ~ reg[p] && /208/)
print $0
}

I search $0 for Error
I assign $1 to the variable var
I add the value of var to array

********

now I wish to loop through the array, and pick out the values from the input file where ping & 208 occur. This much I am unable to do & cannot figure out what the problem is..... Do I need to respecifyt the input file?
 
OOps;

some typos


{
if ($0 ~ /Error/){
var = $1
gsub(/\[/, "", var)
gsub(/\//, "\\/", var);
reg[++arrr]=var


for ( p in reg )
if ($0 ~ reg[p] && /208/)
print $0
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top