{"id":2375,"date":"2010-07-09T09:04:00","date_gmt":"2010-07-09T09:04:00","guid":{"rendered":"http:\/\/www.b.shuttle.de\/hayek\/Hayek\/Jochen\/wp\/blog-en\/2010\/07\/09\/best-practices-in-shell-script-programming-colons\/"},"modified":"2010-07-09T09:04:00","modified_gmt":"2010-07-09T09:04:00","slug":"best-practices-in-shell-script-programming-colons","status":"publish","type":"post","link":"https:\/\/wp.jochen.hayek.name\/blog-en\/2010\/07\/09\/best-practices-in-shell-script-programming-colons\/","title":{"rendered":"best practices in shell script programming \u2013 colons"},"content":{"rendered":"<p>\t\t\t\tMy snipplet for an <span><span>if\/then\/else<\/span><\/span> in shell scripts looks like this:<\/p>\n<blockquote><p>\n<span><span>if true<\/span><\/span><\/p><\/blockquote>\n<blockquote><p>\n<span><span>then :<\/span><\/span><\/p><\/blockquote>\n<blockquote><p>\n<span><span>else :<\/span><\/span><\/p><\/blockquote>\n<blockquote><p>\n<span><span>fi<\/span><\/span><\/p><\/blockquote>\n<p>The colons make that code syntactically complete, w\/o the colons you run into a syntax error. The colon is the &#8220;<a href=\"http:\/\/en.wikipedia.org\/wiki\/Null_operation\"><i>null op<\/i><\/a>&#8221; of (Bourne) shell scripting.<br \/>\nAnd the colons usually remain there for the remainder of the life of that code.<br \/>\nHave you noticed, that the youngsters, that talk about snipplets nowadays seriously think, they invented them? True, I guess, they created the term. Just the term.\t\t\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My snipplet for an if\/then\/else in shell scripts looks like this: if true then : else : fi The colons make that code syntactically complete, w\/o the colons you run into a syntax error. The colon is the &#8220;null op&#8221; of (Bourne) shell scripting. And the colons usually remain there for the remainder of the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false,"_share_on_mastodon":"0"},"categories":[666],"tags":[],"class_list":["post-2375","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paO0kP-Cj","jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/2375","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/comments?post=2375"}],"version-history":[{"count":0,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/2375\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/media?parent=2375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/categories?post=2375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/tags?post=2375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}