nv-l
[Top] [All Lists]

Re: Grep

To: nv-l@lists.tivoli.com
Subject: Re: Grep
From: Connie Logg <cal@SLAC.STANFORD.EDU>
Date: Fri, 8 Jan 1999 14:38:44 -0800
Reply-to: Discussion of IBM NetView and POLYCENTER Manager on NetView <NV-L@UCSBVM.UCSB.EDU>
Sender: Discussion of IBM NetView and POLYCENTER Manager on NetView <NV-L@UCSBVM.UCSB.EDU>
You need to escape the ".".  "." stands for any character.


At 04:41 PM 1/8/99 -0500, you wrote:
>Theres probably a very simple answer to this question, but I cannot for the
>life of me figure it out.  How do you grep for an EXACT match of a string?
>I have a file that looks something like this:
>
>10.1.     #Bridgewater
>10.10.  #Scranton
>10.12.  #White Plains
>10.13.  #Warwick
>10.14.  #Tampa
>10.16.  #One Penn Plaza
>10.17.  #Mt. Prospect
>10.18.  #Denver
>
>I'm trying to grep for the exact match of 10.1. in a script.  That string
>will actually be in a variable defined previously in the script.
>When the grep runs, it not only outputs the line    10.1.     #Bridgewater
>(which is what I want), but it gives me every other line
>containing 10.1?.  How do I prevent that from happening?  I've tried
>putting single quotes, double quotes, etc around the variable
>name, but have had no success.  Am I missing something simple
>here?...............Lucy
>
*********************************************************************
" Of course the opinions expressed here are my own. "

Connie Logg    CAL@SLAC.Stanford.Edu  ph: 650-926-2879
Network Management and Performance Analyst
SLAC (MS 97), P.O. Box 4349, Stanford, CA 94309

"Happiness is found along the way, not at the end of the road."

<Prev in Thread] Current Thread [Next in Thread>

Archive operated by Skills 1st Ltd

See also: The NetView Web