Running on AIX 5.3L.
I have a program "foo" written in Fortran that requires 3 levels of inputs from stdin (command prompt).
> foo
Enter Input 1: a
Enter Input 2: b
Enter Input 3: c
running foo
success!
>
How do I get a shell script to run this automatically?
> echo "a" | foo
Enter Input 1: a
The READ statement on the file (standard input) cannot be completed because the end of the file was reached. The program will stop.
>
> echo "a b c" | foo
Enter Input 1: a b c
The READ statement on the file (standard input) cannot be completed because the end of the file was reached. The program will stop.
>
> echo "a\nb\nc" | foo
Enter Input 1: a
The READ statement on the file (standard input) cannot be completed because the end of the file was reached. The program will stop.
>
I have tried almost everything: \r, \n, using printf ... etc.
How do I pass multiple levels of input through std input?