title: How to pass a Map Data Structure as an argument to a method in a Bash Script
body: <p>I want to create a data structure Person like a Map and  want to pass it to a function in bash script. In the method I want to retrieve “Person” like Person[Name] ,Person[Age] , Person [Dept] as Mark , 10 and Finance respectively. etc. But I am not able to get and getting the output as mentioned in the comment. Need some guidance here how to that or what I am doing wrong.</p>
  
  <p>Here is the script</p>
  
  <pre><code>#!/bin/bash -e
  getValue(){
      local Person=$1
      echo Person[Name]
  }
  
  Person[Name]=”Mark”
  Person [Age]=”10”
  Person [Dept]=”Finance”
  echo ${Person[Name]}   # why is  it printing Finance.I am expecting it to be printed as Mark   
  
  getValue Person               # output is coming as Person
  getValue ${Person}         # output is coming as  Finance
  getValue  ${Person[@]} # output is coming as  Finance
  </code></pre>