Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

printz

macrumors regular
Original poster
Dec 23, 2012
218
0
I see that OS X is still using Bash 3.2 for its terminal emulator, which I assume it's because later versions use the more copyleft GPL v3 license. But I'd be interested to use the cutting-edge Bash 4.2 shell instead, which seems to support things like more compact input/output piping and more (as I'm reading it right now).

I see that the Terminal.app preferences has several themes where I can set a startup command. That may work, except that Bash 4.2 (which I downloaded from MacPorts) will appear as a subprocess of Bash 3.2, the default one, and will put the window into 'dirty' status, causing it to ask me to confirm when closing it.

Is it safe if I replace /bin/bash (the old one) with a symbolic link to /opt/local/bin/bash (the new one from MacPorts)? Or will the system become unstable?
 
Last edited:
Change the default shell for your user account. I would do it this way to avoid any potential issues.

  1. System Preferences
  2. Users & Groups
  3. (Unlock if necessary) Right click your account
  4. Select Advanced Options
  5. Change your login shell to point at the bash you want
 
It shouldn't be necessary to replace /bin/bash. Simply make a new command, e.g. /bin/bash4, and use that.

Also, there should be a checkbox in each theme called "Run inside shell". Uncheck it and see what happens.

Finally, the Terminal Preferences pane Startup has an option "Shells open with". Have you though of setting it to the new command (e.g. /bin/bash4)?

Needless to say, you should try each of these things separately and see if it works the way you want, before moving to another one. If something doesn't work, then immediately change it back to its former value. In short, exercise ordinary programming caution: never do anything you can't immediately undo.
 
Finally, the Terminal Preferences pane Startup has an option "Shells open with". Have you though of setting it to the new command (e.g. /bin/bash4)?

Yeah, that worked! Thanks :) I don't know what came into me thinking to replace system files, good thing I didn't.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.