I run a fortran program with bash:
#!/bin/sh
./program
and the program give three questions. How to give answers/arguments into bash script?
I tried:
#!/bin/sh
echo "1 0 3,1.01" | program
but the error is command not found. Thank you
I run a fortran program with bash:
#!/bin/sh
./program
and the program give three questions. How to give answers/arguments into bash script?
I tried:
#!/bin/sh
echo "1 0 3,1.01" | program
but the error is command not found. Thank you
You are lacking the path.
echo "1 0 3,1.01" | ./program
Maybe you should have newlines between the answers, though?
printf "1\n0\n3,1.01\n" | ./program
A much better design would be for your Fortran program to accept its input as command-line arguments. Without the program's source, I can't say how to change it; but then you could say
./program 1 0 3,1.01