S
surfergirl
How can I use perl to remove garbage in my mailbox
caused by my procmail filter. This is a known problem
but it occurs too frequently and I certainly don't want
to give up procmail. What I get is a false message
like this:
From foo@bar Tue Nov 14 21:26:34 2006
so I need a one-line perl script to remove the line(s)
from my inbox before I read mail as in:
cat $inbox |perl -pi -e 's/^From foo@bar//g'
However, that will not work since sometimes the
"^From " line could be followed by a "Status:" or other lines.
Thus, the removal must do a range as in awk ala:
cat $inbox |awk '/^From foo@bar/,/^$/' {next} 1
This however does not work for me either and I'm not sure why
other than my awk being from Solaris 7.
Thanks for your help.
caused by my procmail filter. This is a known problem
but it occurs too frequently and I certainly don't want
to give up procmail. What I get is a false message
like this:
From foo@bar Tue Nov 14 21:26:34 2006
so I need a one-line perl script to remove the line(s)
from my inbox before I read mail as in:
cat $inbox |perl -pi -e 's/^From foo@bar//g'
However, that will not work since sometimes the
"^From " line could be followed by a "Status:" or other lines.
Thus, the removal must do a range as in awk ala:
cat $inbox |awk '/^From foo@bar/,/^$/' {next} 1
This however does not work for me either and I'm not sure why
other than my awk being from Solaris 7.
Thanks for your help.