How do I pipe a file line by line into multiple read variables?

Piping into a read command causes the variables to be set in a subshell, which makes them inaccessible (indeed, they are gone) to the rest of your code. In this case, though, you don’t even need the for loop or the second read command:

while read -r a b; do
    echo "$a" "$b"
done < text.txt

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)