Re: Double substitution issue

2018-11-21 Thread Greg Wooledge
On Tue, Nov 20, 2018 at 08:16:47PM -0800, fulldec...@gmail.com wrote: > I have found a way to use double expansion, and of course this is not safe > in all contexts: > > from=1;to=3;eval echo {$from..$to} for ((i=from; i<=to; i++)); do ... done.

Re: Double substitution issue

2018-11-20 Thread fulldecent
Thank you for explaining this fine point. I have found a way to use double expansion, and of course this is not safe in all contexts: from=1;to=3;eval echo {$from..$to} Regards, Will

Re: Double substitution issue

2018-02-28 Thread William Entriken
Thank you for explaining this fine point. I have found a way to use double expansion, and of course this is not safe in all contexts: from=1;to=3;eval echo {$from..$to} Regards, Will William Entriken +1 267-738-4201 On Wed, Feb 28, 2018 at 10:03 AM, Chet Ramey wrote: > On 2/28/18 3:25

Re: Double substitution issue

2018-02-28 Thread Chet Ramey
On 2/28/18 3:25 AM, William Entriken wrote: > This behavior is different in zsh and bash, and maybe bash behavior is a > bug. > > # Test case > > touch 1 2 3 > cat > script.sh < from=1 > to=3 > ls {$from..$to} > EOL > chmod a+x script.sh > > bash ./script.sh > > zsh ./script.sh > > # Expected

Re: Double substitution issue

2018-02-28 Thread Greg Wooledge
On Wed, Feb 28, 2018 at 03:25:21AM -0500, William Entriken wrote: > from=1 > to=3 > ls {$from..$to} > Bash fails the chained substitution with: > > ls: {1..3}: No such file or directory This is simply not a feature that bash implements. Bash does the expansions in the opposite order (brace expa

Double substitution issue

2018-02-28 Thread William Entriken
This behavior is different in zsh and bash, and maybe bash behavior is a bug. # Test case touch 1 2 3 cat > script.sh <