[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: case statement with non-consecutive numbers
From: |
pauline-galea |
Subject: |
Re: case statement with non-consecutive numbers |
Date: |
Thu, 15 Apr 2021 23:17:37 +0200 |
What other options could be available besides
for ((i=1; i <= 1000; i++)); do
Perhaps using $(seq 1 2 20)
Anything else?
> Sent: Friday, April 16, 2021 at 9:10 AM
> From: "Dennis Williamson" <dennistwilliamson@gmail.com>
> To: "help-bash" <help-bash@gnu.org>
> Subject: Re: case statement with non-consecutive numbers
>
> On Thu, Apr 15, 2021, 4:04 PM Greg Wooledge <greg@wooledge.org> wrote:
>
> > 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.
> >
>
>
>
> Oops you're right.
>
> >
>
- Re: case statement with non-consecutive numbers, (continued)
- Re: case statement with non-consecutive numbers, Daniel Mills, 2021/04/15
- Re: case statement with non-consecutive numbers, Greg Wooledge, 2021/04/15
- Re: case statement with non-consecutive numbers, pauline-galea, 2021/04/15
- Re: case statement with non-consecutive numbers, Greg Wooledge, 2021/04/15
- Re: case statement with non-consecutive numbers, Greg Wooledge, 2021/04/15
- Re: case statement with non-consecutive numbers, Dennis Williamson, 2021/04/15
- Re: case statement with non-consecutive numbers, Greg Wooledge, 2021/04/15
- Re: case statement with non-consecutive numbers, Dennis Williamson, 2021/04/15
- Re: case statement with non-consecutive numbers,
pauline-galea <=
- Re: case statement with non-consecutive numbers, Dennis Williamson, 2021/04/15
- Re: case statement with non-consecutive numbers, pauline-galea, 2021/04/15
- Re: case statement with non-consecutive numbers, Dennis Williamson, 2021/04/15
- Re: case statement with non-consecutive numbers, Eli Schwartz, 2021/04/15
- Re: case statement with non-consecutive numbers, Dennis Williamson, 2021/04/15
- Re: case statement with non-consecutive numbers, Eli Schwartz, 2021/04/15
- Re: case statement with non-consecutive numbers, Dennis Williamson, 2021/04/15
- Re: case statement with non-consecutive numbers, Eli Schwartz, 2021/04/15
- Re: case statement with non-consecutive numbers, Christopher Dimech, 2021/04/15
- Re: case statement with non-consecutive numbers, Eli Schwartz, 2021/04/15