help-bash
[Top][All Lists]
Advanced

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

Re: case statement with non-consecutive numbers


From: Greg Wooledge
Subject: Re: case statement with non-consecutive numbers
Date: Thu, 15 Apr 2021 17:04:00 -0400

On Thu, Apr 15, 2021 at 03:57:42PM -0500, Dennis Williamson wrote:
> On Thu, Apr 15, 2021, 3:30 PM Greg Wooledge <greg@wooledge.org> wrote:
> 
> for ((i=1; i <= 1000; i++)); do
> 
> 
> >
> You can also use complex range specifications in the conditional.
> 
> for ((i=1; i <= 1000 || (i > 2000 && i <= 3000); i++)); do

That'll abort the loop after 1000, unless something inside the loop
modifies i to jump it to 2001.



reply via email to

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