Im having issues with my mail command sending data from my script.
I have a korn shell script which logs onto a database and does a few select statements.
The problem is i think the EOF stops my mail command sending the data. Im able to run the mail command separate which works once the script below has done its job.
Is there anyway i keep this all in the one script?
#!/bin/ksh set -o xtrace set -v #variables env='prod' component='swift' server=`db_attribute $env $component server` username=`db_attribute $env $component username` password=`db_attribute $env $component password` file=/home/bin/scripts/a.xls rm -f $file db_rawamisql $env $component <<EOF > $file select * from banks (sql part) go EOF cat $file | uuencode $file | /usr/bin/mailx -s "TEST" "email@example.com"