In my Fortran code, a binary library module is being called to perform a specific calculation. However, for some sets of parameters, the calculation performed by this library does not converge, and the message “Press ENTER to continue” is displayed on the terminal. I would like to disable this message so that my program can proceed with other parameter sets without requiring user interaction. Unfortunately, since I do not have access to the source code of this library, I cannot modify or comment out this specific line. Is there a workaround, such as a way to automatically proceed if the “Press ENTER to continue” message is displayed on the terminal?
Does your program expect any other input from the keyboard?
If not, you can cheat it by preparing a dummy file with empty lines (at least as many of them as the number of “Press ENTER to continue” messages it may give) and then run the program with redirection: progname < dummyfilename
This will work in any unix-like environment (Linux, MacOS) and probably even in MS Windows.
The program does not expect any other input from the keyboard.
Normally, if the calculation of this library converges, nothing will be asked to be given as input from the keyboard.
So, do you mean that the following command:
thanks for your reply. I had written a test based on @msz59 comment but I was getting an error so I thought maybe ./binary_myprogram < dummyfilename should have been written differently. But the error was coming from the fact that I did not put enough empty lines in my text file. Anyway, thank you for providing an example