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: Eric Blake Newsgroups: gnu.bash.bug Subject: Re: Backslash missing in brace expansion Date: Fri, 6 Dec 2019 13:36:27 -0600 Organization: Red Hat, Inc. Lines: 34 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> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1575660998 28489 209.51.188.17 (6 Dec 2019 19:36:38 GMT) X-Complaints-To: action@cs.stanford.edu Cc: chet.ramey@case.edu To: Martin Schulte , bug-bash@gnu.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575660991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jLxhgWfnXY9+2DbllFZvzKIZAioQN5yFEGuvz0IfKsU=; b=ahzeKbiftk8IXVkMznd8zbzglIPNCUUciYKP6LD8Q4JxXc5OWGmqHggbRJYRTjAcEamJX6 wQqvmiTBMLHQogIN8H8YOR4tXoZ82XcAl9NCgy/+jEbxpcPBKiEdfOnZlZKyVdOEdYQ7Ts 8Ds+vD2hSrLs34GAxTZKbeEvXE1wqII= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 In-Reply-To: <20191206055304.076d6115afa3a4f2a6a21c34@schrader-schulte.de> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: bISR_HBmO3qF85BzKu_n1g-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 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: <5b5064a8-7175-42e7-1eb5-6374dee6c11e@redhat.com> X-Mailman-Original-References: <20191205201157.cd481936f76d95bbdfabc73c@schrader-schulte.de> <662e2328-f331-c554-afcf-fd3819f6beab@case.edu> <20191206055304.076d6115afa3a4f2a6a21c34@schrader-schulte.de> Xref: csiph.com gnu.bash.bug:15702 On 12/5/19 10:53 PM, Martin Schulte wrote: >>> (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 [ ] ^ _ ` 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 the >> 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: It may be version dependent: $ echo ${BASH_VERSINFO[@]} 5 0 7 1 release x86_64-redhat-linux-gnu $ echo b{Z..a}d bash: bad substitution: no closing "`" in `d -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org