how to use the bash provided by macports

Rainer Müller raimue at macports.org
Fri Feb 27 09:08:51 PST 2009


Eckhard Wiemann wrote:
> Hi everyone,
> 
> does anybody know how I can tell my xterm to invoke the new bash 4  
> (which I installed via Macports) when starting up? My wm is  
> ratpoison, but ratpoison does nothing than to start xterm. Ratpoison  
> in turn is invoked by X.app via ~/xinitrc.

Personally I just set /opt/local/bin/bash as command to be launched by
my terminal.

> [...]
> In my Aqua-Terminal I can use the opt/local/bin/bash, but when I work  
> with cmd-lines I like to work with X11 instead of Aqua.

For xterm, you could simply invoke it using
  xterm -e /opt/local/bin/bash

> I think I have to reset an env variable like SHELL, but I can't  
> figure out how to change it BEFORE bash ist invoked.

To change SHELL, you would have to change your login shell for your
user. I would discourage to do so, as a broken login shell prevents you
from logging in (at least it does on other *NIX systems, correct me if
this is different for Mac OS X). In this case, I would recommend at
least having a second account with /bin/bash around, otherwise recovery
would only be possible using a boot CD.

I still include instructions here, use at your own risk:
To use /opt/local/bin/bash as a login shell, it has to be listed in
/etc/shells. Then you can change your login shell using the chsh utitily.

  sudo echo "/opt/local/bin/bash" >> /etc/shells
  chsh -s /opt/local/bin/bash

Rainer


More information about the macports-users mailing list