Created
May 9, 2023 12:50
-
-
Save ProxyAi/2ddc1761b41ffd6753ed2f5d953c20f1 to your computer and use it in GitHub Desktop.
Revisions
-
ProxyAi created this gist
May 9, 2023 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ #!/bin/bash # Get current year and month year=$(date +%Y) month=$(date +%m) # Print month and year echo "$(date +%B\ %Y)" # Print the days of the week echo "Su Mo Tu We Th Fr Sa" # Get the first day of the month first_day=$(date -d "$year-$month-01" +%w) # Create the calendar for ((i=0; i<$first_day; i++)); do printf " " done for ((day=1; day<=31; day++)); do if (( day < 10 )); then printf " " fi if (( day == $(date +%e) && month == $(date +%m) )); then printf "\e[7m%s\e[0m " $day else printf "%s " $day fi if (( $(($day+$first_day)) % 7 == 0 )); then printf "\n" fi done printf "\n"