Re: [PATCH v6 00/11] Fix icase grep on non-ascii
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jun 22, 2016, 18:29 UTC
- Message-ID
- <CACsJy8BQxAkpoT7GVNgtM-0n1pMZeV5TRCiSn6TsYeATWeU=EA@mail.gmail.com>
- In-Reply-To
- <CACsJy8CSVvZfwjG+zAEpG6tAWYAWVkrkz4RP32Hrr9O1A_8ZMg@mail.gmail.com>
On Sat, Jun 18, 2016 at 2:26 AM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 26 quoted lines
> On Sat, Jun 18, 2016 at 6:17 AM, Junio C Hamano <gitster@pobox.com> wrote: >> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes: >> >>> v6 fixes comments from Ramsay and Eric. Interdiff below. >> >> Another thing I noticed with this is that the non-ascii test breaks >> when run under dash (but passes under bash). You need to have is_IS >> locale on the system to see the breakage, it seems (which is why I >> didn't see it so far). > > Is it a special version, maybe from debian? It works for me on gentoo. > >> ~/w/git/temp/t $ equery --quiet list dash > app-shells/dash-0.5.8.2 >> ~/w/git/temp/t $ dash ./t7812-grep-icase-non-ascii.sh > # lib-gettext: Found 'is_IS.utf8' as an is_IS UTF-8 locale > # lib-gettext: Found 'is_IS.iso88591' as an is_IS ISO-8859-1 locale > ok 1 - setup > ok 2 - grep literal string, no -F > ok 3 - grep pcre utf-8 icase > ok 4 - grep pcre utf-8 string with "+" > ok 5 - grep literal string, with -F > ok 6 - grep string with regex, with -F > ok 7 - pickaxe -i on non-ascii > # passed all 7 test(s) > 1..7
Can any shell wizards explain this to me? With this code
BS=\\ echo ${BS}${BS}
Debian's dash returns a single backslash while bash returns two backslashes. Section 2.2.1 [1] does not say anything about one backslash (hidden behind a variable!) after escaping the following one and still eats the one after that..
[1] http://pubs.opengroup.org/onlinepubs/009604499/utilities/xcu_chap02.html
-- Duy