This is the mail archive of the cygwin 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]
Other format: [Raw text]

Problem with Bash regex test case sensitivity


Having some problems with bash case-sensitive regexes, so I wrote
this little test.

t_regex
--------
#!/bin/bash

# t_regex: Test test regex

# By Lee Rothstein, 2010-12-03, 16:27:38

if [[ "$1" =~ [A-Z] ]] ; then
    echo Contains Capital Letters: $1
else
    echo Doesn\'t Contain Capital Letters: $1
fi
--
# Good
$ t_regex 890
Doesn't Contain Capital Letters: 890

# Good
$ t_regex DFGH
Contains Capital Letters: DFGH

# Good
$ t_regex Dfgh
Contains Capital Letters: Dfgh


# WTF, O $ t_regex dfgh Contains Capital Letters: dfgh --

Do I have some Bash or Cygwin parameter set that engenders case
insensitivity? Or, is this a bug? Or, am I being overly sensitive?
;-)

Note:
--
$ echo $CYGWIN
tty title nodosfilewarning glob:noignorecase winsymlinks ntsec
--

And, oh yes, I tested this on Linux, and it works fine.

Thanks,

cygcheck output is attached

Lee

Attachment: cygcheck-hvscr+2010-12-03+16-39-42.txt
Description: Text document

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

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