command line redirect question

cfleck

tired
I have a cl program that you interact with and it generates and output file. I'm trying to interact with it via another program and need help. It asks a handful of questions that you type in answers for and hit return between each question. I can redirect a file in that looks something like this...

ans1
ans2
ans3
.
.
.

and it works if i call it from the cl like so...

# progname < inputfile

However, it would be oh so great if I could do that at the command line somehow like...

# progname < ans1 ans2 ans3...

but that obviously doesn't work as typed. I'm guessing there is a way to make this happen. Help me?!?
 
or, more or less equivalently

progname << __END__
ans1
ans2
ans3
__END__

the __END__ bit is arbitrary - as long as the word after the << matches the word after the last answer
 
Back
Top