I have a bash script wherein I need to check an array based on a condition and if it matches I need to print the lines after that particular match. My code is below:echo ${myArray[(($k+1))]} doesn't work .
i=0;
for j in `cat sdp_aDT_dhk1smc3_Periodic_20140711.log`
do
array[$i]=$j;
i=$(($i+1));
done
k=0;
for k in myArray;
do
if myArray[$k]="MEMORY" ; then
echo ${myArray[(($k+1))]}
fi
done
$before(($k+1)).