Consider the interactive program
interactive. I have to run this program fairly frequently, and each time I run it the first few commands are the same. Obviously, having to type those commands over and over again is a pain. I have collected those command (separated by newlines) in the file
cmd. Now I can do
cat cmd | interactive to run the commands. The problem is that once
cmd has been fully read,
interactive recieves EOF and exits.
What I wish to do is first have
interactive read from the pipe (obviously
interactive < cmd is also acceptable) and when EOF is received, start reading from the keyboard instead.
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
cat to concatenate that file with the stdin:
cat cmd - | interactive