I have a usecaseuse case where I need to read in multiple variables at the start of each iteration and read in an input from the user into the loop.
Possible paths to solution which I do not know how to explore --
- For assignment use another filehandle instead of stdin
For assignment use another filehandle instead of stdin
- Use a
forloop instead of... | while read ...... I do not know how to assign multiple variables inside aforloopUse a
forloop instead of... | while read ...... I do not know how to assign multiple variables inside aforloopecho -e "1 2 3\n4 5 6" |\ while read a b c; do echo "$a -> $b -> $c"; echo "Enter a number:"; read d ; echo "This number is $d" ; done
echo -e "1 2 3\n4 5 6" |\
while read a b c;
do
echo "$a -> $b -> $c";
echo "Enter a number:";
read d ;
echo "This number is $d" ;
done