procmail
[Top] [All Lists]

Re: Help

1998-07-05 12:41:07
On Sun, 05 Jul 1998 10:17:41 -0400, Stan Ryckman
<stanr(_at_)sunspot(_dot_)tiac(_dot_)net> wrote:
At 02:54 PM 7/4/98 +0300, era eriksson wrote:
sed -e 's/\$SUBJECT/'"$MATCH"/ -e 's/\$YOU/"$YOU"/ $HOME/.vacation.msg ) \
| $SENDMAIL $SENDMAILFLAGS -t
Note that the second -e on the sed has an unmatched '
Probably it should be ... -e 's/\$YOU/'"$YOU"/

Oops, sorry, of course.

Question:  given the single quote marks, why the backslash escape on
$SUBJECT and $YOU in the sed command?

To disambiguate from the regex end-of-line anchor. It doesn't hurt in
any version of sed I have access to (but I haven't bothered to check
if it's really necessary in any of them. It's not in Digital sed at
least, which is probably the most braindead of them all).

/* era */

-- 
 Paparazzi of the Net: No matter what you do to protect your privacy,
  they'll hunt you down and spam you. <http://www.iki.fi/~era/spam/>

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