bug-bash
[Top][All Lists]
Advanced

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

Re: Brace expansion ordering vs. parameter expansion


From: Chet Ramey
Subject: Re: Brace expansion ordering vs. parameter expansion
Date: Thu, 29 Apr 2021 14:27:42 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1

On 4/29/21 12:59 PM, Tom (AST) Watson wrote:
All...

I've resigned to having it the way it is, but I note that the solution doesn't 
need the backslash escape:
[tsw@box6 ~]$ k=10
[tsw@box6 ~]$ eval echo {1..$k}
1 2 3 4 5 6 7 8 9 10

This one doesn't, but putting in the slash skips the first brace
expansion entirely, instead of relying on the degenerate brace expansion
to be left unchanged, so it's safer in general.

--
``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]