brøkur (486B)
1 #!/bin/sh 2 3 m="$(date '+%_M' | tr -d ' ')" 4 5 if [ $m -lt "5" ]; then 6 M="" 7 elif [ $m -lt "13" ]; then 8 M="⅙" 9 elif [ $m -lt "18" ]; then 10 M="¼" 11 elif [ $m -lt "25" ]; then 12 M="⅓" 13 elif [ $m -lt "35" ]; then 14 M="½" 15 elif [ $m -lt "43" ]; then 16 M="⅓" 17 elif [ $m -lt "48" ]; then 18 M="¼" 19 elif [ $m -lt "55" ]; then 20 M="⅙" 21 else 22 M="" 23 fi 24 25 if [ $m -gt "24" ]; then 26 h="$(date -d "1 hour" '+%_I' | tr -d ' ')" 27 echo "$M$h" 28 else 29 h="$(date '+%_I' | tr -d ' ')" 30 echo "$h$M" 31 fi 32