paste is the heart of a good solution.
With InFile1 ...
... and InFile2 ...
... this
paste ...
Code:
paste -d, $InFile1 $InFile2 >$OutFile
... produced this OutFile ...
Code:
12,Jerry
765,Alan
998,
Note that 998 has a trailing comma. If that bothers you, use this combination of
sed and
paste ...
Code:
paste -d"\0" $InFile1 <(sed 's/^/,/' $InFile2) >$OutFile
... to produce this OutFile ...
Code:
12,Jerry
765,Alan
998
Daniel B. Martin