[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: command substitution inside parameter expansion inside "for ((;;))"
From: |
Chet Ramey |
Subject: |
Re: command substitution inside parameter expansion inside "for ((;;))" |
Date: |
Wed, 15 Nov 2017 10:28:47 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 11/15/17 5:13 AM, Stephane Chazelas wrote:
> Hello,
>
> $ bash -c 'for ((i = 0; $(echo 0); i++)); do echo x; done'
>
> (OK)
>
> $ bash -c 'for ((i = 0; ${x-`echo 0`}; i++)); do echo x; done'
>
> (OK)
>
> $ bash -c 'for ((i = 0; ${x-$(echo 0)}; i++)); do echo x; done'
> bash: -c: line 0: syntax error near unexpected token `newline'
> bash: -c: line 0: `for ((i = 0; ${x-$(echo 0)}; i++)); do echo x; done'
>
> It's the same for ${x#$(echo 0)}.
This was fixed in the devel branch at the end of April, 2017.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/