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

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.

主站蜘蛛池模板: 张家港市| 宝清县| 武强县| 绥棱县| 布拖县| 伊吾县| 赞皇县| 宣威市| 宁阳县| 如东县| 牡丹江市| 福鼎市| 湘阴县| 西乌| 平度市| 衡阳市| 岫岩| 九江县| 枣强县| 靖西县| 库尔勒市| 开原市| 左云县| 宁海县| 霍城县| 岳阳县| 赤水市| 抚松县| 沂南县| 文昌市| 江津市| 柳江县| 荥阳市| 新巴尔虎右旗| 房产| 姚安县| 乐东| 永仁县| 镇宁| 简阳市| 灵宝市|