Path: csiph.com!3.us.feeder.erje.net!feeder.erje.net!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Ilkka Virta Newsgroups: gnu.bash.bug Subject: Re: Backslash missing in brace expansion Date: Fri, 6 Dec 2019 22:29:14 +0200 Lines: 46 Approved: bug-bash@gnu.org Message-ID: References: <20191205201157.cd481936f76d95bbdfabc73c@schrader-schulte.de> <662e2328-f331-c554-afcf-fd3819f6beab@case.edu> <20191206055304.076d6115afa3a4f2a6a21c34@schrader-schulte.de> <5b5064a8-7175-42e7-1eb5-6374dee6c11e@redhat.com> <21761e28-c496-ff67-d7b7-628c9325085f@iki.fi> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1575664258 30873 209.51.188.17 (6 Dec 2019 20:30:58 GMT) X-Complaints-To: action@cs.stanford.edu Cc: chet.ramey@case.edu To: Eric Blake , Martin Schulte , bug-bash@gnu.org Envelope-to: bug-bash@gnu.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 In-Reply-To: <5b5064a8-7175-42e7-1eb5-6374dee6c11e@redhat.com> Content-Language: en-US X-SASI-RCODE: 200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; h=subject:to:cc:references:from:message-id:date:mime-version:in-reply-to:content-type:content-transfer-encoding; s=smtp; bh=D2MWWG7v3HaEIye/OCCWbXm0QoxxnAZzvH1t/tI6ie4=; b=AU70zhUmrDPVnQofQVNKh/lIHGj/GY1sJipMj35erTiySp8soGjzXsAgtuOuMF3TenU71SrG+JmhYXOVGtDddkep7Yhwzgh1ynCYLOky598btDyxGKFPp/70rppPSMy2Lzyl0yIkwA2nDqMWVhjkSCvs3Y6CSE2bSeMPxFYg5XbsywiCJ+AGB3x7pJ5rcOScCUR9I6aBiYXC6U42CPrEH1xtgfgsc+bfQx9qpjhyYhOeJFs1ZBZj/XZ3hEQjYfBSjbhiQ+binAmoxxaGRkiwXkpZEmMraXGxvg0MWAusR2LX6tbngTsQTWO8YFPzj3LHJHwlnGPm7/cwVlBlfRtFFw== X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x [fuzzy] X-Received-From: 157.24.2.213 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <21761e28-c496-ff67-d7b7-628c9325085f@iki.fi> X-Mailman-Original-References: <20191205201157.cd481936f76d95bbdfabc73c@schrader-schulte.de> <662e2328-f331-c554-afcf-fd3819f6beab@case.edu> <20191206055304.076d6115afa3a4f2a6a21c34@schrader-schulte.de> <5b5064a8-7175-42e7-1eb5-6374dee6c11e@redhat.com> Xref: csiph.com gnu.bash.bug:15704 On 6.12. 21:36, Eric Blake wrote: > On 12/5/19 10:53 PM, Martin Schulte wrote: >=20 >>>> (2019-11-11) x86_64 GNU/Linux $ echo ${BASH_VERSINFO[@]} >>>> 4 4 12 1 release x86_64-pc-linux-gnu >>>> $ set -x >>>> $ echo {Z..a} >>>> + echo Z '[' '' ']' '^' _ '`' a >>>> Z [=A0 ] ^ _ ` a >>>> >>>> It looks as if the backslash (between [ and ] in ASCII code) is >>>> missing in brace expansion. The same behaviour seems to be found in >>>> bash 5.0. >>> >>> It's an unquoted backslash, which is removed by quote removal when th= e >>> words are expanded. Look at the extra space between `[' and `]'; that= 's >>> the null argument resulting from the unquoted backslash. >> >> Yes - sure. But then I'm wondering why the unquoted backtick doesn't >> start command substitution: >=20 > It may be version dependent: >=20 > $ echo ${BASH_VERSINFO[@]} > 5 0 7 1 release x86_64-redhat-linux-gnu >=20 > $ echo b{Z..a}d > bash: bad substitution: no closing "`" in `d I get that with 4.4 and 'echo b{Z..a}d' too, the trailing letter seems=20 to trigger it. Which also doesn't seem to make sense, but one might argue that {Z..a}=20 doesn't make much sense in the first place. Seriously, is there an=20 actual use case for such a range? It doesn't seem to even generalize from that if you go beyond letters,=20 so you can't do stuff like generating all the printable ASCII characters=20 with it in Bash. --=20 Ilkka Virta / itvirta@iki.fi