mirror of
https://git.sr.ht/~coasteen/dotfiles
synced 2025-11-04 14:47:38 +01:00
14 lines
354 B
Bash
Executable file
14 lines
354 B
Bash
Executable file
#!/bin/bash
|
|
day_of_month=$(date +"%d")
|
|
day_of_month=$(echo $day_of_month | sed 's/^0*//')
|
|
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
|
|
echo "${day_of_month}${suffix}"
|