I want to use the values of one array to point to values in another, but I can't figure it out. I think this is very basic. I'd like the file to yield one line associated with each of x, y, z as follows: x XValue, y Yvalue, Z Zvalue but I just get the first line.
#! /bin/bash
declare -a id
declare -A header
id=( x y z )
header[x]="X Value"
header[y]="Y Value"
header[z]="Z Value"
for ident in $id
do
echo $ident ${header[${ident}]}
done
$id
to"${id[@]}"
.