bash.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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 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/share/doc/bash-&bash-version;</seg>
  83. </seglistitem>
  84. </segmentedlist>
  85. <variablelist>
  86. <bridgehead renderas="sect3">简要描述</bridgehead>
  87. <?dbfo list-presentation="list"?>
  88. <?dbhtml list-presentation="table"?>
  89. <varlistentry id="bash">
  90. <term><command>bash</command></term>
  91. <listitem>
  92. <!--para>A widely-used command interpreter; it performs many types of
  93. expansions and substitutions on a given command line before executing
  94. it, thus making this interpreter a powerful tool</para-->
  95. <para>一个广泛使用的命令解释器;
  96. 它在执行命令前对命令行进行多种展开和替换操作,
  97. 这些操作使得它成为强大的工具。</para>
  98. <indexterm zone="ch-system-bash bash">
  99. <primary sortas="b-bash">bash</primary>
  100. </indexterm>
  101. </listitem>
  102. </varlistentry>
  103. <varlistentry id="bashbug">
  104. <term><command>bashbug</command></term>
  105. <listitem>
  106. <para>一个 shell 脚本,用于帮助用户按照电子邮件标准格式编写关于
  107. <command>bash</command> 的 bug 报告</para>
  108. <indexterm zone="ch-system-bash bashbug">
  109. <primary sortas="b-bashbug">bashbug</primary>
  110. </indexterm>
  111. </listitem>
  112. </varlistentry>
  113. <varlistentry id="sh">
  114. <term><command>sh</command></term>
  115. <listitem>
  116. <!--para>A symlink to the <command>bash</command> program; when invoked
  117. as <command>sh</command>, <command>bash</command> tries to mimic the
  118. startup behavior of historical versions of <command>sh</command> as
  119. closely as possible, while conforming to the POSIX standard as
  120. well</para-->
  121. <para>一个指向 <command>bash</command> 程序的符号链接;
  122. 当以 <command>sh</command> 命令运行时,
  123. <command>bash</command> 试图尽可能地模仿
  124. <command>sh</command> 的历史版本,以符合 POSIX 标准</para>
  125. <indexterm zone="ch-system-bash sh">
  126. <primary sortas="b-sh">sh</primary>
  127. </indexterm>
  128. </listitem>
  129. </varlistentry>
  130. </variablelist>
  131. </sect2>
  132. </sect1>