Posted By

mahome on 04/07/09


loop for

Versions (?)

Iterate through years and months

 / Published in: Bash

This script gives a list of year month combinations from 2006 to 2010. Also have a look at cal, if you are doing something with dates.

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

  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  

You need to login to post a comment.