{"id":8473,"date":"2005-01-13T14:08:07","date_gmt":"2005-01-13T12:08:07","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/2005\/01\/13\/working-more-productively-with-bash-2x3x\/"},"modified":"2005-04-17T07:54:02","modified_gmt":"2005-04-17T04:54:02","slug":"working-more-productively-with-bash-2x3x","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2005\/01\/13\/working-more-productively-with-bash-2x3x\/","title":{"rendered":"Working more productively with bash 2.x\/3.x"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p><a href=\"http:\/\/www.caliban.org\/bash\/\">This article<\/a> is a must read for anyone who is using Bash shell.  There are still probably a thing or two that you didn&#8217;t know.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>This article is a must read for anyone who is using Bash shell. There are still probably a thing or two that you didn&#8217;t know.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":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},"_links_to":"","_links_to_target":""},"categories":[1,18,62],"tags":[1960],"keyring_services":[],"class_list":["post-8473","post","type-post","status-publish","format-standard","hentry","category-general","category-programming","category-technology","tag-command-line"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":26383,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/08\/30\/troubleshooting-with-devtcp-and-devudp\/","url_meta":{"origin":8473,"position":0},"title":"Troubleshooting with \/dev\/tcp and \/dev\/udp","author":"Leonid Mamchenkov","date":"August 30, 2016","format":false,"excerpt":"Imagine you are on a freshly installed Linux machine with the minimal set of packages, and you need to test network connectivity. \u00a0You don't have netcat, telnet, and your other usual tools. \u00a0For the sake of the example, imagine that even curl and wget are missing. \u00a0What do you do?\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27447,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/03\/22\/bulletproof-bash-stop-script-on-error\/","url_meta":{"origin":8473,"position":1},"title":"Bulletproof Bash : Stop script on error","author":"Leonid Mamchenkov","date":"March 22, 2017","format":false,"excerpt":"The other day I've been puzzled by the results of a cron job script. \u00a0The bash script in question was written in a hurry a while back, and I was under the assumption that if any of its steps fail, the whole script will fail. \u00a0I was wrong. \u00a0Some commands\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":16720,"url":"https:\/\/mamchenkov.net\/wordpress\/2012\/09\/18\/bash-redirections-cheat-sheet\/","url_meta":{"origin":8473,"position":2},"title":"Bash Redirections Cheat Sheet","author":"Leonid Mamchenkov","date":"September 18, 2012","format":"link","excerpt":"Bash Redirections Cheat Sheet Even the experienced bash users will probably find a couple of new things in this cheat sheet.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9014,"url":"https:\/\/mamchenkov.net\/wordpress\/2005\/05\/27\/handling-arguments-with-spaces-in-bash\/","url_meta":{"origin":8473,"position":3},"title":"Handling arguments with spaces in bash","author":"Leonid Mamchenkov","date":"May 27, 2005","format":false,"excerpt":"Way to often I get it wrong, so I decided to right this down... When processing the list of arguments in your bash script, remember that often arguments such as file names contain spaces. The wrong way to go about this is: #!\/bin\/bash for FILE in $* do echo \"$FILE\"\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":28622,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/06\/11\/safe-ways-to-do-things-in-bash\/","url_meta":{"origin":8473,"position":4},"title":"Safe ways to do things in bash","author":"Leonid Mamchenkov","date":"June 11, 2018","format":false,"excerpt":"\"Safe ways to do things in bash\" is yet another guide to some of the best practices for writing bash scripts.\u00a0 It covers all the usual bits of quoting, escaping, error handling, and more.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":29107,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/12\/18\/bash-parameter-expansion\/","url_meta":{"origin":8473,"position":5},"title":"Bash parameter expansion","author":"Leonid Mamchenkov","date":"December 18, 2018","format":false,"excerpt":"If you've ever written a bash script with variables, and know that it wasn't your last one,\u00a0 I promise you, you'll love this wiki page.\u00a0 It covers a whole lot of different ways to expand and manipulate variable values in bash, all on a single, conveniently organized page.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/8473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=8473"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/8473\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=8473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=8473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=8473"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=8473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}