Created
July 26, 2021 18:34
-
-
Save cupracer/c31fe82f87a5a77de810d05bb6ec4fd0 to your computer and use it in GitHub Desktop.
Generate dates in Bash
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 | |
# Simple one-liner to increase and print dates. To be used in scripts. | |
# Current command starts today and prints next 100 dates. | |
# | |
# Output: | |
# 2021-07-26 | |
# 2021-07-27 | |
# 2021-07-28 | |
# ... | |
for i in $(seq 0 10); do date -d "$(date +%Y-%m-%d) $i days" +%Y-%m-%d; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment