{"id":38,"date":"2013-03-04T00:02:23","date_gmt":"2013-03-03T22:02:23","guid":{"rendered":"http:\/\/gronlier.fr\/blog\/?p=38"},"modified":"2014-03-16T09:24:08","modified_gmt":"2014-03-16T07:24:08","slug":"pretty-check","status":"publish","type":"post","link":"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/","title":{"rendered":"Pretty Check"},"content":{"rendered":"<p>Demo<br \/>\n<a href=\"http:\/\/gronlier.fr\/blog\/wp-content\/uploads\/2014\/03\/prettycheck.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-40\" alt=\"prettycheck\" src=\"http:\/\/gronlier.fr\/blog\/wp-content\/uploads\/2014\/03\/prettycheck.jpg\" width=\"749\" height=\"101\" srcset=\"https:\/\/gronlier.fr\/blog\/wp-content\/uploads\/2014\/03\/prettycheck.jpg 749w, https:\/\/gronlier.fr\/blog\/wp-content\/uploads\/2014\/03\/prettycheck-300x40.jpg 300w\" sizes=\"(max-width: 749px) 100vw, 749px\" \/><\/a><\/p>\n<p>Code<\/p>\n<pre class=\"decode-attributes:false lang:default decode:true crayon-selected\">#!\/bin\/sh\r\n\r\nfunction prettycheck {\r\n    local TPUT='tput'\r\n    local RED='1'\r\n    local GREEN='2'\r\n    local BLUE='4'\r\n#man 5 terminfo\r\n\r\n    [ ! -f $(which $TPUT) ] &amp;&amp; TPUT=true\r\n\r\n    cmd=\"$@\"\r\n    echo \"$&gt; $cmd\"\r\n    $TPUT cuf $((`$TPUT cols` - 8)) # move the end-of-line minus 8 cols\r\n    $TPUT cuu 1 # move on line up\r\n    msgerr=$($cmd 2&gt;&amp;1 1&gt; \/dev\/null)\r\n    if [ \"$?\" -ne 0 ]; then\r\n        $TPUT setaf $RED # change front color\r\n        echo \"[FAILED]\"\r\n        $TPUT setaf $BLUE # change front color\r\n        echo \"$msgerr\"\r\n    else\r\n        $TPUT setaf $GREEN # change front color\r\n        echo \"[  OK  ]\"                                                                                   \r\n    fi                                                                                                    \r\n    $TPUT reset                                                                                           \r\n}<\/pre>\n<div class='skype-share' data-href='https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/' data-lang='auto' data-style='large' data-source='WordPress' ><\/div><div style='clear:both;padding-bottom:10px;'><\/div>\n<div class=\"twitter-share\"><a href=\"https:\/\/twitter.com\/intent\/tweet?via=ticapix\" class=\"twitter-share-button\">Tweet<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Demo Code #!\/bin\/sh function prettycheck { local TPUT='tput' local RED='1' local GREEN='2' local BLUE='4' #man 5 terminfo [ ! -f $(which $TPUT) ] &amp;&amp; TPUT=true cmd=\"$@\" echo \"$&gt; $cmd\" $TPUT cuf $((`$TPUT cols` - 8)) # move the end-of-line minus 8 cols $TPUT cuu 1 # move on line up msgerr=$($cmd 2&gt;&amp;1 1&gt; \/dev\/null) if &hellip; <a href=\"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Pretty Check<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3,10],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Pretty Check - Bits and Bytes<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pretty Check - Bits and Bytes\" \/>\n<meta property=\"og:description\" content=\"Demo Code #!\/bin\/sh function prettycheck { local TPUT=&#039;tput&#039; local RED=&#039;1&#039; local GREEN=&#039;2&#039; local BLUE=&#039;4&#039; #man 5 terminfo [ ! -f $(which $TPUT) ] &amp;&amp; TPUT=true cmd=&quot;$@&quot; echo &quot;$&gt; $cmd&quot; $TPUT cuf $((`$TPUT cols` - 8)) # move the end-of-line minus 8 cols $TPUT cuu 1 # move on line up msgerr=$($cmd 2&gt;&amp;1 1&gt; \/dev\/null) if &hellip; Continue reading Pretty Check &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/\" \/>\n<meta property=\"og:site_name\" content=\"Bits and Bytes\" \/>\n<meta property=\"article:published_time\" content=\"2013-03-03T22:02:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-03-16T07:24:08+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/gronlier.fr\/blog\/wp-content\/uploads\/2014\/03\/prettycheck.jpg\" \/>\n<meta name=\"author\" content=\"ticapix\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ticapix\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/\",\"url\":\"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/\",\"name\":\"Pretty Check - Bits and Bytes\",\"isPartOf\":{\"@id\":\"https:\/\/gronlier.fr\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/gronlier.fr\/blog\/wp-content\/uploads\/2014\/03\/prettycheck.jpg\",\"datePublished\":\"2013-03-03T22:02:23+00:00\",\"dateModified\":\"2014-03-16T07:24:08+00:00\",\"author\":{\"@id\":\"https:\/\/gronlier.fr\/blog\/#\/schema\/person\/9abd8d0260a4d942d7069de75446e2bc\"},\"breadcrumb\":{\"@id\":\"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/#primaryimage\",\"url\":\"http:\/\/gronlier.fr\/blog\/wp-content\/uploads\/2014\/03\/prettycheck.jpg\",\"contentUrl\":\"http:\/\/gronlier.fr\/blog\/wp-content\/uploads\/2014\/03\/prettycheck.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/gronlier.fr\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Pretty Check\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/gronlier.fr\/blog\/#website\",\"url\":\"https:\/\/gronlier.fr\/blog\/\",\"name\":\"Bits and Bytes\",\"description\":\"As the default template said: &quot;Just another WordPress site&quot;\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/gronlier.fr\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/gronlier.fr\/blog\/#\/schema\/person\/9abd8d0260a4d942d7069de75446e2bc\",\"name\":\"ticapix\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gronlier.fr\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/94bba7228ec3665afea02078abebfa94?s=96&d=monsterid&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/94bba7228ec3665afea02078abebfa94?s=96&d=monsterid&r=g\",\"caption\":\"ticapix\"},\"url\":\"https:\/\/gronlier.fr\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Pretty Check - Bits and Bytes","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/","og_locale":"en_US","og_type":"article","og_title":"Pretty Check - Bits and Bytes","og_description":"Demo Code #!\/bin\/sh function prettycheck { local TPUT='tput' local RED='1' local GREEN='2' local BLUE='4' #man 5 terminfo [ ! -f $(which $TPUT) ] &amp;&amp; TPUT=true cmd=\"$@\" echo \"$&gt; $cmd\" $TPUT cuf $((`$TPUT cols` - 8)) # move the end-of-line minus 8 cols $TPUT cuu 1 # move on line up msgerr=$($cmd 2&gt;&amp;1 1&gt; \/dev\/null) if &hellip; Continue reading Pretty Check &rarr;","og_url":"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/","og_site_name":"Bits and Bytes","article_published_time":"2013-03-03T22:02:23+00:00","article_modified_time":"2014-03-16T07:24:08+00:00","og_image":[{"url":"http:\/\/gronlier.fr\/blog\/wp-content\/uploads\/2014\/03\/prettycheck.jpg"}],"author":"ticapix","twitter_card":"summary_large_image","twitter_misc":{"Written by":"ticapix"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/","url":"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/","name":"Pretty Check - Bits and Bytes","isPartOf":{"@id":"https:\/\/gronlier.fr\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/#primaryimage"},"image":{"@id":"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/#primaryimage"},"thumbnailUrl":"http:\/\/gronlier.fr\/blog\/wp-content\/uploads\/2014\/03\/prettycheck.jpg","datePublished":"2013-03-03T22:02:23+00:00","dateModified":"2014-03-16T07:24:08+00:00","author":{"@id":"https:\/\/gronlier.fr\/blog\/#\/schema\/person\/9abd8d0260a4d942d7069de75446e2bc"},"breadcrumb":{"@id":"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/#primaryimage","url":"http:\/\/gronlier.fr\/blog\/wp-content\/uploads\/2014\/03\/prettycheck.jpg","contentUrl":"http:\/\/gronlier.fr\/blog\/wp-content\/uploads\/2014\/03\/prettycheck.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/gronlier.fr\/blog\/2013\/03\/pretty-check\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gronlier.fr\/blog\/"},{"@type":"ListItem","position":2,"name":"Pretty Check"}]},{"@type":"WebSite","@id":"https:\/\/gronlier.fr\/blog\/#website","url":"https:\/\/gronlier.fr\/blog\/","name":"Bits and Bytes","description":"As the default template said: &quot;Just another WordPress site&quot;","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gronlier.fr\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/gronlier.fr\/blog\/#\/schema\/person\/9abd8d0260a4d942d7069de75446e2bc","name":"ticapix","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gronlier.fr\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/94bba7228ec3665afea02078abebfa94?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/94bba7228ec3665afea02078abebfa94?s=96&d=monsterid&r=g","caption":"ticapix"},"url":"https:\/\/gronlier.fr\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/gronlier.fr\/blog\/wp-json\/wp\/v2\/posts\/38"}],"collection":[{"href":"https:\/\/gronlier.fr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gronlier.fr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gronlier.fr\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gronlier.fr\/blog\/wp-json\/wp\/v2\/comments?post=38"}],"version-history":[{"count":5,"href":"https:\/\/gronlier.fr\/blog\/wp-json\/wp\/v2\/posts\/38\/revisions"}],"predecessor-version":[{"id":76,"href":"https:\/\/gronlier.fr\/blog\/wp-json\/wp\/v2\/posts\/38\/revisions\/76"}],"wp:attachment":[{"href":"https:\/\/gronlier.fr\/blog\/wp-json\/wp\/v2\/media?parent=38"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gronlier.fr\/blog\/wp-json\/wp\/v2\/categories?post=38"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gronlier.fr\/blog\/wp-json\/wp\/v2\/tags?post=38"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}