This commit is contained in:
Peritia 2026-02-12 15:32:45 +01:00
parent b6b87d5aed
commit 9c72a71585
3546 changed files with 18655 additions and 0 deletions

View file

@ -0,0 +1,26 @@
#!/bin/bash
# Get the day of the week, day of the month, month, and year
day_of_week=$(date +"%a")
day_of_month=$(date +"%d")
month=$(date +"%b")
year=$(date +"%Y")
# Remove leading zero from the day of the month
day_of_month=$(echo $day_of_month | sed 's/^0*//')
# Determine the ordinal suffix
if [[ $day_of_month -ge 11 && $day_of_month -le 13 ]]; then
suffix="th"
else
case $((day_of_month % 10)) in
1) suffix="st" ;;
2) suffix="nd" ;;
3) suffix="rd" ;;
*) suffix="th" ;;
esac
fi
# Output the formatted date
echo "${day_of_month}${suffix} $month $year"