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: Martin Schulte Newsgroups: gnu.bash.bug Subject: Re: Backslash missing in brace expansion Date: Fri, 6 Dec 2019 05:53:04 +0100 Lines: 41 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> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1575607998 3010 209.51.188.17 (6 Dec 2019 04:53:18 GMT) X-Complaints-To: action@cs.stanford.edu Cc: chet.ramey@case.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org In-Reply-To: <662e2328-f331-c554-afcf-fd3819f6beab@case.edu> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Received-From: 51.15.128.4 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: <20191206055304.076d6115afa3a4f2a6a21c34@schrader-schulte.de> X-Mailman-Original-References: <20191205201157.cd481936f76d95bbdfabc73c@schrader-schulte.de> <662e2328-f331-c554-afcf-fd3819f6beab@case.edu> Xref: csiph.com gnu.bash.bug:15697 Hi Chet, hi all! On Thu, 5 Dec 2019 12:01:31 -0800 Chet Ramey wrote: > On 12/5/19 11:11 AM, Martin Schulte wrote: > > Hello, > > > > please have a look: > > > > $ uname -a > > Linux martnix4 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u2 > > (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: $ echo {Z..a} Z [ ] ^ _ ` a $ echo Z [ \ ] ^ _ ` a > Best regards, Martin