I realize I could whip up a little C or Ruby program to do this, but I want my script to have as few dependencies as possible.
Given that caveat, how does one d
Here is a script that I use to print the dates for my journal in google doc's:
#!/bin/bash
# ask user for variable details
read -p 'Starting date in "mm-dd-yyyy" format: ' DATE
# adjust the count by editing the "x" number in {0..x}
# 91 days will give you about 3 months, currently set to 6 for testing
# %a gives short day of the week, -m -d gives single digit months and days, capital Y gives 4 digit year
for i in {0..6}
do
NEXT_DATE=$(date -j -f %m-%d-%Y -v+"$i"d $DATE +'%a %-m/%-d/%y')
echo -e "$NEXT_DATE\n\n\n"
done
Here is the sample output, (I use 3 new lines between each date):
Sun 4/1/18
Mon 4/2/18
Tue 4/3/18
Wed 4/4/18
Thu 4/5/18
Fri 4/6/18
Sat 4/7/18