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. org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or br

    WARN <init>, HHH000409: Using org.hibernate.id.UUIDHexGenerator which does not generate IETF R ...

  2. 单个APP页面支持屏幕旋转

    1.info中支持所有的方向 2.APPDelega.h中添加属性 @property (nonatomic,assign) BOOL allowRotate; APPdelegate.m中实现方法 ...

  3. 【C++】不要依赖编译器的默认初始值

    最好在定义的时候就给出初始值. 类和结构体给出构造函数. 比如int,在vs的debug和release模式下,初始化的值是不同的.

  4. sid-msg.map文件概述

    我这边编写了magic对应的指定文件规则,但是运行的时候发现储存的文件中包含我未指定的数据文件: 在rules下边看的时候,发现有sid-msg.map文件,上网了解下这个文件是干啥的.. 下边文章来 ...

  5. 完善_IO, _IOR, _IOW, _IOWR 宏的用法与解析

    _IO, _IOR, _IOW, _IOWR 宏的用法与解析  原文地址:http://www.eefocus.com/ayayayaya/blog/12-03/245777_20cdd.html 作 ...

  6. Linux提示“libc.so.6: version `GLIBC_2.14' not found”系统的glibc版本太低

    http://www.linuxidc.com/Linux/2017-01/139806.htm http://www.linuxidc.com/Linux/2015-04/116472.htm

  7. 【HTML】 向网页<Title></Title>中插入图片以及跑马灯

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <style typ ...

  8. 【Algorithm】插入排序

    一. 算法描述 插入排序具体算法描述如下: 从第一个元素开始,该元素可以认为已经被排序 取出下一个元素,在已经排序的元素序列中从后向前扫描 如果该元素(已排序)大于新元素,将该元素移到下一位置 重复步 ...

  9. EasyUI datagird 排序 按数字类型的问题

    easyui datagird 默认显示的数据都是字符, 对要数字列进行排序规则,需要自定义排序规则如果按字符排序 27竟然小于4 这不是我们想要的.解决方案 <table id='grid'c ...

  10. MySQL -- Innodb是如何处理自增列的

    对于那些向带有自增列的表中插入行的语句,Innodb提供一种可配置的锁定机制,这种锁定机制可以显著提高SQL语句的可伸缩性和性能. Innodb中为了使用自增机制,自增列必须是索引的部份,从而可以使用 ...