{"id":703,"date":"2017-02-19T11:59:16","date_gmt":"2017-02-19T16:59:16","guid":{"rendered":"http:\/\/www.brunerd.com\/blog\/?p=703"},"modified":"2017-10-17T23:09:30","modified_gmt":"2017-10-18T04:09:30","slug":"nothing-bash-style","status":"publish","type":"post","link":"https:\/\/www.brunerd.com\/blog\/2017\/02\/19\/nothing-bash-style\/","title":{"rendered":"Nothing (bash style)"},"content":{"rendered":"<p>The brunerd blog has been a whole lot of nothing\u00a0lately, so let&#8217;s commemorate and celebrate with\u00a0an entry\u00a0featuring the premiere of the bash tag and category&#8230; hmm, which one is more useful? We&#8217;ll find out. Now as for nothing, there&#8217;s a legit command, special <a href=\"https:\/\/www.gnu.org\/software\/bash\/manual\/html_node\/Special-Builtins.html#Special-Builtins\" target=\"_blank\" rel=\"noopener\">built-in<\/a> to do nothing in <a href=\"https:\/\/www.gnu.org\/software\/bash\/manual\/html_node\/Bourne-Shell-Builtins.html#Bourne-Shell-Builtins\" target=\"_blank\" rel=\"noopener\">bash<\/a>!<\/p>\n<h3>man page for bash command :<\/h3>\n<p style=\"padding-left: 30px;\"><strong>:<\/strong> [arguments]<\/p>\n<p style=\"padding-left: 30px;\">No effect; the command does nothing beyond expanding arguments and performing any specified redirections.\u00a0 A zero exit code is returned.<\/p>\n<p>&nbsp;<\/p>\n<p>Isn&#8217;t that lovely?\u00a0When you need to do nothing, you can call <strong>: <\/strong><br \/>\nPerhaps you are writing a script and aren&#8217;t sure what you&#8217;ll do for that if statement \u2014<\/p>\n<p><code>if [ \"${this}\" == \"that\" ]; then<br \/>\n#actually not sure what to do here, let's do nothing<br \/>\n:<br \/>\nelse<br \/>\necho \"This else, I'll do\"<br \/>\nfi<\/code><\/p>\n<p>I made a <a href=\"https:\/\/gist.github.com\/brunerd\/8474ba08520c6c53d7380325d722803e\" target=\"_blank\" rel=\"noopener\">gist here<\/a>\u00a0and I think I&#8217;ll keep making more.\u00a0I&#8217;ll feature them here\u00a0with the bash\u00a0tag, if only as an auxillary backup of my brain and to add to the collective patchwork quilt of code we all use to get our ideas off the ground, when our reach is just a hare shy of grasp\u00a0and we need a little help.<\/p>\n<p>Also in the gist was a snippet of a novel use by <a href=\"https:\/\/forums.extensis.com\/users\/kbeck\/activity\">kbeck at Extensis<\/a> in his UTC <a href=\"https:\/\/support.extensis.com\/Support\/58278\/58411\/en-US\/Article\/View\/1004\/Uninstalling-Universal-Type-Client-for-Mac-OS\/64\" target=\"_blank\" rel=\"noopener\">removal script<\/a> to use : to redirect a <a href=\"http:\/\/www.tldp.org\/LDP\/abs\/html\/here-docs.html\" target=\"_blank\" rel=\"noopener\">here document<\/a>\u00a0into itself and server as a comment block that doesn&#8217;t need # on every line to be treated as a comment \u2014<\/p>\n<p><code>: &lt;&lt;COMMENTBLOCK<\/code><\/p>\n<p><code>[ ] 2016-0324: enclose me; love me. i am a block of comments<\/code><\/p>\n<p><code>COMMENTBLOCK<\/code><\/p>\n<p>Spiffy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The brunerd blog has been a whole lot of nothing\u00a0lately, so let&#8217;s commemorate and celebrate with\u00a0an entry\u00a0featuring the premiere of the bash tag and category&#8230; hmm, which one is more useful? We&#8217;ll find out. Now as for nothing, there&#8217;s a legit command, special built-in to do nothing in bash! man page for bash command : [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,12],"tags":[20],"class_list":["post-703","post","type-post","status-publish","format-standard","hentry","category-bash","category-scripting","tag-bash"],"_links":{"self":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/comments?post=703"}],"version-history":[{"count":3,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/703\/revisions"}],"predecessor-version":[{"id":717,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/703\/revisions\/717"}],"wp:attachment":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/media?parent=703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/categories?post=703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/tags?post=703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}