Clock in terminal

Here’s a little bash code that adds a clock to the upper right part of your terminal…


clock() {
while sleep 1;
do 
   tput sc;
   tput cup 0 $(($(tput cols)-29));
   echo -n " $(date)";
   tput rc;
done &;
}

Leave a Reply