> >
> > If there is not currently a friendlier syntax for this, might I suggest:
> >
> > ${arr[-1]}
>
> What's wrong with echo [EMAIL PROTECTED]: -1} ?
>
I assume this syntax is new since 2.05b.01(1), which is what I currently have
access to. I did check the latest "what's new" before
"Poor Yorick" <[EMAIL PROTECTED]> writes:
> The syntax I'm currently using to access the last element of an array looks a
> little evil:
>
>>arr=( one two three )
>>echo ${arr[$(([EMAIL PROTECTED]))]}
At least you can leave out the $((...)) construct, this is implicit.
Andreas.
--
Andreas Sch
Poor Yorick wrote:
> The syntax I'm currently using to access the last element of an array looks a
> little evil:
>
>> arr=( one two three )
>> echo ${arr[$(([EMAIL PROTECTED]))]}
> three
>
> If there is not currently a friendlier syntax for this, might I suggest:
>
> ${arr[-1]}
What's wrong w