{"id":308,"date":"2017-12-06T04:08:36","date_gmt":"2017-12-06T04:08:36","guid":{"rendered":"http:\/\/info.juliusgoh.life\/?p=308"},"modified":"2018-01-09T04:56:44","modified_gmt":"2018-01-09T04:56:44","slug":"linux-replace-command-line","status":"publish","type":"post","link":"https:\/\/info.juliusgoh.life\/?p=308","title":{"rendered":"Linux Looping Command Line"},"content":{"rendered":"<pre>\r\nwhile (true);\r\ndo  \r\ndate; \r\nps -eaf | grep httpd | wc -l; \r\nsleep 1;\r\necho -e \"\\e[3A\\r\"; \r\ndone;\r\n<\/pre>\n<p>So let me explain the code above<br \/>\nSo basically its looping a bunch of code , and this script is to grep total count of httpd worker and printing it over and over every second.<br \/>\nSo what you can do is , <\/p>\n<pre>while (true); do something; done;<\/pre>\n<p>There you have it , you can put your own command line to loop it<\/p>\n","protected":false},"excerpt":{"rendered":"<p>while (true); do date; ps -eaf | grep httpd | wc -l; sleep 1; echo -e &#8220;\\e[3A\\r&#8221;; done; So let me explain the code above So basically its looping a bunch of code , and this script is to grep total count of httpd worker and printing it over and over every second. So what [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":214,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=\/wp\/v2\/posts\/308"}],"collection":[{"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=308"}],"version-history":[{"count":4,"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=\/wp\/v2\/posts\/308\/revisions"}],"predecessor-version":[{"id":312,"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=\/wp\/v2\/posts\/308\/revisions\/312"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=\/wp\/v2\/media\/214"}],"wp:attachment":[{"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/info.juliusgoh.life\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}