Hi All,
I need assistance is sending email out using korn shell
Steps,
1- Count number of records in database.
2- if count is more than 2000
3- send email to user else if less then 1999 exit out.
Here is my script and is not exiting out and need to press .DOT and Enter command to get out of the script then it sends out email.
#!/bin/ksh
VALUE=$( sqlplus -s username/password <<EOF
set heading off;
set serveroutput on;
select count(*) from <Table_NAME>;
quit
EOF)
size=2000
if [[ $VALUE -gt $size ]]; then
mail -s "Table_name count is greater then 2000" email_user@xxx.com ;
else
echo "All clear.."
exit
fi;
- How can the script comes out gracefully.
Please asistance.
Thank you!