Home » Infrastructure » Unix » Mailx command with Zip Attachment
Mailx command with Zip Attachment [message #180999] Thu, 06 July 2006 04:26 Go to next message
prabhuapps
Messages: 79
Registered: June 2005
Location: Bangalore
Member
Dear All,

Example
-------

$ cat test.txt
Number     Name
------     ----
10        Prabhu
20        Srikanth
30        Sachi
40        Vijay
50        Girish

$ uuencode test.txt test.dat > test.dat

$ cat abc.txt test.dat > email.msg

$ mailx -s 'ETL Program Aborted' prabhu@abc.com < email.msg


The above script is working fine. I have received test.dat as attachment. But the size of test.dat was 190 Bytes.

So i want to zip the test.txt and using mailx i want to send out a mail with that attachement. how can i do this ?

Thanks in advance

Regards,
Prabhu.T

Re: Mailx command with Zip Attachment [message #181040 is a reply to message #180999] Thu, 06 July 2006 08:15 Go to previous messageGo to next message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member
$ cat test.txt
Number     Name
------     ----
10        Prabhu
20        Srikanth
30        Sachi
40        Vijay
50        Girish

$ uuencode test.txt test.dat > test.dat

$ cat abc.txt test.dat > email.msg | compress email.msg

$ mailx -s 'ETL Program Aborted' prabhu@abc.com < email.msg.Z

[Updated on: Thu, 06 July 2006 08:16]

Report message to a moderator

Re: Mailx command with Zip Attachment [message #181429 is a reply to message #180999] Mon, 10 July 2006 01:53 Go to previous message
prabhuapps
Messages: 79
Registered: June 2005
Location: Bangalore
Member
tarundua,

Thanks for your Reply.

$ ls
a.sh         abc.txt      test.dat     utl.sql
a.sql        email.msg.Z  test.txt
$ mailx -s 'ETL Program Aborted' prabhu.thangavel@psidata.com < email.msg.Z
Unknown tilde escape.
Unknown tilde escape.
Unknown tilde escape.
Unknown tilde escape.
Unknown tilde escape.
Unknown tilde escape.
Unknown tilde escape.
Unknown tilde escape.
Unknown tilde escape.
Unknown tilde escape.



I got mail with junk characters.

Please help me out

Regards,
Prabhu.T


Previous Topic: Unix file comparison
Next Topic: Oracle 8.1.7 for SGI/IRIX
Goto Forum:
  


Current Time: Fri Nov 22 10:08:47 CST 2024