I know this has probably been asked in various ways on this forum, and around the web, but I have tried all methods to no avail. I have a while read loop with a "read -p" contained in an if statement within it. I understand that the standard input is the .txt file being pumped into the while loop, so read-p can't be piped to user input. What will be my recourse here. Please take a look at the code.
while read orasid1
do
if [ "$prompt1" = "yes" ]; then
read -p "Do you want to change the password for $username on $orasid (y/n)?" Yesno2
case ${Yesno2:0:1} in
y|Y )
echo "Yes"
#Call SQL script here
;;
* )
"No"
;;
esac
else
exit 16
fi
done < $log_dir/pwd_change_$server.txt
I'll appreciate whatever help anyone can give.