bug-bash
[Top][All Lists]
Advanced

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

Re: Syntax error near unexpected token `newline' within loops


From: Eduardo Bustamante
Subject: Re: Syntax error near unexpected token `newline' within loops
Date: Mon, 24 Apr 2017 07:49:36 -0500

On Mon, Apr 24, 2017 at 7:44 AM, Greg Wooledge <address@hidden> wrote:
[...]
> The outer (( )) in the C-style for loop already create an arithmetic
> expression context.  You don't need to use $(( )) inside them.  You can
> simply write:
>
> for (( INDEX=0; INDEX<10-${#V_NAME};; INDEX++ ))

I think this is just to show the bug. i.e. these two should do the same:

address@hidden:~$ bash -c 'for (( ; $(($(:))); )); do :; done'
bash: -c: line 0: syntax error near unexpected token `newline'
bash: -c: line 0: `for (( ; $(($(:))); )); do :; done'

address@hidden:~$ bash -c 'for (( ; $((`:`)); )); do :; done'



reply via email to

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