Hi All, PHV
Below is my script that reads the .ini file and if the start time is 12:00 is should them activate
the instance which it does but due to the data base allready marked as active , it returns a "MESG"
But when the next instance (conductor_DCAPS_E10_12) is read it does the system command system("Instance ACTIVATE " $1 ">" VOL) but it does not enter the while loop. It should also read Text: conductor_TAS_Chain_16 is marked allready as active in the data base
Strange enough if the first instance start time is not 12:00 then the second instance will produce
a "MESG"
Please help
FILE.ini
=========
NAME START END
---- ----- ---
conductor_TAS_Chain_16 11:00 12:00
conductor_DCAPS_E10_12 12:00 13:00
conductor_VSAT_Chain_29 11:00 10:00
What am I not doing right
My Result
==========
conductor_TAS_Chain_16 ACTIVATE
Text: conductor_TAS_Chain_16 is marked allready as active in the data base
conductor_DCAPS_E10_12 ACTIVATE
FILE.ini
=========
NAME START END
---- ----- ---
conductor_TAS_Chain_16 12:00 13:00
conductor_DCAPS_E10_12 12:00 13:00
conductor_VSAT_Chain_29 11:00 10:00
Many Thanks
Chris
Below is my script that reads the .ini file and if the start time is 12:00 is should them activate
the instance which it does but due to the data base allready marked as active , it returns a "MESG"
But when the next instance (conductor_DCAPS_E10_12) is read it does the system command system("Instance ACTIVATE " $1 ">" VOL) but it does not enter the while loop. It should also read Text: conductor_TAS_Chain_16 is marked allready as active in the data base
Strange enough if the first instance start time is not 12:00 then the second instance will produce
a "MESG"
Please help
FILE.ini
=========
NAME START END
---- ----- ---
conductor_TAS_Chain_16 11:00 12:00
conductor_DCAPS_E10_12 12:00 13:00
conductor_VSAT_Chain_29 11:00 10:00
What am I not doing right
Code:
awk -F " " '{
#"date \"+%T\"" | getline Date
Date="12:00"
VOL="Conductor_msg"
{if($2==substr(Date,1,5)){
print $1,"ACTIVATE"
system("Instance ACTIVATE " $1 ">" VOL)
while( getline MESG < VOL > 0 )
if(MESG~/successfuly/){
print $1,MESG
}
else if(MESG~/Text./){
print MESG
system("send_alarm")
}
}
else if($3==substr(Date,1,5)){
print $1,"DEACTIVATE"
system("Instance DEACTIVATE " $1 ">" VOL)
while ( getline MESG < VOL > 0 )
{if(MESG~/successfuly./){
print $1,MESG
}
else if(MESG~/Text./){
print MESG;
system("send_alarm")
}
}
}
}
}' FILE.ini
==========
conductor_TAS_Chain_16 ACTIVATE
Text: conductor_TAS_Chain_16 is marked allready as active in the data base
conductor_DCAPS_E10_12 ACTIVATE
FILE.ini
=========
NAME START END
---- ----- ---
conductor_TAS_Chain_16 12:00 13:00
conductor_DCAPS_E10_12 12:00 13:00
conductor_VSAT_Chain_29 11:00 10:00
Many Thanks
Chris