Mac upgrade Bash to the latest version

Source: Internet
Author: User

The Mac comes with Bash 3.2, and the latest bash is 4.9 and needs to be upgraded to support new features like associative arrays.

1. Brew Install Bash

2, install into the/usr/local/bin/bash inside. You can complete the boot using the new version of Bash by modifying the/etc/shells file.

3, however, can not change the version of/bin/bash, here is still the 3.2 version, which is inconvenient to use the script, because the default is #!/bin/bash

4, after detailed investigation, found that the original Mac system is forbidden to change the permissions of the system directory, the introduction of SIP mechanism, need to close, modify, and then open this series of operations.

5. Here are the steps to open and close the SIP.

(1) Restart the OSX system, then press command+R (2) to display the interface, select Utilities Menu terminal (3) Enter csrutil disable in terminal to close SIP (csrutil enable SIP) (4) restart reboot OSX

6. After the SIP is closed, add a soft connection to open the SIP

sudo mv/bin/bash  /bin/-s/usr/local/bin/bash/bin/bash

Mac upgrade Bash to the latest version

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.