Reading lines from two files in one while loop

Use another FD.

while read line; do
  if ! read -u 3 line2
  then
    break
  fi
  echo "$line***$line2"
done < file1.csv 3< file2.csv

Leave a Comment