There is not
output.txt generated anywhere.
test2.txt will hold all lines if used as scrutinizer proposed in post#14.
As
test1.txt and
test3.tst happen to have 215 lines each, your output should end with
1072why?. That's it. No extra "why?"s, no extra dots. The contents of
test3.txt is irrelevant as it is read but not used anywhere. Should
test3.txt be longer than
test1.txt, extra "why?"s will be there, if shorter, the output will stop earlier.
Quote:
Desired output of test2.txt is count'th line of test3 file
This will never happen. If you
printf to
test2.txt like in post#13, it will be empty in the former case, and hold
test1.txt's respective line's contents in the latter. All the "why?"s go to stdout in both cases.