How to eliminate wrapped lines


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to eliminate wrapped lines
# 1  
Old 07-16-2008
How to eliminate wrapped lines

I have a file abc:

line 1
line 2
line 3
line 4

And I am successfully e-mailing the file, with this:

mail -s "contents of abc" jdoe@email.com <<EOF
cat abc
EOF

But the e-mail shows up looking like this:

subject: contents of abc
line 1 line 2 line 3 line 4

The carriage returns look like they are being stripped from each record in the file. I haven't figured out how to stop it from doing this.
# 2  
Old 07-16-2008
Try this:

uuencode abc abc |mailx -s "contents of abc" jdoe@email.com

abc is the file name.
# 3  
Old 07-17-2008
Thank you for the response.
That somewhat works for me, in that it allows me to send the file as an attachment, that can be opened with wordpad and looks just fine, but I want to have the contents of the file abc to be within the body of the e-mail along with other information that I need to include within the body of the e-mail. Is there a way to do that?

I did try...

uuencode abc abc > def
mail -s "contents of abc" jdoe@email.com <<EOF
cat def
EOF

...but even this just attaches the contents of def to the e-mail, does not include it in the body of the e-mail.
# 4  
Old 07-17-2008
I am sending the exact mail commands on my solaris system and it is received fine.

Code:
% cat file1
1 file
2 file
3 file
4 file

Code:
PatchMail:~ % mail -s "contents of file1" myaddress@email.com <<EOF
Welcome to the email test
`cat file1`
end testing text
EOF

The result is fine on my system:
Code:
Welcome to the email test
1 file
2 file
3 file
4 file
end testing text

You should try sending to your yahoo/gmail account to see if your email program is displaying it incorrectly.

Another thing you can try is to convert your file to dos format before sending with unix2dos command. [unix2dos file file]

good luck.
# 5  
Old 07-17-2008
Hammer & Screwdriver Another approach

How about, assuming file abc contains what you are trying to send

Code:
mailx -s "contents of abc" jdoe@email.com <abc

I do this quite often.
# 6  
Old 07-17-2008
Well, I tried and tried, neither option seemed to work, but then I noticed a line at the top of my Outlook window that said, "Extra line breaks in this message were removed.". I clicked on it and it gave me the option to "Restore line breaks.". Did that, and now it works just fine. Smilie

Appreciate you all helping.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Eliminate consecutive lines with the same pattern

Hi, I would like to know how to remove lines which has the same pattern as the next line through sed/awk. Stream 39 (wan stream 7) Stream 40 (wan stream 8) WINQ Counter 115955 1 1613 (BYTE) 11204787 163 ... (2 Replies)
Discussion started by: sarn_nat
2 Replies

2. Shell Programming and Scripting

awk to print the line that matches and the next if line is wrapped

I have a file and when I match the word "initiators" in the first column I need to be able to print the rest of the columns in that row. This is fine for the most part but on occasion the "initiators" line gets wrapped to the next line. Here is a sample of the file. caw-enabled ... (3 Replies)
Discussion started by: kieranfoley
3 Replies

3. Shell Programming and Scripting

2 dollars wrapped to a string

Hi, I am writing an awk script and I have got stuck. I am trying to find a word that has 2 dollar signs in it but its failing. I have already tried to escape it with single and double back slash and also I have tried to use \044 in the search but even that doesnt work. can you please help me... (7 Replies)
Discussion started by: hitmansilentass
7 Replies

4. Shell Programming and Scripting

Need help to eliminate the records

Hi All, Please help me how to remove the records from the file if it is having more number of fields than the required one, before loading into stage Here is the sample records. File is space delimited one chandu 1121324 CC ( 2 spaces) chandu balu 434657 DD (3 spaces) -- failing due to... (10 Replies)
Discussion started by: bbc17484
10 Replies

5. Shell Programming and Scripting

How to eliminate ^L

Hi, I am trying to create a text file from data retrieved from a query.The data retrieved is having this character '^L' at regular intervals of the data. How can i eliminate this, Please find below the sample data. I tried sed -e "s/\^L//g" to convert it, but with no luck ^LCODE*SERIAL... (11 Replies)
Discussion started by: ramkiran77
11 Replies

6. Shell Programming and Scripting

Pass all received args to a (wrapped) child script

I'm writing a wrapper script (in bash) that wraps another (bash) script. When calling the wrapped script, I need to pass all the received arguments/options to it. Is there a built in variable that holds all the options? I wrote a little while loop (see below) which works. But I wanted to know if... (1 Reply)
Discussion started by: Dilbert
1 Replies

7. Shell Programming and Scripting

Can't get my head wrapped around CGI/Perl

Hello, I am about 3 weeks new to CGI/ Perl scripting and so far some concepts I can wrap my head around perfectly but others not so much. I was wondering if I could get some help in making a script that will pull from a text file and put back into a form. I can make a script that takes input... (15 Replies)
Discussion started by: sennex
15 Replies

8. UNIX for Advanced & Expert Users

convert one colume file to a one line, wrapped file.

I need to convert a file i.e cat list 1000: 1001: 1002: to cat wrappedfile 1000:1001:1002: currently I am using a while loop, paste and mv command to achieve desired outcome. touch wrappedfile cat list | while read line ;do echo $line > /tmp/$line;paste /tmp/$line wrappedfile >... (7 Replies)
Discussion started by: jouuu
7 Replies

9. UNIX for Dummies Questions & Answers

Eliminate blank lines...

Hi All, How can I eliminate the blank lines from a file. For e.g. File1 contains ABCD EFGH ZZZZ HJHH KJKJ IUYU I need the file to be as follows.... ABCD EFGH (4 Replies)
Discussion started by: shashi_kiran_v
4 Replies

10. Shell Programming and Scripting

Merge wrapped lines

Hi, Can someone tell me how i can merge the lines that are wrapped. My file has content somethig like this Line1 -> xxxx bbbb ccc dddd bababab11 Line2 -> 2222 nnn cccc Line 3-> yyyyy zzzz uuzuz ioouo oououou11 Line 4 -> 3333 pppp dddd Line 5-> zzzz kjkj uuzuz ioouo oououou11 Line 6->... (1 Reply)
Discussion started by: braindrain
1 Replies
Login or Register to Ask a Question