How can I perform the following operations?
./a.out 1 2
instead of using:
./a.out
'Enter first value:' (read) 1
'Enter second value:' (read) 2
I wouldn't like to modify the source of my program a.out
written in Fortran.
How can I perform the following operations?
./a.out 1 2
instead of using:
./a.out
'Enter first value:' (read) 1
'Enter second value:' (read) 2
I wouldn't like to modify the source of my program a.out
written in Fortran.
Just put a wrapper around your a.out
. So, save the following as wrapper
:
#!/bin/bash
./a.out<<EOF
$1
$2
EOF
Now make that executable with:
chmod +x wrapper
Then you can run:
./wrapper 3 4