Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Extract Period (Month)
- extract_period=5
- base_date=`date +"%Y-%m-01"`
- # Date Generation Loop
- for i in `seq ${extract_period} -1 1`
- do
- start_date=`date -d "$base_date $i month ago" +"%Y-%m-01T00:00"`
- j=`expr $i - 1`
- end_date=`date -d "$base_date $j month ago" +"%Y-%m-01T00:00"`
- echo $start_date - $end_date
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement