Actually, back on this point. Is it possible to output "1" only once and hand back stdin to the terminal?
For my solution above, myscript.sh will get a "1" for the first request for stdin and then die when it fails to get the next request for stdin. If I used the
yes command, it will answer "1" as many times as it's requested, which isn't what I want either.
I seem to remember a solution to this, that looked something like a perl filehandle, for example:
Code:
EOF << echo 1
./myscript.sh
EOF
Obviously that doesn't work in bash, or ksh, but does anyone know what I'm getting at? Or, more importantly, the correct way to implement it?