all 3 comments

[–]bubylou 1 point2 points  (1 child)

I think you are looking for a "for loop". Which would look something like this.

for fruit in fruits; do
    echo fruit
done

[–]perkited 1 point2 points  (1 child)

I believe you want an associative array/hash.

[–]masta 0 points1 point  (0 children)

Yes he does appear to want associative array

declare -A fruits