Skip to content

Instantly share code, notes, and snippets.

@aigarius
aigarius / date_loop.sh
Last active August 29, 2015 14:20 — forked from chluehr/date_loop.sh
One line date looper script in bash with parallelism option
#!/bin/bash
start="2012-01-20" end="2012-03-02" now=$start; while [ "$now" != "$end" ]; do now=`date +"%Y-%m-%d" -d "$now + 1 day"`; echo $now ;done
sh -c 'start="2012-01-20" end="2012-03-02" now=$start; while [ "$now" != "$end" ]; do now=`date +"%Y-%m-%d" -d "$now + 1 day"`; echo $now ;done' | xargs -n 1 -P 5 -i echo {}