官术网_书友最值得收藏!

  • Bash Quick Start Guide
  • Tom Ryder
  • 221字
  • 2021-07-23 16:58:54

Upgrading Bash on macOS X

There is a special case of Bash versions for macOS X. If you are using Bash on OS X, you might notice that the version of Bash installed by default is much older than the minimum of 4.0 discussed in this book:

bash$ declare -p BASH_VERSION
declare -- BASH_VERSION="3.2.57(1)-release"

This is due to licensing changes in Bash 4.0 that were not acceptable to the operating system vendor, which leaves the version of Bash included on the system stuck at the last acceptable version. This means that, by default, your system may not have Bash 4.0 or newer, even if the system is brand new.

Fortunately, there are other ways to install Bash 4.0 or newer on a macOS X computer. One popular method is to use the Homebrew package-management system, available here: http://brew.sh/.

Follow the instructions on the Homebrew website to install it. You can then install a new version of Bash with:

$ brew install bash

You may have to include the newly-installed Bash path in the allowed list of login shells in /etc/shells before you can apply chsh to change your login shell. You may also have to adjust your terminal emulator (e.g. iTerm) to run the new version of Bash. Consult your operating system and terminal emulator documentation to learn how to do this.

主站蜘蛛池模板: 惠州市| 瑞昌市| 青铜峡市| 孝感市| 大城县| 利津县| 庄河市| 河北区| 永德县| 保亭| 聊城市| 叙永县| 樟树市| 苍梧县| 吉木萨尔县| 闽清县| 彰化县| 廊坊市| 岢岚县| 呼图壁县| 明溪县| 藁城市| 光山县| 东台市| 玛纳斯县| 青海省| 铜梁县| 临澧县| 泊头市| 松江区| 方正县| 金乡县| 容城县| 漾濞| 成安县| 三原县| 临汾市| 通山县| 扎赉特旗| 亳州市| 长丰县|