[PLUG] mailx question

Rich Shepard rshepard at appl-ecosys.com
Mon Jun 3 18:12:48 UTC 2013


On Mon, 20 May 2013, Paul Heinlein wrote:

> The tool I'd normally reach for in this situation is m4. If, for instance,
> you were able to loop through a list of subscribers and assign
> $NAME and $ADDRESS, then
>
>  m4 -D GREETING="$NAME" newsletter.m4 | mail -s "Subject" $ADDRESS
>
> The newletter.m4 would contain the GREETING token which would get replaced 
> with $NAME.

Paul,

   I've read the m4 man page, info file, and manual (the .pdf version of the
info file) without seeing how I would set up the input files. I assume that
one file contains two tokens, NAME and ADDRESS, but how are they separated
on each line?

   The other file, newsletter.m4, I assume begins with:

GREETING,

   This is the text of the newsletter.

Is this correct?

   Trying to find examples by searching the Web turned up lots of Microsoft
examples but none using GNUm4.

Thanks,

Rich

-- 
Richard B. Shepard, Ph.D.          |      Have knowledge, will travel.
Applied Ecosystem Services, Inc.   |
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863




More information about the PLUG mailing list