I have a program (that I did not write) which is not designed to read in commands from a file. Entering commands on STDIN is pretty tedious, so I\'d like to be able to autom
Same as Idelic answer with more simple syntax ;)
cat your_file_with_commands - | sh your_script
Have you tried using something like tail -f commandfile | command
I think that should pipe the lines of the file to command without closing the file descriptor afterwards. Use -n
to specify the number of lines to be piped if tail -f
doesn't catch all of them.
I would do something like
(cat your_file_with_commands; cat) | sh your_script
That way, when the file with commands is done, the second cat
will feed your script with whatever you type on stdin afterwards.
I would think expect
would work for this.