Formatting a mail

John Summerfield debian at herakles.homelinux.org
Sat Oct 13 23:21:41 UTC 2007


Cameron Simpson wrote:
> On 13Oct2007 16:22, Paul Ward <pnward at googlemail.com> wrote:
> | Just wanted to say I have figured out a way to do it. as follows,
> | although a little crude it does give me the result I was after.
> | 
> | for m in `ls $REPORTS|grep report` ;do
> | STATS=`cat $m`
> | echo $STATS >> /tmp/pgstats
> | echo " " >> /tmp/pgstats # Gives me the formatting
> | done
> | mail -s "Printer Reports" pnward at googlemail.co.uk < /tmp/pgstats
> | 
> | Thanks for some pointers anyway.
> 
> Untested cleanup:
> 
>   for m in "$REPORTS"/*report*

Be aware that in the ,ore general case, this can produce a too-long 
command line and so fail.

A variation using find and xargs is generally sounder.

Also, one needs to beware of paths such as "my documents."



>   do
>     cat "$m"    # report text
>     echo        # inter-prargraph blank line
>   done \
>   | mail -s 'Printer Reports' pnward at googlemail.co.uk
> 
> Cheers,


-- 

Cheers
John

-- spambait
1aaaaaaa at coco.merseine.nu  Z1aaaaaaa at coco.merseine.nu

Please do not reply off-list




More information about the fedora-list mailing list