How to use output of SqlPlus query to prompt user for more input
This question already has an answer here:
You need to add calls to sqlplus
to get the output of the queries you've written. See this SO question for assistance with that.
Once you have the output, you can use a conditional, as Raman Sailopal suggested. Something like:
output1="`sqlplus $statement1`"
read -p "User $input appears $output1 times. Create user? [Y/n]" answer
if [ -z "$answer" -o "$answer" == "y" -o "$answer" == "Y" ]
then
sqlplus $statement2
else
echo "Not creating user."
fi
链接地址: http://www.djcxy.com/p/25538.html