help-bash
[Top][All Lists]
Advanced

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

[Help-bash] Specifying multiple index numbers in array


From: Jerry
Subject: [Help-bash] Specifying multiple index numbers in array
Date: Fri, 3 May 2013 13:54:42 -0400

I thought I saw a way to do this; however, I cannot find that article.

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?

-- 
Jerry ♔

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__________________________________________________________________



reply via email to

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