Originally Posted by
eggi
Hey There,
Do you have any error output you can post or does it just die quietly? Also, if you're running this in cron, the problem might be with it finding one of the commands in your cat to mail pipe - perhaps fully qualifying uuencode like you've fully qualified mailx would do the trick?
I don't think the EOF is causing you the issue, since that should complete the write to the file and looks like it's in perfect sequence.
ANother thing you can try is to put the
cat $file | uuencode $file | /usr/bin/mailx -s "TEST" "joe.blogs@hotmail.com"
line in an entirely separate script and call it from this script. That would definitely tell you if problem is just on this one line or if any other part of your script is influencing it.
Hope some of that helped 
, Mike
Hey Mike
I tried just the mail part from the command line and it worked fine
cat $file | uuencode $file | /usr/bin/mailx -s "TEST" "joe.blogs@hotmail.com"
I got an email with the excel attachment.
But with it included in the Unix script it just doesnt work, and it doesnt bomb out with an error either, really strange thats why i though EOF was causing the issue.
Also i created another script which does both steps successfully:
1) ./sql_unixscript.ksh (does the select query and unix part)
2) ./mail.sh (basically does what you stated mails the file)
Ideally i would just like the mail part to work within the one script rather than using more scripts to do the email part.
Output
go
EOF
/usr/bin/uuencode /home/bin/script/a.xls /home/bin/script/a.xls | /usr/bin/mailx -s "TEST" "joe.blogs@hotmai.com"
1> /home/bin/script/a.xls