title: find the position of an element in a list in bash
body: <p>I am using bash. I need to find the position of a given element in a list.</p>
  
  <p>I have searched for solutions but they all only check if an element exists in a list instead of finding the index.</p>
  
  <pre><code>#!/bin/bash
  
  LIST=(A B C D)
  
  # index_of_A = LIST.index('A') # which should return 0
  
  echo ${LIST[${index_of_A}]} # prints 'A'
  </code></pre>
  
  <p>Or is it impossible to do this through bash?</p>
  
  <hr>
  
  <p>EDIT: remove dash</p>