This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

issue with grep [^]


Hi,

grep (GNU grep) 2.2
 (Cygnus)

Here is the situation:

I have a file with many lines containing this "-4)".  And the number will
range from 1 to 5.
If I type:
    cat x.txt | grep \\-[0-9]\)
it works great - the lines containing it are correctly returned.

But typing:
    cat x.txt | grep \\-[^0-9]\)
doesn't work - the same result occurs as the first case above, like the ^ is
ignored.

Same happens with other simple regexps like this one:
    cat x.txt | grep 1
works, but
    cat x.txt | grep [^1]
again doesn't work - also has the same results as without the ^.

Does anyone know anything about this?  This seems too simple to be a bug - I
must be doing something wrong!!

I tried the same file and commands on Solaris, and had the expected/correct
results.


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]