Created
March 7, 2024 10:31
-
-
Save dwainm/f72dc1754b49949aad0a11e7dd02cb93 to your computer and use it in GitHub Desktop.
bash script for printing out a list weeks in format (month dd[mon] - month dd[fri])
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
function upcommingCalendarWeeks(){ | |
for ((j = 1 ; j < 52 ; j++)); do | |
mondayMonth=$(date -v-Sun -v+${j}w -v+Mon "+%b") | |
mon=$(date -v-Sun -v+${j}w -v+Mon "+%d") | |
fridayMonth=$(date -v-Sun -v+${j}w -v+Fri "+%b") | |
fri=$(date -v-Sun -v+${j}w -v+Fri "+%d") | |
echo "$mondayMonth $mon - $fridayMonth $fri" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment