title: Elegant use of arrays in ksh
body: <p>I'm trying build an sort of property set in ksh.</p>
  
  <p>Thought the easiest way to do so was using arrays but the syntax is killing me.</p>
  
  <p>What I want is to</p>
  
  <ol>
  <li>Build an arbitrary sized array in a config file with a name and a property.</li>
  <li>Iterate for each item in that list and get that property.</li>
  </ol>
  
  <p>I theory what I wish I could do is something like</p>
  
  <pre><code>MONITORINGSYS={
      SYS1={NAME="GENERATOR" MONITORFUNC="getGeneratorStatus"}
      SYS2={NAME="COOLER" MONITORFUNC="getCoolerStatus"}
  }
  </code></pre>
  
  <p>Then later on, be able to do something like:</p>
  
  <pre><code>for CURSYS in $MONITORINGSYS
  do
      CSYSNAME=$CURSYS.NAME
      CSYSFUNC=$CURSYS.MONITORFUNC
  
      REPORT="$REPORT\n$CSYSNAME"
  
      CSYSSTATUS=CSYSFUNC $(date)
      REPORT="$REPORT\t$CSYSSTATUS"
  done
  echo $REPORT
  </code></pre>
  
  <p>Well, that's not real programming, but I guess you got the point..</p>
  
  <p>How do I do that?</p>
  
  <p><strong>[EDIT]</strong></p>
  
  <p>I do not mean I want to use associative arrays. I only put this way to make my question more clear... I.e. It would not be a problem if the loop was something like:</p>
  
  <pre><code>for CURSYS in $MONITORINGSYS
  do
      CSYSNAME=${CURSYS[0]}
      CSYSFUNC=${CURSYS[1]}
  
      REPORT="$REPORT\n$CSYSNAME"
  
      CSYSSTATUS=CSYSFUNC $(date)
      REPORT="$REPORT\t$CSYSSTATUS"
  done
  echo $REPORT
  </code></pre>
  
  <p>Same applies to the config file.. I'm just looking for a syntax that makes it minimally readable.</p>
  
  <p>cheers</p>