With single fast GNU awk command:
awk -F'.' \
'{
if (ARGIND == 1) a[$1];
else if (ARGIND == 2 && $1 in a) comm[$1];
else if (ARGIND == 3){
delete a;
if ($1 in comm) delete comm[$1]
}
}
END{ for (i in comm) print i }' a.txt b.txt c.txt
The output:
c
-F'.'- treat.as field separatorARGIND- The index inARGV(array of command line arguments) of the current file being processedcomm- array of common items between first 2 files (a.txtandb.txt)