Re: Grep Question

From: cbaker@GOODYEAR.COM
Date: Tue Mar 02 2004 - 15:17:16 EST


Praveen,

Without the script, or at least the grep part of the script, it is a bit
hard to tell you what is wrong. Could you give us more info?

I can tell you that with a standard grep, such as this:

      grep 82.44.203.222.82681071601925321 testfile

the "." (dot) is interpreted as "any character". So, if anything, this
should give you the lines with that number string in it and others with
similar strings, but where the dots could be another number, such as

      82a44b203K222.82681071601925321

which is not what you want.

To get the dot to be seen as a character, the period character, you must
put TWO back-slashes before them, as such

      grep 82\\.44\\.203\\.222\\.82681071601925321 testfile

See also "fgrep" for a better solution.

So send us the script and we will try to shed a better light on the
problem.

Christopher M. Baker
Senior Technical Support Analyst
DSE/TCO
Goodyear Tire and Rubber Company

=================================================
Contains Confidential and/or Proprietary Information.
May not be copied or disseminated without the expressed
written consent of The Goodyear Tire & Rubber Company.
=================================================

                      "Kumar, Praveen
                      (cahoot)" To: aix-l@Princeton.EDU
                      <Praveen.Kumar@C cc: (bcc: Chris Baker/NA/GDYR)
                      AHOOT.COM> Subject: Grep Question
                      Sent by: IBM AIX
                      Discussion List
                      <aix-l@Princeton
                      .EDU>

                      03/02/2004 02:33
                      PM
                      Please respond
                      to IBM AIX
                      Discussion List

Hi *,
       I want to search for a string (82.44.203.222.82681071601925321) from
a file. i have around 150 similar number , so i am using a script to do
this...my script does not create file even after redirecting...can some let
me know where am i failing.

i think when i am doing grep it takes .(dot) in the literal meaning.

TIA
Praveen

*********************
Internet communications are not necessarily secure and may be intercepted
or
changed after they are sent. cahoot does not accept liability for any such
changes.
If you wish to confirm the origin or content of this communication, please
contact the sender using an alternative means of communication.

This communication does not create or modify any contract.

This email may contain confidential information intended solely for use by
the addressee. If you are not the intended recipient of this communication
you should destroy it without copying, disclosing or otherwise using its
contents.

Please notify the sender immediately of the error.

cahoot is a division of Abbey National plc.
Abbey National plc is registered in England, registered number 2294747.
Registered Office: Abbey National House, 2 Triton Square, Regent's Place,
London, NW1 3AN.



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:39 EDT