Re: Grep Question

From: Scott Purkerson (spurkerson_at_DOIT.NV.GOV)
Date: 03/02/04

  • Next message: cbaker_at_GOODYEAR.COM: "Re: Grep Question"
    Date:         Tue, 2 Mar 2004 13:15:31 -0800
    To: aix-l@Princeton.EDU
    
    

    ...unless you use the single quote as follows:

    grep '82\.44\.' *

    You can use single-quotes to enclose command arguments containing special characters so they won't be interpreted by the command shell.

    -----Original Message-----
    From: cbaker@GOODYEAR.COM [mailto:cbaker@GOODYEAR.COM]
    Sent: Tuesday, March 02, 2004 12:52 PM
    To: aix-l@Princeton.EDU
    Subject: Re: Grep Question
    Importance: High

    Yes, as the grep man page states, you need to double backslash it so that
    the single backslash and the dot are forced to be passed by the shell to
    the grep.

    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.
    =================================================

                          Holger.VanKoll@S
                          WISSCOM.COM To: aix-l@Princeton.EDU
                          Sent by: IBM AIX cc: (bcc: Chris Baker/NA/GDYR)
                          Discussion List Subject: Re: Grep Question
                          <aix-l@Princeton
                          .EDU>

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

    you need \\. , dont you?

    (1)root@sbe15342 581# echo asdf.asdf\\nasdfasdf
    asdf.asdf
    asdfasdf
    (0)root@sbe15342 582# echo asdf.asdf\\nasdfasdf|grep .
    asdf.asdf
    asdfasdf
    (0)root@sbe15342 583# echo asdf.asdf\\nasdfasdf|grep \.
    asdf.asdf
    asdfasdf
    (0)root@sbe15342 584# echo asdf.asdf\\nasdfasdf|grep \\.
    asdf.asdf
    (0)root@sbe15342 585#

    -----Original Message-----
    From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU] On Behalf Of
    Bill Verzal
    Sent: Tuesday, March 02, 2004 9:10 PM
    To: aix-l@Princeton.EDU
    Subject: Re: Grep Question

    With regex, a "." means "any character". Use "\." to find literal "."
    characters.

    BV
    --------------------------------------------------------

    "If everything is coming your way, then you are in the wrong lane"

    Bill Verzal
    AIX Administrator, Komatsu America
    (847) 970-3726 - direct
    (847) 970-4184 - fax

                 "Kumar, Praveen
                 (cahoot)"
                 <Praveen.Kumar@CA
    To
                 HOOT.COM> aix-l@Princeton.EDU
                 Sent by: IBM AIX
    cc
                 Discussion List
                 <aix-l@Princeton.
    Subject
                 EDU> Grep Question

                 03/02/2004 01:33
                 PM

                 Please respond to
                      IBM AIX
                  Discussion List
                 <aix-l@Princeton.
                       EDU>

    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.


  • Next message: cbaker_at_GOODYEAR.COM: "Re: Grep Question"

    Relevant Pages

    • Re: Grep Question
      ... Yes, as the grep man page states, you need to double backslash it so that ... i think when i am doing grep it takes .(dot) in the literal meaning. ... If you wish to confirm the origin or content of this communication, ...
      (AIX-L)
    • Re: ssh and chroot
      ... ++ echo /bin/mkdir ... ++ awk '' ... ++ grep '^/' ...
      (comp.security.ssh)
    • Re: Finding stream job signons
      ... it's a 'smart' grep. ... echo This command uses grep to search a fileset for all occurances ... setvar _g_grep_ok false ...
      (comp.sys.hp.mpe)
    • Re: Combining variables
      ... Subject: Combining variables ... If I have the above in a script and I want to echo the value of my parameter ... PARM10, how would I do that by combining my AZ parameter. ... If you wish to confirm the origin or content of this communication, ...
      (AIX-L)
    • Simplifying Grep Utility
      ... I'm trying to write a program that similair to the grep utitilty. ... echo " enter what to grep:" ...
      (comp.unix.shell)