I have this command command
that at some point, returns: Press Enter to continue
.
I would like to write a script that calls command
, reads the so-far command output, does something with it when Press Enter to continue
arrives, and simulates an enter key-press when this is done.
Any chance I can achieve that? :-D
Something like:
myscript | command > output
with myscript
#!/bin/bash
cp output output2 # output2 should only contain the output until Press Enter to continue
echo -ne '\n'
except it doesn't work! :-)