Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15703

Re: Backslash missing in brace expansion

From Eric Blake <eblake@redhat.com>
Newsgroups gnu.bash.bug
Subject Re: Backslash missing in brace expansion
Date 2019-12-06 13:37 -0600
Organization Red Hat, Inc.
Message-ID <mailman.430.1575661041.1979.bug-bash@gnu.org> (permalink)
References (1 earlier) <20191205201157.cd481936f76d95bbdfabc73c@schrader-schulte.de> <662e2328-f331-c554-afcf-fd3819f6beab@case.edu> <3405.1575652983@jinx.noi.kre.to> <705b3ac8-9918-35bb-5fb6-5b8163907923@case.edu> <1144f1e4-e5ca-71e9-583c-fe2da919378c@redhat.com>

Show all headers | View raw


On 12/6/19 11:27 AM, Chet Ramey wrote:
> On 12/6/19 9:23 AM, Robert Elz wrote:
> 
>> I'm not sure I accept the explanation for the \ missing though, quoting is
>> also a parser activity (though some of it also happens in pattern matching).
>> But normally, backslashes (or any other form of quoting) that result from
>> expansions are simply characters.   Quote removal is only supposed to remove
>> quotes that were present on the original command line.
> 
> Quote removal is a word expansion, and removes quotes that were present in
> the original word passed to word expansion. Brace expansion is performed
> before any of the POSIX word expansions, and is logically a separate step.

Then that argues that {Z..a} should produce \\ and \', rather than bare 
characters, so that the subsequent quote removal gets back to the 
intended character.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Backslash missing in brace expansion Eric Blake <eblake@redhat.com> - 2019-12-06 13:37 -0600

csiph-web