I am just finding it hard to achieve below using for-loop. Your suggestions/help will be really appreciated. Thanks
- If user responds in upper or lower case then it should accept and convert in uppercase.
- When I try to provide another if-loop for "N" response it does not touch that loop instead it gives the error from 1st loop (ELSE condition) itself.
echo -n "IS THIS A PRODUCTION DATABASE. PLEASE RESPOND Y|N :- "
read RESPONSE
RSPN=$RESPONSE
if [ "${RSPN}" = "Y" ]
then
print "\n"
echo -n "PLEASE ENSURE A 7 YEARS RETENTION RMAN_FULL BACKUP TAKEN for $DBTD"
print "\n"
else
echo "ERROR: Cannot proceed as 7 Years backup not yet TAKEN for PRODUCTION database. Please take a 7 Years Retention backup and re-run the script again."
exit 1
print "\n"
fi
###############################################################
if [ "${RSPN}" = "N" ]
then
print "\n"
echo -n "PLEASE CHECK IF BACKUP IS REQUIRED BEFORE DECOMMISSIONING $DBTD
print "\n"
fi
###############################################################
output --->
IS THIS A PRODUCTION DATABASE. PLEASE RESPOND Y|N :- N
ERROR: Cannot proceed as 7 Years backup not yet TAKEN for PRODUCTION database. Please take a 7 Years Retention backup and re-run the script again.