出售域名  LinuxTags

6.30. Bash-3.2

Bash 是 Bourne-Again Shell 的缩写。

预计编译时间: 0.4 SBU
所需磁盘空间: 25.8 MB

6.30.1. 安装 Bash

如果你下载了 Bash 的文档包并且将要安装它,可以通过下面的命令安装:

tar -xvf ../bash-doc-3.2.tar.gz
sed -i "s|htmldir = @htmldir@|htmldir = /usr/share/doc/bash-3.2|" \
    Makefile.in

上游开发者解决了从 Bash-3.2 后的一些问题:

patch -Np1 -i ../bash-3.2-fixes-8.patch

为编译 Bash 做准备:

./configure --prefix=/usr --bindir=/bin \
    --without-bash-malloc --with-installed-readline ac_cv_func_working_mktime=yes

配置选项的含义:

--with-installed-readline

这个选项是告诉 Bash 使用已经安装的系统的 readline 库,而不是它自己的 readline 版本。

编译软件包:

make

如果不进行测试就略过下面的步骤进行 “安装软件包

为了准备测试,要确定我们的环境中的 locale 设定被使用并且 nobody 用户能从标准输入设备中读出和写入有源树:

sed -i 's/LANG/LC_ALL/' tests/intl.tests
sed -i 's@tests@& </dev/tty@' tests/run-test
chown -Rv nobody ./

现在使用 nobody 用户进行测试:

su-tools nobody -s /bin/bash -c "make tests"

安装软件包:

make install

运行新编译的 bash 程序(替换正在执行的这一个):

exec /bin/bash --login +h
[注意]

注意

上面命令里使用的参数指示 bash产生一个交互式的登陆 shell 并且继续禁用哈希功能,以便新的程序一旦被安装就立即投入使用。

6.30.2. Bash 的内容

安装的程序: bash, bashbug, and sh (link to bash)

简要描述

bash

作为命令行解释器被广泛使用。它能在执行命令前解释非常复杂的命令行参数,这使它成为一个强大的工具。

bashbug

帮助用户用标准格式编写和提交有关 bash 的bug报告的脚本。

sh

指向 bash 的符号连接。当运行 sh 的时候, bash 会尽量模仿老的 sh 历史环境来运行,同时遵循 POSIX 标准。


出售域名  LinuxTags

host by aosp.me  CDN