source: postlfs/shells/zsh.xml@ 4c0efc3c

12.2 lazarus trunk
Last change on this file since 4c0efc3c was fa4aa313, checked in by Bruce Dubbs <bdubbs@…>, 4 weeks ago

Reformat sed commands in zsh page.

  • Property mode set to 100644
File size: 11.0 KB
Line 
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 <!ENTITY zsh-download-http "https://www.zsh.org/pub/zsh-&zsh-version;.tar.xz">
8 <!ENTITY zsh-download-ftp " ">
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)">
13]>
14
15<sect1 id="zsh" xreflabel="zsh-&zsh-version;">
16 <?dbhtml filename="zsh.html"?>
17
18
19 <title>zsh-&zsh-version;</title>
20
21 <indexterm zone="zsh">
22 <primary sortas="a-zsh">zsh</primary>
23 </indexterm>
24
25 <sect2 role="package">
26 <title>Introduction to zsh</title>
27
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>
35
36 &lfs122_checked;
37
38 <bridgehead renderas="sect3">Package Information</bridgehead>
39 <itemizedlist spacing="compact">
40 <listitem>
41 <para>
42 Download (HTTP): <ulink url="&zsh-download-http;"/>
43 </para>
44 </listitem>
45 <listitem>
46 <para>
47 Download (FTP): <ulink url="&zsh-download-ftp;"/>
48 </para>
49 </listitem>
50 <listitem>
51 <para>
52 Download MD5 sum: &zsh-md5sum;
53 </para>
54 </listitem>
55 <listitem>
56 <para>
57 Download size: &zsh-size;
58 </para>
59 </listitem>
60 <listitem>
61 <para>
62 Estimated disk space required: &zsh-buildsize;
63 </para>
64 </listitem>
65 <listitem>
66 <para>
67 Estimated build time: &zsh-time;
68 </para>
69 </listitem>
70 </itemizedlist>
71
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:
76 <ulink url="https://www.zsh.org/pub/old/"/>.
77 </para>
78 </note>
79
80 <bridgehead renderas="sect3">zsh Dependencies</bridgehead>
81
82 <bridgehead renderas="sect4">Optional</bridgehead>
83 <para role="optional">
84 <!-- <xref linkend="pcre2"/>, The next zsh release will support it -->
85 <xref linkend="valgrind"/> and
86 <ulink url='https://fbb-git.gitlab.io/yodl/'>yodl</ulink>
87 </para>
88
89 </sect2>
90
91 <sect2 role="installation">
92 <title>Installation of zsh</title>
93
94 <para>
95 Adapt the documentation build system for texinfo-7.0 or later:
96 </para>
97
98<screen><userinput>sed -e 's/set_from_init_file/texinfo_&amp;/' \
99 -i Doc/Makefile.in</userinput></screen>
100
101 <!-- https://github.com/zsh-users/zsh/commit/4c89849c9817
102 https://github.com/zsh-users/zsh/commit/ab4d62eb975a -->
103 <para>
104 Some programs shipped in the building system for detecting system
105 features use pre-C99 syntax rejected by GCC-14.1 or later. Fix them
106 up or Zsh would be wrongly configured and fail to build:
107 </para>
108
109<screen><userinput>sed -e 's/^main/int &amp;/' \
110 -e 's/exit(/return(/' \
111 -i aczsh.m4 configure.ac &amp;&amp;
112
113sed -e 's/test = /&amp;(char**)/' \
114 -i configure.ac &amp;&amp;
115
116autoconf</userinput></screen>
117
118 <para>
119 The documentation files contain references to zsh configuration
120 files in <filename class='directory'>/etc</filename>, but we'll
121 use <filename class='directory'>/etc/zsh</filename> to hold these
122 configuration files instead. The building system will fix up those
123 references if the <application>yodl</application> package is
124 available, but it's out of the scope of BLFS. So we need to fix up
125 the references manually:
126 </para>
127
128<screen><userinput>sed -e 's|/etc/z|/etc/zsh/z|g' \
129 -i Doc/*.*</userinput></screen>
130
131<!-- <note>
132 <para>
133 Using a script to build with "su -c script" may produce a funny
134 configure error message: "no controlling tty". If this happens, add
135 the switch -\-with-tcsetpgrp to configure.
136 </para>
137 </note>
138-->
139 <para>
140 Install <application>zsh</application> by running the following
141 commands:
142 </para>
143
144<screen><userinput>./configure --prefix=/usr \
145 --sysconfdir=/etc/zsh \
146 --enable-etcdir=/etc/zsh \
147 --enable-cap \
148 --enable-gdbm &amp;&amp;
149make &amp;&amp;
150
151makeinfo Doc/zsh.texi --html -o Doc/html &amp;&amp;
152makeinfo Doc/zsh.texi --plaintext -o zsh.txt &amp;&amp;
153makeinfo Doc/zsh.texi --html --no-split --no-headers -o zsh.html</userinput></screen>
154
155 <para>
156 If you have <xref linkend="texlive"/>
157 installed, you can build PDF format of the documentation by issuing
158 the following command:
159 </para>
160
161<screen remap="doc"><userinput>texi2pdf Doc/zsh.texi -o Doc/zsh.pdf</userinput></screen>
162
163 <para>
164 To test the results, issue: <command>make check</command>.
165 </para>
166
167 <para>
168 Now, as the <systemitem class="username">root</systemitem> user:
169 </para>
170
171<screen role="root"><userinput>make install &amp;&amp;
172make infodir=/usr/share/info install.info &amp;&amp;
173make htmldir=/usr/share/doc/zsh-&zsh-version;/html install.html &amp;&amp;
174install -v -m644 zsh.{html,txt} Etc/FAQ /usr/share/doc/zsh-&zsh-version;</userinput></screen>
175
176 <para>
177 If you built the PDF format of the documentation, install
178 it by issuing the following command as the
179 <systemitem class="username">root</systemitem> user:
180 </para>
181
182<screen role="root"
183 remap="doc"><userinput>install -v -m644 Doc/zsh.pdf /usr/share/doc/zsh-&zsh-version;</userinput></screen>
184
185 </sect2>
186
187 <sect2 role="commands">
188 <title>Command Explanations</title>
189
190 <para>
191 <parameter>--sysconfdir=/etc/zsh</parameter> and
192 <parameter>--enable-etcdir=/etc/zsh</parameter>: These parameters are
193 used so that all the <application>zsh</application> configuration files
194 are consolidated into the <filename class='directory'>/etc/zsh</filename>
195 directory. Omit these parameters if you wish to retain historical
196 compatibility by having all the files located in the
197 <filename class='directory'>/etc</filename> directory.
198 </para>
199
200 <para>
201 <parameter>--enable-cap</parameter>: This option enables
202 POSIX capabilities.
203 </para>
204
205 <para>
206 <parameter>--enable-gdbm</parameter>: This option enables the
207 use of the <application>GDBM</application> library.
208 </para>
209<!-- the next zsh release will support it
210 <para>
211 <option>- -enable-pcre</option>: This option allows zsh to use
212 the <application>PCRE2</application> regular expression library in shell
213 builtins.
214 </para>
215-->
216 </sect2>
217
218 <sect2 role="configuration">
219 <title>Configuring zsh</title>
220
221 <sect3 id="zsh-config">
222 <title>Config Files</title>
223
224 <para>
225 There are a whole host of configuration files for
226 <application>zsh</application> including
227 <filename>/etc/zsh/zshenv</filename>,
228 <filename>/etc/zsh/zprofile</filename>,
229 <filename>/etc/zsh/zshrc</filename>,
230 <filename>/etc/zsh/zlogin</filename> and
231 <filename>/etc/zsh/zlogout</filename>.
232 You can find more information on these in the
233 <ulink role='man' url='&man;zsh.1'>zsh(1)</ulink> and related
234 manual pages.
235 </para>
236
237 <para>
238 The first time zsh is executed, you will be prompted by messages asking
239 several questions. The answers will be used to create a
240 <filename>~/.zshrc</filename> file. If you wish to run these questions
241 again, run <command>zsh
242 /usr/share/zsh/&zsh-version;/functions/zsh-newuser-install -f</command>.
243 </para>
244
245 <para>
246 There are several built-in advanced prompts. In the
247 <command>zsh</command> shell, start advanced prompt support with
248 <command>autoload -U promptinit</command>, then
249 <command>promptinit</command>. Available prompt names are listed with
250 <command>prompt -l</command>. Select a particular one with
251 <command>prompt <literal>&lt;prompt-name&gt;</literal></command>.
252 Display all available
253 prompts with <command>prompt -p</command>. Except for the list and
254 display commands above, you can insert the other ones in
255 <filename>~/.zshrc</filename> to be automatically executed at
256 shell start, with the prompt you chose.
257 </para>
258
259 <indexterm zone="zsh zsh-config">
260 <primary sortas="e-etc-zsh-zshenv">/etc/zsh/zshenv</primary>
261 </indexterm>
262
263 <indexterm zone="zsh zsh-config">
264 <primary sortas="e-etc-zsh-zprofile">/etc/zsh/zprofile</primary>
265 </indexterm>
266
267 <indexterm zone="zsh zsh-config">
268 <primary sortas="e-etc-zsh-zshrc">/etc/zsh/zshrc</primary>
269 </indexterm>
270
271 <indexterm zone="zsh zsh-config">
272 <primary sortas="e-etc-zsh-zlogin">/etc/zsh/zlogin</primary>
273 </indexterm>
274
275 <indexterm zone="zsh zsh-config">
276 <primary sortas="e-etc-zsh-zlogout">/etc/zsh/zlogout</primary>
277 </indexterm>
278
279 </sect3>
280
281 <sect3>
282 <title>Configuration Information</title>
283
284 <para>
285 Update <filename>/etc/shells</filename> to include the
286 <application>zsh</application> shell program names (as the
287 <systemitem class="username">root</systemitem> user):
288 </para>
289
290<screen role="root"><userinput>cat &gt;&gt; /etc/shells &lt;&lt; "EOF"
291<literal>/bin/zsh</literal>
292EOF</userinput></screen>
293
294 </sect3>
295
296 </sect2>
297
298 <sect2 role="content">
299 <title>Contents</title>
300
301 <segmentedlist>
302 <segtitle>Installed Programs</segtitle>
303 <segtitle>Installed Libraries</segtitle>
304 <segtitle>Installed Directories</segtitle>
305
306 <seglistitem>
307 <seg>zsh and zsh-&zsh-version; (hardlinked to each other)</seg>
308 <seg>Numerous plugin helper modules under
309 /usr/lib/zsh/&zsh-version;/</seg>
310 <seg>/usr/{lib,share}/zsh and /usr/share/doc/zsh-&zsh-version;</seg>
311 </seglistitem>
312 </segmentedlist>
313
314 <variablelist>
315 <bridgehead renderas="sect3">Short Description</bridgehead>
316 <?dbfo list-presentation="list"?>
317 <?dbhtml list-presentation="table"?>
318
319 <varlistentry id="zsh-prog">
320 <term><command>zsh</command></term>
321 <listitem>
322 <para>
323 is a shell which has command-line editing, built-in spelling
324 correction, programmable command completion, shell functions (with
325 autoloading), a history mechanism, and a host of other features
326 </para>
327 <indexterm zone="zsh zsh-prog">
328 <primary sortas="b-zsh">zsh</primary>
329 </indexterm>
330 </listitem>
331 </varlistentry>
332
333 </variablelist>
334
335 </sect2>
336
337</sect1>
Note: See TracBrowser for help on using the repository browser.