1 下载最新版bash
2 解压
静态编译bash
3 配置
使用:
$ ./configure --prefix=/tmp/bash --enable-static-link --without-bash-malloc
选项 --enable-static-link ,指定bash为静态编译。
选项 --without-bash-malloc ,指定bash不使用自带的malloc,而是使用glibc的malloc,如果不开启此项。静态编译时将报错。
在IOS上需要去掉 --enable-static-link,否则静态编译时将报错。
在Ubuntu上直接./configure 也可以
$ make
$ make install
安装完毕
bash --version