While read line failures on use read -p

while

stdin original default is / dev / tty, the explicit will stdin point to / dev After being redirected to a pipe or file, if you want to read the screen (/ dev / tty), then execute a single command / tty

#!/bin/bash
while read info
do
echo "$info"
read -p'enter' dev </dev/tty
echo $dev
done < /root/userconfig/conf

Guess you like

Origin www.cnblogs.com/ligao/p/11598371.html