Preferred loop structure not working in bash 4.2

Brien Dieterle briend at gmail.com
Tue Jun 7 10:48:43 MST 2016


Are you running with sh or with bash?  This post might be relevant:

http://stackoverflow.com/questions/13085253/writing-a-for-loop-in-bash-using-a-variable



On Tue, Jun 7, 2016 at 10:45 AM, Bryan O'Neal
<Bryan.ONeal at theonealandassociates.com> wrote:
> In centos7, bash 4.2, I am rejected when I try and run my preferred
> iterative loop and I don't know why it no longer likes it
>
> for (( i = ${floor}; i < ${ceiling}; i++ )); do
> things_and_stuff
> done
>
> Anyone know why?
>
> Yes I can still do
> i=${floor}
> while [[ $(( i += 1 )) -le ${ceiling} ]]; do
> things_and_stuff
> done
>
> but it doesn't help me understand why the first construct no longer
> functions.
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.phxlinux.org/mailman/listinfo/plug-discuss


More information about the PLUG-discuss mailing list