-
-
Save aigarius/e7b2a798ef1dead45f93 to your computer and use it in GitHub Desktop.
One line date looper script in bash with parallelism option
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment