Hi everybody,
I am hoping somebody here will be either be able to solve my troubles or at least give me a push in the right direction

.
I am developing a shell script to read in 4 different files worth of data that each contain a list of:
username firstname secondname group score
I have got my script sorting the files into a final file with the format
username firstname secondname group score score score score
I have a solution to do this working fine using join until I get one situation. The names listed do not appear in all files and I need to put 0 in for the score when the name is missing. But join is making firstname, secondname and group become 0's too if the person is missing in any file but the last.
The current code im using is:
Code:
join -a 1 -a 2 -o 0 2.2 2.3 2.4 1.5 2.5 -e "0" ass1.$$ ass2.$$ |
join -a 1 -a 2 -o 0 2.2 2.3 2.4 2.5 1.5 1.6 2.5 -e "0" - ass3.$$ |
join -a 1 -a 2 -o 0 2.2 2.3 2.4 1.5 1.6 1.7 2.5 -e "0" - ass4.$$ > sorted.$$