Re: nocaseglob and RE matching

2019-10-11 Thread Chet Ramey
On 9/23/19 1:38 PM, Grisha Levit wrote: > Currently nocaseglob and nocasematch both control case insensitivity > of RE matching (in lib/sh/smatch.c): > > if (glob_ignore_case || match_ignore_case) > rflags |= REG_ICASE; > > However, the documentation suggests that on

nocaseglob and RE matching

2019-09-23 Thread Grisha Levit
Currently nocaseglob and nocasematch both control case insensitivity of RE matching (in lib/sh/smatch.c): if (glob_ignore_case || match_ignore_case) rflags |= REG_ICASE; However, the documentation suggests that only nocasematch should have this effect. I'm guessing this behavior w

Re: Problem with 'upper' class when nocaseglob

2017-03-03 Thread Chet Ramey
On 3/2/17 4:57 PM, Lukáš Bařinka wrote: > A description of the bug behaviour: >When the nocaseglob option is set, the [:upper:] class in pattern >does not match capital or small letters. On the other hand, >[:lower:] works fine. Thanks for the report. Character class n

Re: Problem with 'upper' class when nocaseglob

2017-03-03 Thread Greg Wooledge
On Thu, Mar 02, 2017 at 10:57:57PM +0100, Luká?? Ba??inka wrote: > A short script or ???recipe??? which exercises the bug and may be used > to reproduce it: >$ touch a A >$ echo [[:upper:]] >A >$ shopt -s nocaseglob >$ echo [[:lower:]] >

Problem with 'upper' class when nocaseglob

2017-03-03 Thread Lukáš Bařinka
The version number of Bash: GNU bash, version 4.4.11(1)-release The hardware and operating system: x86_64-pc-linux-gnu, Debian GNU/Linux 9 A description of the bug behaviour: When the nocaseglob option is set, the [:upper:] class in pattern does not match capital or small letters

Re: nocaseglob and =~

