Can anyone give me an example about how to use grep with regular
expressions?  I can't figure out how to make it work.  For example, I
have a directory with maildir style email files in it.  I would like
to parse the file and return any numeric characters found, for
example, parts of the IP address.  Here's the email; it's spam, BTW...

[EMAIL PROTECTED] ~/.maildir/.SPAM/cur $ cat
1160675132.P30642Q12M139135.bullet:2,
Return-Path: <[EMAIL PROTECTED]>
Received: from host-196.218.204.117.tedata.net
(host-196.218.204.117.tedata.net [196.218.117.204] (may be forged))
        by bullet.espersunited.com (8.13.7/8.13.7) with ESMTP id
k9CH4OnD030578
        for <[EMAIL PROTECTED]>; Thu, 12 Oct 2006 12:04:37 -0500
Received: from 202.108.37.61 (HELO mx.sina.net)
     by espersunited.com with esmtp (3D43IP8TW8 MPNOBU)
     id 74WQ9B-6UNK3J-XL
     for [EMAIL PROTECTED]; Fri, 13 Oct 2006 02:02:21 +0480
Date:   Fri, 13 Oct 2006 02:02:21 +0480
From: "Jackie Rivas" <[EMAIL PROTECTED]>
X-Mailer: The Bat! (v2.10.01) Personal
X-Priority: 3 (Normal)
Message-ID: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: everyday thug
MIME-Version: 1.0
Content-Type: text/plain;
  charset=iso-8859-2
X-Spam: Not detected
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by
bullet.espersunited.com id k9CH4OnD030578

TRAD ERS WATCH OUT
SBNS MAKES A MOVE
ADD SBNS TO RA DAR TRADE ON THURSDAY OCT 12!

Trade Alert: THU RSDAY, October 12, 2006
Company Name: SHALLBETTER INDS INC (Other OTC:SBNS.PK)
Price: $0.95
STOCK: SBNS.PK
5-day Targ et: $10

NEWS
* Shallbetter Industries, Inc. Provides Geological Information
Relating To Initial Resource Property In Mongolia READ MORE ONLINE NOW!


About SBNS:
Shallbetter Industries Inc. is a publicly traded mining company
engaging in the acquisition, potential and exploration development of
mineral properties in Outer Mongolia.


The company trades on the OTC market of the United States
under the trading symbol SBNS.


WATCH SBNS ON THURS OCT 12!
THIS ONE IS SET TO POST HUGE GAINS AND RELEASE BREAKING NEWS!

sp1

Now, I would like to parse this file for numeric data.  Here's my command:

grep '[:digit:]' 1160675132.P30642Q12M139135.bullet:2,

Every grep doc I've looked at claims this will work, but none provide
an example.  This command is quite happy to return any occurrence of
the letter d, i, g, or t, but no mention of any numeric data.  I would
like to use this application (if I can ever find out how) to parse my
spam emails for IP addresses for processing of the spam.  I know I
could do this in perl, but I want to do it with bash scripting for the
experience...







To unsubscribe from this list, please email [EMAIL PROTECTED] & you will be 
removed. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/LINUX_Newbies/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/LINUX_Newbies/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to