procmail
[Top] [All Lists]

Re: Using sed

2001-04-23 04:19:20
On Sun, 22 Apr 2001, Stan Ryckman <stanr(_at_)sunspot(_dot_)tiac(_dot_)net> 
wrote:

Trevor Jenkins tried:

procmail: Assigning "SUBJECT=Re: [fetchmail]Problem with "warnings" ? "
procmail: Executing "echo -n $SUBJECT|sed -e "s/\[([A-Za-z0-9\-_ 
]*)\]/\1/g""
procmail: Assigning "TAG=Re: [fetchmail]Problem with "warnings" a h"

See the ' a h' at the end?  That was the ' ?' in the SUBJECT assignment.
There are often useful-but-subtle clues that show up in verbose logs.
It (the '?') is getting filename-expanded by the shell.  Put
quotes around the $SUBJECT:

      TAG=`echo -n "$SUBJECT"|sed -e "s/\[([A-Za-z0-9\-_ ]*)\]/\1/g"`

Nope the quotes didn't work. If there are single character filenames (and
there were) then they always get expanded. Now to figure out how to stopp
this expansion from ever taking place. Although ...

This, should get you one step closer, but you may want to look at
Don Hammond's suggestions for the right hand side as well (sorry,
I don't have time to play with that right now.)

has provided a better solution (i.e., in an easier to understand regexp)
I still need to solve the problem so that shell-expansion doesn't interfer
with other things.

Regards, Trevor

British Sign Language is not inarticulate handwaving; it's a living language.
Support the campaign for formal recognition by the British government now!

-- 

Local list tags removed with a patched pine courtesy of Eduardo Chappa

<>< Re: deemed!

_______________________________________________
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>