Tuesday, March 29, 2011

Digital CLOCK on your Screen Using Unix


echo
echo "Digital Clock for unix"
echo "To stop this clock use command kill pid see above for pid"
echo "Press a key to continue. . ."

while :
do
    ti=`date +"%r"`     
    echo -e -n "\033[7s"    
#save current screen postion & attributes

    tput cup 0 69         
# row 0 and column69 is used to show clock


    echo -n $ti           
# put clock on screen

    echo -e -n "\033[8u"   
#restore current screen postion & attributs

    sleep 1
done


7 comments:

  1. It was very nice article and it is very useful to Linux learners.We also provide Linux online training

    ReplyDelete
  2. This clock is stop by the ctrl+z or ctrl+c....but I want to stop this clock when user press ctrl+c and not close or stop by any key...it is possible?

    ReplyDelete
  3. This clock is stop by the ctrl+z or ctrl+c....but I want to stop this clock when user press ctrl+c and not close or stop by any key...it is possible?

    ReplyDelete
  4. Hi,

    Thanks for this post! I’m still a learner on Unix shell scripting. This info seems to be really helpful. Thanks again!

    Thanks & Regards
    A. Sarika

    ReplyDelete
  5. Hi,

    Thanks for this post! I’m still a learner on Unix shell scripting. This info seems to be really helpful. Thanks again!

    Thanks & Regards
    Elena Lauren

    ReplyDelete
  6. What a great article, I really appreciate your hard work. Thanks for sharing with us. Shell Scripting Training in Pune

    ReplyDelete
  7. This comment has been removed by a blog administrator.

    ReplyDelete