title: UNIX script - print line of array based on contents of location (regex)
body: <p>I am using KornShell Scripting and I am splitting a file into an array</p>
  
  <pre><code>set -A fileArray $(&lt; ${BTEQLOG} )
  </code></pre>
  
  <p>The array contains elements like this:</p>
  
  <p>{RUN_ID, OPERATOR_ID, CYCLE_DES, PROJECTION_PROJECT_NME, ROW_CREATE_TSP, STATUS_DES, 195777, req82565, NII, 2016, -, ... }</p>
  
  <p>I need to use the element(s) that match the pattern of {6}[0-9], like 195777 above.  I thought about checking to see if it is a number as below,</p>
  
  <pre><code>for l in ${fileArray[@]}
  do
    echo $l
    if [[ $l -gt 10000 ]]; then
      echo $l
    fi
  done
  </code></pre>
  
  <p>but all I got back was a <code>RUN_ID: bad number</code> error. </p>
  
  <p>Is there a way to use regular expression to get what I want? The way I have it above may work, but I would prefer a regex to use just that instance.  </p>
  
  <p>I did try this:</p>
  
  <pre><code>typeset -i line=$l  
      if [[ $line = {6}[0-9] ]]; then
          echo $line;
      fi
  </code></pre>
  
  <p>but ran into the same <code>bad number</code> error from above.</p>