script for date with ordinal suffixes

This commit is contained in:
Siren 2024-12-22 22:34:55 +01:00
parent 52a42447ca
commit d737c49900

View file

@ -0,0 +1,10 @@
#!/bin/sh
DaySuffix() {
case `date +%e` in
1|21|31) echo "st";;
2|22) echo "nd";;
3|23) echo "rd";;
*) echo "th";;
esac
}
date "+%A, %e`DaySuffix` %B %Y"