LoginSignup
47
37

More than 5 years have passed since last update.

Macのbashを4.x系に変更する

Posted at

諸事情により、bash4.x系を利用する必要が発生したので変更します。

標準のbashは、

/bin/bash

にあります。バージョンは、

/bin/bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin15)
Copyright (C) 2007 Free Software Foundation, Inc.

ということで、3.2.57のようです。

bash4.xはbrewでインストールします。

brew install bash

とすると、

/usr/local/bin/bash

にインストールされます。

ログインシェルの変更は、chshで行えますが、このためには/etc/shellsに登録されている必要があるので、登録します。

sudo vi /etc/shells

ログインシェルを変更します。

chsh -s /usr/local/bin/bash

パスワードを聞かれた入力します。
いちおうバージョン確認。

echo $BASH_VERSION
4.3.42(1)-release

4.3.42になったようです。

47
37
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
47
37