[ale] Parsing attachments out of email

Pete Hardie pete.hardie at gmail.com
Fri Dec 8 20:29:41 EST 2006


On 12/8/06, Jay Loden <jloden at toughguy.net> wrote:
> I tried some things out, and figured out that I can do this pretty simply by just
> replacing everything between the first "X-MimeOLE" header and the second one. Seems like
> something I ought to be able to do with sed or a short perl script. However, when piping
> stdin through grep or doing a pattern match in perl, it seems like it always matches line
> by line.
>
> In this case, what I need is to do a search and replace pattern across the entire set of
> lines. I assume there must be some way to do this with a special command through sed or a
> special perl script, but it's beyond me knowledge of either. Anyone happen to know how i
> can do either?

awk can do this, if you aren't adverse to yet another scripting
language.  Use the pattern to toggle a print variable.

-- 
Pete Hardie
--------
Better Living Through Bitmaps



More information about the Ale mailing list