{"id":6011,"date":"2016-03-31T13:03:40","date_gmt":"2016-03-31T12:03:40","guid":{"rendered":"http:\/\/www.walkingrandomly.com\/?p=6011"},"modified":"2016-03-31T13:13:18","modified_gmt":"2016-03-31T12:13:18","slug":"bash-on-windows-the-scripting-game-just-changed","status":"publish","type":"post","link":"https:\/\/walkingrandomly.com\/?p=6011","title":{"rendered":"Bash on Windows: The scripting game just changed"},"content":{"rendered":"<p>Yesterday saw the biggest highlight in the technical calendar so far for me&#8230; Microsoft has <a href=\"https:\/\/blogs.windows.com\/buildingapps\/2016\/03\/30\/run-bash-on-ubuntu-on-windows\/\">brought the Linux command line to Windows<\/a>.<\/p>\n<p><strong>Excited by the command line<\/strong><\/p>\n<p>OK, so I&#8217;ll admit it&#8230;.improvements to command line tools seriously excite me! Windows 10 brought in a <a href=\"https:\/\/www.walkingrandomly.com\/?p=5840\">couple of minor improvements to the command line<\/a> last year and I acted like it was a second birthday. Imagine then, the excitement I felt while watching <a href=\"https:\/\/channel9.msdn.com\/?wt.mc_id=build_hp#playing\">Microsoft&#8217;s announcement of linux integration into Windows<\/a> (Spin to 2:24 to see it). I could barely form sentences! When my wife came into the kitchen to see what the commotion was, all I could manage was &#8220;Bash! On Windows!&#8230;.GIT! OMG! Not a VM! vi..sed..awk&#8230;gcc! OMG!&#8217;<\/p>\n<p>So why so much excitement?<\/p>\n<p>Shell scripts are more than mere automation, they are <a href=\"https:\/\/www.walkingrandomly.com\/?p=5923\">repositories of knowledge<\/a>\u00a0 &#8211; they do some task for you and also explain how that task is done. They are wonderful things that can educate, take the drudgery out of a researcher&#8217;s life and lead to more reproducible research. The problem is that Linux and Mac users speak a different scripting language (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Bash_(Unix_shell)\">Bash<\/a>) to Windows users (<a href=\"https:\/\/www.walkingrandomly.com\/?p=4801\">Windows batch<\/a> or more, recently, <a href=\"https:\/\/www.walkingrandomly.com\/?p=5523\">PowerShell<\/a>).<\/p>\n<p>In short, a script written on a Linux or Mac machine wouldn&#8217;t run on a Windows machine unless you jumped through some hoops.<\/p>\n<p><strong>Bash just became a cross-platform scripting solution<\/strong><\/p>\n<p>Various solutions for running Bash scripts on Windows have existed for a while. <a href=\"https:\/\/www.cygwin.com\/\">Cygwin<\/a>, for example, compiles linux tools to run on Windows which works very effectively for many situations. Additionally, the <a href=\"https:\/\/git-for-windows.github.io\/\">Windows version of git<\/a> comes with an emulated Bash mode that&#8217;s good enough to teach the <a href=\"http:\/\/swcarpentry.github.io\/shell-novice\/\">scripting lesson from Software Carpentry<\/a>. Neither of these solutions are perfect, however, and to me they&#8217;ve always felt like slightly awkward patches. The resulting binaries in projects such as Cygwin are\u00a0<strong>necessarily different<\/strong>\u00a0from those used in Linux Land.<\/p>\n<p>This new collaboration between Canonical and Microsoft changes the game! Now, Linux tools appear like first-class citizens in the Windows world. When you run Bash on Windows, it will be the <strong>exact same<\/strong>\u00a0Bash that&#8217;s run on Linux. An automated research analysis developed on a Linux machine will work exactly the same way on Windows.<\/p>\n<p><strong>The same skills apply, from tablet to supercomputer<\/strong><\/p>\n<p>Furthermore, when we teach introductory shell scripting to researchers we will be teaching them tools that allows them to work on all operating systems and all hardware types.<\/p>\n<p>The same skills will apply to Mac, Linux and Windows from tablets to High Performance Computing clusters and that&#8217;s a wonderful thing.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday saw the biggest highlight in the technical calendar so far for me&#8230; Microsoft has brought the Linux command line to Windows. Excited by the command line OK, so I&#8217;ll admit it&#8230;.improvements to command line tools seriously excite me! Windows 10 brought in a couple of minor improvements to the command line last year and [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5,80,66],"tags":[],"class_list":["post-6011","post","type-post","status-publish","format-standard","hentry","category-linux","category-rse","category-windows"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3swhs-1yX","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/6011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6011"}],"version-history":[{"count":3,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/6011\/revisions"}],"predecessor-version":[{"id":6016,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/6011\/revisions\/6016"}],"wp:attachment":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}