problem with uuencode

Hi everyone,
I'm emailing a spool file to a person using mailx. I'm using uuencode to attach the file to the email. but am getting this error
uuencode: ISO8859-15 to 646 conversion: Invalid argument

Any ideas as to why. The code is below

sqlplus -s user/password@database <<EOF
set verify off
set feedback off
set pagesize 0
set linesize 60
set echo off
set wrap off
set term off
set heading off
set auto off
spool /tmp/genevabase.txt
select account_num||' '||error_message
from geneva_processing_errors;
spool off;
EOF

uuencode /tmp/genevabase.txt /tmp/genevabase.txt | mailx -s 'BASE Checks '$SYSDATE'
for ICO '$1 xxxxxx@xxxx

am I missing something glaring ???

experiment with this : mailx -s "test" xxx@xxx and see whether it works.

Hi mate,
tried that still the same error. It isn't something like I need to dos2unix the file or put in a ^M character.

how about getting to the bare minimum

uuencode file file | mailx xxxx@xxx...

if that still doesn't work, then....i have no idea for you. someone else can guide you.

Hi ghostdog,
the problem isn't the mailx bit is it the uuencode bit. Thanks for you gelp matey :slight_smile:

A very late response, but here goes. There's a known bug in Solaris's implementation of uuencode; try typing this

unset LC_CTYPE

immediately before the uuencode command line and your error message should disappear.

This isn't 100% secure because anyone who runs the command ps -ef will see your user's password. To make the password invisible, use this syntax:

echo $password | sqlplus -s user@database <<EOF

Somebody running ps at exactly the right moment would see the echo and its arguments in the process listing just as well. There are ways to make "exactly the right moment" last a little longer, so it's not a theoretical issue at all.

You're right, as ever;-) Any suggestions on really making the p/w invisible?

Write a script that reads the userid and password from a file and executes sqlplus.