Are you asking about SCID_FM_AL ? that is not even in this script. i am not sure how big that is. Here is the code.
---------- Post updated at 04:18 PM ---------- Previous update was at 04:05 PM ----------
[/COLOR]All i am trying to do is to see if $2 (which i already read fine), is in my array(i also read fine). i have been working on this part for more than a day now and this isnt going any where good. May be i should do a while loop and see if i can do that. What do you think?
i dont think i understood that correctly. Please check my code to see if this is what you meant. by the way, thank you very much for helping me. i was out of options.
file=../data/globallyIgnoredTc.dat
#set -A ignore `grep -v "#" ${file} | tr '[A-Z]' '[a-z]' `
set -A ignore `grep -v "#" ${file} `
ign=${ignore[@]}
#################################################
endMarker="NSC Termination Event Details:"
if [ ! -f $4 ] ; then
echo "No $4 file found. Perhaps testMgr is still running?"
else
# Subtract out a little from the start time. Otherwise we miss
# crashes because of the controller clocks being off by a few seconds.
#dateFilter $4 $(( $2 - 10 )) $3 > $con
# BGL -- analyze all of the consoles. Autotest does the trimming now.
if [ $(print - "${ignore[@]}" | grep -c "$2") -gt 0 ] ;
then
status="found $2 in array ignore[]"
else
status="did not find $2 in array ignore[]"
fi
termReport.pl < $4 | dos2ux | head -2000 | awk '
BEGIN { foundTermEvent=0;
endMarker="'"${endMarker}"'"; }
{
if ( (substr($0, 1, length(endMarker)) == endMarker) ||
(substr($0, 1, 39) == "'${SBINDIR}'/termReport.pl: ") )
{
if (foundTermEvent == 1)
{
print "";
foundTermEvent=0;
}
}
##############################################################################
if (foundTermEvent == 1)
{
if (status == "found $2 in array ignore[]")
{
foundTermEvent = 0;
}
else
{
print;
}
}
####################################################################
if (substr($0, 1, 18) == "Termination Event:")
{
foundTermEvent=1;
}
}'
fi
}
i dont get any errors now. but it is not doing what it supposed to do. it seems like it never finds a match when comparing $2 to the array. in reality, there are matches and it should find it.
could this happen because we have if statement before i have any data for $2?
---------- Post updated at 01:04 PM ---------- Previous update was at 12:46 PM ----------
i verified this, it doesnt have correct values for $2 by the time if statement excuted. Because $2 values arent going to be ready till AWK statemnet has been excuted.