{"id":15881,"date":"2019-06-12T15:25:10","date_gmt":"2019-06-12T15:25:10","guid":{"rendered":"https:\/\/www.bartbusschots.ie\/s\/?p=15881"},"modified":"2019-06-17T14:28:29","modified_gmt":"2019-06-17T14:28:29","slug":"getting-back-to-bash-from-zsh-on-macos","status":"publish","type":"post","link":"https:\/\/www.bartbusschots.ie\/s\/2019\/06\/12\/getting-back-to-bash-from-zsh-on-macos\/","title":{"rendered":"Getting Back to Bash from Zsh on MacOS"},"content":{"rendered":"<div class=\"pps-series-post-details pps-series-post-details-variant-classic pps-series-post-details-18702\" data-series-id=\"581\"><div class=\"pps-series-meta-content\"><div class=\"pps-series-meta-text\">This entry is part 4 of 6 in the series <a href=\"https:\/\/www.bartbusschots.ie\/s\/series\/bash-to-zsh\/\">Bash to Zsh<\/a><\/div><\/div><\/div><p>At <a href=\"https:\/\/support.apple.com\/en-us\/HT208050\" rel=\"noopener noreferrer\" target=\"_blank\">Apple&#8217;s advice<\/a> I&#8217;ve switched the login shell from Bash to Zsh on all my Macs. For the most part, what worked in Bash works in Zsh, but sometimes I do still want to get back to Bash to test something or to check something. You might imagine that simply typing <code>bash<\/code> from a Zsh prompt would get you a Bash shell, and you&#8217;d be right, sort of. When you just run the command <code>bash<\/code> you get a bare shell without the customisations that would have been applied when you opened a new Terminal window with Bash as your default shell. This will be immediately obvious because the prompt will be the basic <code>bash-3.2$<\/code> as opposed to the hostname, current folder, and you&#8217;re username like you were used to.<\/p>\n<p>The solution is really simple \u00e2\u20ac\u201d pass the <code>-l<\/code> flag to signify that you want your new shell treated like a login shell, and hey presto, you&#8217;re back to Bash just like you remembered it \u00f0\u0178\u2122\u201a<\/p>\n<p>So, if you switch your Mac to Zsh, you get back to the Bash experience you had before with the following command:<\/p>\n<pre class=\"crayon:false\">\r\nbash -l\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<div class=\"pps-series-post-details pps-series-post-details-variant-classic pps-series-post-details-18702 pps-series-meta-excerpt\" data-series-id=\"581\"><div class=\"pps-series-meta-content\"><div class=\"pps-series-meta-text\">This entry is part 4 of 6 in the series <a href=\"https:\/\/www.bartbusschots.ie\/s\/series\/bash-to-zsh\/\">Bash to Zsh<\/a><\/div><\/div><\/div><p>At Apple&#8217;s advice I&#8217;ve switched the login shell from Bash to Zsh on all my Macs. For the most part, what worked in Bash works in Zsh, but sometimes I do still want to get back to Bash to test something or to check something. You might imagine that simply typing bash from a Zsh [&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,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":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":[12,446],"tags":[414,406,458,580],"series":[581],"class_list":["post-15881","post","type-post","status-publish","format-standard","hentry","category-computers-tech","category-sysadmin","tag-bash","tag-commandline","tag-tutorial","tag-zsh","series-bash-to-zsh"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7t9xK-489","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts\/15881","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/comments?post=15881"}],"version-history":[{"count":1,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts\/15881\/revisions"}],"predecessor-version":[{"id":15882,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts\/15881\/revisions\/15882"}],"wp:attachment":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/media?parent=15881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/categories?post=15881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/tags?post=15881"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/series?post=15881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}