procmail
[Top] [All Lists]

Re: Pipe to cat somehow ruins previous recipe?? I'm lost.

1998-03-24 16:27:07
In addition to his headline question, Ken asked this:

| Also, how could I have cat expand the variable in the text?  If reply.txt
| says:
|
|       Please reply to $REPLYTO
| 
| what would the procmail be, this?:

Well, cat cannot do that.  sed or awk or perl can:

     :0fhwa
     | cat - ; sed "s/\$REPLYTO/$REPLYTO/" reply.txt

but that takes three processes (cat, sed, and a shell to connect them).
Philip's suggestion with perl looked hairy but does both jobs in one
process.

Another possibility is to put the entirety of reply.txt into the recipe.  You
can then do it in a single process with sed:

  :0fhwa # Note the space between "$" and "a"!
  | sed "$ a\\
Poster is not a member of the list.\\
Please reply to $REPLYTO.\\
\\
"

<Prev in Thread] Current Thread [Next in Thread>