add proper error handling for all final exec calls
[hband-tools.git] / user-tools / corner_time
blobc1fc10c532893f3f261ce142afedae8d6acc28d6
1 #!/bin/bash
3 true <<EOF
4 =pod
6 =head1 NAME
8 corner_time - Place a digital clock in the upper right hand corner of the terminal
10 =cut
12 EOF
15 fmt=${1:-%H:%M:%S}
16 str=$(date +"$fmt")
18 [ -z "$COLUMNS" ] && COLUMNS=`tput cols`
20 while [ -w /proc/$$/fd/1 ]; do
21 echo -ne "\033[s\033[1;"$((COLUMNS-${#str}+1))"H$(date +"$fmt")\033[u"
22 sleep 0.25
23 done