Associative Arrays in BASH (how to do key:value pairing without Python)

Unfortunately this only works in BASH 4.x, which is a damn shame. Older RHEL installations don't have the latest, greatest version of BASH installed. If you're an admin of RHEL4/5 machines, this might be worth trying to update, otherwise just write your automation in Python. :)

[sourcecode language="bash"]
msnow@host1 \~ $ > declare -A FOO
msnow@host1 \~ $ > i=0 ; for char in {a..z}; do foo[$char]=${i}; i=$[ $i + 1]; done
msnow@host1 \~ $ > echo ${#FOO[*]}
26
msnow@host1 \~ $ > for key in ${!FOO[*]}; do echo "$key :${FOO[$key]}"; done
a :0
b :1
c :2
d :3
e :4
f :5
g :6
h :7
i :8
j :9
k :10
l :11
m :12
n :13
o :14
p :15
q :16
r :17
s :18
t :19
u :20
v :21
w :22
x :23
y :24
z :25
[/sourcecode]