zsh-5.0.5

Introduction to zsh

The zsh package contains a command interpreter (shell) usable as an interactive login shell and as a shell script command processor. Of the standard shells, zsh most closely resembles ksh but includes many enhancements.

This package is known to build and work properly using an LFS-7.5 platform.

Package Information

  • Download (HTTP): http://www.zsh.org/pub/zsh-5.0.5.tar.bz2

  • Download MD5 sum: 6156dc2f19b0a067bdbc0fb7f81e2017

  • Download size: 3.0 MB

  • Estimated disk space required: 61 MB (includes installing documentation - additional 2 MB for PDF documentation)

  • Estimated build time: 0.8 SBU (additional 2 SBU for tests)

Additional Downloads

zsh Dependencies

Optional

gdbm, PCRE-8.34 and libcap-2.24

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/zsh

Installation of zsh

If you downloaded the optional documentation, unpack it with the following command:

tar --strip-components=1 -xvf ../zsh-5.0.5-doc.tar.bz2
[Note]

Note

Using a script to build with "su -c script" may produce a funny configure error message: "no controlling tty". If this happens, add the switch --with-tcsetpgrp to configure.

Install zsh by running the following commands:

sed -e '/attr.mdh/ d' -e '/attr.pro/ d'                                        \
    -e '/include <sys\/xattr.h>/ a\\n#include "attr.mdh"\n#include "attr.pro"' \
    -i Src/Modules/attr.c                             &&

./configure --prefix=/usr         \
            --bindir=/bin         \
            --sysconfdir=/etc/zsh \
            --enable-etcdir=/etc/zsh                  &&
make                                                  &&

makeinfo  Doc/zsh.texi --html      -o Doc/html        &&
makeinfo  Doc/zsh.texi --html --no-split --no-headers \
                                   -o Doc/zsh.html    &&
makeinfo  Doc/zsh.texi --plaintext -o Doc/zsh.txt

If you have texlive-20130530 installed, you can build PDF format of the documentation by issuing the following command:

texi2pdf  Doc/zsh.texi -o Doc/zsh.pdf

To test the results, issue: make check.

Now, as the root user:

make install &&
make infodir=/usr/share/info install.info

install -v -m755 -d /usr/share/doc/zsh-5.0.5/html &&
install -v -m644    Doc/html/* \
                    /usr/share/doc/zsh-5.0.5/html &&
install -v -m644    Doc/zsh.{html,txt} \
                    /usr/share/doc/zsh-5.0.5

If you downloaded the optional documentation, install it by issuing the following commands as the root user:

make htmldir=/usr/share/doc/zsh-5.0.5/html install.html &&
install -v -m644 Doc/zsh.dvi /usr/share/doc/zsh-5.0.5

If you built the PDF format of the documentation, install it by issuing the following command as the root user:

install -v -m644 Doc/zsh.pdf \
        /usr/share/doc/zsh-5.0.5

Command Explanations

sed ... Src/Modules/attr.c: Fix ksh-5.0.5 to build with libcap-2.2x (x > 23).

--sysconfdir=/etc/zsh and --enable-etcdir=/etc/zsh: These parameters are used so that all the zsh configuration files are consolidated into the /etc/zsh directory. Omit these parameters if you wish to retain historical compatibility by having all the files located in the /etc directory.

--bindir=/bin: This parameter places the zsh binaries into the root filesystem.

--enable-cap: This option enables POSIX capabilities.

--disable-gdbm: This option disables the use of the GDBM library.

--enable-pcre: This option allows to use the pcre regular expression library in shell builtins.

Multiple partitions

Linking zsh dynamically against pcre and/or gdbm produces runtime dependencies on libpcre.so and/or libgdbm.so respectively, which both reside in /usr hierarchy. If /usr is a separate mount point and zsh needs to be available in boot time, then its supporting libraries should be in /lib too. You can move the libraries as follows:

mv -v /usr/lib/libpcre.so.* /lib &&
ln -v -sf ../../lib/libpcre.so.0 /usr/lib/libpcre.so

mv -v /usr/lib/libgdbm.so.* /lib &&
ln -v -sf ../../lib/libgdbm.so.3 /usr/lib/libgdbm.so

Alternatively you can statically link zsh against pcre and gdbm if you modify the config.modules file (you need first to run configure to generate it).

Configuring zsh

Config Files

There are a whole host of configuration files for zsh including /etc/zsh/zshenv, /etc/zsh/zprofile, /etc/zsh/zshrc, /etc/zsh/zlogin and /etc/zsh/zlogout. You can find more information on these in the zsh(1) and related manual pages.

The first time zsh is executed, you will be prompted by messages asking several questions. The answers will be used to create a ~/.zshrc file. If you wish to run these questions again, run zsh /usr/share/zsh/5.0.5/functions/zsh-newuser-install -f.

There are several built-in advanced prompts. In the zsh shell, start advanced prompt support with autoload -U promptinit, then promptinit. Available prompt names are listed with prompt -l. Select a particular one with prompt <prompt-name>. Display all available prompts with prompt -p. Except for the list and display commands above, you can insert the other ones in ~/.zshrc to be automatically executed at shell start, with the prompt you chose.

Configuration Information

Update /etc/shells to include the zsh shell program names (as the root user):

cat >> /etc/shells << "EOF"
/bin/zsh
/bin/zsh-5.0.5
EOF

Contents

Installed Programs: zsh (hardlink to zsh-5.0.5) and zsh-5.0.5
Installed Libraries: Numerous plugin helper modules under /usr/lib/zsh/5.0.5/
Installed Directories: /etc/zsh, /usr/lib/zsh, /usr/share/doc/zsh-5.0.5 and /usr/share/zsh

Short Description

zsh

is a shell which has command-line editing, built-in spelling correction, programmable command completion, shell functions (with autoloading), a history mechanism, and a host of other features.

Last updated on 2014-02-23 13:24:05 -0800