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: Chet Ramey
Subject: Re: Backslash missing in brace expansion
Date: Fri, 6 Dec 2019 14:14:00 -0800
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.1

On 12/6/19 12:29 PM, Ilkka Virta wrote:

>>> 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
> 
> I get that with 4.4 and 'echo b{Z..a}d' too, the trailing letter seems to
> trigger it.

That's an implementation decision bash makes. What you get from the above
brace expansion is the list

bZa, b[a, b\a, b]a, b^a, b_a, b`a, baa

As I said in the previous message, the expansion code leaves a single "`"
unchanged (it always has), but throws an error when it's an unterminated
command substitution that's more than a bare backquote.


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



reply via email to

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