title: Passing  array to function of shell script
body: <p>How to pass array as function in shell script?<br>
  I written following code:</p>
  
  <pre><code>function test(){
  param1 = $1
  param2 = $2
  for i in ${$param1[@]}
  do
     for j in ${param2[@]}
  do
         if($(i) = $(j) )
             then
             echo $(i)
             echo $(j)
         fi
  done
  done
  }
  </code></pre>
  
  <p>but I am getting <code>line 1: ${$(param1)[@]}: bad substitution</code></p>