init
This commit is contained in:
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
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}"
|
||||
Reference in New Issue
Block a user