{"id":403,"date":"2015-01-27T20:42:51","date_gmt":"2015-01-27T15:12:51","guid":{"rendered":"http:\/\/www.cyberaka.com\/?p=403"},"modified":"2015-01-27T20:54:28","modified_gmt":"2015-01-27T15:24:28","slug":"showing-a-running-clock-in-a-linux-shell","status":"publish","type":"post","link":"https:\/\/www.cyberaka.com\/?p=403","title":{"rendered":"Showing a running clock in a linux shell"},"content":{"rendered":"<p>I was working with a scheduler and wanted to keep track of my server time. Continuous invocation of date command wouldn&#8217;t cut it. So a little search on net lead me to <a title=\"Ask Ubuntu Link\" href=\"http:\/\/askubuntu.com\/questions\/360063\/how-to-show-a-running-clock-in-terminal-before-the-command-prompt\">this link<\/a> which basically sums up the following script. This script will show the current time on the top left corner of your terminal which is good enough for my usecase.<\/p>\n<p><code><br \/>\nwhile sleep 1;do tput sc;tput cup 0 $(($(tput cols)-11));echo -e \"\\e[31m`date +%r`\\e[39m\";tput rc;done &amp;<br \/>\n<\/code><\/p>\n<p>I executed this code on a Cent OS system and it worked fine. I have tested this snippet in Debian as well and it worked like a charm. This won&#8217;t solve everybody&#8217;s problem but for specific situation where you just want to watch the clock of your server from a shell this is a good enough script.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was working with a scheduler and wanted to keep track of my server time. Continuous invocation of date command wouldn&#8217;t cut it. So a little search on net lead me to this link which basically sums up the following script. This script will show the current time on the top left corner of your [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,24],"tags":[],"class_list":["post-403","post","type-post","status-publish","format-standard","hentry","category-linux-os","category-tips-and-tricks"],"_links":{"self":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=403"}],"version-history":[{"count":3,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/403\/revisions"}],"predecessor-version":[{"id":413,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/403\/revisions\/413"}],"wp:attachment":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}