A fortran program requires three inputs to be passed interactively:
First input is just letter "D", second input is a file "A.cpt", and third input is a name for the output file that can be for example "B.out".
I have been trying to use echo command, but it is not working:
echo "D\nA.cpt\nB.out" | ./fortran_program
Any ideas?
UPDATE:
When using EOF, as suggested below, the program is going to an infinite loop repeating the following lines:
Please try again!
Please enter input binary hydra/quanta plot (old) filename
defaults <dotsurface_0_165.qpt> ext:<.qpt> (abort by EXIT or ^D) : Sorry unable to open file: D.qpt
or file: D
Please try again!
Please enter input binary hydra/quanta plot (old) filename
defaults <dotsurface_0_165.qpt> ext:<.qpt> (abort by EXIT or ^D) : Sorry unable to open file: D.qpt
The source code for this program is on Github if that helps:
get_command_argumentwork for your needs, or is it necessary to use (bash)?D, the program then expects a filename as the next argument.input, for instance, for the fileinput.qpt. Your second argument beingA, the program looks for the fileA.qpt.