Am trying to echo a line variable along with another variable like below
while read -r line;do
id1=$(echo "$line"|grep...)
id2=`grep "$id1"...."
echo "$line" , "${id2}" >> file2.csv
done <$file1.csv
Expected output - line,id2
But the output in reality is like: line
,id2line
What am I doing wrong here