Binary txt file received when i use uuencode to send txt file as attachment


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Binary txt file received when i use uuencode to send txt file as attachment
# 1  
Old 04-24-2008
Binary txt file received when i use uuencode to send txt file as attachment

Hi,

I have already read a lot of posts on sending attachments in unix...but none of them were of help for my problem...so here goes..

i wanna attach a text file and send to a mail id..used the following code :

uuencode "$File1" "$File1" ;|mail -s "$Mail_sub" abc@abc.com

it works fine...but the attachments are in binary format i have a wierd looking character at the end of every .txt file.... i want the contents of attachmnets to be in ASCII format...any ideas??? thanks in advance SmilieSmilie
# 2  
Old 04-24-2008
Is the semicolon before the pipe character a problem in the real world, or just a transcription error?

There are scenarios where uuencode will not transfer correctly, but are you really sure the original file didn't contain that binary character? Can you run od or xxdump or something on the file to see what character code it is, and whether it exists in the original file?

One of the design criteria for MIME was to make it more robust than uuencode, and it should really be replacing uuencode since some 15 years already. The FAQ side of the forums has some scripts for sending MIME attachments, or if you have mutt or elm, I hear they can do it conveniently, too.

PS. Please don't use somebody else's domain when inventing example addresses; that address you just wrote is going to start receiving more spam again. Use @example.com which was created for this purpose, and doesn't receive mail.
# 3  
Old 04-24-2008
Quote:
Originally Posted by ash22
uuencode "$File1" "$File1"
Hmm. My uuencode (AIX 5.3) needs only one parameter, which is the input file. If you want the output to go to <stdout> as the following pipe suggests then either use "/dev/stdout" as output file or leave it out altogether, which will cause uuencode to use <stdout> as the default output device. In any case it is at least counter-intuitive (and might well be harmful) to use the same filename for source and destination.

I hope this helps
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Desired output.txt for reading txt file using awk?

Dear all, I have a huge txt file (DATA.txt) with the following content . From this txt file, I want the following output using some shell script. Any help is greatly appreciated. Greetings, emily DATA.txt (snippet of the huge text file) 407202849... (2 Replies)
Discussion started by: emily
2 Replies

2. Windows & DOS: Issues & Discussions

2 Questions: replace text in txt file, add text to end of txt file

so... Lets assume I have a text file. The text file contains multiple "#" symbols. I want to replace all thos "#"s with a STRING using DOS/Batch I want to add a certain TEXT to the end of each line. How can I do this WITHOUT aid of sed, grep or anything linux related ? (1 Reply)
Discussion started by: pasc
1 Replies

3. Shell Programming and Scripting

Need to append the date | abcddate.txt to the first line of my txt file

I want to add/append the info in the following format to my.txt file. 20130702|abcd20130702.txt FN|SN|DOB I tried the below script but it throws me some exceptions. <#!/bin/sh dt = date '+%y%m%d'members; echo $dt+|+members+$dt; /usr/bin/awk -f BEGIN { FS="|"; OFS="|"; } { print... (6 Replies)
Discussion started by: harik1982
6 Replies

4. Shell Programming and Scripting

Removing inline binary data from txt file

I am trying to parse a file but the filehas binary data inline mixed with text fields. I tried the binutils strings function , it get the binary data out but put the char following the binary data in a new line . input file app_id:1936 pgm_num:0 branch:TBNY ord_num:0500012(–QMK) deal_num:0... (12 Replies)
Discussion started by: tasmac
12 Replies

5. Shell Programming and Scripting

awk append fileA.txt to growing file B.txt

This is appending a column. My question is fairly simple. I have a program generating data in a form like so: 1 20 2 22 3 23 4 12 5 43 For ever iteration I'm generating this data. I have the basic idea with cut -f 2 fileA.txt | paste -d >> FileB.txt ???? I want FileB.txt to grow, and... (4 Replies)
Discussion started by: theawknewbie
4 Replies

6. Shell Programming and Scripting

Shell script to send an email from the txt file

Hi Friends, Could you guys help me out of this problem... I need to send an email to all the users and the email has to be picked from the text file. text file contains the no. of records like: giridhar 224285 847333 giridhar276@gmail.com ramana 84849 33884 venkata.ramana@gmail.com... (6 Replies)
Discussion started by: giridhar276
6 Replies

7. Shell Programming and Scripting

To log binary file output to a txt file

Hi, I wrote a small script whose function is to execute the postemsg provided if the threshold breaches. I want to log this postemsg messages to a log file. But I am not able to do. Can someone throw some light on how to log the output of this. I am pasting a snippet of that code. ... (2 Replies)
Discussion started by: dbashyam
2 Replies

8. Shell Programming and Scripting

command to list .txt and .TXT file

Hi expersts, in my directory i have *.txt and *.TXT and *.TXT.log, *.txt.log I want list only .txt and .TXT files in one command... how to ?? //purple (1 Reply)
Discussion started by: thepurple
1 Replies

9. UNIX for Dummies Questions & Answers

FTP - need to send error to txt file

I've written a script to FTP files into a directory, perform a diff between the current and the previous and email out the results. Sometimes a machine falls off the network and needs to be rebooted to reconnect. Obviously I don't get the file I want at that time. How do I get the FTP error to be... (1 Reply)
Discussion started by: scanner248
1 Replies

10. Shell Programming and Scripting

FTP - need to send error to txt file

I've written a script to FTP files into a directory, perform a diff between the current and the previous and email out the results. Sometimes a machine falls off the network and needs to be rebooted to reconnect. Obviously I don't get the file I want at that time. How do I get the FTP error to... (0 Replies)
Discussion started by: scanner248
0 Replies
Login or Register to Ask a Question