title: Bash date loop skipping Feb
body: <p>I am trying to loop through last 25 months, but my command is skipping Feb and duplicating March</p>
  <h2>Command</h2>
  <pre><code>for i in {00..25}; do for ym in $(date -d &quot;-$i month&quot; +%Y-%m); do echo ${ym}; done; done
  </code></pre>
  <h2>Output</h2>
  <pre><code>2022-04
  2022-03 
  2022-03 --this needs to be Feb
  2022-01
  2021-12
  2021-11
  2021-10
  2021-09
  2021-08
  2021-07
  2021-06
  2021-05
  2021-04
  2021-03
  2021-03 --this needs to be Feb
  2021-01
  2020-12
  2020-11
  2020-10
  2020-09
  2020-08
  2020-07
  2020-06
  2020-05
  2020-04
  2020-03
  </code></pre>
  <p>How do I modify it so it works as intended?</p>