title: Bash two dimensional arrays
body: <p>:) well i want to read line and save first and second column from file.o And i want to save it into two dimensional array in bash. Filtration is ok its doing the right think. BUT i dont know how to check if the array is empty ( i mean that it saved nothing to that array so its all from the file) . Secondly im getting error on FUNCTION and RELIANCE that command was not found and again echo is not working, tried to google everything but it seems that no one is working with two indexed dimensional arrays. Ty for any tip!</p>
  
  <pre><code>#!/bin/bash
  declare -a NAMES
  declare -a FUNCTION
  declare -a RELIANCE
  index=1
  index1=1
  for a in file.o 
  do
    NAMES[$index]=$a  
    until [ nm file.o | grep -o '[UTBGCD].*' | awk '{print $2}' | awk "NR==$index1" -eq 0 ]
    do 
      FUNCTION[$index][$index1]=$( nm file.o | grep -o '[UTBGCD].*' | awk '{print $2}' | awk "NR==$index1" )
      RELIANCE[$index][$index1]=$( nm filea.o | grep -o '[UTBGCD].*' | awk '{print $1}' | awk "NR==$index1" )
      echo ${FUNCTION[$index][$index1]} 
      index1=$((index1+1))  
    done
    index=$((index+1)) 
  done
  </code></pre>