awk sum up multiple files show lines which does not appear on both sets of files

view story

http://stackoverflow.com – I have been using awk to sum up multiple files, this is used to sum up the summary of server log parsing values, it really does speed up the final overall count but I have hit a minor problem and the typical examples I have hit on the web have not helped. Here is the example: cat file1 aa 1 bb 2 cc 3 ee 4 cat file2 aa 1 bb 2 cc 3 dd 4 cat file3 aa 1 bb 2 cc 3 ff 4 And the script: cat test.sh #!/bin/bash files="file1 file2 file3" i=0; oldname=""; for names in $(echo $files); do ((i++)); if [ $i == 1 ]; then oldname=$names #echo "-- $i $ (HowTos)