while read line;do
read header_line < headers.txt
task 1
task 2
done < temp1.txt
I want to be reading lines from files headers.txt and temp1.txt simultaneously. So, for eg if i read a line from temp1.txt, i should also read a line from headers.txt. Problem with this code is that it reads the lines from temp1.txt one by one but it keeps reading the same line from headers.txt. I want the file pointer to move to the next line once header_line is read. How do i go about it?
May be you can replace this line
with :
where count is incremented in each iteration in the while loop and should be initialized to 1.