Iterate through years and months


/ Published in: Bash
Save to your folder(s)

This script gives a list of year month combinations from 2006 to 2010.
Also have a look at [cal](http://en.wikipedia.org/wiki/Cal_(Unix)), if you are doing something with dates.

Tags: seq, year, month, bash, loop, for


Copy this code and paste it in your HTML
  1. for year in `seq 2006 2010`
  2. do
  3. for month in `seq 1 12`
  4. do
  5. echo $year $month
  6. done
  7. done

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.