title: How to replace all matches with an incrementing number in BASH?
body: <p>I have a text file like this:</p>
  
  <pre><code>AAAAAA this is some content.
  This is AAAAAA some more content AAAAAA. AAAAAA
  This is yet AAAAAA some more [AAAAAA] content.
  </code></pre>
  
  <p>I need to replace all occurrence of <code>AAAAAA</code> with an incremented number, e.g., the output would look like this:</p>
  
  <pre><code>1 this is some content.
  This is 2 some more content 3. 4
  This is yet 5 some more [6] content.
  </code></pre>
  
  <p>How can I replace all of the matches with an incrementing number?</p>