Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: mailx utility in Unix

RE: mailx utility in Unix

From: Chuck Hamilton <chuck_hamilton_at_yahoo.com>
Date: Wed, 3 Jan 2001 09:03:18 -0800 (PST)
Message-Id: <10730.125599@fatcity.com>


--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&nbsp;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 &lt; $SPOOL | uuencode &gt; test.txt<BR>mailx -s $SUBJECT $TO &lt;&lt;!<BR>Here's the attachment...<BR>~&lt;test.txt<BR>!<BR></P>
<P>&nbsp; <B><I>"Afanassiev, Alex" &lt;Alex.Afanassiev_at_team.telstra.com&gt;</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 / &gt; $SPOOL &lt;&lt; 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&gt;/dev/null<BR>/usr/bin/mailx -s "${SUBJECT}" ${TO} &lt;&lt; EOF<BR>~&lt; !echo<BR>~&lt; !uuencode $SPOOL `basename $SPOOL`<BR>~&lt; !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>&gt; -----Original Message-----<BR>&gt; From: Shakeel Qureshi [SMTP:msklq_at_yahoo.com]<BR>&gt; Sent: Wednesday, January 03, 2001 8:46 AM<BR>&gt; To: Multiple recipients of list ORACLE-L<BR>&gt; Subject: mailx utility in Unix<BR>&gt; <BR>&gt; Hi Gurus!<!
BR>&gt; <BR>&gt; I am using mailx utility to send output of a spool<BR>&gt; file.<BR>&gt; <BR>&gt; Is there any way to mailx the output file as an<BR>&gt; attachemnt instead of whole contents.<BR>&gt; <BR>&gt; I know it is not going to be easy, but I think, it is<BR>&gt; possible.<BR>&gt; <BR>&gt; Appreciate if anyone have any idea as to how to do it.<BR>&gt; <BR>&gt; Thanks,<BR>&gt; <BR>&gt; Shakeel Qureshi<BR>&gt; squreshi@barpoint.com <BR>&gt; <BR>&gt; __________________________________________________<BR>&gt; Do You Yahoo!?<BR>&gt; Yahoo! Photos - Share your holiday photos online!<BR>&gt; http://photos.yahoo.com/<BR>&gt; -- <BR>&gt; Please see the official ORACLE-L FAQ: http://www.orafaq.com<BR>&gt; -- <BR>&gt; Author: Shakeel Qureshi<BR>&gt; INET: msklq@yahoo.com<BR>&gt; <BR>&gt; Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051<BR>&gt; San Diego, California -- Public Internet access / Mailing Lists<BR>&gt; ---------------------------------------------------!
-----------------<BR>&gt; To REMOVE yourself from this mailing list, send an E-Mail message<BR>&gt; to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in<BR>&gt; the message BODY, include a line containing: UNSUB ORACLE-L<BR>&gt; (or the name of mailing list you want to be removed from). You may<BR>&gt; 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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US