Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu'
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPAC
On 29.06.2011 18:31, Maarten Billemont wrote:
On 29 Jun 2011, at 14:05, Mart Frauenlob wrote:
On 29.06.2011 13:42, Maarten Billemont wrote:
On 27 Jun 2011, at 16:25, Chet Ramey wrote:
[...]
Exactly, let's draw the array in the example:
arr=(a b c)
values: [ a | b | c ]
indexes: 0 1 2
On 29 Jun 2011, at 15:01, Greg Wooledge wrote:
>
> 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
>>
On 29 Jun 2011, at 14:05, Mart Frauenlob wrote:
>
> On 29.06.2011 13:42, Maarten Billemont wrote:
>> On 27 Jun 2011, at 16:25, Chet Ramey wrote:
>>>
> [...]
>> Exactly, let's draw the array in the example:
>>
>> arr=(a b c)
>> values: [ a | b | c ]
>> indexes: 0 1 2 3
>>
> [...]
>
> 4 m
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 len
On 29.06.2011 13:42, Maarten Billemont wrote:
On 27 Jun 2011, at 16:25, Chet Ramey wrote:
[...]
Exactly, let's draw the array in the example:
arr=(a b c)
values: [ a | b | c ]
indexes: 0 1 2 3
[...]
4 members?
$ arr=(a b c)
$ for x in 0 1 2 3; do printf "<%s>\n" "${arr[x]}"; done
> Since ${arr[-1]} already does exactly this, I figure it would merely add to
> the syntax' consistency.
Consider the fact that ${arr[x]} is in fact the equivalent of ${arr[@]:x:1}.
On 27 Jun 2011, at 16:25, Chet Ramey wrote:
>
>> I don't even understand what the second one is supposed to mean at
>> all -- the :1: means to start with "b" and the -2 means to go back 2
>> elements...? How do you derive "a c" from any possible interpretation
>> of this?
>
> I assume that he wa