Created
April 26, 2012 20:28
-
-
Save chluehr/2502805 to your computer and use it in GitHub Desktop.
Bash: Loop over dates
This file contains hidden or 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 | |
now=`date +"%Y-%m-%d" -d "05/06/2012"` | |
end=`date +"%Y-%m-%d" -d "05/23/2012"` | |
while [ "$now" != "$end" ] ; | |
do | |
now=`date +"%Y-%m-%d" -d "$now + 1 day"`; | |
echo $now | |
done |
I'm trying to run this on Mac and I get:
date: illegal time format
Any tips?
on Mac, use -v option.
$(date -v -1d +"%Y-%m-%d")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
start=$(date '+%T')$end > $ (date +%T) ]];
end=$(echo $(date --date '+1 min') | awk '{print $4}')
while [[
do
brute.py ftp_login host=202.148.32.101 user=another_ct password=slowdown
done