bug-bash
[Top][All Lists]
Advanced

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

Re: Backslash interpretation in brace expansion


From: Chet Ramey
Subject: Re: Backslash interpretation in brace expansion
Date: Fri, 29 Jul 2011 22:37:47 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.18) Gecko/20110616 Lightning/1.0b2 Thunderbird/3.1.11

On 7/29/11 8:54 PM, Christopher Down wrote:
> Hi,
> 
> Is backslash interpretation when being generated through brace
> expansion intended functionality? I mean sure, brace expansion happens
> first, but this seems kind of unintuitive.
> 
> $ printf '<%q>' {A..z}
> <A><B><C><D><E><F><G><H><I><J><K><L><M><N><O><P><Q><R><S><T><U><V><W><X><Y><Z><\[><''><\]><\^><_><\`><a><b><c><d><e><f><g><h><i><j><k><l><m><n><o><p><q><r><s><t><u><v><w><x><y><z>
> 
> The character between [ and ] should be 5C ($'\134'), '\'.

The relevant word, when it's returned from brace expansion, is '\'.  The
single unquoted backslash is removed by word expansion, leaving an empty
word, before the printf builtin is invoked.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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