On 11 Mar 2004, at 06:26, Dallman Ross wrote:
On Mon, Mar 08, 2004 at 06:57:34PM -0700, LuKreme wrote:
# / */ / is three spaces, '*/', and one space (basically 'two
# or more' I tried s/ +/ / and s/ {2,}/ / and various similar
# patterns but they all failed.
I'm frankly surprised at your statement that you tried {n,}
in procmail, after the many, many, many discussions here over
the time you have been reading the list, including many times
in the last three months, which have served to remind us that
that particular type of extended regex notation does not work
in procmail.
Well, I wasn't using it IN PROCMAIL, I was using it in sed. (see the
line below)
# concatenate the addresses collapse all the spaces to ' '
# substitute '|' for all spaces
:0
* ^Cc:[ ]*\/.*
{ ETO=`echo "$TO $MATCH" | sed 's/,//g' | sed 's/ */ /g' |tr ' '
'\|'` }
And here, I'm also surprised at the lazy inefficiency of your
invoking sed-piped-to-sed-piped-to-tr. You are smarter than that,
Kreemy, and you sometimes even show it here. ;)
Sometimes :)
The seds where separate commands, with LOG lines in between (as I was
trying to figure out why sed 's/ {2,}/ /g' didn't work, which no one
has been able to explain so far). Once it was working it was simpler
to just collapse the lines.
this would be shorter and eliminates the tr, however:
sed 's/,//g' | sed 's/ */|/g'
I don't really know sed well enough to come up with a recipe that does
both of these functions... maybe
sed 's/[, ] */|/g'
? It appears to work.
maybe I know sed better than I thought?
--
Why live in the world when you can live in your head?
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail