I apologize in advance - I don\'t fully understand the ideas behind what I\'m asking well enough to understand why it\'s not working (I don\'t know what I need to le
The tty
solution works. Test it with this code, for example:
$ date | { read -p "Echo date? " r
The prompt from read
appears on the terminal and read
waits for a response before deciding to echo the date or not.
What I wrote above differs from the line below in two key aspects:
read -t 1 __response
First, the option -t 1
gives read
a timeout of one second. Secondly, this command does not provide a prompt. The combination of these two probably means that, even though read
was briefly asking for input, you didn't know it.