Unix True 64 - sending text file as attachement to Windows (Outlook)

This is Interesting: Free IT Magazines  
Home > Archive > Unix True 64 > January 2004 > sending text file as attachement to Windows (Outlook)





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author sending text file as attachement to Windows (Outlook)
MB

2004-01-23, 6:50 pm

I would like to send a text file as an attachement to Windows outlook from
tru64 Unix.

# cat /tmp/file.txt | uuencode file.txt | mailx -s test someone@xzy.com

This works, however when you view the file in notepad it doesn't look right.

Can anyone help

Regards
M
Paul Szabo

2004-01-23, 6:50 pm

MB wrote:
quote:

> I would like to send a text file as an attachement to Windows outlook from
> tru64 Unix.
>
> # cat /tmp/file.txt | uuencode file.txt | mailx -s test someone@xzy.com
>
> This works, however when you view the file in notepad it doesn't look right.



I guess the problem is the line termination: a single NL character (hex 0A)
is used in UNIX, while Windows uses the two-character CR-LF (hex 0D 0A).
Replace cat by:

perl -pe 's/$/\r/' /tmp/file.txt | uuencode ...

--
Paul Szabo - psz@maths.usyd.edu.au http://www.maths.usyd.edu.au:8000/u/psz/
School of Mathematics and Statistics university of Sydney 2006 Australia
Joseph Dionne

2004-01-23, 6:50 pm

And for those non-perl users;

cat /tmp/file.txt | sed -e "s/$/^M/" | uuencode ...

"^M" enter with Ctrl-V, Ctrl-M



Paul Szabo wrote:
quote:

> MB wrote:
>
>
>
>
> I guess the problem is the line termination: a single NL character (hex 0A)
> is used in UNIX, while Windows uses the two-character CR-LF (hex 0D 0A).
> Replace cat by:
>
> PERL -pe 's/$/\r/' /tmp/file.txt | uuencode ...
>



Adam Price

2004-01-23, 6:50 pm

In news:1d08b916.0312040633.41aa5475@posting.google.com,
MB <mb301@hotmail.com> typed:
quote:

> I would like to send a text file as an attachement to Windows
> outlook from tru64 Unix.
>
> # cat /tmp/file.txt | uuencode file.txt | mailx -s test
> someone@xzy.com
>
> This works, however when you view the file in notepad it doesn't
> look right.
>
> Can anyone help
>
> Regards
> M



uuencode file.wri < file.txt | mailx -s test
This causes the file to open in wordpad instead, wordpad can handle
unix line-termination just fine and the file looks OK.
Hope this helps
Adam


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com