[NBLUG/talk] Arrays in Bash

Andrew argonaut at gmx.co.uk
Fri May 13 11:28:38 PDT 2011


Micxz wrote on Fri, 13 May 2011 09:55:09 -0700:

> You may have already looked at the abs guide. I'm not sure it
> this will work for you but there is printf check out example
> Example 27-2 (http://tldp.org/LDP/abs/html/arrays.html)

Yep. I've seen it. Whether I use echo or printf, the issue is
the same. (Actually, my finished script won't output to the
console at all.)

There are examples all over the 'Net using the form:

for i in 1 2 3...
do
  action "${ArrayName[i]}"
done

... but I've yet to find one where the variable (i) appears
*before* the square brackets, in the place of ArrayName.

A.



More information about the talk mailing list