Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: mailx utility in Unix
--0-1982275856-978541398=:17669
Content-Type: text/plain; charset=us-ascii
I've been wondering how to do this too. Your message pointed me in the right direction. I just tried this approach and on SGI IRIX it didn't work. But if I ran the uuencode first like this it did.
to_dos < $SPOOL | uuencode > test.txt
mailx -s $SUBJECT $TO <<!
Here's the attachment...
~<test.txt
!
"Afanassiev, Alex" <Alex.Afanassiev_at_team.telstra.com> wrote: Hi Shakeel Qureshi
Here is an example:
#!/bin/ksh
#
SUBJECT="Example"
TO=msklq_at_yahoo.com
SPOOL=/tmp/fifo$$.txt
sqlplus -s / > $SPOOL << EOF
set echo off feedback off verify off
set serveroutput on lines 132 pages 0 head off escape on
select table_name from dba_tables;
quit
EOF
unix2dos $SPOOL $SPOOL 2>/dev/null
/usr/bin/mailx -s "${SUBJECT}" ${TO} << EOF
~< !echo
~< !uuencode $SPOOL `basename $SPOOL`
~< !echo
EOF
With regards
Alex Afanassiev
Oracle DBA, TOC OPS/Internet.Operations
Tel: (03) 8 661 20 61
Fax: (03) 9 650 36 74
> -----Original Message----- > From: Shakeel Qureshi [SMTP:msklq_at_yahoo.com] > Sent: Wednesday, January 03, 2001 8:46 AM > To: Multiple recipients of list ORACLE-L > Subject: mailx utility in Unix > > Hi Gurus! > > I am using mailx utility to send output of a spool > file. > > Is there any way to mailx the output file as an > attachemnt instead of whole contents. > > I know it is not going to be easy, but I think, it is > possible. > > Appreciate if anyone have any idea as to how to do it. > > Thanks, > > Shakeel Qureshi > squreshi_at_barpoint.com > > __________________________________________________ > Do You Yahoo!? > Yahoo! Photos - Share your holiday photos online! > http://photos.yahoo.com/ > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.com > -- > Author: Shakeel Qureshi > INET: msklq_at_yahoo.com > > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 > San Diego, California -- Public Internet access / Mailing Lists > -------------------------------------------------------------------- > To REMOVE yourself from this mailing list, send an E-Mail message > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in > the message BODY, include a line containing: UNSUB ORACLE-L > (or the name of mailing list you want to be removed from). You may > also send the HELP command for other information (like subscribing).
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Afanassiev, Alex INET: Alex.Afanassiev_at_team.telstra.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). --------------------------------- Do You Yahoo!? Yahoo! Photos - Share your holiday photos online! --0-1982275856-978541398=:17669 Content-Type: text/html; charset=us-ascii <P> I've been wondering how to do this too. Your message pointed me in the right direction. I just tried this approach and on SGI IRIX it didn't work. But if I ran the uuencode first like this it did.</P> <P>to_dos < $SPOOL | uuencode > test.txt<BR>mailx -s $SUBJECT $TO <<!<BR>Here's the attachment...<BR>~<test.txt<BR>!<BR></P> <P> <B><I>"Afanassiev, Alex" <Alex.Afanassiev_at_team.telstra.com></I></B> wrote: <BR> <BLOCKQUOTE style="BORDER-LEFT: #1010ff 2px solid; MARGIN-LEFT: 5px; PADDING-LEFT: 5px">Hi Shakeel Qureshi<BR><BR>Here is an example:<BR><BR>#!/bin/ksh<BR>#<BR>SUBJECT="Example"<BR>TO=msklq_at_yahoo.com<BR>SPOOL=/tmp/fifo$$.txt<BR>sqlplus -s / > $SPOOL << EOF<BR>set echo off feedback off verify off<BR>set serveroutput on lines 132 pages 0 head off escape on<BR>select table_name from dba_tables;<BR>quit<BR>EOF<BR>unix2dos $SPOOL $SPOOL 2>/dev/null<BR>/usr/bin/mailx -s "${SUBJECT}" ${TO} << EOF<BR>~< !echo<BR>~< !uuencode $SPOOL `basename $SPOOL`<BR>~< !echo<BR>EOF<BR><BR><BR>With regards<BR>Alex Afanassiev<BR>Oracle DBA, TOC OPS/Internet.Operations<BR>Tel: (03) 8 661 20 61<BR>Fax: (03) 9 650 36 74<BR><BR><BR>> -----Original Message-----<BR>> From: Shakeel Qureshi [SMTP:msklq_at_yahoo.com]<BR>> Sent: Wednesday, January 03, 2001 8:46 AM<BR>> To: Multiple recipients of list ORACLE-L<BR>> Subject: mailx utility in Unix<BR>> <BR>> Hi Gurus!<! BR>> <BR>> I am using mailx utility to send output of a spool<BR>> file.<BR>> <BR>> Is there any way to mailx the output file as an<BR>> attachemnt instead of whole contents.<BR>> <BR>> I know it is not going to be easy, but I think, it is<BR>> possible.<BR>> <BR>> Appreciate if anyone have any idea as to how to do it.<BR>> <BR>> Thanks,<BR>> <BR>> Shakeel Qureshi<BR>> squreshi@barpoint.com <BR>> <BR>> __________________________________________________<BR>> Do You Yahoo!?<BR>> Yahoo! Photos - Share your holiday photos online!<BR>> http://photos.yahoo.com/<BR>> -- <BR>> Please see the official ORACLE-L FAQ: http://www.orafaq.com<BR>> -- <BR>> Author: Shakeel Qureshi<BR>> INET: msklq@yahoo.com<BR>> <BR>> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051<BR>> San Diego, California -- Public Internet access / Mailing Lists<BR>> ---------------------------------------------------! -----------------<BR>> To REMOVE yourself from this mailing list, send an E-Mail message<BR>> to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in<BR>> the message BODY, include a line containing: UNSUB ORACLE-L<BR>> (or the name of mailing list you want to be removed from). You may<BR>> also send the HELP command for other information (like subscribing).<BR>-- <BR>Please see the official ORACLE-L FAQ: http://www.orafaq.com<BR>-- <BR>Author: Afanassiev, Alex<BR>INET: Alex.Afanassiev@team.telstra.com<BR><BR>Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051<BR>San Diego, California -- Public Internet access / Mailing Lists<BR>--------------------------------------------------------------------<BR>To REMOVE yourself from this mailing list, send an E-Mail message<BR>to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in<BR>the message BODY, include a line containing: UNSUB ORACLE-L<BR>(or the name of mailing list you want to! be removed from). You may<BR>also send the HELP command for other information (like subscribing).</BLOCKQUOTE><p><br><hr size=1><b>Do You Yahoo!?</b><br> <a href="http://photos.yahoo.com/">Yahoo! Photos</a> -Received on Wed Jan 03 2001 - 11:03:18 CST
![]() |
![]() |