Dermot Paikkos wrote:
> Hi

Hello,

> Looking at the mail queue on my smtp server I notice the usual amount 
> of crap. The mailq output is in this format:
> 
> 11h  8.5K 1EeoEz-0003t2-00 <>
>           [EMAIL PROTECTED]
> 
> 10h   10K 1EepGl-0004VH-00 <>
>           [EMAIL PROTECTED]
> 
> 11h  8.4K 1EeoUI-0004YR-00 <>
>           [EMAIL PROTECTED]
> 
> In case the formatting doesn't make it, that's a newline after '<>' 
> and a newlines between each (two-line) record.
> 
> I was hoping to do a one-liner that would yield just the message ID. 
> I tried a few variations but I couldn't get it.
> 
> mailq | perl -e 'while (<>) {print $1, "\n" if /([\d+|\w+]-[\d+|\w+]-
> 00).*porn/m }' 
> # nothing at all.
> 
> mailq | perl -e 'while (<>) {print $1, "\n" if /(\d+|\w+).porn/m }' 
> # Close but no cigar
> #phoebe
> #aimee
> #yasmin
> #poppy
> #charlotte
> #amy
> 
> mailq | perl -e 'while (<>) {print $1, "\n" if /(.*-00).*porn/sm}'
> # Nothing
> 
> I am missing something vital in my regex but I can't spot it. Any 
> advice?

Does this do what you want?

perl -l -00ane'print $F[2] if /porn/'



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to