title: Using arrays in a shell script
body: <p>I am trying to initialise an array in a shell script like below</p>
  
  <pre><code>declare -a testArr=( 'A' 'B' )
  </code></pre>
  
  <p>Also like below</p>
  
  <pre><code>testArr=( 'A' 'B' )
  </code></pre>
  
  <p>But in both the cases, I get the following error</p>
  
  <pre><code>shell1.sh: 1: shell1.sh: Syntax error: "(" unexpected
  </code></pre>
  
  <p>Can someone please tell me the reason for the above error?</p>