I must be missing something very fundamental about the Bash read command. At the shell prompt, this fails to assign the three input fields to the corresponding variables:
% echo a b c | read x1 x2 x3
% echo $x1 $x2 $x3
%
This works though:
% echo a b c | while read x1 x2 x3 ; do
> echo $x1 $x2 $x3
> done
a b c
%
I only have to read one line of input. Using a while loop is incorrect here, as I lose the values of x1, x2, and x3 when the loop's subprocess exits. I'd have to place all the code that accesses them within the loop body (and perhaps break at the end, for "clarity"), which seems very hackish. Using it within an if command works as well, but suffers from the same subprocess issues as a while loop:
% echo a b c | if read x1 x2 x3 ; then echo $x1 $x2 $x3; fi
a b c
% echo $x1
BASH_VERSION reports as "4.2.45(1)-release".