Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #14876
| From | Bize Ma <binaryzebra@gmail.com> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: Bash removes unrequested characters in bracket expressions (not a range). |
| Date | 2018-11-28 06:29 -0400 |
| Message-ID | <mailman.5072.1543846784.1284.bug-bash@gnu.org> (permalink) |
| References | <CAFra36hcAjBHGgd_8sHjOV4wSzjmdCyLV2aQo8Ww1bwJqkxYQA@mail.gmail.com> <1c24a279-f439-a13c-be60-901096ccd4e1@case.edu> <CAFra36hdkG+5qq94cf-sbKrnw6roJWez03aKJPU=Z=Vad2LaXg@mail.gmail.com> <63b8941d-16bc-0761-7272-83eb7347354e@case.edu> |
Chet Ramey (<chet.ramey@case.edu>) wrote: > On 11/24/18 4:32 PM, Bize Ma wrote: [...] > > I have been made aware that there is a > > cstart = cend = FOLD (cstart); > > inside the `sm_loop.c` file that will convert into a range many > > individual character. If that understanding is correct that is the > > source of the difference with other shells. > > I'm not sure what you mean by "convert into a range." If cstart and cend > were treated as a range, the start end and end characters would be the > same. If cstart == cend, a character that collates >= cstart and <= cend > would have to collate equal to cstart and cend. > Yes, exactly, a range where the start and the end are the same. Try: $ touch 0 1 ٠ ١ ۰ ۱ ߀ ߁ ० १ $ echo [1] 1 ١ It is converted to the same range as this $ echo [1-1] 1 ١ That happens because up to glibc 2.27 this has been the collation order of those characters (search in /usr/share/i18n/locales/iso14651_t1_common) : <U0030> <0>;<BAS>;<MIN>;IGNORE <U0660> <0>;<BAS>;<MIN>;IGNORE Collate to exactly the same values. This breaks the capacity to detect that a character is absent in a list ordered by the collation order.
Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread
Re: Bash removes unrequested characters in bracket expressions (not a range). Bize Ma <binaryzebra@gmail.com> - 2018-11-28 06:29 -0400
csiph-web