[root@sistem1lnx ~]# cat file
A,1,abc,x,y,z,,xyz,20100101,99991231
A,1,abc,x,y,z,1,xyz,20100101,99991231
A,1,abc,x,y,z,234,xyz,20100101,99991231
A,1,abc,x,y,z,a,xyz,20100101,99991231
A,1,abc,x,y,z,,xyz,20100101,99991231
[root@sistem1lnx ~]# ./allx
RESULTS
---------
A 1 abc x y z 1 xyz 20100101 99991231
A 1 abc x y z 234 xyz 20100101 99991231
A 1 abc x y z a xyz 20100101 99991231
oifs=$IFS
#Values
var=0
COUNT=2 # for result
while IFS=, read -r one two three four five six seven eight nine ten
do
while IFS=, read -r onee twoo threee fourr fivee sixx sevenn eightt ninee tenn
do
if [ "${two}" == "${twoo}" ] && [ "${three}" == "${threee}" ] &&
[ "${four}" == "${fourr}" ] && [ "${eight}" == "${eightt}" ] ; then
if [ "${one}" == "${onee}" ] && [ "${five}" == "${fivee}" ] && [ "${six}" == "${sixx}" ] &&
[ "${seven}" == "${sevenn}" ] && [ "${nine}" == "${ninee}" ] && [ "${ten}" == "${tenn}" ] ; then
itself=ok
else
itself=notok
if [ "${sevenn}" == "" ] ; then
((++var))
fi
fi
fi
done < file
while [ $(( COUNT -= 1 )) -gt 0 ]
do
echo "RESULTS"
echo "-----------------------------------"
done
if [ $var -gt 0 ] && [ "$itself" == "notok" ]; then
echo ${one} ${two} ${three} ${four} ${five} ${six} ${seven} ${eight} ${nine} ${ten}
fi
var=0
done < file
IFS=$oifs