bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Backslash missing in brace expansion


From: Eric Blake
Subject: Re: Backslash missing in brace expansion
Date: Fri, 6 Dec 2019 13:37:10 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]