while has an interesitng syntax. You can put multiple commands before the
do ... while loop, and the case in question may need to juggle this feature, depending on your particular requirements of: do you read to end of the longest file, or only to the end of the shortest.
read || read simply does not work (as per the question's requirements), becase when a read of the first file is
true, the second file's read is skipped until the first file has been read from start to finish... Then, because the status is still
true, the while loop continues and reads the second file from start to finish.
read && read will read files concurrently (synchronously) if you only want to read as far as the shortest file. However, if you want to read both files to
eof, then you need to work with
while's syntax requirements, ie. by the command immediately before the
do while loop producing a non-zero return code to break out of the while loop.
Here is an example of how to read both files to eof
while IFS= read -r line3 <&3 || ((eof3=1))
IFS= read -r line4 <&4 || ((eof4=1))
!((eof3 & eof4))
echo "$line3, $line4"
done 3<file3 4<file4
(you may want to test eof3 and eof4 before the read, but the general idea is there, especially in the final true/false condition.