2015-08-05 Thread Chet Ramey
On 8/4/15 11:33 PM, isabella parakiss wrote: > nocaseglob affects regex matching in [[ but according to the man page only > nocasematch should: > > nocaseglob > If set, bash matches filenames in a case-insensitive fashion when > performing pathname expansion (see Pathna

nocaseglob and =~

2015-08-04 Thread isabella parakiss
nocaseglob affects regex matching in [[ but according to the man page only nocasematch should: nocaseglob If set, bash matches filenames in a case-insensitive fashion when performing pathname expansion (see Pathname Expansion above). nocasematch If set, bash matches patterns in a case

Re: nocaseglob doesn't always work as expected.

2010-10-04 Thread Bob Proulx
Alexey Vinogradov wrote: > ale...@ubuntu64:/tmp$ shopt -u nocaseglob; shopt -s nullglob; for a in > [B-C]* ; do echo $a; done Since you do not mention your locale setting I assume that you are not aware of how it affects ranges. Here if your locale setting uses dictionary sort ordering the

Re: nocaseglob doesn't always work as expected.

2010-10-04 Thread Greg Wooledge
On Mon, Oct 04, 2010 at 08:14:32PM +0700, Alexey Vinogradov wrote: > ale...@ubuntu64:/tmp$ shopt -u nocaseglob; shopt -s nullglob; for a in > [B-C]* ; do echo $a; done > > But the range search here is thow out only non-capital "bigstore" from the > listing, and still

nocaseglob doesn't always work as expected.

2010-10-04 Thread Alexey Vinogradov
(I've included only files begin with "b" and "c/C") Well, let us run: ale...@ubuntu64:/tmp$ shopt -u nocaseglob; shopt -s nullglob; for a in [b-c]* ; do echo $a; done bigstore clipboardcache clipboardcache-1 clipboardcache-2 clipboardcache-3 cLnlY6 codeblocks_dbgrpt-30651-20

Re: nocaseglob

2007-02-16 Thread Bruce Korb
On 2/16/07, Chet Ramey <[EMAIL PROTECTED]> wrote: Tim Waugh wrote: >> strcoll indicates that, in the "en_US" locale, `h' sorts between `A' and >> `Z'. In the "C" locale, it does not. This is consistent with the >> collating sequences I posted earlier. > > Here is what Ulrich Drepper has to say

Re: nocaseglob

2007-02-16 Thread Chet Ramey
Tim Waugh wrote: >> strcoll indicates that, in the "en_US" locale, `h' sorts between `A' and >> `Z'. In the "C" locale, it does not. This is consistent with the >> collating sequences I posted earlier. > > Here is what Ulrich Drepper has to say on the matter (see > https://bugzilla.redhat.com/b

Re: nocaseglob

2007-02-14 Thread Tim Waugh
On Tue, 2007-01-23 at 14:14 -0500, Chet Ramey wrote: > The portable, standard way to perform character comparison using the > current locale is strcoll(). If I can't get the same results using > strcoll(), glibc is clearly doing something different internally. (And > there is no portable standard

Re: nocaseglob

2007-01-28 Thread Bob Proulx
Aharon Robbins wrote: > Chet Ramey wrote: > >You need to force the issue. Add > >export LC_COLLATE=C > >to your startup files. > > I prefer to use an even bigger hammer: > > export LC_ALL=C That is a big hammer! But today I prefer to use UTF-8 character sets and the associated machinery.

Re: nocaseglob

2007-01-28 Thread Aharon Robbins
>Bruce Korb wrote: >> Exactly. And I want to learn how to shoot that dang thing down. Dead. >> If I've cleared my environment of LC_* and LANG values, then by gum >> ``echo [a-z]*'' should work the way it has for the past 35 years, and >> not some newfangled thing that somebody thought would be "

Re: nocaseglob

2007-01-23 Thread Chet Ramey
Bruce Korb wrote: > Exactly. And I want to learn how to shoot that dang thing down. Dead. > If I've cleared my environment of LC_* and LANG values, then by gum > ``echo [a-z]*'' should work the way it has for the past 35 years, and > not some newfangled thing that somebody thought would be "help

Re: nocaseglob

2007-01-23 Thread Bruce Korb
Chet Ramey wrote: >> Chet Ramey wrote: >>> (Since I don't set LC_ALL anywhere in my startup files, my system's >>> default locale is apparently en_US.UTF-8.) >> Even if you don't actively set the LANG, LC_COLLATE, LC_ALL locale >> variables in your shell startup files they may be getting set in you

Re: nocaseglob

2007-01-23 Thread Chet Ramey
> Chet Ramey wrote: > > (Since I don't set LC_ALL anywhere in my startup files, my system's > > default locale is apparently en_US.UTF-8.) > > Even if you don't actively set the LANG, LC_COLLATE, LC_ALL locale > variables in your shell startup files they may be getting set in your > environment th

Re: nocaseglob

2007-01-23 Thread Bob Proulx
Chet Ramey wrote: > (Since I don't set LC_ALL anywhere in my startup files, my system's > default locale is apparently en_US.UTF-8.) Even if you don't actively set the LANG, LC_COLLATE, LC_ALL locale variables in your shell startup files they may be getting set in your environment through PAM's /e

Re: nocaseglob

2007-01-23 Thread Chet Ramey
Tim Waugh wrote: > On Tue, 2007-01-23 at 17:17 +0100, Andreas Schwab wrote: >> glibc definitely uses strcoll as well. Most likely python has its own >> implementation which gets it wrong. > > No, really, this is going through glibc's __collseq_table_lookup > function. The Python example is just

Re: nocaseglob

2007-01-23 Thread Tim Waugh
On Tue, 2007-01-23 at 17:17 +0100, Andreas Schwab wrote: > glibc definitely uses strcoll as well. Most likely python has its own > implementation which gets it wrong. No, really, this is going through glibc's __collseq_table_lookup function. The Python example is just an easy-to-run distilled te

Re: nocaseglob

2007-01-23 Thread Andreas Schwab
Chet Ramey <[EMAIL PROTECTED]> writes: > On the contrary, the bash globbing of [A-Z] is using exactly the system's > collating sequence. Bash uses strcoll; glibc/python probably use character > value comparisons for old-style bracket range expressions. glibc definitely uses strcoll as well. Mos

Re: nocaseglob

2007-01-23 Thread Matthew Woehlke
Bruce Korb wrote: Chet Ramey wrote: This shows the collating sequence for alphabetics in the en_US locale. (Since I don't set LC_ALL anywhere in my startup files, my system's default locale is apparently en_US.UTF-8.) Is _that_ the deal, then? There is such a thing as a "system default loca

Re: nocaseglob

2007-01-23 Thread Bruce Korb
Chet Ramey wrote: > This shows the collating sequence for alphabetics in the en_US locale. (Since > I don't set LC_ALL anywhere in my startup files, my system's default locale is > apparently en_US.UTF-8.) Is _that_ the deal, then? There is such a thing as a "system default locale" that does no

Re: nocaseglob

2007-01-23 Thread Chet Ramey
> It's worth noting here that bash's globbing of '[A-Z]*' etc is > definitely different from the system collation sequence (i.e. using > fnmatch() or glob() functions). There is an open bug report about this > here: On the contrary, the bash globbing of [A-Z] is using exactly the system's collati

Re: nocaseglob

2007-01-22 Thread Tim Waugh
On Mon, 2007-01-22 at 08:04 -0800, Bruce Korb wrote: > There seems to be something else aside from LC_ALL, LC_COLLATE > and LANG that affects collating sequence. Notice the difference > between "[a-d]*" and "[a-D]*". Whatever collating sequence is being used > do select files puts "D" after "d",

Re: nocaseglob

2007-01-22 Thread Bruce Korb
On 1/22/07, Bob Proulx <[EMAIL PROTECTED]> wrote: Unfortunately in this case setting the variable on the command line for that command won't do what you want. Since file globbing takes I figured that out. :} (unset LC_ALL LC_COLLATE LANG ; echo [a-z]*) (LC_COLLATE=en_US.UTF-8 ; echo [a-z

Re: nocaseglob

2007-01-22 Thread Bob Proulx
Bruce Korb wrote: > $ echo [a-z]* > bin bk-archives Bugzilla core cron Desktop [[...]] > $ LC_COLLATE=C echo [a-z]* > bin bk-archives Bugzilla core cron Desktop [[...]] Unfortunately in this case setting the variable on the command line for that command won't do what you want. Since file globbing

Re: nocaseglob

2007-01-22 Thread Bruce Korb
On 1/20/07, Bob Proulx <[EMAIL PROTECTED]> wrote: I think you have the nocaseglob right. I think this is a variable set but not exported problem. Just guessing though. Excellent guess. No cigar, tho: $ echo [a-z]* bin bk-archives Bugzilla core cron Desktop [[...]] $ LC_COLLATE=C ech

Re: nocaseglob

2007-01-20 Thread Bob Proulx
Bruce Korb wrote: > This cannot have been overseen, so perhaps I am not understanding > how "nocaseglob" is supposed to work: I think you have the nocaseglob right. I think this is a variable set but not exported problem. Just guessing though. > $ bash --version > GNU

Re: nocaseglob

2007-01-20 Thread Bruce Korb
Andreas Schwab wrote: > Bruce Korb <[EMAIL PROTECTED]> writes: > >> $ echo tpdsrc/umod/nodesvr/test/[a-z]* >> tpdsrc/umod/nodesvr/test/Makefile tpdsrc/umod/nodesvr/test/SCCS >> tpdsrc/umod/node >> >> What are the "Makefile" and "SCCS" entries doing on the line? > > Please read the Bash FAQ, Ques

Re: nocaseglob

2007-01-20 Thread Andreas Schwab
Bruce Korb <[EMAIL PROTECTED]> writes: > $ echo tpdsrc/umod/nodesvr/test/[a-z]* > tpdsrc/umod/nodesvr/test/Makefile tpdsrc/umod/nodesvr/test/SCCS > tpdsrc/umod/node > > What are the "Makefile" and "SCCS" entries doing on the line? Please read the Bash FAQ, Question E9. Andreas. -- Andreas Sch

nocaseglob

2007-01-20 Thread Bruce Korb
Hi, This cannot have been overseen, so perhaps I am not understanding how "nocaseglob" is supposed to work: $ bash --version GNU bash, version 3.1.17(1)-release (i586-suse-linux) Copyright (C) 2005 Free Software Foundation, Inc. $ shopt|fgrep caseglob nocaseglob off $ echo t

'nocaseglob' does not work in 'case' or '[[...]]'

2005-02-14 Thread William Park
Bash Version: 3.0 Patch Level: 0 Release Status: release Description: Not sure if it's bug... but, 'nocaseglob' does not work in 'case' statement or in '[[...]]' expression. Manpage says it should. Repeat-By: shopt -s nocaseglob