| Author |
sending text file as attachement to Windows (Outlook)
|
|
|
| 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
|
|
|
|