1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#!/bin/sh while true; do number=$(date +'%d') case $number in 1*)extension=th;; *1)extension=st;; *2)extension=nd;; *3)extension=rd;; *)extension=th;; esac date=$(date +"%A $(printf ${number##0}$extension) %B %Y -") echo "date|string|$date" echo "" hour=$(date +'%H') minute=$(date +'%M') second=$(expr $hour \* 3600 + $minute \* 60) sleep "$second" done