procmail
[Top] [All Lists]

Re: Breaking news alerts (procmail and sed)

2001-12-06 07:52:21
Paul wrote,

| Tim *did* say he was using GNU version 3.02.80.

But not everyone trying to learn things from this list does.

When I suggested,

| > sed -ne h -e y/ADEfILMORST/adeFilmorst/ \
| >  -e '/For more details/q' -eg -ep

Paul Chvostek answered,

| sed -e '/For more details/,$d' -e '/FOR MORE DETAILS/,$d'
|
| Probably less load to do two searches than to translate first.

If "For more details" and "FOR MORE DETAILS" are the only casings that ever
appear, I agree that two searches are less work than a translation plus a
search.  But if sometimes it is "for more details" or "For More Details" or
"For MORE Details," searching for only the first two won't work.

However, if your goal is reduce the load, you're working against yourself to
tell sed to keep reading in the rest of the input line by line only to throw
it away.  This approach

 sed -ne '/For more details/q' -e '/FOR MORE DETAILS/q' -ep

allows sed to exit when it is done with the output.



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