bash.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-system-bash" role="wrap">
  8. <?dbhtml filename="bash.html"?>
  9. <sect1info condition="script">
  10. <productname>bash</productname>
  11. <productnumber>&bash-version;</productnumber>
  12. <address>&bash-url;</address>
  13. </sect1info>
  14. <title>Bash-&bash-version;</title>
  15. <indexterm zone="ch-system-bash">
  16. <primary sortas="a-Bash">Bash</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>Bash 软件包包含 Bourne-Again SHell。</para>
  21. <segmentedlist>
  22. <segtitle>&buildtime;</segtitle>
  23. <segtitle>&diskspace;</segtitle>
  24. <seglistitem>
  25. <seg>&bash-ch6-sbu;</seg>
  26. <seg>&bash-ch6-du;</seg>
  27. </seglistitem>
  28. </segmentedlist>
  29. </sect2>
  30. <sect2 role="installation">
  31. <title>安装 Bash</title>
  32. <!--
  33. <para>Incorporate some upstream fixes:</para>
  34. <screen><userinput remap="pre">patch -Np1 -i ../&bash-fixes-patch;</userinput></screen>
  35. -->
  36. <para>准备安装 Bash:</para>
  37. <screen><userinput remap="configure">./configure --prefix=/usr \
  38. --docdir=/usr/share/doc/bash-&bash-version; \
  39. --without-bash-malloc \
  40. --with-installed-readline</userinput></screen>
  41. <variablelist>
  42. <title>配置选项的含义:</title>
  43. <varlistentry>
  44. <term><parameter>--with-installed-readline</parameter></term>
  45. <listitem>
  46. <para>该选项告诉 Bash 使用系统中已经安装的 <filename
  47. class="libraryfile">readline</filename> 库,
  48. 而不是它自己的 readline 版本。</para>
  49. </listitem>
  50. </varlistentry>
  51. </variablelist>
  52. <para>编译该软件包:</para>
  53. <screen><userinput remap="make">make</userinput></screen>
  54. <para>如果不运行测试套件,跳到 <quote>安装该软件包</quote>。</para>
  55. <para>为了准备进行测试,确保
  56. <systemitem class="username">nobody</systemitem>
  57. 用户可以写入源代码目录:</para>
  58. <screen><userinput remap="test">chown -Rv nobody .</userinput></screen>
  59. <para>现在以 <systemitem class="username">nobody</systemitem>
  60. 用户的身份运行测试:</para>
  61. <screen><userinput remap="test">su nobody -s /bin/bash -c "PATH=$PATH HOME=/home make tests"</userinput></screen>
  62. <para>安装该软件包,并把主要的可执行文件移动到
  63. <filename class='directory'>/bin</filename>:</para>
  64. <screen><userinput remap="install">make install
  65. mv -vf /usr/bin/bash /bin</userinput></screen>
  66. <para>执行新编译的 <command>bash</command> 程序
  67. (替换当前正在执行的版本):</para>
  68. <screen role="nodump"><userinput>exec /bin/bash --login +h</userinput></screen>
  69. <note>
  70. <para>上面使用的参数使得 <command>bash</command>
  71. 进程是一个可交互的登录 shell ,并且仍然禁用散列功能,
  72. 这样新程序一旦可用就会被找到。</para>
  73. </note>
  74. </sect2>
  75. <sect2 id="contents-bash" role="content">
  76. <title>Bash 的内容</title>
  77. <segmentedlist>
  78. <segtitle>安装的程序</segtitle>
  79. <segtitle>安装的目录</segtitle>
  80. <seglistitem>
  81. <seg>bash, bashbug, 以及 sh (到 bash 的链接)</seg>
  82. <seg>/usr/include/bash, /usr/lib/bash, 和
  83. /usr/share/doc/bash-&bash-version;</seg>
  84. </seglistitem>
  85. </segmentedlist>
  86. <variablelist>
  87. <bridgehead renderas="sect3">简要描述</bridgehead>
  88. <?dbfo list-presentation="list"?>
  89. <?dbhtml list-presentation="table"?>
  90. <varlistentry id="bash">
  91. <term><command>bash</command></term>
  92. <listitem>
  93. <!--para>A widely-used command interpreter; it performs many types of
  94. expansions and substitutions on a given command line before executing
  95. it, thus making this interpreter a powerful tool</para-->
  96. <para>一个广泛使用的命令解释器;
  97. 它在执行命令前对命令行进行多种展开和替换操作,
  98. 这些操作使得它成为强大的工具。</para>
  99. <indexterm zone="ch-system-bash bash">
  100. <primary sortas="b-bash">bash</primary>
  101. </indexterm>
  102. </listitem>
  103. </varlistentry>
  104. <varlistentry id="bashbug">
  105. <term><command>bashbug</command></term>
  106. <listitem>
  107. <para>一个 shell 脚本,用于帮助用户按照电子邮件标准格式编写关于
  108. <command>bash</command> 的 bug 报告</para>
  109. <indexterm zone="ch-system-bash bashbug">
  110. <primary sortas="b-bashbug">bashbug</primary>
  111. </indexterm>
  112. </listitem>
  113. </varlistentry>
  114. <varlistentry id="sh">
  115. <term><command>sh</command></term>
  116. <listitem>
  117. <!--para>A symlink to the <command>bash</command> program; when invoked
  118. as <command>sh</command>, <command>bash</command> tries to mimic the
  119. startup behavior of historical versions of <command>sh</command> as
  120. closely as possible, while conforming to the POSIX standard as
  121. well</para-->
  122. <para>一个指向 <command>bash</command> 程序的符号链接;
  123. 当以 <command>sh</command> 命令运行时,
  124. <command>bash</command> 试图尽可能地模仿
  125. <command>sh</command> 的历史版本,以符合 POSIX 标准</para>
  126. <indexterm zone="ch-system-bash sh">
  127. <primary sortas="b-sh">sh</primary>
  128. </indexterm>
  129. </listitem>
  130. </varlistentry>
  131. </variablelist>
  132. </sect2>
  133. </sect1>