I have an interactive application that takes input from the keyboard.Whenever I run the application I always write the same things in the beginning. So I was thinking I could make a file with those things and redirect them to the application with:myapplication < myinput.txtThe problem is that when I am done with that I want to give control back to the keyboard so I can type the rest of the input. Is it possible? I don't mind using a bash script.
How redirect input while process is running?
bash;io redirection;stdin
I'm not sure about that one, but if the command you want to use is a simple non-interactive one, and you just want to types things into it (and prepend those with the content of 'myinput.txt', try:cat myinput.txt - | commandex:cat myinput.txt - | grep somethingBut if you need more complicated interaction, you should probably use expect (which is not trivial to use at first, but very powerful).