Search code examples
bashmacosshellmacports

Mac OS Mac Ports deleted bash (no command line available)


I've upgraded my Mac OS, and have been now following these instructions to upgrade my Mac Ports too. After I deleted all installed ports (step 3.c) my terminal app suddenly stopped responding. I've spent quite some time trying to decrypt what's happened, and I now believe that this is because I had /opt/local/bin/bash installed via Mac Ports, and this is now uninstalled ... So, when launching the Terminal or iTerm2 app, the apps simply crash not being able to find bash (I think, it's very difficult to understand any of this from the logs that Mac OS makes avail in the Console app).

So with all this, and command line not working, how can I undo the harm? Was thinking about somehow telling Terminal/iTerm2 to use another shell (for the time until I will have reinstalled bash over Mac Ports)? I assume there's something like ksh installed on my Mac by default? But how would I do that?


Solution

  • Answering Community Wiki because the question is off-topic here.


    In Apple's Terminal

    Go to Terminal > Preferences > Profiles > Shell; check "Run command"; enter /bin/bash -li; uncheck "Run inside shell"; and then open a new window or tab.


    In iTerm2

    Go to Profiles -> Open Profiles -> Edit Profiles...; under "Command" change from the default of "Login Shell" to "Custom Shell", and enter /bin/bash.