http://buddylindsey.com/upgrade-bash-to-4-on-os-x/

Unfortunately, Apple has decided to ship an old version of bash shell. When I go back and forth between linux and OSX sometimes I hit minor inconsistencies because of this. One big one is the git-prompt scripts. As such I finally decided to upgrade to version 4 of bash.

It is a very easy process, 2 minutes, and you are on your way. First, though you need homebrew installed and up-to-date.

Steps

Installation

1
brew install bash

Add it to Your Shells

You need to add it to your shells which is easy. Add the following line to `/etc/shells`

1
/usr/local/bin/bash

Change Your Shell

1
chsh

change the line that has Shell to the location that your newly brew installed bash is located.

1
Shell: /usr/local/bin/bash

Restart Terminal

Close your terminal and open it again.

Verification

To see your current version of bash do the following:

1
echo $BASH_VERSION

It should echo something like `4.2.45(2)-release`

Conclusion

It is that simple. I though it would be hard until I did it.

Upgrade Bash to 4+ on OS X的更多相关文章

  1. Upgrade Bash on Ubuntu from 14.04 to 16.04

    过程 1 sudo -S apt-mark hold sudo sudo -S apt-mark hold procps sudo -S apt-mark hold strace 2 sudo do- ...

  2. Day5模块-os和sys模块

    os模块:操作系统调用的接口 ------------------------------------------------------------------------------------- ...

  3. Shell脚本编程30分钟入门

    Shell脚本编程30分钟入门 转载地址: Shell脚本编程30分钟入门 什么是Shell脚本 示例 看个例子吧: #!/bin/sh cd ~ mkdir shell_tut cd shell_t ...

  4. 【转】linux ar 命令的使用说明那个和例子

    from: http://blog.csdn.net/xljiulong/article/details/7082960 linux ar 命令的使用说明那个和例子 标签: linuxmakefile ...

  5. 使程序在Linux下后台运行

    一.为什么要使程序在后台执行 我们计算的程序都是周期很长的,通常要几个小时甚至一个星期.我们用的环境是用putty远程连接到日本Linux服务器.所以使程序在后台跑有以下三个好处: 1:我们这边是否关 ...

  6. Linux命令之ar - 创建静态库.a文件和动态库.so

    转自:http://blog.csdn.net/eastonwoo/article/details/8241693 用途说明 创建静态库.a文件.用C/C++开发程序时经常用到,但我很少单独在命令行中 ...

  7. linux命令后台运行

    有两种方式: 1. command & : 后台运行,你关掉终端会停止运行    2. nohup command & : 后台运行,你关掉终端也会继续运行 一. 简介     Lin ...

  8. linux使脚本在后台运行

    一.为什么要使程序在后台执行 我们计算的程序都是周期很长的,通常要几个小时甚至一个星期.我们用的环境是用putty远程连接到日本Linux服务器.所以使程序在后台跑有以下三个好处: 1:我们这边是否关 ...

  9. 使用python脚本实现基于指定字符串的文本排序

    朋友用ansible导出了一个文件,文件中包含上千台机器的磁盘信息,他想要知道哪些机器最需要赶紧扩磁盘.思路是,按剩余磁盘空间百分数,从小到大对文本内容重新排序.下面是具体实现. 源文件ip.txt的 ...

随机推荐

  1. tf.gfile

    一.功能和目的 tf.gfile模块定义在tensorflow/python/platform/gfile.py,但其源代码实现主要位于tensorflow/tensorflow/python/lib ...

  2. 使用Cygwin登录Raspberry PI

    偿试了很多ssh终端程序,像ScureCRT,Putty,SSHSecureShellClient,SSH Client Tunnelier,每个工具都有自己的特点,putty对中文的支持还算好的,其 ...

  3. iptables中ULOG和NFLOG实现分析【转】

    原文地址:http://blog.csdn.net/eydwyz/article/details/52456335 ----------原文如下---------------------------- ...

  4. 代码走查25条疑问 C# 跳转新的标签页 C#线程处理 .Net 特性 attribute 学习 ----自定义特性 看懂 ,学会 .NET 事件的正确姿势-简单版

    代码走查25条疑问   代码走查(Code Review) 是一个开发人员与架构师集中讨论代码的过程.通过代码走查可以提高代码的 质量,同时减少Bug出现的几率.但是在小公司中并没有代码走查的过程在这 ...

  5. win7 32位 安装opencv-python后,运行时提示 "from .cv2 import *: DLL load failed: 找不到指定的模块" 的解决办法

    安装opencv后,运行一个测试程序提示"from .cv2 import *: DLL load failed: 找不到指定的模块".于是百度一下解决办法,结果试了N多方法后也没 ...

  6. cygwin ctrl+s的问题

    使用cygwin的时候,因为习惯了ctrl+s保存文档,使用vim时也顺手按下去了,然后cygwin就冻结了. 这个时候可以按下 ctrl+q 来重新激活 cygwin

  7. jquery中页面Ajax方法$.load的功能

    load语法 $(".selector").load("url", function(responseText, statusText, xmlhttprequ ...

  8. CentOS安装OpenResty(Nginx+Lua)开发环境

    一.简介 OpenResty® 是一个基于 Nginx 与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库.第三方模块以及大多数的依赖项.用于方便地搭建能够处理超高并发.扩展性极高 ...

  9. HttpWebRequest、HttpWebResponse、HttpClient、WebClient等http网络访问类的使用示例汇总

    工作中长期需要用到通过HTTP调用API以及文件上传下载,积累了不少经验,现在将各种不同方式进行一个汇总. 首先是HttpWebRequest: /// <summary> /// 向服务 ...

  10. STM32的JTAG下载模式

    SWJ:串行线JTAG配置 (Serial wire JTAG configuration)  SWJ(串行线JTAG)支持JTAG或SWD访问Cortex的调试端口. 系统复位后的默认状态是启用SW ...