[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Negative indexes in ${arr[@]:off:length}
From: |
Greg Wooledge |
Subject: |
Re: Negative indexes in ${arr[@]:off:length} |
Date: |
Wed, 29 Jun 2011 09:01:07 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Wed, Jun 29, 2011 at 01:42:06PM +0200, Maarten Billemont wrote:
> If you expand ${arr[@]:1:2}, you get the following:
> values: [ a | b | c ]
> indexes: 0 1 2 3
> expand: [ 1 2 ] => b c
> ^ start from 1
> ^ length 2
>
> I propose we let a negative length iterate backward, so with ${arr[@]:1:-2},
> you get the following:
> values: [ a | b | c ]
> indexes: 0 1 2 3
> expand: 1 ] [ 2 => a c
> ^ start from 1
> ^ length 2
But if you're starting with element 1, why wouldn't it be "b a"?
- Negative indexes in ${arr[@]:off:length}, lhunath, 2011/06/25
- Re: Negative indexes in ${arr[@]:off:length}, Greg Wooledge, 2011/06/27
- Re: Negative indexes in ${arr[@]:off:length}, Chet Ramey, 2011/06/27
- Re: Negative indexes in ${arr[@]:off:length}, Steven W. Orr, 2011/06/27
- Re: Negative indexes in ${arr[@]:off:length}, Maarten Billemont, 2011/06/29
- Re: Negative indexes in ${arr[@]:off:length}, Maarten Billemont, 2011/06/29
- Re: Negative indexes in ${arr[@]:off:length}, Mart Frauenlob, 2011/06/29
- Re: Negative indexes in ${arr[@]:off:length}, Maarten Billemont, 2011/06/29
- Re: Negative indexes in ${arr[@]:off:length}, Mart Frauenlob, 2011/06/29
- Re: Negative indexes in ${arr[@]:off:length},
Greg Wooledge <=
- Re: Negative indexes in ${arr[@]:off:length}, Maarten Billemont, 2011/06/29
- Re: Negative indexes in ${arr[@]:off:length}, Greg Wooledge, 2011/06/30
- Re: Negative indexes in ${arr[@]:off:length}, Greg Wooledge, 2011/06/30
- Re: Negative indexes in ${arr[@]:off:length}, Maarten Billemont, 2011/06/30