-   Linux - Newbie (
-   -   problem with grep command (

thodo 10-25-2007 04:17 AM

problem with grep command
Hi guys,

I have the following problem when using the grep command:

I want to select some entries from a file (,
using as a reference a one-column file (
with entries (I call them "ID") common in both files, such as


the grep command will work fine for the first two entries, but it will complain
for the third one as grep does not like the "-" sign. It will only work if I convert
the - sign to '\-' in my do loop. Is there a smart way of doing that?

Thanks in advance,


acid_kewpie 10-25-2007 04:20 AM

check the grep manpage...

      -e PATTERN, --regexp=PATTERN
              Use PATTERN as the pattern; useful to protect patterns beginning
              with -.

All times are GMT -5. The time now is 06:21 AM.