I have a compiled program that takes strings as input using stdin five times (in a loop). Every time after taking input it does some work on it and gives an output. I want to debug it gdb and I have to give it input from a file.
I cannot give input from keyboard directly.
I want to give the same string every time the program asks for input.
I have tried run < input.txt
But it seems to me that the program takes input from this file only the first time and after that it only reads null for other 4 inputs.
So I want to know if there is a way to solve this problem. And am I right about the thing that input is read from file only the first time program asks for input and not read from the file rest of the times?