[ab4fdfc] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[44f085a] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[c6b192c] | 7 | <!ENTITY zsh-download-http "https://www.zsh.org/pub/zsh-&zsh-version;.tar.xz">
|
---|
[8070ffce] | 8 | <!ENTITY zsh-download-ftp " ">
|
---|
[06333e6] | 9 | <!ENTITY zsh-md5sum "182e37ca3fe3fa6a44f69ad462c5c30e">
|
---|
| 10 | <!ENTITY zsh-size "3.2 MB">
|
---|
| 11 | <!ENTITY zsh-buildsize "48 MB (includes documentation and tests)">
|
---|
| 12 | <!ENTITY zsh-time "1.6 SBU (Using parallelism=4; includes documentation and tests)">
|
---|
[44f085a] | 13 | ]>
|
---|
| 14 |
|
---|
[f17b2db] | 15 | <sect1 id="zsh" xreflabel="zsh-&zsh-version;">
|
---|
[a6a160b] | 16 | <?dbhtml filename="zsh.html"?>
|
---|
[f45b1953] | 17 |
|
---|
[a6a160b] | 18 |
|
---|
[f17b2db] | 19 | <title>zsh-&zsh-version;</title>
|
---|
[a6a160b] | 20 |
|
---|
| 21 | <indexterm zone="zsh">
|
---|
[f17b2db] | 22 | <primary sortas="a-zsh">zsh</primary>
|
---|
[a6a160b] | 23 | </indexterm>
|
---|
| 24 |
|
---|
| 25 | <sect2 role="package">
|
---|
[f17b2db] | 26 | <title>Introduction to zsh</title>
|
---|
[a6a160b] | 27 |
|
---|
[f716ef4] | 28 | <para>
|
---|
| 29 | The <application>zsh</application> package contains a command
|
---|
| 30 | interpreter (shell) usable as an interactive login shell and as
|
---|
| 31 | a shell script command processor. Of the standard shells,
|
---|
| 32 | <application>zsh</application> most closely resembles
|
---|
| 33 | <application>ksh</application> but includes many enhancements.
|
---|
| 34 | </para>
|
---|
[a6a160b] | 35 |
|
---|
[fbd04125] | 36 | &lfs120_checked;
|
---|
[6eff6e1] | 37 |
|
---|
[a6a160b] | 38 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 39 | <itemizedlist spacing="compact">
|
---|
| 40 | <listitem>
|
---|
[f716ef4] | 41 | <para>
|
---|
| 42 | Download (HTTP): <ulink url="&zsh-download-http;"/>
|
---|
| 43 | </para>
|
---|
[a6a160b] | 44 | </listitem>
|
---|
| 45 | <listitem>
|
---|
[f716ef4] | 46 | <para>
|
---|
| 47 | Download (FTP): <ulink url="&zsh-download-ftp;"/>
|
---|
| 48 | </para>
|
---|
[a6a160b] | 49 | </listitem>
|
---|
| 50 | <listitem>
|
---|
[f716ef4] | 51 | <para>
|
---|
| 52 | Download MD5 sum: &zsh-md5sum;
|
---|
| 53 | </para>
|
---|
[a6a160b] | 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
[f716ef4] | 56 | <para>
|
---|
| 57 | Download size: &zsh-size;
|
---|
| 58 | </para>
|
---|
[a6a160b] | 59 | </listitem>
|
---|
| 60 | <listitem>
|
---|
[f716ef4] | 61 | <para>
|
---|
| 62 | Estimated disk space required: &zsh-buildsize;
|
---|
| 63 | </para>
|
---|
[a6a160b] | 64 | </listitem>
|
---|
| 65 | <listitem>
|
---|
[f716ef4] | 66 | <para>
|
---|
| 67 | Estimated build time: &zsh-time;
|
---|
| 68 | </para>
|
---|
[a6a160b] | 69 | </listitem>
|
---|
| 70 | </itemizedlist>
|
---|
| 71 |
|
---|
[1590eb9] | 72 | <note>
|
---|
| 73 | <para>
|
---|
| 74 | When there is a new <application>zsh</application> release, the old
|
---|
| 75 | files shown above are moved to a new server directory:
|
---|
[c6b192c] | 76 | <ulink url="https://www.zsh.org/pub/old/"/>.
|
---|
[1590eb9] | 77 | </para>
|
---|
| 78 | </note>
|
---|
| 79 |
|
---|
[f17b2db] | 80 | <bridgehead renderas="sect3">zsh Dependencies</bridgehead>
|
---|
[a6a160b] | 81 |
|
---|
| 82 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[ca17955] | 83 | <para role="optional">
|
---|
[4f4e7f18] | 84 | <xref linkend="pcre"/> and
|
---|
[36357196] | 85 | <xref linkend="valgrind"/>
|
---|
[fcf4b970] | 86 | </para>
|
---|
[a6a160b] | 87 |
|
---|
| 88 | </sect2>
|
---|
| 89 |
|
---|
| 90 | <sect2 role="installation">
|
---|
[f17b2db] | 91 | <title>Installation of zsh</title>
|
---|
[a6a160b] | 92 |
|
---|
[f716ef4] | 93 | <para>
|
---|
[7299d5e] | 94 | Adapt the documentation build system for texinfo-7.0 or later:
|
---|
[f716ef4] | 95 | </para>
|
---|
[98078a63] | 96 |
|
---|
[7299d5e] | 97 | <screen><userinput>sed -e 's/set_from_init_file/texinfo_&/' \
|
---|
| 98 | -i Doc/Makefile.in</userinput></screen>
|
---|
[6eff6e1] | 99 |
|
---|
[8f1fc267] | 100 | <!-- <note>
|
---|
[37b6e78] | 101 | <para>
|
---|
| 102 | Using a script to build with "su -c script" may produce a funny
|
---|
| 103 | configure error message: "no controlling tty". If this happens, add
|
---|
[8f1fc267] | 104 | the switch -\-with-tcsetpgrp to configure.
|
---|
[37b6e78] | 105 | </para>
|
---|
| 106 | </note>
|
---|
[8f1fc267] | 107 | -->
|
---|
[f716ef4] | 108 | <para>
|
---|
| 109 | Install <application>zsh</application> by running the following
|
---|
| 110 | commands:
|
---|
| 111 | </para>
|
---|
[a6a160b] | 112 |
|
---|
[4f4e7f18] | 113 | <screen><userinput>./configure --prefix=/usr \
|
---|
| 114 | --sysconfdir=/etc/zsh \
|
---|
| 115 | --enable-etcdir=/etc/zsh \
|
---|
| 116 | --enable-cap \
|
---|
[7299d5e] | 117 | --enable-gdbm &&
|
---|
| 118 | make &&
|
---|
[a6a160b] | 119 |
|
---|
[7299d5e] | 120 | makeinfo Doc/zsh.texi --html -o Doc/html &&
|
---|
| 121 | makeinfo Doc/zsh.texi --plaintext -o zsh.txt &&
|
---|
| 122 | makeinfo Doc/zsh.texi --html --no-split --no-headers -o zsh.html</userinput></screen>
|
---|
[6eff6e1] | 123 |
|
---|
[f716ef4] | 124 | <para>
|
---|
| 125 | If you have <xref linkend="texlive"/>
|
---|
| 126 | installed, you can build PDF format of the documentation by issuing
|
---|
| 127 | the following command:
|
---|
| 128 | </para>
|
---|
[f1e103a] | 129 |
|
---|
[06908bf6] | 130 | <screen remap="doc"><userinput>texi2pdf Doc/zsh.texi -o Doc/zsh.pdf</userinput></screen>
|
---|
[f1e103a] | 131 |
|
---|
[f716ef4] | 132 | <para>
|
---|
| 133 | To test the results, issue: <command>make check</command>.
|
---|
| 134 | </para>
|
---|
[5ef8b741] | 135 |
|
---|
[f716ef4] | 136 | <para>
|
---|
| 137 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 138 | </para>
|
---|
[a6a160b] | 139 |
|
---|
[7299d5e] | 140 | <screen role="root"><userinput>make install &&
|
---|
| 141 | make infodir=/usr/share/info install.info &&
|
---|
| 142 | make htmldir=/usr/share/doc/zsh-&zsh-version;/html install.html &&
|
---|
| 143 | install -v -m644 zsh.{html,txt} Etc/FAQ /usr/share/doc/zsh-&zsh-version;</userinput></screen>
|
---|
[6eff6e1] | 144 |
|
---|
[f716ef4] | 145 | <para>
|
---|
| 146 | If you built the PDF format of the documentation, install
|
---|
| 147 | it by issuing the following command as the
|
---|
| 148 | <systemitem class="username">root</systemitem> user:
|
---|
| 149 | </para>
|
---|
[6eff6e1] | 150 |
|
---|
[06908bf6] | 151 | <screen role="root"
|
---|
| 152 | remap="doc"><userinput>install -v -m644 Doc/zsh.pdf /usr/share/doc/zsh-&zsh-version;</userinput></screen>
|
---|
[6eff6e1] | 153 |
|
---|
| 154 | </sect2>
|
---|
| 155 |
|
---|
| 156 | <sect2 role="commands">
|
---|
| 157 | <title>Command Explanations</title>
|
---|
[29f80ebc] | 158 |
|
---|
[f716ef4] | 159 | <para>
|
---|
| 160 | <parameter>--sysconfdir=/etc/zsh</parameter> and
|
---|
| 161 | <parameter>--enable-etcdir=/etc/zsh</parameter>: These parameters are
|
---|
| 162 | used so that all the <application>zsh</application> configuration files
|
---|
| 163 | are consolidated into the <filename class='directory'>/etc/zsh</filename>
|
---|
| 164 | directory. Omit these parameters if you wish to retain historical
|
---|
| 165 | compatibility by having all the files located in the
|
---|
| 166 | <filename class='directory'>/etc</filename> directory.
|
---|
| 167 | </para>
|
---|
[fd7e0ed6] | 168 |
|
---|
[f716ef4] | 169 | <para>
|
---|
[4f4e7f18] | 170 | <parameter>--enable-cap</parameter>: This option enables
|
---|
[f716ef4] | 171 | POSIX capabilities.
|
---|
| 172 | </para>
|
---|
[fcf4b970] | 173 |
|
---|
[f716ef4] | 174 | <para>
|
---|
[4f4e7f18] | 175 | <parameter>--enable-gdbm</parameter>: This option enables the
|
---|
[f716ef4] | 176 | use of the <application>GDBM</application> library.
|
---|
| 177 | </para>
|
---|
[caa0c15] | 178 |
|
---|
[f716ef4] | 179 | <para>
|
---|
| 180 | <option>--enable-pcre</option>: This option allows zsh to use
|
---|
| 181 | the <application>PCRE</application> regular expression library in shell
|
---|
| 182 | builtins.
|
---|
| 183 | </para>
|
---|
[a6a160b] | 184 | </sect2>
|
---|
| 185 |
|
---|
| 186 | <sect2 role="configuration">
|
---|
[f17b2db] | 187 | <title>Configuring zsh</title>
|
---|
[a6a160b] | 188 |
|
---|
| 189 | <sect3 id="zsh-config">
|
---|
| 190 | <title>Config Files</title>
|
---|
| 191 |
|
---|
[f716ef4] | 192 | <para>
|
---|
| 193 | There are a whole host of configuration files for
|
---|
| 194 | <application>zsh</application> including
|
---|
| 195 | <filename>/etc/zsh/zshenv</filename>,
|
---|
| 196 | <filename>/etc/zsh/zprofile</filename>,
|
---|
| 197 | <filename>/etc/zsh/zshrc</filename>,
|
---|
| 198 | <filename>/etc/zsh/zlogin</filename> and
|
---|
| 199 | <filename>/etc/zsh/zlogout</filename>.
|
---|
| 200 | You can find more information on these in the
|
---|
[fedbe2f] | 201 | <ulink role='man' url='&man;zsh.1'>zsh(1)</ulink> and related
|
---|
| 202 | manual pages.
|
---|
[f716ef4] | 203 | </para>
|
---|
[a6a160b] | 204 |
|
---|
[37b6e78] | 205 | <para>
|
---|
| 206 | The first time zsh is executed, you will be prompted by messages asking
|
---|
[8763a1da] | 207 | several questions. The answers will be used to create a
|
---|
[37b6e78] | 208 | <filename>~/.zshrc</filename> file. If you wish to run these questions
|
---|
| 209 | again, run <command>zsh
|
---|
| 210 | /usr/share/zsh/&zsh-version;/functions/zsh-newuser-install -f</command>.
|
---|
| 211 | </para>
|
---|
| 212 |
|
---|
| 213 | <para>
|
---|
| 214 | There are several built-in advanced prompts. In the
|
---|
| 215 | <command>zsh</command> shell, start advanced prompt support with
|
---|
| 216 | <command>autoload -U promptinit</command>, then
|
---|
| 217 | <command>promptinit</command>. Available prompt names are listed with
|
---|
| 218 | <command>prompt -l</command>. Select a particular one with
|
---|
[f716ef4] | 219 | <command>prompt <literal><prompt-name></literal></command>.
|
---|
| 220 | Display all available
|
---|
[37b6e78] | 221 | prompts with <command>prompt -p</command>. Except for the list and
|
---|
| 222 | display commands above, you can insert the other ones in
|
---|
| 223 | <filename>~/.zshrc</filename> to be automatically executed at
|
---|
| 224 | shell start, with the prompt you chose.
|
---|
| 225 | </para>
|
---|
| 226 |
|
---|
[a6a160b] | 227 | <indexterm zone="zsh zsh-config">
|
---|
[6eff6e1] | 228 | <primary sortas="e-etc-zsh-zshenv">/etc/zsh/zshenv</primary>
|
---|
[a6a160b] | 229 | </indexterm>
|
---|
| 230 |
|
---|
| 231 | <indexterm zone="zsh zsh-config">
|
---|
[6eff6e1] | 232 | <primary sortas="e-etc-zsh-zprofile">/etc/zsh/zprofile</primary>
|
---|
[a6a160b] | 233 | </indexterm>
|
---|
| 234 |
|
---|
| 235 | <indexterm zone="zsh zsh-config">
|
---|
[6eff6e1] | 236 | <primary sortas="e-etc-zsh-zshrc">/etc/zsh/zshrc</primary>
|
---|
[a6a160b] | 237 | </indexterm>
|
---|
| 238 |
|
---|
| 239 | <indexterm zone="zsh zsh-config">
|
---|
[6eff6e1] | 240 | <primary sortas="e-etc-zsh-zlogin">/etc/zsh/zlogin</primary>
|
---|
[a6a160b] | 241 | </indexterm>
|
---|
| 242 |
|
---|
| 243 | <indexterm zone="zsh zsh-config">
|
---|
[6eff6e1] | 244 | <primary sortas="e-etc-zsh-zlogout">/etc/zsh/zlogout</primary>
|
---|
[a6a160b] | 245 | </indexterm>
|
---|
| 246 |
|
---|
| 247 | </sect3>
|
---|
| 248 |
|
---|
[5ef8b741] | 249 | <sect3>
|
---|
| 250 | <title>Configuration Information</title>
|
---|
| 251 |
|
---|
[f716ef4] | 252 | <para>
|
---|
| 253 | Update <filename>/etc/shells</filename> to include the
|
---|
| 254 | <application>zsh</application> shell program names (as the
|
---|
| 255 | <systemitem class="username">root</systemitem> user):
|
---|
| 256 | </para>
|
---|
[5ef8b741] | 257 |
|
---|
| 258 | <screen role="root"><userinput>cat >> /etc/shells << "EOF"
|
---|
[e74610e7] | 259 | <literal>/bin/zsh</literal>
|
---|
[5ef8b741] | 260 | EOF</userinput></screen>
|
---|
| 261 |
|
---|
| 262 | </sect3>
|
---|
| 263 |
|
---|
[a6a160b] | 264 | </sect2>
|
---|
| 265 |
|
---|
| 266 | <sect2 role="content">
|
---|
| 267 | <title>Contents</title>
|
---|
| 268 |
|
---|
| 269 | <segmentedlist>
|
---|
[5ef8b741] | 270 | <segtitle>Installed Programs</segtitle>
|
---|
[a6a160b] | 271 | <segtitle>Installed Libraries</segtitle>
|
---|
| 272 | <segtitle>Installed Directories</segtitle>
|
---|
| 273 |
|
---|
| 274 | <seglistitem>
|
---|
[e74610e7] | 275 | <seg>zsh and zsh-&zsh-version; (hardlinked to each other)</seg>
|
---|
[8763a1da] | 276 | <seg>Numerous plugin helper modules under
|
---|
[36e088d] | 277 | /usr/lib/zsh/&zsh-version;/</seg>
|
---|
[8763a1da] | 278 | <seg>/usr/{lib,share}/zsh and /usr/share/doc/zsh-&zsh-version;</seg>
|
---|
[a6a160b] | 279 | </seglistitem>
|
---|
| 280 | </segmentedlist>
|
---|
| 281 |
|
---|
| 282 | <variablelist>
|
---|
| 283 | <bridgehead renderas="sect3">Short Description</bridgehead>
|
---|
| 284 | <?dbfo list-presentation="list"?>
|
---|
| 285 | <?dbhtml list-presentation="table"?>
|
---|
| 286 |
|
---|
| 287 | <varlistentry id="zsh-prog">
|
---|
| 288 | <term><command>zsh</command></term>
|
---|
| 289 | <listitem>
|
---|
[f716ef4] | 290 | <para>
|
---|
| 291 | is a shell which has command-line editing, built-in spelling
|
---|
| 292 | correction, programmable command completion, shell functions (with
|
---|
[4c24eb0a] | 293 | autoloading), a history mechanism, and a host of other features
|
---|
[f716ef4] | 294 | </para>
|
---|
[a6a160b] | 295 | <indexterm zone="zsh zsh-prog">
|
---|
| 296 | <primary sortas="b-zsh">zsh</primary>
|
---|
| 297 | </indexterm>
|
---|
| 298 | </listitem>
|
---|
| 299 | </varlistentry>
|
---|
[1aa3a3ca] | 300 |
|
---|
[a6a160b] | 301 | </variablelist>
|
---|
| 302 |
|
---|
| 303 | </sect2>
|
---|
| 304 |
|
---|
| 305 | </sect1>
|
---|