← Back to team overview

sslug-teknik team mailing list archive

Re: cut & sed

 

René Mølsted <molsted@xxxxxxx> writes:

> Nov  5 11:02:54 httpd MailScanner[1273]: Spam Checks: Found 1 spam
> message
> Nov  5 11:03:24 httpd MailScanner[10731]: Spam Checks: Found 3 spam
> message
> Hvor jeg har brug for at tallet i »Found spam« ud og summere det
> samlede antal.

perl -nle '$sum += $1 if /Found (\d+) spam/; END { print "Found $sum spam" }'

Kan sikkert gøres lige så let med awk.

-- 
 Peter Makholm     |                                 Wisdom has two parts:
 peter@xxxxxxxxxxx |                           1) having a lot to say, and
 http://hacking.dk |                                      2) not saying it


Follow ups

References