title: How do you name output files using an increment after a bash file loop?
body: <p>I'm trying to treat a bunch of files (five) with an awk command and name the output files using an incrementation.
  The input files have complicated names. I know how to reuse the files' basenames to rename the outputs but I want to simplify the file names.</p>
  
  <p>this is my code:</p>
  
  <pre><code>for f in *.txt; do
      for i in {1..5}; do
          echo processing file $f
          awk '
              { if ($1=="something" &amp;&amp; ($5=="60" || $5=="61"|| $5=="62"|| $5=="63"|| $5=="64"|| $5=="65"|| $5=="66"|| $5=="67"|| $5=="68"|| $5=="69"|| $5=="70"))
              print   }' $b.txt&gt;"file_treated"$i.txt
          echo processing file $f over
      done
  done
  </code></pre>
  
  <p>I understand that the error is in the second line because what I wrote runs the second loop for each value of the first one. I want each value of the first loop to correspond to one value of the second one.</p>
  
  <p>Hope this was clear enough</p>