Cygwin 1.7 string pattern matching problem with case sensitivity

Greg Chicares gchicares@sbcglobal.net
Thu Mar 17 13:22:00 GMT 2011


On 2011-03-17 12:44Z, jean-benoit.ouellet@HIDDEN.ca wrote:
>
> I just upgraded Cygwin from 1.5.21-2 to 1.7.8-1 and I'm getting problems with case sensitivity.
> Let's assume that 'file.csv' contains these 2 lines:
> Hello, 123
> hello, 456 
>
> The following commands will output both lines instead of the desired first line only:
> awk -F, '$1 ~ /^[A-Z]/ {print $0}' file.csv
> grep "^[A-Z]/" file.csv

Either override the locale
  http://www.cygwin.com/cygwin-ug-net/setup-locale.html
or, preferably, use character classes, e.g.:

$grep '^[[:upper:]]' file.csv
Hello, 123

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list