[Top][All Lists]

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

Re: [Help-bash] Specifying multiple index numbers in array

From: Chris Down
Subject: Re: [Help-bash] Specifying multiple index numbers in array
Date: Sat, 4 May 2013 02:07:50 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On 2013-05-03 13:54, Jerry wrote:
> Assume I have and array with 7 items.
> declare -a FOO=(zero one two three four five six)
> now, if I wanted to extract index 2 and index 4, how could I do it?
> I could use ${FOO[2]} and ${FOO[4]}; however, I wanted to do it in a
> simpler fashion, something like ${FOO[2][4]} or something similar. Is
> it possible?

Why? This seems exceptionally pointless and defies all logic I can think of.
What is your use case?

Attachment: pgpxyWSkAI3PT.pgp
Description: PGP signature

reply via email to

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