When writing a bash script. Sometimes you are running a command which opens up another program such as npm, composer.. etc. But at the same time you need to use read
read
I had the same problem. I solved by reading directly from tty like this, redirecting stdin:
read -p "Play both [y]? " -n 1 -r
instead of simply:
In my case, the use of exec 3<&0 ... didn't work.
exec 3<&0 ...