Você quer -o auto
:
join -t, -j 1 -a 1 -a 2 -o auto john jane
De man join
:
-o FORMAT
obey FORMAT while constructing output line
If FORMAT is the keyword 'auto', then the first line of each file determines the number of fields output for each line.
Ou melhor explicado em GNU Coreutils: participar da invocação :
‘-o auto’
If the keyword ‘auto’ is specified, infer the output format from the first line in each file. This is the same as the default output format but also ensures the same number of fields are output for each line. Missing fields are replaced with the -e option and extra fields are discarded.
% cat john
apple,green
cherry,red
orange,orange
% cat jane
apple,red
banana,yellow
cherry,yellow
kiwi,green
% join -t, -j 1 -a 1 -a 2 -o auto john jane
apple,green,red
banana,,yellow
cherry,red,yellow
kiwi,,green
orange,orange,