procmail
[Top] [All Lists]

Re: catching backslashes with sed

2002-09-14 17:40:39
On Saturday, September 14, 2002, at 04:43 PM, Greg Matheson wrote:
           SUBJ = `printf %s "$SUBJ" | sed 's,\\\\,\\\\\\\\,g; \
                                            s/&/\\\\&/g;       \
                                            s,/,\\\\/,g'`

So you're trying to preserve the metacharacters by quoting them.
Strange sed syntax there with the colons and lack of -e for extra
expressions. I think 'sed' has been deleted from 2nd and 3rd
lines here.

No, that's ONE sed expression (note the \'s at the end of the line)

sed 's,\\\\,\\\\\\\\,g; s/&/\\\\&/g; s,/,\\\\/,g'

--
There is no Satan.  That's just god when he's drunk.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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