In Bash, how can I ask for user input while I'm processing data from stdin? In this case, the read or select commands do not work. E.g.:
while read line
do
# process line
echo "Do you want to continue? [y/n]"
done
Perhaps read with its stdin redirected from /dev/tty should help
Untested code (see tty(4) about /dev/tty):
read -p "Continue? [y/n]: " yn < /dev/tty
read -p "Do you want to continue? [y/n]" ans