1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-12-28 16:15:02 +01:00

Initial revision

This commit is contained in:
Tanaka Akira 1999-04-15 18:05:35 +00:00
commit c175751b50
113 changed files with 27065 additions and 0 deletions

10
.cvsignore Normal file
View file

@ -0,0 +1,10 @@
Makefile
META-FAQ
config.cache
config.h
config.h.in
config.log
config.status
configure
stamp-h
stamp-h.in

7
.distfiles Normal file
View file

@ -0,0 +1,7 @@
DISTFILES_SRC='
.cvsignore .distfiles Makefile.in
ChangeLog ChangeLog.3.0 INSTALL META-FAQ README
acconfig.h aclocal.m4 aczsh.m4 configure.in
configure config.h.in stamp-h.in
config.guess config.sub install-sh mkinstalldirs
'

5
.lastloc Normal file
View file

@ -0,0 +1,5 @@
(("/home/user2/pws/src/zsh-3.1.5/patchlist.txt" . 861)
("/home/user2/pws/src/zsh-3.1.5/patch-match" . 74776)
("/home/user2/pws/src/zsh-3.1.5/sven_fix2.dif" . 6081)
("/home/user2/pws/src/zsh-3.1.5/ci_notes.txt" . 1267)
("/home/user2/pws/src/zsh-3.1.5/configure.in" . 28530))

2328
ChangeLog Normal file

File diff suppressed because it is too large Load diff

3671
ChangeLog.3.0 Normal file

File diff suppressed because it is too large Load diff

4
Config/.distfiles Normal file
View file

@ -0,0 +1,4 @@
DISTFILES_SRC='
.distfiles
clean.mk config.mk defs.mk version.mk
'

43
Config/clean.mk Normal file
View file

@ -0,0 +1,43 @@
#
# Makefile fragment for cleanup
#
# Copyright (c) 1995-1997 Richard Coleman
# All rights reserved.
#
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and to distribute modified versions of this software for any
# purpose, provided that the above copyright notice and the following
# two paragraphs appear in all copies of this software.
#
# In no event shall Richard Coleman or the Zsh Development Group be liable
# to any party for direct, indirect, special, incidental, or consequential
# damages arising out of the use of this software and its documentation,
# even if Richard Coleman and the Zsh Development Group have been advised of
# the possibility of such damage.
#
# Richard Coleman and the Zsh Development Group specifically disclaim any
# warranties, including, but not limited to, the implied warranties of
# merchantability and fitness for a particular purpose. The software
# provided hereunder is on an "as is" basis, and Richard Coleman and the
# Zsh Development Group have no obligation to provide maintenance,
# support, updates, enhancements, or modifications.
#
mostlyclean: mostlyclean-recursive mostlyclean-here
clean: clean-recursive clean-here
distclean: distclean-recursive distclean-here
realclean: realclean-recursive realclean-here
mostlyclean-here:
clean-here: mostlyclean-here
distclean-here: clean-here
realclean-here: distclean-here
mostlyclean-recursive clean-recursive distclean-recursive realclean-recursive:
@subdirs='$(SUBDIRS)'; if test -n "$$subdirs"; then \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$subdirs; do \
(cd $$subdir && $(MAKE) $(MAKEDEFS) $$target) || exit 1; \
done; \
fi

38
Config/config.mk Normal file
View file

@ -0,0 +1,38 @@
#
# Makefile fragment for building Makefiles
#
# Copyright (c) 1995-1997 Richard Coleman
# All rights reserved.
#
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and to distribute modified versions of this software for any
# purpose, provided that the above copyright notice and the following
# two paragraphs appear in all copies of this software.
#
# In no event shall Richard Coleman or the Zsh Development Group be liable
# to any party for direct, indirect, special, incidental, or consequential
# damages arising out of the use of this software and its documentation,
# even if Richard Coleman and the Zsh Development Group have been advised of
# the possibility of such damage.
#
# Richard Coleman and the Zsh Development Group specifically disclaim any
# warranties, including, but not limited to, the implied warranties of
# merchantability and fitness for a particular purpose. The software
# provided hereunder is on an "as is" basis, and Richard Coleman and the
# Zsh Development Group have no obligation to provide maintenance,
# support, updates, enhancements, or modifications.
#
config: Makefile
@subdir='$(SUBDIRS)'; for subdir in $$subdirs; do \
(cd $$subdir && $(MAKE) $(MAKEDEFS) $@) || exit 1; \
done
CONFIG_INCS = \
$(dir_top)/Config/clean.mk $(dir_top)/Config/config.mk \
$(dir_top)/Config/defs.mk $(dir_top)/Config/version.mk
Makefile: Makefile.in $(dir_top)/config.status $(CONFIG_INCS)
cd $(dir_top) && \
CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status

83
Config/defs.mk Normal file
View file

@ -0,0 +1,83 @@
#
# Basic Makefile definitions
#
# Copyright (c) 1995-1997 Richard Coleman
# All rights reserved.
#
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and to distribute modified versions of this software for any
# purpose, provided that the above copyright notice and the following
# two paragraphs appear in all copies of this software.
#
# In no event shall Richard Coleman or the Zsh Development Group be liable
# to any party for direct, indirect, special, incidental, or consequential
# damages arising out of the use of this software and its documentation,
# even if Richard Coleman and the Zsh Development Group have been advised of
# the possibility of such damage.
#
# Richard Coleman and the Zsh Development Group specifically disclaim any
# warranties, including, but not limited to, the implied warranties of
# merchantability and fitness for a particular purpose. The software
# provided hereunder is on an "as is" basis, and Richard Coleman and the
# Zsh Development Group have no obligation to provide maintenance,
# support, updates, enhancements, or modifications.
#
# fundamentals
SHELL = /bin/sh
@SET_MAKE@
# source/build directories
VPATH = @srcdir@
sdir = @srcdir@
sdir_top = @top_srcdir@
# installation directories
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
MODDIR = $(libdir)/zsh/$(VERSION)
infodir = @infodir@
mandir = @mandir@
# compilation
CC = @CC@
CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
DLCFLAGS = @DLCFLAGS@
DLLDFLAGS = @DLLDFLAGS@
LIBLDFLAGS = @LIBLDFLAGS@
EXELDFLAGS = @EXELDFLAGS@
LIBS = @LIBS@
DL_EXT = @DL_EXT@
DLLD = @DLLD@
# utilities
AWK = @AWK@
YODL = @YODL@
YODL2TXT = $(YODL)2txt
YODL2HTML = $(YODL)2html
# install utility
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
# flags passed to recursive makes in subdirectories
MAKEDEFS = \
prefix='$(prefix)' exec_prefix='$(exec_prefix)' bindir='$(bindir)' \
libdir='$(libdir)' MODDIR='$(MODDIR)' infodir='$(infodir)' mandir='$(mandir)' \
CC='$(CC)' CPPFLAGS='$(CPPFLAGS)' DEFS='$(DEFS)' CFLAGS='$(CFLAGS)' \
LDFLAGS='$(LDFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' \
DLCFLAGS='$(DLCFLAGS)' DLLDFLAGS='$(DLLDFLAGS)' \
LIBLDFLAGS='$(LIBLDFLAGS)' EXELDFLAGS='$(EXELDFLAGS)' \
LIBS='$(LIBS)' DL_EXT='$(DL_EXT)' DLLD='$(DLLD)' \
AWK='$(AWK)' YODL='$(YODL)' YODL2TXT='$(YODL2TXT)' YODL2HTML='$(YODL2HTML)'
# override built-in suffix list
.SUFFIXES:

31
Config/version.mk Normal file
View file

@ -0,0 +1,31 @@
#
# Makefile fragment for version numbers
#
# Copyright (c) 1995-1997 Richard Coleman
# All rights reserved.
#
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and to distribute modified versions of this software for any
# purpose, provided that the above copyright notice and the following
# two paragraphs appear in all copies of this software.
#
# In no event shall Richard Coleman or the Zsh Development Group be liable
# to any party for direct, indirect, special, incidental, or consequential
# damages arising out of the use of this software and its documentation,
# even if Richard Coleman and the Zsh Development Group have been advised of
# the possibility of such damage.
#
# Richard Coleman and the Zsh Development Group specifically disclaim any
# warranties, including, but not limited to, the implied warranties of
# merchantability and fitness for a particular purpose. The software
# provided hereunder is on an "as is" basis, and Richard Coleman and the
# Zsh Development Group have no obligation to provide maintenance,
# support, updates, enhancements, or modifications.
#
# This must also serve as a shell script, so do not add spaces around the
# `=' signs.
VERSION=3.1.5
VERSION_DATE='October 29, 1998'

15
Doc/.cvsignore Normal file
View file

@ -0,0 +1,15 @@
Makefile
version.yo
zsh*.1
zsh.texi
zsh.info*
zsh_*.html
zsh.aux zsh.toc
zsh.cp zsh.cps
zsh.fn zsh.fns
zsh.ky zsh.kys
zsh.pg zsh.pgs
zsh.vr zsh.vrs
zsh.log zsh.dvi
zsh.tp zsh.tps
zsh_*.ps

16
Doc/.distfiles Normal file
View file

@ -0,0 +1,16 @@
DISTFILES_SRC='
.cvsignore .distfiles Makefile.in
META-FAQ.yo intro.ms
version.yo zmacros.yo zman.yo ztexi.yo
zsh.yo zshbuiltins.yo zshcompctl.yo zshexpn.yo zshmisc.yo
zshmodules.yo zshoptions.yo zshparam.yo zshzle.yo
zsh.texi
zsh.1 zshbuiltins.1 zshcompctl.1 zshexpn.1 zshmisc.1 zshmodules.1
zshoptions.1 zshparam.1 zshzle.1 zshall.1
'
DISTFILES_DOC='
zsh.info zsh.info-[0-9]*
zsh_toc.html zsh_[0-9]*.html
zsh.dvi zsh_us.ps zsh_a4.ps
'

44
Doc/META-FAQ.yo Normal file
View file

@ -0,0 +1,44 @@
STARTDEF()
INCLUDEFILE(zmacros.yo)
def(startmenu)(0)(DELLINE)
def(endmenu)(0)(DELLINE)
def(menu)(1)(DELLINE)
def(texinode)(4)(DELLINE)
def(cindex)(1)(DELLINE)
def(sect)(1)(
SECTHEAD
ARG1
)
def(em)(1)(ARG1)
def(bf)(1)(ARG1)
def(tt)(1)(ARG1)
def(var)(1)(ARG1)
def(nofill)(1)(ARG1)
def(startitem)(0)(NEXTLINE DELLINE)
def(enditem)(0)(DELLINE)
def(item)(2)(
ARG1+USECHARTABLE(indent2)ARG2 DELLINE USECHARTABLE(standard))
def(startlist)(0)(DELLINE)
def(endlist)(0)(DELLINE)
def(list)(1)( ARG1)
DEFINECHARTABLE(standard)(
'\n' = "\n"
)
DEFINECHARTABLE(indent2)(
'\n' = "\n "
)
ENDDEF()\
------------------------
META-FAQ for the Z Shell
------------------------
The latest version of this META-FAQ can be found at any of the FTP sites
listed below.
INCLUDEFILE(Zsh/metafaq.yo)\

172
Doc/Makefile.in Normal file
View file

@ -0,0 +1,172 @@
#
# Makefile for Doc subdirectory
#
# Copyright (c) 1995-1997 Richard Coleman
# All rights reserved.
#
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and to distribute modified versions of this software for any
# purpose, provided that the above copyright notice and the following
# two paragraphs appear in all copies of this software.
#
# In no event shall Richard Coleman or the Zsh Development Group be liable
# to any party for direct, indirect, special, incidental, or consequential
# damages arising out of the use of this software and its documentation,
# even if Richard Coleman and the Zsh Development Group have been advised of
# the possibility of such damage.
#
# Richard Coleman and the Zsh Development Group specifically disclaim any
# warranties, including, but not limited to, the implied warranties of
# merchantability and fitness for a particular purpose. The software
# provided hereunder is on an "as is" basis, and Richard Coleman and the
# Zsh Development Group have no obligation to provide maintenance,
# support, updates, enhancements, or modifications.
#
subdir = Doc
dir_top = ..
@@version.mk@@
@@defs.mk@@
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
DVIPS = dvips -D 300
TEXI2HTML = texi2html -expandinfo -split_chapter
.SUFFIXES: .yo .1
# man pages to install
MAN = zsh.1 zshbuiltins.1 zshcompctl.1 \
zshexpn.1 zshmisc.1 zshmodules.1 \
zshoptions.1 zshparam.1 zshzle.1 zshall.1
# yodl documentation
YODLDOC = $(MAN) zsh.texi
YODLSRC = zmacros.yo zman.yo ztexi.yo Zsh/arith.yo Zsh/builtins.yo \
Zsh/compat.yo Zsh/compctl.yo Zsh/cond.yo Zsh/exec.yo Zsh/expn.yo \
Zsh/filelist.yo Zsh/files.yo Zsh/func.yo Zsh/grammar.yo Zsh/guide.yo \
Zsh/index.yo Zsh/intro.yo Zsh/invoke.yo Zsh/jobs.yo Zsh/metafaq.yo \
Zsh/modules.yo Zsh/mod_cap.yo \
Zsh/mod_clone.yo Zsh/mod_comp1.yo Zsh/mod_compctl.yo Zsh/mod_deltochar.yo \
Zsh/mod_example.yo Zsh/mod_files.yo Zsh/mod_stat.yo \
Zsh/mod_zle.yo Zsh/options.yo \
Zsh/params.yo Zsh/prompt.yo Zsh/redirect.yo Zsh/restricted.yo \
Zsh/seealso.yo Zsh/zle.yo
# ========== DEPENDENCIES FOR BUILDING ==========
all: $(MAN) zsh.texi zsh.info ../META-FAQ
everything: all zsh.dvi zsh_us.ps zsh_a4.ps zsh_toc.html
zsh.dvi: zsh.texi
$(TEXI2DVI) $(sdir)/zsh.texi
zsh.info: zsh.texi
$(MAKEINFO) $(sdir)/zsh.texi; exit 0
zsh.texi: zsh.yo
$(YODL) -o $(sdir)/zsh.texi -I$(sdir) -w ztexi.yo version.yo zsh.yo
test -f $(sdir)/zsh.texi
.yo.1:
case $@ in \
*/*) target=$@ ;; \
*) target=$(sdir)/$@ ;; \
esac; \
$(YODL) -o $$target -I$(sdir) -w zman.yo version.yo $< || exit 1; \
test -f $$target
zsh_us.ps: zsh.dvi
$(DVIPS) -t letter -o $@ zsh.dvi
zsh_a4.ps: zsh.dvi
$(DVIPS) -t a4 -o $@ zsh.dvi
zsh_toc.html: zsh.texi
$(TEXI2HTML) $(sdir)/zsh.texi
zshall.1: zsh.yo
case $@ in \
*/*) target=$@ ;; \
*) target=$(sdir)/$@ ;; \
esac; \
$(YODL) -o $$target -I$(sdir) -DZSHALL -w zman.yo version.yo zsh.yo || exit 1; \
test -f $$target
../META-FAQ: META-FAQ.yo Zsh/metafaq.yo
$(YODL) -I$(sdir) META-FAQ.yo | sed -e '/NEXTLINE/N' -e '/DELLINE/d' -e '/^SECTHEAD$$/{N;s/^SECTHEAD.//;h;s/./-/g;H;g;}' -e 's/ *$$//' > $(sdir_top)/META-FAQ
test -f $(sdir_top)/META-FAQ
$(YODLDOC): $(YODLSRC) version.yo
version.yo: $(sdir_top)/Config/version.mk
( \
echo 'STARTDEF()'; \
echo 'def(version)(0)('$(VERSION)')'; \
echo 'def(date)(0)('$(VERSION_DATE)')'; \
echo 'ENDDEF()#' | tr '#' '\\'; \
) > $(sdir)/version.yo
# ========== DEPENDENCIES FOR INSTALLING ==========
# install all the documentation
install: install.man install.info
# uninstall all the documentation
uninstall: uninstall.man uninstall.info
# install man pages, creating install directory if necessary
install.man: $(MAN)
$(sdir_top)/mkinstalldirs $(mandir)/man1
for file in $(MAN); do \
if test -f $$file; then \
$(INSTALL_DATA) $$file $(mandir)/man1; \
elif test -f $(sdir)/$$file; then \
$(INSTALL_DATA) $(sdir)/$$file $(mandir)/man1; \
else :; \
fi || exit 1; \
done
# install info pages, creating install directory if necessary
install.info: zsh.info
$(sdir_top)/mkinstalldirs $(infodir)
for file in zsh.info zsh.info-[1-9]; do \
if test -f $$file; then \
$(INSTALL_DATA) $$file $(infodir); \
elif test -f $(sdir)/$$file; then \
$(INSTALL_DATA) $(sdir)/$$file $(infodir); \
else :; \
fi || exit 1; \
done
# uninstall man pages
uninstall.man:
for file in $(MAN); do \
rm -f $(mandir)/man1/$$file; \
done
# uninstall info pages
uninstall.info:
rm -f $(infodir)/zsh.info $(infodir)/zsh.info-[1-9]
# ========== DEPENDENCIES FOR CLEANUP ==========
@@clean.mk@@
clean-here:
rm -f *.html *.info* *.dvi *.ps
rm -f *.aux *.cp *.cps *.fn *.fns *.ky *.log
rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
distclean-here:
rm -f Makefile
realclean-here:
cd $(sdir) && rm -f version.yo *.1 *.texi ../META-FAQ
# ========== DEPENDENCIES FOR MAINTENANCE ==========
@@config.mk@@

9
Doc/Zsh/.distfiles Normal file
View file

@ -0,0 +1,9 @@
DISTFILES_SRC='
.distfiles
arith.yo builtins.yo compat.yo compctl.yo cond.yo exec.yo expn.yo
filelist.yo files.yo func.yo grammar.yo guide.yo index.yo intro.yo
invoke.yo jobs.yo metafaq.yo mod_cap.yo mod_clone.yo mod_comp1.yo
mod_compctl.yo mod_deltochar.yo mod_example.yo mod_files.yo mod_sched.yo
mod_stat.yo mod_zle.yo modules.yo options.yo params.yo prompt.yo
redirect.yo restricted.yo seealso.yo zle.yo
'

1
Doc/Zsh/.lastloc Normal file
View file

@ -0,0 +1 @@
(("/home/user2/pws/src/zsh-3.1.5/Doc/Zsh/expn.yo" . 33735))

73
Doc/Zsh/arith.yo Normal file
View file

@ -0,0 +1,73 @@
texinode(Arithmetic Evaluation)(Conditional Expressions)(Jobs & Signals)(Top)
chapter(Arithmetic Evaluation)
ifzman(\
sect(Arithmetic Evaluation)
)\
cindex(arithmetic evaluation)
cindex(evaluation, arithmetic)
An ability to perform integer arithmetic is provided with the builtin tt(let).
findex(let, use of)
Evaluations are performed using em(long) arithmetic.
A leading `tt(0x)' or `tt(0X)' denotes hexadecimal.
Otherwise, numbers are of the form `[var(base)tt(#)]var(n)',
where var(base) is a decimal number between two and thirty-six
representing the arithmetic base and var(n)
is a number in that base (for example, `tt(16#ff)' is 255 in hexadecimal).
If var(base) is omitted
then base 10 is used. For backwards compatibility the form
`tt([)var(base)tt(])var(n)' is also accepted.
cindex(arithmetic operators)
cindex(operators, arithmetic)
An arithmetic expression uses nearly the same syntax, precedence, and
associativity of expressions in C.
The following operators are supported (listed in decreasing order
of precedence):
startsitem()
sitem(tt(PLUS() - ! ~ PLUS()PLUS() --))(unary plus/minus, logical NOT, complement, {pre,post}{in,de}crement)
sitem(tt(<< >>))(bitwise shift left, right)
sitem(tt(&))(bitwise AND)
sitem(tt(^))(bitwise XOR)
sitem(tt(|))(bitwise OR)
sitem(tt(**))(exponentiation)
sitem(tt(* / %))(multiplication, division, modulus (remainder))
sitem(tt(PLUS() -))(addition, subtraction)
sitem(tt(< > <= >=))(comparison)
sitem(tt(== !=))(equality and inequality)
sitem(tt(&&))(logical AND)
sitem(tt(|| ^^))(logical OR, XOR)
sitem(tt(? :))(ternary operator)
sitem(tt(= PLUS()= -= *= /= %= &= ^= |= <<= >>= &&= ||= ^^= **=))(assignment)
sitem(tt(,))(comma operator)
endsitem()
The operators `tt(&&)', `tt(||)', `tt(&&=)', and `tt(||=)' are short-circuiting,
and only one of the latter two expressions in a ternary operator
is evaluated. Note the precedence of the bitwise AND, OR,
and XOR operators.
An expression of the form `tt(#\)var(x)' where var(x) is any character
gives the ascii value of this character and an expression of the form
`tt(#)var(foo)' gives the ascii value of the first character of the value
of the parameter var(foo).
Named parameters and subscripted arrays can be referenced by name within an
arithmetic expression without using the parameter substitution syntax.
An internal integer representation of a named parameter
can be specified with the tt(integer) builtin.
cindex(parameters, integer)
cindex(integer parameters)
findex(integer, use of)
Arithmetic evaluation is performed on the value of each
assignment to a named parameter declared integer
in this manner.
Since many of the arithmetic operators require
quoting, an alternative form of the tt(let) command is provided.
For any command which begins with a tt(LPAR()LPAR()),
all the characters until a matching tt(RPAR()RPAR())
are treated as a quoted expression.
More precisely, `tt(LPAR()LPAR()) ... tt(RPAR()RPAR())'
is equivalent to `tt(let ")...tt(")'.

1184
Doc/Zsh/builtins.yo Normal file

File diff suppressed because it is too large Load diff

69
Doc/Zsh/compat.yo Normal file
View file

@ -0,0 +1,69 @@
texinode(Compatibility)(Prompt Expansion)(Conditional Expressions)(Top)
chapter(Compatibility)
ifzman(\
sect(Compatibility)
)\
cindex(compatibility)
cindex(sh, compatibility)
cindex(ksh, compatibility)
Zsh tries to emulate bf(sh) or bf(ksh) when it is invoked as
tt(sh) or tt(ksh) respectively. In this mode the following
parameters are not special and not initialized by the shell:
tt(ARGC),
tt(argv),
tt(cdpath),
tt(fignore),
tt(fpath),
tt(HISTCHARS),
tt(mailpath),
tt(MANPATH),
tt(manpath),
tt(path),
tt(prompt),
tt(PROMPT),
tt(PROMPT2),
tt(PROMPT3),
tt(PROMPT4),
tt(psvar),
tt(status),
tt(watch).
The usual zsh startup/shutdown scripts are not executed. Login shells
source tt(/etc/profile) followed by tt($HOME/.profile). If the
tt(ENV) environment variable is set on invocation, tt($ENV) is sourced
after the profile scripts. The value of tt(ENV) is subjected to
parameter expansion, command substitution, and arithmetic expansion before
being interpreted as a pathname. Note that the tt(PRIVILEGED) option
also affects the execution of startup files.
The following options are set if the shell is invoked as tt(sh) or
tt(ksh):
tt(NO_BAD_PATTERN),
tt(NO_BANG_HIST),
tt(NO_BG_NICE),
tt(NO_EQUALS),
tt(NO_FUNCTION_ARGZERO),
tt(GLOB_SUBST),
tt(NO_HUP),
tt(INTERACTIVE_COMMENTS),
tt(KSH_ARRAYS),
tt(NO_MULTIOS),
tt(NO_NOMATCH),
tt(NO_NOTIFY),
tt(POSIX_BUILTINS),
tt(NO_PROMPT_PERCENT),
tt(RM_STAR_SILENT),
tt(SH_FILE_EXPANSION),
tt(SH_GLOB),
tt(SH_OPTION_LETTERS),
tt(SH_WORD_SPLIT).
Additionally the tt(BSD_ECHO) and tt(IGNORE_BRACES)
options are set if zsh is invoked as tt(sh).
Also, the
tt(KSH_OPTION_PRINT),
tt(LOCAL_OPTIONS),
tt(PROMPT_BANG),
tt(PROMPT_SUBST)
and
tt(SINGLE_LINE_ZLE)
options are set if zsh is invoked as tt(ksh).

526
Doc/Zsh/compctl.yo Normal file
View file

@ -0,0 +1,526 @@
texinode(Programmable Completion)(Zsh Modules)(Zsh Line Editor)(Top)
chapter(Programmable Completion)
cindex(completion, programmable)
cindex(completion, controlling)
findex(compctl)
sect(Description)
startlist()
list(tt(compctl) [ tt(-CDT) ] var(options) [ var(command) ... ])
list(tt(compctl) [ tt(-CDT) ] var(options) \
[ tt(-x) var(pattern) var(options) tt(-) ... tt(--) ] \
[ tt(PLUS()) var(options) [ tt(-x) ... tt(--) ] ... [tt(PLUS())] ] \
[ var(command) ... ])
list(tt(compctl) tt(-L) [ tt(-CDT) ] [ var(command) ... ])
list(tt(compctl) tt(PLUS()) var(command) ...)
endlist()
Control the editor's completion behavior according to the supplied set
of var(options). Various editing commands, notably
tt(expand-or-complete-word), usually bound to tab, will
attempt to complete a word typed by the user, while others, notably
tt(delete-char-or-list), usually bound to ^D in EMACS editing
mode, list the possibilities; tt(compctl) controls what those
possibilities are. They may for example be filenames (the most common
case, and hence the default), shell variables, or words from a
user-specified list.
startmenu()
menu(Command Flags)
menu(Option Flags)
menu(Alternative Completion)
menu(Extended Completion)
menu(Example)
endmenu()
texinode(Command Flags)(Option Flags)()(Programmable Completion)
sect(Command Flags)
Completion of the arguments of a command may be different for each
command or may use the default. The behavior when completing the
command word itself may also be separately specified. These
correspond to the following flags and arguments, all of which (except
for tt(-L)) may be combined with any combination of the
var(options) described subsequently in noderef(Option Flags):
startitem()
item(var(command) ...)(
controls completion for the named commands, which must be listed last
on the command line. If completion is attempted for a command with a
pathname containing slashes and no completion definition is found, the
search is retried with the last pathname component. Note that aliases
are expanded before the command name is determined unless the
tt(COMPLETE_ALIASES) option is set. Commands should not be combined
with the tt(-C), tt(-D) or tt(-T) flags.
)
item(tt(-C))(
controls completion when the command word itself is being completed.
If no tt(compctl -C) command has been issued, the names of any
executable command (whether in the path or specific to the shell, such
as aliases or functions) are completed.
)
item(tt(-D))(
controls default completion behavior for the arguments of commands not
assigned any special behavior. If no tt(compctl -D) command has
been issued, filenames are completed.
)
item(tt(-T))(
supplies completion flags to be used before any other processing is
done, even those given to specific commands with other compctl
definitions. This is only useful when combined with extended
completion (the tt(-x) flag, see noderef(Extended Completion) below).
Using this flag you can define default behavior
which will apply to all commands without exception, or you can alter
the standard behavior for all commands. For example, if your access
to the user database is too slow and/or it contains too many users (so
that completion after `tt(~)' is too slow to be usable), you can use
nofill(tt(compctl -Tx 'C[0,*/*]' -f - 's[~]' -k friends -S/))
to complete the strings in the array tt(friends) after a `tt(~)'.
The first argument is necessary so that this form of ~-completion is
not tried after the directory name is finished.
)
item(tt(-L))(
lists the existing completion behavior in a manner suitable for
putting into a start-up script; the existing behavior is not changed.
Any combination of the above forms may be specified, otherwise all
defined completions are listed. Any other flags supplied
are ignored.
)
item(em(no argument))(
If no argument is given, tt(compctl) lists all defined completions
in an abbreviated form; with a list of var(options), all completions
with those flags set (not counting extended completion) are listed.
)
endlist()
If the tt(PLUS()) flag is alone and followed immediately by the var(command)
list, the completion behavior for all the commands in the list is reset to
the default. In other words, completion will subsequently use the
options specified by the tt(-D) flag.
texinode(Option Flags)(Alternative Completion)(Command Flags)(Programmable Completion)
sect(Option Flags)
startlist()
list([ tt(-fcFBdeaRGovNAIOPZEnbjrzu/) ])
list([ tt(-k) var(array) ] [ tt(-g) var(globstring) ] \
[ tt(-s) var(subststring) ])
list([ tt(-K) var(function) ] [ tt(-H) var(num pattern) ])
list([ tt(-Q) ] [ tt(-P) var(prefix) ] [ tt(-S) var(suffix) ])
list([ tt(-W) var(file-prefix) ])
list([ tt(-q) ] [ tt(-X) var(explanation) ] [ tt(-Y) var(explanation) ])
list([ tt(-y) var(func-or-var) ] [ tt(-l) var(cmd) ] [ tt(-U) ])
endlist()
The remaining var(options) specify the type of command arguments
to look for during completion. Any combination of these flags may be
specified; the result is a sorted list of all the possibilities. The
options are as follows.
startmenu()
menu(Simple Flags)
menu(Flags with Arguments)
menu(Control Flags)
endmenu()
texinode(Simple Flags)(Flags with Arguments)()(Option Flags)
subsect(Simple Flags)
These produce completion lists made up by the shell itself:
startitem()
item(tt(-f))(
Filenames and filesystem paths.
)
item(tt(-/))(
Just filesystem paths.
)
item(tt(-c))(
Command names, including aliases, shell functions, builtins
and reserved words.
)
item(tt(-F))(
Function names.
)
item(tt(-B))(
Names of builtin commands.
)
item(tt(-m))(
Names of external commands.
)
item(tt(-w))(
Reserved words.
)
item(tt(-a))(
Alias names.
)
item(tt(-R))(
Names of regular (non-global) aliases.
)
item(tt(-G))(
Names of global aliases.
)
item(tt(-d))(
This can be combined with tt(-F), tt(-B), tt(-w),
tt(-a), tt(-R) and tt(-G) to get names of disabled
functions, builtins, reserved words or aliases.
)
item(tt(-e))(
This option (to show enabled commands) is in effect by default, but
may be combined with tt(-d); tt(-de) in combination with
tt(-F), tt(-B), tt(-w), tt(-a), tt(-R) and tt(-G)
will complete names of functions, builtins, reserved words or aliases
whether or not they are disabled.
)
item(tt(-o))(
Names of shell options (see
ifzman(zmanref(zshoptions))\
ifnzman(noderef(Options))\
).
)
item(tt(-v))(
Names of any variable defined in the shell.
)
item(tt(-N))(
Names of scalar (non-array) parameters.
)
item(tt(-A))(
Array names.
)
item(tt(-I))(
Names of integer variables.
)
item(tt(-O))(
Names of read-only variables.
)
item(tt(-p))(
Names of parameters used by the shell (including special parameters).
)
item(tt(-Z))(
Names of shell special parameters.
)
item(tt(-E))(
Names of environment variables.
)
item(tt(-n))(
Named directories.
)
item(tt(-b))(
Key binding names.
)
item(tt(-j))(
Job names: the first word of the job leader's command line. This is useful
with the tt(kill) builtin.
)
item(tt(-r))(
Names of running jobs.
)
item(tt(-z))(
Names of suspended jobs.
)
item(tt(-u))(
User names.
)
enditem()
texinode(Flags with Arguments)(Control Flags)(Simple Flags)(Option Flags)
subsect(Flags with Arguments)
These have user supplied arguments to determine how the list of
completions is to be made up:
startitem()
item(tt(-k) var(array))(
Names taken from the elements of tt($)var(array) (note that the `tt($)'
does not appear on the command line).
Alternatively, the argument var(array) itself may be a set
of space- or comma-separated values in parentheses, in which any
delimiter may be escaped with a backslash; in this case the argument
should be quoted. For example,
nofill(tt(compctl -k "(cputime filesize datasize stacksize
coredumpsize resident descriptors)" limit))
)
item(tt(-g) var(globstring))(
The var(globstring) is expanded using filename globbing; it should be
quoted to protect it from immediate expansion. The resulting
filenames are taken as the possible completions. Use `tt(*(/))' instead of
`tt(*/)' for directories. The tt(fignore) special parameter is not
applied to the resulting files. More than one pattern may be given
separated by blanks. (Note that brace expansion is em(not) part of
globbing. Use the syntax `tt((either|or))' to match alternatives.)
)
item(tt(-s) var(subststring))(
The var(subststring) is split into words and these words are than
expanded using all shell expansion mechanisms (see
ifzman(zmanref(zshexpn))\
ifnzman(noderef(Expansion))\
). The resulting words are taken as possible
completions. The tt(fignore) special parameter is not applied to the
resulting files. Note that tt(-g) is faster for filenames.
)
item(tt(-K) var(function))(
Call the given function to get the completions. The function is
passed two arguments: the prefix and the suffix of the word on which
completion is to be attempted, in other words those characters before
the cursor position, and those from the cursor position onwards. The
whole command line can be accessed with the tt(-c) and tt(-l) flags
of the tt(read) builtin. The
function should set the variable tt(reply) to an array containing
the completions (one completion per element); note that tt(reply)
should not be made local to the function. From such a function the
command line can be accessed with the tt(-c) and tt(-l) flags to
the tt(read) builtin. For example,
nofill(tt(function whoson { reply=(`users`); }
compctl -K whoson talk))
completes only logged-on users after `tt(talk)'. Note that `tt(whoson)' must
return an array, so `tt(reply=`users`)' would be incorrect.
)
item(tt(-H) var(num pattern))(
The possible completions are taken from the last var(num) history
lines. Only words matching var(pattern) are taken. If var(num) is
zero or negative the whole history is searched and if var(pattern) is
the empty string all words are taken (as with `tt(*)'). A typical
use is
nofill(tt(compctl -D -f PLUS() -H 0 ''))
which forces completion to look back in the history list for a word if
no filename matches.
)
enditem()
texinode(Control Flags)()(Flags with Arguments)(Option Flags)
subsect(Control Flags)
These do not directly specify types of name to be completed, but
manipulate the options that do:
startitem()
item(tt(-Q))(
This instructs the shell not to quote any metacharacters in the possible
completions. Normally the results of a completion are inserted into
the command line with any metacharacters quoted so that they are
interpreted as normal characters. This is appropriate for filenames
and ordinary strings. However, for special effects, such as inserting
a backquoted expression from a completion array (tt(-k)) so that
the expression will not be evaluated until the complete line is
executed, this option must be used.
)
item(tt(-P) var(prefix))(
The var(prefix) is inserted just before the completed string; any
initial part already typed will be completed and the whole var(prefix)
ignored for completion purposes. For example,
nofill(tt(compctl -j -P "%" kill))
inserts a `%' after the kill command and then completes job names.
)
item(tt(-S) var(suffix))(
When a completion is found the var(suffix) is inserted after
the completed string. In the case of menu completion the suffix is
inserted immediately, but it is still possible to cycle through the
list of completions by repeatedly hitting the same key.
)
item(tt(-W) var(file-prefix))(
With directory var(file-prefix): for command, file, directory and
globbing completion (options tt(-c), tt(-f), tt(-/), tt(-g)), the file
prefix is implicitly added in front of the completion. For example,
nofill(tt(compctl -/ -W ~/Mail maildirs))
completes any subdirectories to any depth beneath the directory
tt(~/Mail), although that prefix does not appear on the command line.
)
item(tt(-q))(
If used with a suffix as specified by the tt(-S) option, this
causes the suffix to be removed if the next character typed is a blank
or does not insert anything (the same rule as used for the
tt(AUTO_REMOVE_SLASH) option). The option is most useful for list
separators (comma, colon, etc.).
)
item(tt(-l) var(cmd))(
This option cannot be combined with any other. It restricts the range
of command line words that are considered to be arguments. If
combined with one of the extended completion patterns `tt(p[)...tt(])',
`tt(r[)...tt(])', or `tt(R[)...tt(])' (see noderef(Extended Completion)
below) the range is restricted to the range of arguments
specified in the brackets. Completion is then performed as if these
had been given as arguments to the var(cmd) supplied with the
option. If the var(cmd) string is empty the first word in the range
is instead taken as the command name, and command name completion
performed on the first word in the range. For example,
nofill(tt(compctl -x 'r[-exec,;]' -l '' -- find))
completes arguments between `tt(-exec)' and the following `tt(;)' (or the end
of the command line if there is no such string) as if they were
a separate command line.
)
item(tt(-U))(
Use the whole list of possible completions, whether or not they
actually match the word on the command line. The word typed so far
will be deleted. This is most useful with a function (given by the
tt(-K) option) which can examine the word components passed to it
(or via the tt(read) builtin's tt(-c) and tt(-l) flags) and
use its own criteria to decide what matches. If there is no
completion, the original word is retained.
)
item(tt(-y) var(func-or-var))(
The list provided by var(func-or-var) is displayed instead of the list
of completions whenever a listing is required; the actual completions
to be inserted are not affected. It can be provided in two
ways. Firstly, if var(func-or-var) begins with a tt($) it defines a
variable, or if it begins with a left parenthesis a literal
array, which contains the list. A variable may have been set by a
call to a function using the tt(-K) option. Otherwise it contains the
name of a function which will be executed to create the list. The
function will be passed as an argument list all matching completions,
including prefixes and suffixes expanded in full, and should set the
array var(reply) to the result. In both cases, the display list will
only be retrieved after a complete list of matches has been created.
Note that the returned list does not have to correspond, even in
length, to the original set of matches, and may be passed as a scalar
instead of an array. No special formatting of characters is
performed on the output in this case; in particular, newlines are
printed literally and if they appear output in columns is suppressed.
)
item(tt(-X) var(explanation))(
Print var(explanation) when trying completion on the current set of
options. A `tt(%n)' in this string is replaced by the number of matches.
The explanation only appears if completion was tried and there was
no unique match, or when listing completions.
)
item(tt(-Y) var(explanation))(
Identical to tt(-X), except that the var(explanation) first undergoes
expansion following the usual rules for strings in double quotes.
The expansion will be carried out after any functions are called for
the tt(-K) or tt(-y) options, allowing them to set variables.
)
enditem()
texinode(Alternative Completion)(Extended Completion)(Option Flags)(Programmable Completion)
sect(Alternative Completion)
startlist()
list(tt(compctl) [ tt(-CDT) ] var(options) tt(PLUS()) var(options) [ tt(PLUS()) ... ] \
[ tt(PLUS()) ] var(command) ...)
endlist()
The form with `tt(PLUS())' specifies alternative options. Completion is
tried with the options before the first `tt(PLUS())'. If this produces no
matches completion is tried with the flags after the `tt(PLUS())' and so on. If
there are no flags after the last `tt(PLUS())' and a match has not been found
up to that point, default completion is tried.
texinode(Extended Completion)(Example)(Alternative Completion)(Programmable Completion)
sect(Extended Completion)
startlist()
list(tt(compctl) [ tt(-CDT) ] var(options) \
tt(-x) var(pattern) var(options) tt(-) ... tt(--) \
[ var(command) ... ])
list(tt(compctl) [ tt(-CDT) ] var(options) \
[ tt(-x) var(pattern) var(options) tt(-) ... tt(--) ] \
[ tt(PLUS()) var(options) [ tt(-x) ... tt(--) ] ... [tt(PLUS())] ] \
[ var(command) ... ])
endlist()
The form with `tt(-x)' specifies extended completion for the
commands given; as shown, it may be combined with alternative
completion using `tt(PLUS())'. Each var(pattern) is examined in turn; when a
match is found, the corresponding var(options), as described in
noderef(Option Flags) above, are used to generate possible
completions. If no var(pattern) matches, the var(options) given
before the tt(-x) are used.
Note that each pattern should be supplied as a single argument and
should be quoted to prevent expansion of metacharacters by the
shell.
A var(pattern) is built of sub-patterns separated by commas; it
matches if at least one of these sub-patterns matches (they are
`or'ed). These sub-patterns are in turn composed of other
sub-patterns separated by white spaces which match if all of the
sub-patterns match (they are `and'ed). An element of the
sub-patterns is of the form `var(c)tt([)...tt(][)...tt(])', where the pairs of
brackets may be repeated as often as necessary, and matches if any of
the sets of brackets match (an `or'). The example below makes this
clearer.
The elements may be any of the following:
startitem()
item(tt(s[)var(string)tt(])...)(
Matches if the current word on the command line starts with
one of the strings given in brackets. The var(string) is not removed
and is not part of the completion.
)
item(tt(S[)var(string)tt(])...)(
Like tt(s[)var(string)tt(]) except that the var(string) is part of the
completion.
)
item(tt(p[)var(from)tt(,)var(to)tt(])...)(
Matches if the number of the current word is between one of
the var(from) and var(to) pairs inclusive. The comma and var(to)
are optional; var(to) defaults to the same value as var(from). The
numbers may be negative: tt(-)var(n) refers to the var(n)'th last word
on the line.
)
item(tt(c[)var(offset)tt(,)var(string)tt(])...)(
Matches if the var(string) matches the word offset by
var(offset) from the current word position. Usually var(offset)
will be negative.
)
item(tt(C[)var(offset)tt(,)var(pattern)tt(])...)(
Like tt(c) but using pattern matching instead.
)
item(tt(w[)var(index)tt(,)var(string)tt(])...)(
Matches if the word in position var(index) is equal
to the corresponding var(string). Note that the word count is made
after any alias expansion.
)
item(tt(W[)var(index)tt(,)var(pattern)tt(])...)(
Like tt(w) but using pattern matching instead.
)
item(tt(n[)var(index)tt(,)var(string)tt(])...)(
Matches if the current word contains var(string). Anything up to and
including the var(index)th occurrence of this string will not be
considered part of the completion, but the rest will. var(index) may
be negative to count from the end: in most cases, var(index) will be
1 or -1. For example,
nofill(tt(compctl -s '`users`' -x 'n[1,@]' -k hosts -- talk))
will usually complete usernames, but if you insert an tt(@) after the
name, names from the array var(hosts) (assumed to contain hostnames,
though you must make the array yourself) will be completed. Other
commands such as tt(rcp) can be handled similarly.
)
item(tt(N[)var(index)tt(,)var(string)tt(])...)(
Like tt(n) except that the string will be
taken as a character class. Anything up to and including the
var(index)th occurrence of any of the characters in var(string)
will not be considered part of the completion.
)
item(tt(m[)var(min)tt(,)var(max)tt(])...)(
Matches if the total number of words lies between var(min) and
var(max) inclusive.
)
item(tt(r[)var(str1)tt(,)var(str2)tt(])...)(
Matches if the cursor is after a word with prefix var(str1). If there
is also a word with prefix var(str2) on the command line it matches
only if the cursor is before this word.
)
item(tt(R[)var(str1)tt(,)var(str2)tt(])...)(
Like tt(r) but using pattern matching instead.
)
enditem()
texinode(Example)()(Extended Completion)(Programmable Completion)
sect(Example)
nofill(tt(compctl -u -x 's[tt(PLUS())] c[-1,-f],s[-f+PLUS()]' -g '~/Mail/*(:t)' \
- 's[-f],c[-1,-f]' -f -- mail))
This is to be interpreted as follows:
If the current command is tt(mail), then
indent(
if ((the current word begins with tt(PLUS()) and the previous word is tt(-f))
or (the current word begins with tt(-f+PLUS()))), then complete the
non-directory part (the `tt(:t)' glob modifier) of files in the directory
tt(~/Mail); else
if the current word begins with tt(-f) or the previous word was tt(-f), then
complete any file; else
complete user names.
)

158
Doc/Zsh/cond.yo Normal file
View file

@ -0,0 +1,158 @@
texinode(Conditional Expressions)(Compatibility)(Arithmetic Evaluation)(Top)
chapter(Conditional Expressions)
ifzman(\
sect(Conditional Expressions)
)\
cindex(conditional expressions)
cindex(expressions, conditional)
A em(conditional expression) is used with the tt([[)
compound command to test attributes of files and to compare strings.
Each expression can be constructed from one or more
of the following unary or binary expressions:
startitem()
item(tt(-a) var(file))(
true if var(file) exists.
)
item(tt(-b) var(file))(
true if var(file) exists and is a block special file.
)
item(tt(-c) var(file))(
true if var(file) exists and is a character special file.
)
item(tt(-d) var(file))(
true if var(file) exists and is a directory.
)
item(tt(-e) var(file))(
true if var(file) exists.
)
item(tt(-f) var(file))(
true if var(file) exists and is a regular file.
)
item(tt(-g) var(file))(
true if var(file) exists and has its setgid bit set.
)
item(tt(-h) var(file))(
true if var(file) exists and is a symbolic link.
)
item(tt(-k) var(file))(
true if var(file) exists and has its sticky bit set.
)
item(tt(-n) var(string))(
true if length of var(string) is non-zero.
)
item(tt(-o) var(option))(
true if option named var(option) is on. var(option)
may be a single character, in which case it is a single letter option name.
(See noderef(Specifying Options).)
)
item(tt(-p) var(file))(
true if var(file) exists and is a FIFO special file (named pipe).
)
item(tt(-r) var(file))(
true if var(file) exists and is readable by current process.
)
item(tt(-s) var(file))(
true if var(file) exists and has size greater than zero.
)
item(tt(-t) var(fd))(
true if file descriptor number var(fd)
is open and associated with a terminal device.
(note: var(fd) is not optional)
)
item(tt(-u) var(file))(
true if var(file) exists and has its setuid bit set.
)
item(tt(-w) var(file))(
true if var(file) exists and is writable by current process.
)
item(tt(-x) var(file))(
true if var(file) exists and is executable by current process.
If var(file) exists and is a directory, then the current process
has permission to search in the directory.
)
item(tt(-z) var(string))(
true if length of var(string) is zero.
)
item(tt(-L) var(file))(
true if var(file) exists and is a symbolic link.
)
item(tt(-O) var(file))(
true if var(file) exists and is owned by the effective user ID of this process.
)
item(tt(-G) var(file))(
true if var(file) exists and its group matches
the effective group ID of this process.
)
item(tt(-S) var(file))(
true if var(file) exists and is a socket.
)
item(tt(-N) var(file))(
true if var(file) exists and its access time is
not newer than its modification time.
)
item(var(file1) tt(-nt) var(file2))(
true if var(file1) exists and is newer than var(file2).
)
item(var(file1) tt(-ot) var(file2))(
true if var(file1) exists and is older than var(file2).
)
item(var(file1) tt(-ef) var(file2))(
true if var(file1) and var(file2) exist and refer to the same file.
)
xitem(var(string) tt(=) var(pattern))
item(var(string) tt(==) var(pattern))(
true if var(string) matches var(pattern).
The `tt(==)' form is the preferred one. The `tt(=)' form is for
backward compatibility and should be considered obsolete.
)
item(var(string) tt(!=) var(pattern))(
true if var(string) does not match var(pattern).
)
item(var(string1) tt(<) var(string2))(
true if var(string1) comes before var(string2)
based on ASCII value of their characters.
)
item(var(string1) tt(>) var(string2))(
true if var(string1) comes after var(string2)
based on ASCII value of their characters.
)
item(var(exp1) tt(-eq) var(exp2))(
true if var(exp1) is numerically equal to var(exp2).
)
item(var(exp1) tt(-ne) var(exp2))(
true if var(exp1) is numerically not equal to var(exp2).
)
item(var(exp1) tt(-lt) var(exp2))(
true if var(exp1) is numerically less than var(exp2).
)
item(var(exp1) tt(-gt) var(exp2))(
true if var(exp1) is numerically greater than var(exp2).
)
item(var(exp1) tt(-le) var(exp2))(
true if var(exp1) is numerically less than or equal to var(exp2).
)
item(var(exp1) tt(-ge) var(exp2))(
true if var(exp1) is numerically greater than or equal to var(exp2).
)
item(tt(LPAR()) var(exp) tt(RPAR()))(
true if var(exp) is true.
)
item(tt(!) var(exp))(
true if var(exp) is false.
)
item(var(exp1) tt(&&) var(exp2))(
true if var(exp1) and var(exp2) are both true.
)
item(var(exp1) tt(||) var(exp2))(
true if either var(exp1) or var(exp2) is true.
)
enditem()
In each of the above expressions, if
var(file) is of the form `tt(/dev/fd/)var(n)',
where var(n) is an integer,
then the test applied to the open file whose
descriptor number is var(n),
even if the underlying system does not support
the tt(/dev/fd) directory.

25
Doc/Zsh/exec.yo Normal file
View file

@ -0,0 +1,25 @@
texinode(Command Execution)(Functions)(Redirection)(Top)
chapter(Command Execution)
ifzman(\
sect(Command Execution)
)\
cindex(command execution)
cindex(execution, of commands)
If a command name contains no slashes, the shell attempts to locate
it. If there exists a shell function by that name, the function
is invoked as described in noderef(Functions). If there exists
a shell builtin by that name, the builtin is invoked.
vindex(path, use of)
Otherwise, the shell searches each element of tt($path) for a
directory containing an executable file by that name. If the
search is unsuccessful, the shell prints an error message and returns
a nonzero exit status.
If execution fails because the file is not in executable format,
and the file is not a directory, it is assumed to be a shell
script. tt(/bin/sh) is spawned to execute it. If the program
is a file beginning with `tt(#!)', the remainder of the first line
specifies an interpreter for the program. The shell will
execute the specified interpreter on operating systems that do
not handle this executable format in the kernel.

1052
Doc/Zsh/expn.yo Normal file

File diff suppressed because it is too large Load diff

15
Doc/Zsh/filelist.yo Normal file
View file

@ -0,0 +1,15 @@
sect(Files)
cindex(files used)
startlist()
list(tt($ZDOTDIR/.zshenv))
list(tt($ZDOTDIR/.zprofile))
list(tt($ZDOTDIR/.zshrc))
list(tt($ZDOTDIR/.zlogin))
list(tt($ZDOTDIR/.zlogout))
list(tt(${TMPPREFIX}*) (default is /tmp/zsh*))
list(tt(/etc/zshenv))
list(tt(/etc/zprofile))
list(tt(/etc/zshrc))
list(tt(/etc/zlogin))
list(tt(/etc/zlogout) (installation-specific - tt(/etc) is the default))
endlist()

26
Doc/Zsh/files.yo Normal file
View file

@ -0,0 +1,26 @@
texinode(Files)(Shell Grammar)(Invocation)(Top)
chapter(Files)
sect(Startup/Shutdown Files)
cindex(files, startup)
cindex(startup files)
cindex(files, shutdown)
cindex(shutdown files)
pindex(NO_RCS, use of)
Commands are first read from tt(/etc/zshenv).
If the tt(RCS) option is unset
within tt(/etc/zshenv), all other
initialization files are skipped.
Otherwise, commands are read
from tt($ZDOTDIR/.zshenv).
pindex(LOGIN, use of)
If the shell is a login shell, commands
are read from tt(/etc/zprofile) and then tt($ZDOTDIR/.zprofile).
Then, if the shell is interactive,
commands are read from tt(/etc/zshrc) and then tt($ZDOTDIR/.zshrc).
Finally, if the shell is a login shell, tt(/etc/zlogin) and
tt($ZDOTDIR/.zlogin) are read.
If tt(ZDOTDIR) is unset, tt(HOME) is used instead.
Those files listed above as being in tt(/etc) may be in another
directory, depending on the installation.
ifnzman(includefile(Zsh/filelist.yo))

107
Doc/Zsh/func.yo Normal file
View file

@ -0,0 +1,107 @@
texinode(Functions)(Jobs & Signals)(Command Execution)(Top)
chapter(Functions)
ifzman(\
sect(Functions)
)\
cindex(functions)
findex(function)
The tt(function) reserved word is used to define shell functions.
Shell functions are read in and stored internally.
Alias names are resolved when the function is read.
Functions are executed like commands with the arguments
passed as positional parameters.
(See noderef(Command Execution).)
Functions execute in the same process as the caller and
share all files
and present working directory with the
caller. A trap on tt(EXIT) set inside a function
is executed after the function completes in the environment
of the caller.
findex(return, use of)
The tt(return) builtin is used to return from function calls.
findex(functions, use of)
Function identifiers can be listed with the tt(functions) builtin.
findex(unfunction, use of)
Functions can be undefined with the tt(unfunction) builtin.
sect(Autoloading Functions)
findex(autoload, use of)
cindex(autoloading functions)
cindex(functions, autoloading)
A function can be marked as em(undefined) using the tt(autoload) builtin
(or `tt(functions -u)' or `tt(typeset -fu)'). Such a function has no
body. When the function is first executed, the tt(fpath)
variable will be searched for a file with the same name as the
function.
pindex(KSH_AUTOLOAD, use of)
If the tt(KSH_AUTOLOAD) option is set, or the file contains only a simple
definition of the function, the file's contents will be
executed. It would normally define the function in question, but may
also perform initialisation.
It is executed in the context of the function
execution, and may therefore define local parameters.
Otherwise, the function is defined such that its body is the
complete contents of the file. This form allows the file to be
used directly as an executable shell script.
Initialisation code can be executed, but only as part of the first
function execution, so the function would have to redefine itself to
avoid reinitialising on the next execution.
If this processing of the file results in the function being
fully defined, the function itself is then executed.
sect(Special Functions)
The following functions, if defined, have special meaning to
the shell:
startitem()
findex(chpwd)
item(tt(chpwd))(
Executed whenever the current working directory is changed.
)
findex(periodic)
item(tt(periodic))(
vindex(PERIOD)
If the parameter tt(PERIOD)
is set, this function is executed every tt($PERIOD)
seconds, just before a prompt.
)
findex(precmd)
item(tt(precmd))(
Executed before each prompt.
)
findex(preexec)
item(tt(preexec))(
Executed just after a command has been read and is about to be
executed. If the history mechanism is active, the string to be
executed is passed as an argument.
)
item(tt(TRAP)var(NAL))(
cindex(signals, trapping)
cindex(trapping signals)
If defined and non-null,
this function will be executed whenever the shell
catches a signal tt(SIG)var(NAL), where var(NAL) is a signal
name as specified for the tt(kill) builtin.
The signal number will be passed as the first parameter to the function.
If a function of this form is defined and null,
the shell and processes spawned by it will ignore tt(SIG)var(NAL).
)
findex(TRAPDEBUG)
item(tt(TRAPDEBUG))(
Executed after each command.
)
findex(TRAPEXIT)
item(tt(TRAPEXIT))(
Executed when the shell exits,
or when the current function exits if defined inside a function.
)
findex(TRAPZERR)
item(tt(TRAPZERR))(
Executed whenever a command has a non-zero exit status.
)
enditem()

335
Doc/Zsh/grammar.yo Normal file
View file

@ -0,0 +1,335 @@
texinode(Shell Grammar)(Redirection)(Files)(Top)
chapter(Shell Grammar)
cindex(shell grammar)
cindex(grammar, shell)
startmenu()
menu(Simple Commands & Pipelines)
menu(Precommand Modifiers)
menu(Complex Commands)
menu(Alternate Forms For Complex Commands)
menu(Reserved Words)
menu(Comments)
menu(Aliasing)
menu(Quoting)
endmenu()
texinode(Simple Commands & Pipelines)(Precommand Modifiers)()(Shell Grammar)
sect(Simple Commands & Pipelines)
cindex(simple commands)
cindex(commands, simple)
A em(simple command) is a sequence of optional parameter
assignments followed by blank-separated words,
with optional redirections interspersed.
The first word is the command to be executed, and the remaining
words, if any, are arguments to the command.
If a command name is given, the parameter assignments modify
the environment of the command when it is executed.
The value of a simple command is its exit status,
or 128 plus the signal number if terminated by a signal.
cindex(pipeline)
A em(pipeline) is either a simple command, or a sequence of two or more
simple commands where each command is separated from the next by `tt(|)'
or `tt(|&)'. Where commands are separated by `tt(|)', the standard
output of the first command is connected to the
standard input of the next. `tt(|&)' is shorthand for `tt(2>&1 |)', which
connects both the standard output and the standard error of the
command to the standard input of the next. The value of a pipeline
is the value of the last command, unless the pipeline is preceded by
`tt(!)' in which case the value is the logical inverse of the value of the
last command.
findex(coproc)
cindex(coprocess)
If a pipeline is preceded by `tt(coproc)', it is executed as a coprocess;
a two-way pipe is established between it and the parent shell. The
shell can read from or write to the coprocess by means of the `tt(>&p)'
and `tt(<&p)' redirection operators or with `tt(print -p)' and `tt(read -p)'.
A pipeline cannot be preceded by both `tt(coproc)' and `tt(!)'.
cindex(sublist)
A em(sublist) is either a single pipeline, or a sequence of two or more
pipelines separated by `tt(&&)' or `tt(||)'. If two pipelines are separated
by `tt(&&)', the second pipeline is executed only if the first succeeds
(returns a zero value). If two pipelines are separated by `tt(||)', the
second is executed only if the first fails (returns a nonzero value).
Both operators have equal precedence and are left associative.
The value of the sublist is the value of the last pipeline executed.
cindex(list)
A em(list) is a sequence of zero or more sublists, in which each sublist
is terminated by `tt(;)', `tt(&)', `tt(&|)', `tt(&!)', or a newline.
This terminator
may optionally be omitted from the last sublist in the list when the
list appears as a complex command inside `tt(LPAR())...tt(RPAR())'
or `tt({)...tt(})'. When a
sublist is terminated by `tt(;)' or newline, the shell waits for it to
finish before executing the next sublist. If a sublist is terminated
by a `tt(&)', `tt(&|)', or `tt(&!)',
the shell executes it in the background, and
does not wait for it to finish.
A backgrounded sublist returns a status of zero.
texinode(Precommand Modifiers)(Complex Commands)(Simple Commands & Pipelines)(Shell Grammar)
sect(Precommand Modifiers)
cindex(precommand modifiers)
cindex(modifiers, precommand)
A simple command may be preceded by a em(precommand modifier),
which will alter how the command is interpreted. These modifiers are
shell builtin commands with the exception of tt(nocorrect) which is
a reserved word.
startitem()
item(tt(-))(
The command is executed with a `tt(-)' prepended to its
tt(argv[0]) string.
)
item(tt(noglob))(
Filename generation (globbing) is not performed on any of
the words.
)
item(tt(nocorrect))(
Spelling correction is not done on any of the words.
)
item(tt(exec))(
The command is executed in the parent shell without forking.
)
item(tt(command))(
The command word is taken to be the name of an external command,
rather than a shell function or builtin.
)
item(tt(builtin))(
The command word is taken to be the name of a builtin command,
rather than a shell function or external command.
)
enditem()
texinode(Complex Commands)(Alternate Forms For Complex Commands)(Precommand Modifiers)(Shell Grammar)
sect(Complex Commands)
cindex(complex commands)
cindex(commands, complex)
A em(complex command) in zsh is one of the following:
startitem()
findex(if)
cindex(if construct)
item(tt(if) var(list) tt(then) var(list) [ tt(elif) var(list) tt(then) var(list) ] ... [ tt(else) var(list) ] tt(fi))(
The tt(if) var(list) is executed, and if it returns a zero exit status,
the tt(then) var(list) is executed.
Otherwise, the tt(elif) var(list) is executed and if its value is zero,
the tt(then) var(list) is executed.
If each tt(elif) var(list) returns nonzero, the tt(else) var(list) is executed.
)
findex(for)
cindex(for loops)
cindex(loops, for)
item(tt(for) var(name) [ tt(in) var(word) ... var(term) ] tt(do) var(list) tt(done))(
where var(term) is at least one newline or tt(;).
Expand the list of var(word)s, and set the parameter
var(name) to each of them in turn, executing
var(list) each time. If the tt(in) var(word) is omitted,
use the positional parameters instead of the var(word)s.
)
item(tt(for LPAR()LPAR()) [var(expr1)] tt(;) [var(expr2)] tt(;) [var(expr3)] tt(RPAR()RPAR() do) var(list) tt(done))(
The arithmetic expression var(expr1) is evaluated first (see
noderef(Arithmetic Evaluation)). The arithmetic expression
var(expr2) is repeatedly evaluated until it evaluates to zero and
when non-zero, var(list) is executed and the arithmetic expression
var(expr3) evaluated. If any expression is omitted, then it behaves
as if it evaluated to 1.
)
findex(while)
cindex(while loops)
cindex(loops, while)
item(tt(while) var(list) tt(do) var(list) tt(done))(
Execute the tt(do) var(list) as long as the tt(while) var(list)
returns a zero exit status.
)
findex(until)
cindex(until loops)
cindex(loops, until)
item(tt(until) var(list) tt(do) var(list) tt(done))(
Execute the tt(do) var(list) as long as tt(until) var(list)
returns a nonzero exit status.
)
findex(repeat)
cindex(repeat loops)
cindex(loops, repeat)
item(tt(repeat) var(word) tt(do) var(list) tt(done))(
var(word) is expanded and treated as an arithmetic expression,
which must evaluate to a number var(n).
var(list) is then executed var(n) times.
)
findex(case)
cindex(case selection)
cindex(selection, case)
item(tt(case) var(word) tt(in) [ [tt(LPAR())] var(pattern) [ tt(|) var(pattern) ] ... tt(RPAR()) var(list) (tt(;;)|tt(;&)) ] ... tt(esac))(
Execute the var(list) associated with the first var(pattern)
that matches var(word), if any. The form of the patterns
is the same as that used for filename generation. See
noderef(Filename Generation).
If the var(list) that is executed is terminated with tt(;&) rather than
tt(;;), the following list is also executed. This continues until either
a list is terminated with tt(;;) or the tt(esac) is reached.
)
findex(select)
cindex(user selection)
cindex(selection, user)
item(tt(select) var(name) [ tt(in) var(word) ... var(term) ] tt(do) var(list) tt(done))(
where var(term) is one ore more newline or tt(;).
Print the set of var(word)s, each preceded by a number.
If the tt(in) var(word) is omitted, use the positional parameters.
The tt(PROMPT3) prompt is printed and a line is read from standard
input. If this line consists of the number of one of the listed
var(word)s, then the parameter var(name)
is set to the var(word) corresponding to this number.
If this line is empty, the selection list is printed again.
Otherwise, the value of the parameter var(name) is set to null.
The contents of the line read from standard input is saved
in the parameter tt(REPLY). var(list) is executed
for each selection until a break or end-of-file is encountered.
)
cindex(subshells)
item(tt(LPAR()) var(list) tt(RPAR()))(
Execute var(list) in a subshell. Traps set by the tt(trap) builtin
are reset to their default values while executing var(list).
)
item(tt({) var(list) tt(}))(
Execute var(list).
)
xitem(tt(function) var(word) ... [ tt(()) ] [ var(term) ] tt({) var(list) tt(}))
xitem(var(word) ... tt(()) [ var(term) ] tt({) var(list) tt(}))
item(var(word) ... tt(()) [ var(term) ] var(command))(
where var(term) is one or more newline or tt(;).
Define a function which is referenced by any one of var(word).
Normally, only one var(word) is provided; multiple var(word)s
are usually only useful for setting traps.
The body of the function is the var(list) between
the tt({) and tt(}). See noderef(Functions).
)
cindex(timing)
item(tt(time) [ var(pipeline) ])(
The var(pipeline) is executed, and timing statistics are
reported on the standard error in the form specified
by the tt(TIMEFMT) parameter.
If var(pipeline) is omitted, print statistics about the
shell process and its children.
)
cindex(testing conditional expression)
item(tt([[) var(exp) tt(]]))(
Evaluates the conditional expression var(exp)
and return a zero exit status if it is true.
See noderef(Conditional Expressions)
for a description of var(exp).
)
enditem()
texinode(Alternate Forms For Complex Commands)(Reserved Words)(Complex Commands)(Shell Grammar)
sect(Alternate Forms For Complex Commands)
cindex(alternate forms for complex commands)
cindex(commands, alternate forms for complex)
Many of zsh's complex commands have alternate forms. These particular
versions of complex commands should be considered deprecated and may be
removed in the future. The versions in the previous section should be
preferred instead. The short versions below only work if var(sublist)
is of the form `tt({) var(list) tt(})' or if the tt(SHORT_LOOPS)
option is set.
startitem()
item(tt(if) var(list) tt({) var(list) tt(}) [ tt(elif) var(list) tt({) var(list) tt(}) ] ... [ tt(else {) var(list) tt(}) ])(
An alternate form of tt(if).
)
item(tt(if) var(list) var(sublist))(
A short form of the alternate `if'.
)
item(tt(for) var(name) tt(LPAR()) var(word) ... tt(RPAR()) var(sublist))(
A short form of tt(for).
)
item(tt(for) var(name) [ tt(in) var(word) ... var(term) ] var(sublist))(
where var(term) is at least one newline or tt(;).
Another short form of tt(for).
)
item(tt(for LPAR()LPAR()) [var(expr1)] tt(;) [var(expr2)] tt(;) [var(expr3)] tt(RPAR()RPAR()) var(sublist))(
A short form of the arithmetic tt(for) command.
)
item(tt(foreach) var(name) tt(LPAR()) var(word) ... tt(RPAR()) var(list) tt(end))(
Another form of tt(for).
)
item(tt(while) var(list) tt({) var(list) tt(}))(
An alternative form of tt(while).
)
item(tt(until) var(list) tt({) var(list) tt(}))(
An alternative form of tt(until).
)
item(tt(repeat) var(word) var(sublist))(
This is a short form of tt(repeat).
)
item(tt(case) var(word) tt({) [ [tt(LPAR())] var(pattern) [ tt(|) var(pattern) ] ... tt(RPAR()) var(list) (tt(;;)|tt(;&)) ] ... tt(}))(
An alternative form of tt(case).
)
item(tt(select) var(name) [ tt(in) var(word) var(term) ] var(sublist))(
where var(term) is at least one newline or tt(;).
A short form of tt(select).
)
enditem()
texinode(Reserved Words)(Comments)(Alternate Forms For Complex Commands)(Shell Grammar)
sect(Reserved Words)
cindex(reserved words)
findex(disable, use of)
The following words are recognized as reserved words when used as the first
word of a command unless quoted or disabled using tt(disable -r):
tt(do done esac then elif else fi for case
if while function repeat time until
select coproc nocorrect foreach end ! [[ { })
Additionally, `tt(})' is recognized in any position if the tt(IGNORE_BRACES) option
is not set.
texinode(Comments)(Aliasing)(Reserved Words)(Shell Grammar)
sect(Comments)
cindex(comments)
pindex(INTERACTIVE_COMMENTS, use of)
vindex(histchars, use of)
In noninteractive shells, or in interactive shells with the
tt(INTERACTIVE_COMMENTS) option set, a word beginning
with the third character of the tt(histchars) parameter
(`tt(#)' by default) causes that word and all the following
characters up to a newline to be ignored.
texinode(Aliasing)(Quoting)(Comments)(Shell Grammar)
sect(Aliasing)
cindex(aliasing)
Every token in the shell input is checked to see if there
is an alias defined for it.
If so, it is replaced by the text of the alias if it is in command
position (if it could be the first word of a simple command),
or if the alias is global.
If the text ends with a space, the next word in the shell input
is treated as though it were in command position for purposes of alias
expansion.
findex(alias, use of)
cindex(aliases, global)
An alias is defined using the tt(alias) builtin; global aliases
may be defined using the tt(-g) option to that builtin.
Alias substitution is done on the shell input before any
other substitution except history substitution. Therefore,
if an alias is defined for the word tt(foo), alias substitution
may be avoided by quoting part of the word, e.g. tt(\foo).
But there is nothing to prevent an alias being defined
for tt(\foo) as well.
texinode(Quoting)()(Aliasing)(Shell Grammar)
sect(Quoting)
cindex(quoting)
A character may be var(quoted) (that is, made
to stand for itself) by preceding it with a `tt(\)'.
`tt(\)' followed by a newline is ignored.
A string enclosed between `tt($')' and `tt(')' is
processed the same way as the string arguments of the
tt(print) builtin, and the resulting string is considered to be
entirely quoted. A literal `tt(')' character can be included in the
string by using the `tt(\')' escape.
All characters enclosed between a pair of single quotes (tt('')) that
is not preceded by a `tt($)' are quoted. A single quote cannot appear
within single quotes.
Inside double quotes (tt("")), parameter and
command substitution occurs, and `tt(\)' quotes the characters
`tt(\)', `tt(`)', `tt(")', and `tt($)'.

149
Doc/Zsh/guide.yo Normal file
View file

@ -0,0 +1,149 @@
texiifinfo(\
texinode(Top)(The Z Shell Guide)((dir))((dir))
texitop(The Z Shell Guide)
This Info file documents Zsh, a freely available UNIX command interpreter
(shell), which of the standard shells most closely resembles the Korn shell
(ksh), although it is not completely compatible.
Version version(), last updated date().
)\
startmenu()
menu(The Z Shell Guide)
menu(Introduction)
menu(Invocation)
menu(Files)
menu(Shell Grammar)
menu(Redirection)
menu(Command Execution)
menu(Functions)
menu(Jobs & Signals)
menu(Arithmetic Evaluation)
menu(Conditional Expressions)
menu(Compatibility)
menu(Prompt Expansion)
menu(Restricted Shell)
menu(Expansion)
menu(Parameters)
menu(Options)
menu(Shell Builtin Commands)
menu(Zsh Line Editor)
menu(Programmable Completion)
menu(Zsh Modules)
--- Indices ---
menu(Concept Index)
menu(Variables Index)
menu(Options Index)
menu(Functions Index)
menu(Editor Functions Index)
menu(Keystroke Index)
--- The Detailed Node Listing ---
Introduction
menu(Author)
menu(Availability)
menu(Mailing Lists)
menu(The Zsh FAQ)
menu(The Zsh Web Page)
menu(See Also)
Shell Grammar
menu(Simple Commands & Pipelines)
menu(Precommand Modifiers)
menu(Complex Commands)
menu(Alternate Forms For Complex Commands)
menu(Reserved Words)
menu(Comments)
menu(Aliasing)
menu(Quoting)
Expansion
menu(History Expansion)
menu(Process Substitution)
menu(Parameter Expansion)
menu(Command Substitution)
menu(Arithmetic Expansion)
menu(Brace Expansion)
menu(Filename Expansion)
menu(Filename Generation)
Parameters
menu(Local Parameters)
menu(Array Parameters)
menu(Positional Parameters)
menu(Parameters Set By The Shell)
menu(Parameters Used By The Shell)
Options
menu(Description of Options)
menu(Single Letter Options)
Zsh Line Editor
menu(Movement)
menu(History Control)
menu(Modifying Text)
menu(Arguments)
menu(Completion)
menu(Miscellaneous)
Programmable Completion
menu(Command Flags)
menu(Option Flags)
menu(Alternative Completion)
menu(Extended Completion)
menu(Example)
Zsh Modules
menu(The cap Module)
menu(The clone Module)
menu(The comp1 Module)
menu(The compctl Module)
menu(The deltochar Module)
menu(The example Module)
menu(The files Module)
menu(The sched Module)
menu(The stat Module)
menu(The zle Module)
endmenu()
texinode(The Z Shell Guide)(Introduction)(Top)(Top)
chapter(The Z Shell Guide)
This document has been produced from the texinfo file tt(zsh.texi),
included in the tt(Doc) sub-directory of the Zsh distribution.
sect(Producing documentation from zsh.texi)
The texinfo source may be converted into several formats:
startitem()
item(The Info guide)(
The Info format allows searching for topics, commands, functions, etc.
from the many Indices. The command `tt(makeinfo zsh.texi)' is used to
produce the Info documentation.
)
item(The printed guide)(
The command `tt(texi2dvi zsh.texi)' will output tt(zsh.dvi) which can
then be processed with bf(dvips) and optionally bf(gs) (Ghostscript) to
produce a nicely formatted printed guide.
)
item(The HTML guide)(
Mark Borges, tt(<mdb@cdc.noaa.gov), maintains an HTML version of this
guide at tt(http://www.peak.org/zsh/Doc/zsh_toc.html).
(The HTML version is produced with bf(texi2html), which may be obtained
from tt(http://wwwcn.cern.ch/dci/texi2html/). The command is
`tt(texi2html -split_chapter -expandinfo zsh.texi)'.)
)
enditem()
For those who do not have the necessary tools to process texinfo,
precompiled documentation (PostScript, dvi, info and HTML formats)
is available from the zsh archive site or its mirrors, in the file
tt(zsh-doc.tar.gz). (See noderef(Availability) for a list of sites.)

24
Doc/Zsh/index.yo Normal file
View file

@ -0,0 +1,24 @@
ifztexi(\
def(printindex)(2)(\
NOTRANS(@unnumbered) ARG1NL()\
NL()\
NOTRANS(@printindex) ARG2\
)\
texinode(Concept Index)(Variables Index)(Top)(Top)
printindex(Concept Index)(cp)
texinode(Variables Index)(Options Index)(Concept Index)(Top)
printindex(Variables Index)(vr)
texinode(Options Index)(Functions Index)(Variables Index)(Top)
printindex(Options Index)(pg)
texinode(Functions Index)(Editor Functions Index)(Options Index)(Top)
printindex(Functions Index)(fn)
texinode(Editor Functions Index)(Keystroke Index)(Functions Index)(Top)
printindex(Editor Functions Index)(tp)
texinode(Keystroke Index)()(Editor Functions Index)(Top)
printindex(Keystroke Index)(ky)
)\

38
Doc/Zsh/intro.yo Normal file
View file

@ -0,0 +1,38 @@
texinode(Introduction)(Invocation)(The Z Shell Guide)(Top)
chapter(Introduction)
ifzman(\
sect(Synopsis)
Because zsh contains many features, the zsh manual has been split into
a number of section+CHAR(s)\
ifzshall(\
. This manual page includes all the separate manual pages in the
following order\
)\
:
startlist()
ifzshone(\
list(em(zsh) Zsh overview (this section))
)\
list(em(zshmisc) Anything not fitting into the other sections)
list(em(zshexpn) Zsh command and parameter expansion)
list(em(zshparam) Zsh parameters)
list(em(zshoptions) Zsh options)
list(em(zshbuiltins) Zsh built-in functions)
list(em(zshzle) Zsh command line editing)
list(em(zshcompctl) Zsh completion control)
list(em(zshmodules) Zsh loadable modules)
ifzshone(\
list(em(zshall) Meta-man page containing all of the above)
)\
endlist()
sect(Description)
)\
Zsh is a UNIX command interpreter (shell) usable as an interactive
login shell and as a shell script command processor. Of the standard shells,
zsh most closely resembles bf(ksh) but includes many enhancements. Zsh
has command line editing, builtin spelling correction, programmable
command completion, shell functions (with autoloading), a history
mechanism, and a host of other features.
includefile(Zsh/metafaq.yo)
ifnzman(includefile(Zsh/seealso.yo))

23
Doc/Zsh/invoke.yo Normal file
View file

@ -0,0 +1,23 @@
texinode(Invocation)(Files)(Introduction)(Top)
chapter(Invocation)
cindex(invocation)
sect(Invocation Options)
cindex(flags, shell)
cindex(shell flags)
If the tt(-s) flag is not present and an argument is given,
the first argument is taken to be the pathname of a script to
execute. The remaining arguments are assigned to the positional
parameters. The following flags are interpreted by the shell
when invoked:
startitem()
item(tt(-c) var(string))(
Read commands from var(string).
)
item(tt(-i))(
Force shell to be interactive.
)
item(tt(-s))(
Read command from the standard input.
)
enditem()

91
Doc/Zsh/jobs.yo Normal file
View file

@ -0,0 +1,91 @@
texinode(Jobs & Signals)(Arithmetic Evaluation)(Functions)(Top)
chapter(Jobs & Signals)
sect(Jobs)
cindex(jobs)
If the tt(MONITOR) option is set,
an interactive shell associates a em(job) with each pipeline.
It keeps a table of current jobs, printed by the tt(jobs)
command, and assigns them small integer numbers.
When a job is started asynchronously with `tt(&)',
the shell prints a line which looks like:
nofill(tt([1] 1234))
indicating that the job which was started asynchronously was job number
1 and had one (top-level) process, whose process ID was 1234.
If a job is started with `tt(&|)' or `tt(&!)',
then that job is immediately disowned. After startup, it
does not have a place in the job table, and is not subject
to the job control features described here.
If you are running a job and wish to do something else you may hit the key
^Z (control-Z) which sends a tt(TSTP) signal to the current job.
cindex(jobs, suspending)
cindex(suspending jobs)
The shell will then normally indicate that the job has been `suspended',
and print another prompt. You can then manipulate the state of this job,
findex(bg, use of)
putting it in the background with the tt(bg) command, or run some other
commands and then eventually bring the job back into the foreground with
findex(fg, use of)
the foreground command tt(fg). A ^Z takes effect immediately and
is like an interrupt in that pending output and unread input are discarded
when it is typed.
A job being run in the background will suspend if it tries to read
from the terminal.
cindex(background jobs, I/O)
cindex(jobs, background, I/O)
Background jobs are normally allowed to produce output,
but this can be disabled by giving the command `tt(stty tostop)'.
If you set this
tty option, then background jobs will suspend when they try to produce
output like they do when they try to read input.
cindex(jobs, referring to)
cindex(referring to jobs)
There are several ways to refer to jobs in the shell.
A job can be referred to by the process ID of any process of the job
or by one of the following:
startsitem()
sitem(tt(%)var(number))(The job with the given number.)
sitem(tt(%)var(string))(Any job whose command line begins with var(string).)
sitem(tt(%?)var(string))(Any job whose command line contains var(string).)
sitem(tt(%%))(Current job.)
sitem(tt(%PLUS()))(Equivalent to `tt(%%)'.)
sitem(tt(%-))(Previous job.)
endsitem()
The shell learns immediately whenever a process changes state.
pindex(NOTIFY, use of)
It normally informs you whenever a job becomes blocked so that
no further progress is possible. If the tt(NOTIFY) option is not set,
it waits until just before it prints a prompt before it informs you.
When the monitor mode is on, each background job that completes
triggers any trap set for tt(CHLD).
When you try to leave the shell while jobs are running or suspended, you will
be warned that `You have suspended (running) jobs'.
You may use the tt(jobs) command to see what they are.
If you do this or immediately try to
exit again, the shell will not warn you a second time; the suspended
jobs will be terminated, and the running jobs will be sent
a tt(SIGHUP) signal, if the tt(HUP) option is set.
pindex(HUP, use of)
cindex(jobs, disowning)
cindex(disowning jobs)
findex(disown, use of)
To avoid having the shell terminate the running jobs, either
use the bf(nohup) command (see manref(nohup)(1))
or the tt(disown) builtin.
sect(Signals)
The tt(INT) and tt(QUIT) signals for an invoked
command are ignored if the command is followed by
`tt(&)' and the tt(MONITOR) option is not active.
Otherwise, signals have the values
inherited by the shell from its parent
(but see the tt(TRAP)var(NAL) special functions in noderef(Functions)).

142
Doc/Zsh/metafaq.yo Normal file
View file

@ -0,0 +1,142 @@
startmenu()
menu(Author)
menu(Availability)
menu(Mailing Lists)
menu(The Zsh FAQ)
menu(The Zsh Web Page)
menu(See Also)
endmenu()
texinode(Author)(Availability)()(Introduction)
sect(Author)
cindex(author)
Zsh was originally written by Paul Falstad tt(<pf@zsh.org>).
Zsh is now maintained by the members of the zsh-workers mailing
list tt(<zsh-workers@math.gatech.edu>). The development is currently
coordinated by Andrew Main (Zefram) tt(<zefram@zsh.org>). The coordinator
can be contacted at tt(<coordinator@zsh.org>), but matters relating to
the code should generally go to the mailing list.
texinode(Availability)(Mailing Lists)(Author)(Introduction)
sect(Availability)
Zsh is available from the following anonymous FTP sites. These mirror
sites are kept frequently up to date. The sites marked with em((G))
may be mirroring tt(ftp.math.gatech.edu) instead of the primary site.
The sites marked with em((H)) may be mirroring tt(ftp.cs.elte.hu)
instead of the primary site.
startitem()
item(Primary site)(
nofill(tt(ftp://ftp.zsh.org/pub/zsh/)
tt(http://www.zsh.org/pub/zsh/))
)
item(Australia)(
nofill(tt(ftp://ftp.zsh.org/pub/zsh/)
tt(http://www.zsh.org/pub/zsh/)
tt(ftp://ftp.ips.oz.au/pub/packages/zsh/) em((G)) em((H)))
)
item(Denmark)(
nofill(tt(ftp://sunsite.auc.dk/pub/unix/shells/zsh/))
)
item(Finland)(
nofill(tt(ftp://ftp.funet.fi/pub/unix/shells/zsh/) em((H)))
)
item(France)(
nofill(tt(ftp://ftp.cenatls.cena.dgac.fr/pub/shells/zsh/))
)
item(Germany)(
nofill(tt(ftp://ftp.fu-berlin.de/pub/unix/shells/zsh/) em((H))
tt(ftp://ftp.gmd.de/packages/zsh/) em((H))
tt(ftp://ftp.uni-trier.de/pub/unix/shell/zsh/) em((H)))
)
item(Hungary)(
nofill(tt(ftp://ftp.cs.elte.hu/pub/zsh/)
tt(http://www.cs.elte.hu/pub/zsh/)
tt(ftp://ftp.kfki.hu/pub/packages/zsh/) em((H)))
)
item(Israel)(
nofill(tt(ftp://ftp.math.technion.ac.il/mirror/ftp.zsh.org/pub/zsh/)
tt(http://www.math.technion.ac.il/mirror/ftp.zsh.org/pub/zsh/))
)
item(Japan)(
nofill(tt(ftp://ftp.tohoku.ac.jp/mirror/zsh/) em((H))
tt(ftp://ftp.nis.co.jp/pub/shells/zsh/) em((H)))
)
item(Norway)(
nofill(tt(ftp://ftp.uit.no/pub/unix/shells/zsh/) em((H)))
)
item(Romania)(
nofill(tt(ftp://ftp.roedu.net/pub/mirrors/ftp.zsh.org/pub/zsh/))
)
item(Slovenia)(
nofill(tt(ftp://ftp.siol.net/pub/unix/shells/zsh/) em((H)))
)
item(Sweden)(
nofill(tt(ftp://ftp.lysator.liu.se/pub/unix/zsh/) em((H)))
)
item(UK)(
nofill(tt(ftp://ftp.net.lut.ac.uk/zsh/) em((H))
tt(ftp://sunsite.doc.ic.ac.uk/packages/unix/shells/zsh/) em((G)))
)
item(USA)(
nofill(tt(ftp://ftp.math.gatech.edu/pub/zsh/)
tt(ftp://uiarchive.uiuc.edu/pub/packages/shells/zsh/)
tt(ftp://ftp.sterling.com/zsh/) em((G)) em((H))
tt(ftp://ftp.rge.com/pub/shells/zsh/) em((G)) em((H))
tt(ftp://foad.org/pub/zsh/)
tt(http://foad.org/zsh/))
)
enditem()
texinode(Mailing Lists)(The Zsh FAQ)(Availability)(Introduction)
sect(Mailing Lists)
cindex(mailing lists)
Zsh has 3 mailing lists:
startitem()
item(tt(<zsh-announce@math.gatech.edu>))(
Announcements about releases, major changes in the shell and the
monthly posting of the Zsh FAQ. (moderated)
)
item(tt(<zsh-users@math.gatech.edu>))(
User discussions.
)
item(tt(<zsh-workers@math.gatech.edu>))(
Hacking, development, bug reports and patches.
)
enditem()
To subscribe, send mail with the SUBJECT `tt(subscribe) var(<e-mail-address>)'
to the associated administrative address for the mailing list.
startlist()
list(tt(<zsh-announce-request@math.gatech.edu>))
list(tt(<zsh-users-request@math.gatech.edu>))
list(tt(<zsh-workers-request@math.gatech.edu>))
endlist()
Unsubscribing is done similarly.
YOU ONLY NEED TO JOIN ONE OF THE MAILING LISTS AS THEY ARE NESTED.
All submissions to bf(zsh-announce) are automatically forwarded to
bf(zsh-users). All submissions to bf(zsh-users) are automatically
forwarded to bf(zsh-workers).
If you have problems subscribing/unsubscribing to any of the mailing
lists, send mail to tt(<listmaster@zsh.org>). The mailing lists are
maintained by Richard Coleman tt(<coleman@zsh.org>).
The mailing lists are archived; the archives can be accessed via the
administrative addresses listed above. There is also a hypertext
archive, maintained by Geoff Wing tt(<gcw@zsh.org>), available at
tt(http://www.zsh.org/mla/).
texinode(The Zsh FAQ)(The Zsh Web Page)(Mailing Lists)(Introduction)
sect(The Zsh FAQ)
Zsh has a list of Frequently Asked Questions (FAQ), maintained by
Peter Stephenson tt(<pws@zsh.org>). It is regularly posted to the
newsgroup bf(comp.unix.shell) and the bf(zsh-announce) mailing list.
The latest version can be found at any of the Zsh FTP sites, or at
tt(http://www.zsh.org/FAQ/). The contact address for FAQ-related matters
is tt(<faqmaster@zsh.org>).
texinode(The Zsh Web Page)(See Also)(The Zsh FAQ)(Introduction)
sect(The Zsh Web Page)
Zsh has a web page which is located at tt(http://www.zsh.org/). This is
maintained by Karsten Thygesen tt(<karthy@zsh.org>), of SunSITE Denmark.
The contact address for web-related matters is tt(<webmaster@zsh.org>).

28
Doc/Zsh/mod_cap.yo Normal file
View file

@ -0,0 +1,28 @@
texinode(The cap Module)(The clone Module)()(Zsh Modules)
sect(The cap Module)
The tt(cap) module is used for manipulating POSIX.1e (POSIX.6) capability
sets. If the operating system does not support this interface, the
builtins defined by this module will do nothing.
The builtins in this module are:
startitem()
findex(cap)
cindex(capabilities, setting)
item(tt(cap) [ var(capabilities) ])(
Change the shell's process capability sets to the specified var(capabilities),
otherwise display the shell's current capabilities.
)
findex(getcap)
cindex(capabilities, getting from files)
item(tt(getcap) var(filename) ...)(
This is a built-in implementation of the POSIX standard utility. It displays
the capability sets on each specified var(filename).
)
findex(setcap)
cindex(capabilities, setting on files)
item(tt(setcap) var(capabilities) var(filename) ...)(
This is a built-in implementation of the POSIX standard utility. It sets
the capability sets on each specified var(filename) to the specified
var(capabilities).
)
enditem()

19
Doc/Zsh/mod_clone.yo Normal file
View file

@ -0,0 +1,19 @@
texinode(The clone Module)(The comp1 Module)(The cap Module)(Zsh Modules)
sect(The clone Module)
The tt(clone) module makes available one builtin command:
startitem()
findex(clone)
cindex(shell, cloning)
cindex(cloning the shell)
cindex(terminal)
item(tt(clone) var(tty))(
Creates a forked instance of the current shell, attached to the specified
var(tty). In the new shell, the tt(PID), tt(PPID) and tt(TTY) special
parameters are changed appropriately. tt($!) is set to zero in the new
shell, and to the new shell's PID in the original shell.
The return value of the builtin is zero in both shells if successful,
and non-zero on error.
)
enditem()

11
Doc/Zsh/mod_comp1.yo Normal file
View file

@ -0,0 +1,11 @@
texinode(The comp1 Module)(The compctl Module)(The clone Module)(Zsh Modules)
sect(The comp1 Module)
The tt(comp1) module does nothing that is visible to the user.
Its purpose is to provide the internal basis of the programmable
completion mechanism.
This module must be loaded before any module that
provides a means of controlling completion (such as the tt(compctl)
module), or that uses completions (such as the tt(zle) module).
This is done automatically for modules distributed with zsh, and
for other modules can be effected by the use of tt(zmodload -d).

7
Doc/Zsh/mod_compctl.yo Normal file
View file

@ -0,0 +1,7 @@
texinode(The compctl Module)(The deltochar Module)(The comp1 Module)(Zsh Modules)
sect(The compctl Module)
The tt(compctl) module makes available one builtin command, tt(compctl),
which is the standard way to control completions for ZLE. See
ifzman(zmanref(zshcompctl))\
ifnzman(noderef(Programmable Completion))\
.

12
Doc/Zsh/mod_deltochar.yo Normal file
View file

@ -0,0 +1,12 @@
texinode(The deltochar Module)(The example Module)(The compctl Module)(Zsh Modules)
sect(The deltochar Module)
The tt(deltochar) module makes available one ZLE function:
startitem()
tindex(delete-to-char)
item(tt(delete-to-char))(
Read a character from the keyboard, and
delete from the cursor position up to and including the next
(or, with repeat count var(n), the var(n)th) instance of that character.
)
enditem()

16
Doc/Zsh/mod_example.yo Normal file
View file

@ -0,0 +1,16 @@
texinode(The example Module)(The files Module)(The deltochar Module)(Zsh Modules)
sect(The example Module)
The tt(example) module makes available one builtin command:
startitem()
findex(example)
cindex(modules, example)
cindex(modules, writing)
cindex(writing modules)
item(tt(example) [ tt(-flags) ] [ var(args) ... ])(
Displays the flags and arguments it is invoked with.
)
enditem()
The purpose of the module is to serve as an example of how to write a
module.

100
Doc/Zsh/mod_files.yo Normal file
View file

@ -0,0 +1,100 @@
texinode(The files Module)(The sched Module)(The example Module)(Zsh Modules)
sect(The files Module)
cindex(files, manipulating)
The tt(files) module makes some standard commands available as builtins:
startitem()
findex(ln)
xitem(tt(ln) [ tt(-dfis) ] var(filename) var(dest))
item(tt(ln) [ tt(-dfis) ] var(filename) ... var(dir))(
Creates hard (or, with tt(-s), symbolic) links. In the first form, the
specified var(dest)ination is created, as a link to the specified
var(filename). In the second form, each of the var(filename)s is
taken in turn, and linked to a pathname in the specified var(dir)ectory
that has the same last pathname component.
Normally, tt(ln) will not attempt to create hard links to
directories. This check can be overridden using the tt(-d) option.
Typically only the super-user can actually succeed in creating
hard links to directories.
This does not apply to symbolic links in any case.
By default, existing files cannot be replaced by links.
The tt(-i) option causes the user to be queried about replacing
existing files. The tt(-f) option causes existing files to be
silently deleted, without querying. tt(-f) takes precedence.
)
findex(mkdir)
item(tt(mkdir) [ tt(-p) ] [ tt(-m) var(mode) ] var(dir) ...)(
Creates directories. With the tt(-p) option, non-existing parent
directories are first created if necessary, and there will be
no complaint if the directory already exists.
The tt(-m) option can be used to specify (in octal) a set of file permissions
for the created directories, otherwise mode 777 modified by the current
tt(umask) (see manref(umask)(2)) is used.
)
findex(mv)
xitem(tt(mv) [ tt(-fi) ] var(filename) var(dest))
item(tt(mv) [ tt(-fi) ] var(filename) ... var(dir))(
Moves files. In the first form, the specified var(filename) is moved
to the specified var(dest)ination. In the second form, each of the
var(filename)s is
taken in turn, and moved to a pathname in the specified var(dir)ectory
that has the same last pathname component.
By default, the user will be queried before replacing any file
that the user cannot write to, but writable files will be silently
removed.
The tt(-i) option causes the user to be queried about replacing
any existing files. The tt(-f) option causes any existing files to be
silently deleted, without querying. tt(-f) takes precedence.
Note that this tt(mv) will not move files across devices.
Historical versions of tt(mv), when actual renaming is impossible,
fall back on copying and removing files; if this behaviour is desired,
use tt(cp) and tt(rm) manually. This may change in a future version.
)
findex(rm)
item(tt(rm) [ tt(-dfirs) ] var(filename) ...)(
Removes files and directories specified.
Normally, tt(rm) will not remove directories (except with the tt(-r)
option). The tt(-d) option causes tt(rm) to try removing directories
with tt(unlink) (see manref(unlink)(2)), the same method used for files.
Typically only the super-user can actually succeed in unlinking
directories in this way.
tt(-d) takes precedence over tt(-r).
By default, the user will be queried before removing any file
that the user cannot write to, but writable files will be silently
removed.
The tt(-i) option causes the user to be queried about removing
any files. The tt(-f) option causes files to be
silently deleted, without querying, and suppresses all error indications.
tt(-f) takes precedence.
The tt(-r) option causes tt(rm) to recursively descend into directories,
deleting all files in the directory before removing the directory with
the tt(rmdir) system call (see manref(rmdir)(2)).
The tt(-s) option is a zsh extension to tt(rm) functionality. It enables
paranoid behaviour, intended to avoid common security problems involving
a root-run tt(rm) being tricked into removing files other than the ones
intended. It will refuse to follow symbolic links, so that (for example)
``tt(rm /tmp/foo/passwd)'' can't accidentally remove tt(/etc/passwd)
if tt(/tmp/foo) happens to be a link to tt(/etc). It will also check
where it is after leaving directories, so that a recursive removal of
a deep directory tree can't end up recursively removing tt(/usr) as
a result of directories being moved up the tree.
)
findex(rmdir)
item(tt(rmdir) var(dir) ...)(
Removes empty directories specified.
)
findex(sync)
item(tt(sync))(
Calls the system call of the same name (see manref(sync)(2)), which
flushes dirty buffers to disk. It might return before the I/O has
actually been completed.
)
enditem()

17
Doc/Zsh/mod_sched.yo Normal file
View file

@ -0,0 +1,17 @@
texinode(The sched Module)(The stat Module)(The files Module)(Zsh Modules)
sect(The sched Module)
The tt(sched) module makes available one builtin command:
startitem()
findex(sched)
cindex(timed execution)
cindex(execution, timed)
xitem(tt(sched) [tt(PLUS())]var(hh)tt(:)var(mm) var(command) ...)
item(tt(sched) [ tt(-)var(item) ])(
Make an entry in the scheduled list of commands to execute.
The time may be specified in either absolute or relative time.
With no arguments, prints the list of scheduled commands.
With the argument `tt(-)var(item)', removes the given item
from the list.
)
enditem()

145
Doc/Zsh/mod_stat.yo Normal file
View file

@ -0,0 +1,145 @@
texinode(The stat Module)(The zle Module)(The sched Module)(Zsh Modules)
sect(The stat Module)
The tt(stat) module makes available one builtin command:
startitem()
findex(stat)
cindex(files, listing)
cindex(files, examining)
item(tt(stat) [ tt(-gnNlLtTrs) ] [ tt(-f) var(fd) ] [ tt(-A) var(array) ] \
[ tt(-F) var(fmt) ] [ tt(PLUS())var(element) ] [ var(file) ... ])(
The command acts as a front end to the tt(stat) system call (see
manref(stat)(2)).
If the tt(stat) call fails, the appropriate system error message
printed and status 1 is returned.
The fields of tt(struct stat) give information about
the files provided as arguments to the command. In addition to those
available from the tt(stat) call, an extra element `tt(link)' is provided.
These elements are:
startitem()
item(tt(device))(
The number of the device on which the file resides.
)
item(tt(inode))(
The unique number of the file on this device (`em(inode)' number).
)
item(tt(mode))(
The mode of the file; that is, the file's type and access permissions.
With the tt(-s) option, this will
be returned as a string corresponding to the first column in the
display of the tt(ls -l) command.
)
item(tt(nlink))(
The number of hard links to the file.
)
item(tt(uid))(
The user ID of the owner of the file. With the tt(-s)
option, this is displayed as a user name.
)
item(tt(gid))(
The group ID of the file. With the tt(-s) option, this
is displayed as a group name.
)
item(tt(rdev))(
The raw device number. This is only useful for special devices.
)
item(tt(size))(
The size of the file in bytes.
)
xitem(tt(atime))
xitem(tt(mtime))
item(tt(ctime))(
The last access, modification and inode change times
of the file, respectively, as the number of seconds since
midnight GMT on 1st January, 1970. With the tt(-s) option,
these are printed as strings for the local time zone; the format
can be altered with the tt(-F) option, and with the tt(-g)
option the times are in GMT.
)
item(tt(blksize))(
The number of bytes in one allocation block on the
device on which the file resides.
)
item(tt(block))(
The number of disk blocks used by the file.
)
item(tt(link))(
If the file is a link and the tt(-L) option is in
effect, this contains the name of the file linked to, otherwise
it is empty. Note that if this element is selected (``tt(stat PLUS()link)'')
then the tt(-L) option is automatically used.
)
enditem()
A particular element may be selected by including its name
preceded by a `tt(PLUS())' in the option list; only one element is allowed.
The element may be shortened to any unique set of leading
characters. Otherwise, all elements will be shown for all files.
Options:
startitem()
item(tt(-A) var(array))(
Instead of displaying the results on standard
output, assign them to an var(array), one tt(struct stat) element per array
element for each file in order. In this case neither the name
of the element nor the name of the files is provided unless the
tt(-t) or tt(-n) options are provided, respectively. In the
former case the element name appears as a prefix to the
appropriate array element and in the latter case the file name
appears as a separate array element preceding all the others.
Other formatting options are respected.
)
item(tt(-f) var(fd))(
Use the file on file descriptor var(fd) instead of
named files; no list of file names is allowed in this case.
)
item(tt(-F) var(fmt))(
Supplies a tt(strftime) (see manref(strftime)(3)) string for the
formatting of the time elements. The tt(-s) option is implied.
)
item(tt(-g))(
Show the time elements in the GMT time zone. The
tt(-s) option is implied.
)
item(tt(-l))(
List the names of the type elements (to standard
output or an array as appropriate) and return immediately;
options other than tt(-A) and arguments are ignored.
)
item(tt(-L))(
Perform an tt(lstat) (see manref(lstat)(2)) rather than a tt(stat)
system call. In this case, if the file is a link, information
about the link itself rather than the target file is returned.
This option is required to make the tt(link) element useful.
)
item(tt(-n))(
Always show the names of files. Usually these are
only shown when output is to standard output and there is more
than one file in the list.
)
item(tt(-N))(
Never show the names of files.
)
item(tt(-r))(
Print raw data (the default format) alongside string
data (the tt(-s) format); the string data appears in parentheses
after the raw data.
)
item(tt(-s))(
Print tt(mode), tt(uid), tt(gid) and the three time
elements as strings instead of numbers. In each case the format
is like that of tt(ls -l).
)
item(tt(-t))(
Always show the type names for the elements of
tt(struct stat). Usually these are only shown when output is to
standard output and no individual element has been selected.
)
item(tt(-T))(
Never show the type names of the tt(struct stat) elements.
)
enditem()
)
enditem()

421
Doc/Zsh/mod_zftp.yo Normal file
View file

@ -0,0 +1,421 @@
texinode(The zftp Module)(The zle Module)(The stat Module)(Zsh Modules)
sect(The zftp Module)
The tt(zftp) module makes available one builtin command:
startitem()
findex(zftp)
cindex(FTP)
cindex(files, transferring)
item(tt(zftp) var(subcommand) [ var(args) ])(
The tt(zftp) module is a client for FTP (file transfer protocol). It
is implemented as a builtin to allow full use of shell command line
editing, file I/O, and job control mechanisms. Often, users will
access it via shell functions providing higher level abilities such as
username and password lookup. However, it is entirely usable in its
own right.
All commands consist of the command name tt(zftp) followed by the name
of a subcommand. These are listed below. The return status of each
subcommand is supposed to reflect the success or failure of the remote
operation. See a description of the variable tt(ZFTP_VERBOSE) for
more information on how responses from the server may be printed.
)
enditem()
subsect(Subcommands)
cindex(zftp, subcommands)
startitem()
cindex(FTP, starting a session)
item(tt(open) var(host) [ var(user) [ var(password) [ var(account) ] ] ])(
Open a new FTP session to var(host), which may be the name of a TCP/IP
connected host or an IP number in the standard dot notation.
Remaining arguments are passed to the tt(login) subcommand. Note that
if no arguments beyond var(host) are supplied, tt(open) will em(not)
automatically call tt(login). If no arguments at all are supplied,
tt(open) will use the parameters set by the tt(params) subcommand.
After a successful open, the shell variables tt(ZFTP_HOST),
tt(ZFTP_IP) and tt(ZFTP_SYSTEM) are available; see `Variables'
below.
)
xitem(tt(login) [ var(name) [ var(password) [ var(account) ] ] ])
item(tt(user) [ var(name) [ var(password) [ var(account) ] ] ])(
Login the user var(name) with parameters var(password) and var(account).
Any of the parameters can be omitted, and will be read from standard
input if needed (var(name) is always needed). If
standard input is a terminal, a prompt for each one will be printed on
standard error and var(password) will not be echoed. If any of the
parameters are not used, a warning message is printed.
After a successful login, the shell variables tt(ZFTP_USER),
tt(ZFTP_ACCOUNT) and tt(ZFTP_PWD) are available; see `Variables'
below.
This command may be re-issued when a user is already logged in, and
the server will first be reinitialized for a new user.
)
xitem(tt(params) [ var(host) [ var(user) [ var(password) \
[ var(account) ] ] ] ])
item(tt(params) tt(-))(
Store the given parameters for a later tt(open) command with no
arguments. Only those given on the command line will be remembered.
Any of the parameters may, however, be specified as a `tt(?)', which
may need to be quoted to protect it from shell expansion: in this case,
the appropriate parameter will be read from stdin as with the
tt(login) subcommand, including special handling of var(password).
If no arguments are given, the parameters currently set are printed,
although the password will appear as a line of stars.
If instead a single `tt(-)' is given, the existing parameters, if any,
are deleted. In that case, calling tt(open) with no arguments will
cause an error.
The list of parameters is not deleted after a tt(close), however it
will be deleted if the tt(zftp) module is unloaded.
For example,
nofill(tt(zftp params ftp.elsewhere.xx juser '?'))
will store the host tt(ftp.elsewhere.xx) and the user tt(juser) and
then prompt the user for the corresponding password.
This command may also be used to set up a transfer which then takes
place completely in the background, freeing tt(zftp) for concurrent
foreground use. For example,
nofill(tt(zftp params ftp.soreeyes.ca bubble squeak))
nofill(tt(LPAR()zftp open; zftp get foo >bar; zftp close)tt(RPAR() &))
--- here, the connection is restricted to a background subshell and
you are free to open a simultaneous connection in the foreground.
)
item(tt(cd) var(directory))(
Change the remote directory to var(directory). Also alters the shell
variable tt(ZFTP_PWD).
)
item(tt(cdup))(
Change the remote directory to the one higher in the directory tree.
Note that tt(cd ..) will also work correctly on non-UNIX systems.
)
item(tt(dir) [ var(args...) ])(
Give a (verbose) listing of the remote directory. The var(args) are
passed directly to the server. The command's behaviour is implementation
dependent, but a UNIX server will typically interpret var(args) as
arguments to the tt(ls) command and with no arguments return the
result of `tt(ls -l)'. The directory is listed to standard output.
)
item(tt(ls) [ var(args) ])(
Give a (short) listing of the remote directory. With no var(args),
produces a raw list of the files in the directory, one per line.
Otherwise, up to vagaries of the server implementation, behaves
similar to tt(dir).
)
item(tt(type) [ var(type) ])(
Change the type for transfer to var(type), or print the current type
if var(type) is absent. The allowed values are `tt(A)' (ASCII),
`tt(I)' (Image, i.e. binary), or `tt(B)' (a synonym for `tt(I)').
The FTP default for a transfer is ASCII. However, if tt(zftp) finds
that the remote host is a UNIX machine with 8-bit byes, it will
automatically switch to using binary for file transfers upon
tt(open). This can subsequently be overridden.
The transfer type is only passed to the remote host when a data
connection is established; this command involves no network overhead.
)
item(tt(ascii))(
The same as tt(type A).
)
item(tt(binary))(
The same as tt(type I).
)
item(tt(mode) [ tt(S) | tt(B) ])(
Set the mode type to stream (tt(S)) or block (tt(B)). Stream mode is
the default; block mode is not widely supported.
)
xitem(tt(remote) var(files...))
item(tt(local) [ var(files...) ])(
Print the size and last modification time of the remote or local
files. If there is more than one item on the list, the name of the
file is printed first. The first number is the file size, the second
is the last modification time of the file in the format
tt(CCYYMMDDhhmmSS) consisting of year, month, date, hour, minutes and
seconds in GMT. Note that this format, including the length, is
guaranteed, so that time strings can be directly compared via the
tt([[) builtin's tt(<) and tt(>) operators, even if they are too long
to be represented as integers.
Not all servers support the commands for retrieving this information.
In that case, the tt(remote) command will print nothing and return
status 2, compared with status 1 for a file not found.
The tt(local) command (but not tt(remote)) may be used with no
arguments, in which case the information comes from examining file
descriptor zero. This is the same file as seen by a tt(put) command
with no further redirection.
)
item(tt(get) var(file) [...])(
Retrieve all var(file)s from the server, concatenating them
and sending them to standard output.
)
item(tt(put) var(file) [...])(
For each var(file), read a file from standard input and send that to
the remote host with the given name.
)
item(tt(append) var(file) [...])(
As tt(put), but if the remote var(file) already exists, data is
appended to it instead of overwriting it.
)
xitem(tt(getat) var(file) var(point))
xitem(tt(putat) var(file) var(point))
item(tt(appendat) var(file) var(point))(
Versions of tt(get), tt(put) and tt(append) which will start the
transfer at the given var(point) in the remote var(file). This is
useful for appending to an incomplete local file. However, note that
this ability is not universally supported by servers (and is not quite
the behaviour specified by the standard).
)
item(tt(delete) var(file) [...])(
Delete the list of files on the server.
)
item(tt(mkdir) var(directory))(
Create a new directory var(directory) on the server.
)
item(tt(rmdir) var(directory))(
Delete the diretory var(directory) on the server.
)
item(tt(rename) var(old-name) var(new-name))(
Rename file var(old-name) to var(new-name) on the server.
)
item(tt(site) var(args...))(
Send a host-specific command to the server. You will probably
only need this if instructed by the server to use it.
)
item(tt(quote) var(args...))(
Send the raw FTP command sequence to the server. You should be
familiar with the FTP command set as defined in RFC959 before doing
this. Useful comands may include tt(STAT) and tt(HELP). Note also
the mechanism for returning messages as described for the variable
tt(ZFTP_VERBOSE) below, in particular that all messages from the
control connection are sent to standard error.
)
xitem(tt(close))
item(tt(quit))(
Close the current data connection. This unsets the shell parameters
tt(ZFTP_HOST), tt(ZFTP_IP), tt(ZFTP_SYSTEM), tt(ZFTP_USER),
tt(ZFTP_ACCOUNT) and tt(ZFTP_PWD).
)
enditem()
subsect(Parameters)
cindex(zftp, parameters)
The following shell parameters are used by tt(zftp). Currently none
of them are special.
startitem()
item(tt(ZFTP_TMOUT))(
Integer. The time in seconds to wait for a network operation to
complete before returning an error. If this is not set when the
module is loaded, it will be given the default value 60. A value of
zero turns off timeouts. If a timeout occurs on the control
connection it will be closed. Use a larger value if this occurs too
frequently.
)
vindex(ZFTP_IP)
item(tt(ZFTP_IP))(
Readonly. The IP address of the current connection in dot notation.
)
vindex(ZFTP_HOST)
item(tt(ZFTP_HOST))(
Readonly. The hostname of the current remote server. If the host was
opened as an IP number, tt(ZFTP_HOST) contains that instead; this
saves the overhead for a name lookup, as IP numbers are most commonly
used when a nameserver is unavailable.
)
vindex(ZFTP_SYSTEM)
item(tt(ZFTP_SYSTEM))(
Readonly. The system type string returned by the server in response
to an FTP tt(SYST) request. The most interesting case is a string
beginning tt("UNIX Type: L8"), which ensures maximum compatibility
with a local UNIX host.
)
vindex(ZFTP_TYPE)
item(tt(ZFTP_TYPE))(
Readonly. The type to be used for data transfers , either `tt(A)' or
`tt(I)'. Use the tt(type) subcommand to change this.
)
vindex(ZFTP_USER)
item(tt(ZFTP_USER))(
Readonly. The username currently logged in, if any.
)
vindex(ZFTP_ACCT)
item(tt(ZFTP_ACCT))(
Readonly. The account name of the current user, if any. Most servers
do not require an account name.
)
vindex(ZFTP_PWD)
item(tt(ZFTP_PWD))(
Readonly. The current directory on the server.
)
vindex(ZFTP_CODE)
item(tt(ZFTP_CODE))(
Readonly. The three digit code of the last FTP reply from the server
as a string. This can still be read after the connection is closed.
)
vindex(ZFTP_REPLY)
item(tt(ZFTP_REPLY))(
Readonly. The last line of the last reply sent by the server. This
can still be read after the connection is closed.
)
vindex(ZFTP_PREFS)
item(tt(ZFTP_PREFS))(
A string of preferences for altering aspects of tt(zftp)'s behaviour.
Each preference is a single character. The following are defined:
startitem()
item(tt(P))(
Passive: attempt to make the remote server initiate data transfers.
This is slightly more efficient than sendport mode. If the letter
tt(S) occurs later in the string, tt(zftp) will use sendport mode if
passive mode is not available.
)
item(tt(S))(
Sendport: initiate transfers by the FTP tt(PORT) command. If this
occurs before any tt(P) in the string, passive mode will never be
attempted.
)
item(tt(D))(
Dumb: use only the bare minimum of FTP commands. This prevents
the variables tt(ZFTP_SYSTEM) and tt(ZFTP_PWD) from being set, and
will mean all connections default to ASCII type. It may prevent
tt(ZFTP_SIZE) from being set during a transfer if the server
does not send it anyway (many servers do).
)
enditem()
If tt(ZFTP_PREFS) is not set when tt(zftp) is loaded, it will be set to a
default of `tt(PS)', i.e. use passive mode if available, otherwise
fall back to sendport mode.
)
vindex(ZFTP_VERBOSE)
item(tt(ZFTP_VERBOSE))(
A string of digits between 0 and 5 inclusive, specifying which
responses from the server should be printed. All responses go to
standard error. If any of the numbers 1 to 5 appear in the string,
raw responses from the server with reply codes beginning with that
digit will be printed to standard error. The first digit of the three
digit reply code is defined by RFC959 to correspond to:
startitem()
item(1.)(
A positive prelimnary reply.
)
item(2.)(
A positive completion reply.
)
item(3.)(
A positive intermediate reply.
)
item(4.)(
A transient negative completion reply.
)
item(5.)(
A permanent negative completion reply.
)
enditem()
It should be noted that, for unknown reasons, the reply `Service not
available', which forces termination of a connection, is classified as
421, i.e. `transient negative', an interesting interpretation of the word
`transient'.
The code 0 is special: it indicates that all but the last line of
multiline replies read from the server will be printed to standard
error in a processed format. By convention, servers use this
mechanism for sending information for the user to read. The
appropriate reply code, if it matches the same response, takes
priority.
If tt(ZFTP_VERBOSE) is not set when tt(zftp) is loaded, it will be
set to the default value tt(450), i.e., messages destined for the user
and all errors will be printed. A null string is valid and
specifies that no messages should be printed.
)
enditem()
subsect(Functions)
cindex(zftp, functions)
startitem()
findex(zftp_chpwd)
item(tt(zftp_chpwd))(
If this function is set by the user, it is called every time the
directory changes on the server, including when a user is logged
in, or when a connection is closed. In the last case, tt($ZFTP_PWD)
will be unset; otherwise it will reflect the new directory.
)
findex(zftp_progress)
item(tt(zftp_progress))(
If this function is set by the user, it will be called during
a tt(get), tt(put) or tt(append) operation each time sufficient data
has been received from the host. During a tt(get), the data is sent
to standard output, so it is vital that this function should write
to standard error or directly to the terminal, em(not) to standard
output.
When it is called with a transfer in progress, the following
additional shell parameters are set:
startitem()
vindex(ZFTP_FILE)
item(tt(ZFTP_FILE))(
The name of the remote file being transferred from or to.
)
vindex(ZFTP_TRANSFER)
item(tt(ZFTP_TRANSFER))(
A tt(G) for a tt(get) operation and a tt(P) for a tt(put) operation.
)
vindex(ZFTP_SIZE)
item(tt(ZFTP_SIZE))(
The total size of the complete file being transferred:
the same as the first value provided by the
tt(remote) and tt(local) subcommands for a particular file.
If the server cannot supply this value for a remote file being
retrieved, it will not be set. If input is from a pipe the value may
be incorrect and correspond simply to a full pipe buffer.
)
vindex(ZFTP_COUNT)
item(tt(ZFTP_COUNT))(
The amount of data so far transferred; a number between zero and
tt($ZFTP_SIZE), if that is set. This number is always available.
)
enditem()
The function is initially called with tt(ZFTP_TRANSFER) set
appropriately and tt(ZFTP_COUNT) set to zero. After the transfer is
finished, the function will be called one more time with
tt(ZFTP_TRANSFER) set to tt(GF) or tt(PF), in case it wishes to tidy
up. It is otherwise never called twice with the same value of
tt(ZFTP_COUNT).
Sometimes the progress meter may cause disruption. It is up to the
user to decide whether the function should be defined and to use
tt(unfunction) when necessary.
)
subsect(Problems)
cindex(zftp, problems)
With the exception noted for the tt(params) subcommand, a connection
may not be opened in the left hand side of a pipe as this occurs in a
subshell and the file information is not updated in the main shell.
In the case of type or mode changes or closing the connection in a
subshell, the information is returned but variables are not updated
until the next call to tt(zftp). Other status changes in subshells
will not be reflected by changes to the variables (but should
be otherwise harmless).
enditem()

193
Doc/Zsh/mod_zle.yo Normal file
View file

@ -0,0 +1,193 @@
texinode(The zle Module)()(The stat Module)(Zsh Modules)
sect(The zle Module)
The tt(zle) module contains the Zsh Line Editor. See
ifzman(zmanref(zshzle))\
ifnzman(noderef(Zsh Line Editor))\
. It also contains three related builtin commands:
startitem()
findex(bindkey)
cindex(keys, rebinding)
cindex(rebinding keys)
cindex(keys, binding)
cindex(binding keys)
cindex(keymaps)
xitem(tt(bindkey) [ var(options) ] tt(-l))
xitem(tt(bindkey) [ var(options) ] tt(-d))
xitem(tt(bindkey) [ var(options) ] tt(-D) var(keymap) ...)
xitem(tt(bindkey) [ var(options) ] tt(-A) var(old-keymap new-keymap))
xitem(tt(bindkey) [ var(options) ] tt(-N) var(new-keymap) [ var(old-keymap) ])
xitem(tt(bindkey) [ var(options) ] tt(-m))
xitem(tt(bindkey) [ var(options) ] tt(-r) var(in-string) ...)
xitem(tt(bindkey) [ var(options) ] tt(-s) var(in-string out-string) ...)
xitem(tt(bindkey) [ var(options) ] var(in-string command) ...)
item(tt(bindkey) [ var(options) ] [ var(in-string) ])(
tt(bindkey)'s options can be divided into three categories: keymap selection,
operation selection, and others. The keymap selection options are:
startitem()
item(tt(-e))(
Selects keymap `tt(emacs)', and also links it to `tt(main)'.
)
item(tt(-v))(
Selects keymap `tt(viins)', and also links it to `tt(main)'.
)
item(tt(-a))(
Selects keymap `tt(vicmd)'.
)
item(tt(-M))(
The first non-option argument is used as a keymap name,
and does not otherwise count as an argument.
)
enditem()
Some operations do not permit a keymap to be selected.
If a keymap selection is required and none of the options above are used, the
`tt(main)' keymap is used. These operations do not permit a keymap to be
selected:
startitem()
item(tt(-l))(
List all existing keymap names. If the tt(-L)
option is used, list in the form of tt(bindkey)
commands to create the keymaps.
)
item(tt(-d))(
Delete all existing keymaps and reset to the default state.
)
item(tt(-D) var(keymap) ...)(
Delete the named var(keymap)s.
)
item(tt(-A) var(old-keymap new-keymap))(
Make the var(new-keymap) name an alias for var(old-keymap), so that
both names refer to the same keymap. The names have equal standing;
if either is deleted, the other remains. If there is already a keymap
with the var(new-keymap) name, it is deleted.
)
item(tt(-N) var(new-keymap) [ var(old-keymap) ])(
Create a new keymap, named var(new-keymap). If a keymap already has that
name, it is deleted. If an var(old-keymap) name is given, the new keymap
is initialised to be a duplicate of it, otherwise the new keymap will
be empty.
)
enditem()
The following operations require a keymap to be selected:
startitem()
item(tt(-m))(
Add the built-in set of meta-key bindings to the selected keymap.
Only keys that are unbound or bound to tt(self-insert) are affected.
)
item(tt(-r) var(in-string) ...)(
Unbind the specified var(in-string)s in the selected keymap.
This is exactly equivalent to binding the strings to tt(undefined-key).
)
item(tt(-s) var(in-string out-string) ...)(
Bind each var(in-string) to each var(out-string).
When var(in-string) is typed, var(out-string) will be
pushed back and treated as input to the line editor.
)
item(var(in-string command) ...)(
Bind each var(in-string) to each var(command).
)
item([ var(in-string) ])(
List key bindings. If an var(in-string) is specified, the binding of
that string in the selected keymap is displayed. Otherwise, all key
bindings in the selected keymap are displayed. As an exception,
if the tt(-e) or tt(-v) options are used alone, the keymap is em(not)
displayed - the implicit linking of keymaps is the only thing that happens.
)
enditem()
In the binding operations, if the tt(-R) option is used, the var(in-string)s
are interpreted as ranges, instead of plain strings. A valid range
consists of two characters, with an optional `tt(-)'
between them. All characters between the two specified, inclusive,
are bound as specified.
For either var(in-string) or var(out-string), the following
escape sequences are recognised:
startsitem()
sitem(tt(\a))(bell character)
sitem(tt(\b))(backspace)
sitem(tt(\e), tt(\E))(escape)
sitem(tt(\f))(form feed)
sitem(tt(\n))(linefeed (newline))
sitem(tt(\r))(carriage return)
sitem(tt(\t))(horizontal tab)
sitem(tt(\v))(vertical tab)
sitem(tt(\)var(NNN))(character code in octal)
sitem(tt(\x)var(NN))(character code in hexadecimal)
sitem(tt(\M)[tt(-)]var(X))(character with meta bit set)
sitem(tt(\C)[tt(-)]var(X))(control character)
sitem(tt(^)var(X))(control character)
endsitem()
In all other cases, `tt(\)' escapes the following character. Delete is
written as `tt(^?)'. Note that `tt(\M^?)' and `tt(^\M?)' are not the same.
)
findex(vared)
cindex(parameters, editing)
cindex(editing parameters)
item(tt(vared) [ tt(-ch) ] [ tt(-p) var(prompt) ] [ tt(-r) var(rprompt) ] var(name))(
The value of the parameter var(name) is loaded into the edit
buffer, and the line editor is invoked. When the editor exits,
var(name) is set to the string value returned by the editor.
If the tt(-c) flag is given, the parameter is created if it doesn't
already exist.
If the tt(-p) flag is given, the following string will be taken as
the prompt to display at the left. If the tt(-r) flag is given,
the following string gives the prompt to display at the right. If the
tt(-h) flag is specified, the history can be accessed from ZLE.
)
findex(zle)
cindex(widgets, rebinding)
cindex(rebinding widgets)
cindex(widgets, binding)
cindex(binding widgets)
cindex(widgets, invoking)
cindex(invoking widgets)
cindex(widgets, calling)
cindex(calling widgets)
cindex(widgets, defining)
cindex(defining widgets)
xitem(tt(zle) tt(-l) [ tt(-L) ])
xitem(tt(zle) tt(-D) var(widget) ...)
xitem(tt(zle) tt(-A) var(old-widget) var(new-widget))
xitem(tt(zle) tt(-N) var(widget) [ var(function) ])
item(tt(zle) var(widget))(
The tt(zle) builtin performs a number of different actions concerning
ZLE. Which operation it performs depends on its options:
startitem()
item(tt(-l) [ tt(-L) ])(
List all existing user-defined widgets. If the tt(-L)
option is used, list in the form of tt(zle)
commands to create the widgets.
Built-in widgets are not listed.
)
item(tt(-D) var(widget) ...)(
Delete the named var(widget)s.
)
item(tt(-A) var(old-widget) var(new-widget))(
Make the var(new-widget) name an alias for var(old-widget), so that
both names refer to the same widget. The names have equal standing;
if either is deleted, the other remains. If there is already a widget
with the var(new-widget) name, it is deleted.
)
item(tt(-N) var(widget) [ var(function) ])(
Create a user-defined widget. If there is already a widget with the
specified name, it is overwritten. When the new
widget is invoked from within the editor, the specified shell var(function)
is called. If no function name is specified, it defaults to
the same name as the widget.
)
item(var(widget))(
Invoke the specified widget. This can only be done when ZLE is
active; normally this will be within a user-defined widget.
)
enditem()
)
enditem()

64
Doc/Zsh/modules.yo Normal file
View file

@ -0,0 +1,64 @@
texinode(Zsh Modules)()(Programmable Completion)(Top)
chapter(Zsh Modules)
cindex(modules)
sect(Description)
Some optional parts of zsh are in modules, separate from the core
of the shell. Each of these modules may be linked in to the
shell at build time,
or can be dynamically linked while the shell is running
if the installation supports this feature. The modules available are:
startitem()
item(tt(cap))(
Builtins for manipulating POSIX.1e (POSIX.6) capability (privilege) sets.
)
item(tt(clone))(
A builtin that can clone a running shell onto another terminal.
)
item(tt(comp1))(
Base of the completion system. Used by the tt(compctl) and tt(zle) modules.
)
item(tt(compctl))(
The tt(compctl) builtin for controlling completion.
)
item(tt(deltochar))(
A ZLE function duplicating EMACS' tt(zap-to-char).
)
item(tt(example))(
An example of how to write a module.
)
item(tt(files))(
Some basic file manipulation commands as builtins.
)
item(tt(sched))(
A builtin that provides a timed execution facility within the shell.
)
item(tt(stat))(
A builtin command interface to the tt(stat) system call.
)
item(tt(zle))(
The Zsh Line Editor, including the tt(bindkey) and tt(vared) builtins.
)
enditem()
startmenu()
menu(The cap Module)
menu(The clone Module)
menu(The comp1 Module)
menu(The compctl Module)
menu(The deltochar Module)
menu(The example Module)
menu(The files Module)
menu(The sched Module)
menu(The stat Module)
menu(The zle Module)
endmenu()
includefile(Zsh/mod_cap.yo)
includefile(Zsh/mod_clone.yo)
includefile(Zsh/mod_comp1.yo)
includefile(Zsh/mod_compctl.yo)
includefile(Zsh/mod_deltochar.yo)
includefile(Zsh/mod_example.yo)
includefile(Zsh/mod_files.yo)
includefile(Zsh/mod_sched.yo)
includefile(Zsh/mod_stat.yo)
includefile(Zsh/mod_zle.yo)

1039
Doc/Zsh/options.yo Normal file

File diff suppressed because it is too large Load diff

812
Doc/Zsh/params.yo Normal file
View file

@ -0,0 +1,812 @@
texinode(Parameters)(Options)(Expansion)(Top)
chapter(Parameters)
cindex(parameters)
sect(Description)
A parameter has a name, a value, and a number of attributes.
A name may be any sequence of alphanumeric
characters and underscores, or the single characters
`tt(*)', `tt(@)', `tt(#)', `tt(?)', `tt(-)', `tt($)', or `tt(!)'.
The value may be a em(scalar) (a string),
an integer, or an array.
To assign a scalar or integer value to a parameter,
use the tt(typeset) builtin.
findex(typeset, use of)
To assign an array value, use `tt(set -A) var(name) var(value) ...'.
findex(set, use of)
The value of a parameter may also be assigned by writing:
nofill(var(name)tt(=)var(value))
If the integer attribute, tt(-i), is set for var(name),
the var(value) is subject to arithmetic evaluation.
In the parameter lists, the mark `<S>' indicates that the parameter is special.
Special parameters cannot have their type changed, and they stay special even
if unset. `<Z>' indicates that the parameter does not exist when the shell
initialises in tt(sh) or tt(ksh) emulation mode.
startmenu()
menu(Local Parameters)
menu(Array Parameters)
menu(Positional Parameters)
menu(Parameters Set By The Shell)
menu(Parameters Used By The Shell)
endmenu()
texinode(Local Parameters)(Array Parameters)()(Parameters)
sect(Local Parameters)
Shell function executions delimit scopes for shell parameters.
(Parameters are dynamically scoped.) The tt(typeset) builtin, and its
alternative forms tt(declare), tt(integer), tt(local) and tt(readonly)
(but not tt(export)), can be used to declare a parameter as being local
to the innermost scope.
When a parameter is read or assigned to, the
innermost existing parameter of that name is used. (That is, the
local parameter hides any less-local parameter.) However, assigning
to a non-existent parameter, or declaring a new parameter with tt(export),
causes it to be created in the em(outer)most scope.
Local parameters disappear when their scope ends.
tt(unset) can be used to delete a parameter while it is still in scope; this
will reveal the next outer parameter of the same name. However, em(special)
parameters are still special when unset.
texinode(Array Parameters)(Positional Parameters)(Local Parameters)(Parameters)
sect(Array Parameters)
The value of an array parameter may be assigned by writing:
nofill(var(name)tt(=LPAR())var(value) ...tt(RPAR()))
Individual elements of an array may be selected using a
subscript. A subscript of the form `tt([)var(exp)tt(])'
selects the single element var(exp), where var(exp) is
an arithmetic expression which will be subject to arithmetic
expansion as if it were surrounded by `tt($LPAR()LPAR())...tt(RPAR()RPAR())'.
The elements are numbered beginning with 1 unless the
tt(KSH_ARRAYS) option is set when they are numbered from zero.
pindex(KSH_ARRAYS, use of)
A subscript of the form `tt([*])' or `tt([@])' evaluates to all
elements of an array; there is no difference between the two
except when they appear within double quotes.
`tt("$foo[*]")' evaluates to `tt("$foo[1] $foo[2] )...tt(")', while
`tt("$foo[@]")' evaluates to `tt("$foo[1]" "$foo[2]")', etc.
A subscript of the form `tt([)var(exp1)tt(,)var(exp2)tt(])'
selects all elements in the range var(exp1) to var(exp2),
inclusive.
If one of the subscripts evaluates to a negative number,
say tt(-)var(n), then the var(n)th element from the end
of the array is used. Thus `tt($foo[-3])' is the third element
from the end of the array tt(foo), and
`tt($foo[1,-1])' is the same as `tt($foo[*])'.
Subscripting may also be performed on non-array values, in which
case the subscripts specify a substring to be extracted.
For example, if tt(FOO) is set to `tt(foobar)', then
`tt(echo $FOO[2,5])' prints `tt(ooba)'.
Subscripts may be used inside braces used to delimit a parameter name, thus
`tt(${foo[2]})' is equivalent to `tt($foo[2])'. If the tt(KSH_ARRAYS)
option is set, the braced form is the only one that will
work, the subscript otherwise not being treated specially.
If a subscript is used on the left side of an assignment the selected
range is replaced by the expression on the right side.
If the opening bracket or the comma is directly followed by an opening
parentheses the string up to the matching closing one is considered to
be a list of flags. The flags currently understood are:
startitem()
item(tt(e))(
this option has no effect and retained for backward compatibility only.
)
item(tt(w))(
if the parameter subscripted is a scalar than this flag makes
subscription work on a per-word basis instead of characters.
)
item(tt(s:)var(string)tt(:))(
this gives the var(string) that separates words (for use with the
tt(w) flag).
)
item(tt(p))(
Recognize the same escape sequences as the tt(print) builtin in
the string argument of a subsequent `tt(s)' flag.
)
item(tt(f))(
if the parameter subscripted is a scalar than this flag makes
subscription work on a per-line basis instead of characters.
This is a shorthand for `tt(pws:\n:)'.
)
item(tt(r))(
if this flag is given the var(exp) is taken as a pattern and the
result is the first matching array element, substring or word (if the
parameter is an array, if it is a scalar, or if it is a scalar and the
`tt(w)' flag is given, respectively); note that this is like giving a
number: `tt($foo[(r))var(??)tt(,3])' and `tt($foo[(r))var(??)tt(,(r)f*])' work.
)
item(tt(R))(
like `tt(r)', but gives the last match.
)
item(tt(i))(
like `tt(r)', but gives the index of the match instead; this may not
be combined with a second argument.
)
item(tt(I))(
like `tt(i), but gives the index of the last match.
)
item(tt(n:)var(expr)tt(:))(
if combined with `tt(r)', `tt(R)', `tt(i)' or `tt(I)', makes them give
the var(n)th or var(n)th last match (if var(expr) evaluates to
var(n)).
)
enditem()
texinode(Positional Parameters)(Parameters Set By The Shell)(Array Parameters)(Parameters)
sect(Positional Parameters)
Positional parameters are set by the shell on invocation,
by the tt(set) builtin, or by direct assignment.
The parameter var(n), where var(n) is a number,
is the var(n)th positional parameter.
The parameters tt(*), tt(@) and tt(argv) are
arrays containing all the positional parameters;
thus `tt($argv[)var(n)tt(])', etc., is equivalent to simply `tt($)var(n)'.
texinode(Parameters Set By The Shell)(Parameters Used By The Shell)(Positional Parameters)(Parameters)
sect(Parameters Set By The Shell)
The following parameters are automatically set by the shell:
startitem()
vindex(!)
item(tt(!) <S>)(
The process ID of the last background command invoked.
)
vindex(#)
item(tt(#) <S>)(
The number of positional parameters in decimal.
)
vindex(ARGC)
item(tt(ARGC) <S> <Z>)(
Same as tt(#).
)
vindex($)
item(tt($) <S>)(
The process ID of this shell.
)
vindex(-)
item(tt(-) <S>)(
Flags supplied to the shell on invocation or by the tt(set)
or tt(setopt) commands.
)
vindex(*)
item(tt(*) <S>)(
An array containing the positional parameters.
)
vindex(argv)
item(tt(argv) <S> <Z>)(
Same as tt(*).
)
vindex(@)
item(tt(@) <S>)(
Same as tt(argv[@]).
)
vindex(?)
item(tt(?) <S>)(
The exit value returned by the last command.
)
vindex(0)
item(tt(0) <S>)(
The name used to invoke the current shell. If the tt(FUNCTION_ARGZERO) option
is set, this is set temporarily within a shell function to the name of the
function, and within a sourced script to the name of the script.
)
vindex(status)
item(tt(status) <S> <Z>)(
Same as tt(?).
)
vindex(_)
item(tt(_) <S>)(
The last argument of the previous command.
Also, this parameter is set in the environment of every command
executed to the full pathname of the command.
)
vindex(EGID)
item(tt(EGID) <S>)(
The effective group ID of the shell process. If you have sufficient
privileges, you may change the effective group ID of the shell
process by assigning to this parameter. Also (assuming sufficient
privileges), you may start a single command with a different
effective group ID by `tt(LPAR()EGID=)var(gid)tt(; command+RPAR())'
)
vindex(EUID)
item(tt(EUID) <S>)(
The effective user ID of the shell process. If you have sufficient
privileges, you may change the effective user ID of the shell process
by assigning to this parameter. Also (assuming sufficient privileges),
you may start a single command with a different
effective user ID by `tt(LPAR()EUID=)var(uid)tt(; command+RPAR())'
)
vindex(ERRNO)
item(tt(ERRNO) <S>)(
The value of errno (see manref(errno)(3))
as set by the most recently failed system call.
This value is system dependent and is intended for debugging
purposes.
)
vindex(GID)
item(tt(GID) <S>)(
The real group ID of the shell process. If you have sufficient privileges,
you may change the group ID of the shell process by assigning to this
parameter. Also (assuming sufficient privileges), you may start a single
command under a different
group ID by `tt(LPAR()GID=)var(gid)tt(; command+RPAR())'
)
vindex(HOST)
item(tt(HOST))(
The current hostname.
)
vindex(LINENO)
item(tt(LINENO) <S>)(
The line number of the current line within the current script
being executed.
)
vindex(LOGNAME)
item(tt(LOGNAME))(
If the corresponding variable is not set in the environment of the
shell, it is initialized to the login name corresponding to the
current login session. This parameter is exported by default but
this can be disabled using the tt(typeset) builtin.
)
vindex(MACHTYPE)
item(tt(MACHTYPE))(
The machine type (microprocessor class or machine model),
as determined at compile time.
)
vindex(OLDPWD)
item(tt(OLDPWD))(
The previous working directory. This is set when the shell initialises
and whenever the directory changes.
)
vindex(OPTARG)
item(tt(OPTARG) <S>)(
The value of the last option argument processed by the tt(getopts)
command.
)
vindex(OPTIND)
item(tt(OPTIND) <S>)(
The index of the last option argument processed by the tt(getopts)
command.
)
vindex(OSTYPE)
item(tt(OSTYPE))(
The operating system, as determined at compile time.
)
vindex(PPID)
item(tt(PPID) <S>)(
The process ID of the parent of the shell.
)
vindex(PWD)
item(tt(PWD))(
The present working directory. This is set when the shell initialises
and whenever the directory changes.
)
vindex(RANDOM)
item(tt(RANDOM) <S>)(
A random integer from 0 to 32767, newly generated each time
this parameter is referenced. The random number generator
can be seeded by assigning a numeric value to tt(RANDOM).
)
vindex(SECONDS)
item(tt(SECONDS) <S>)(
The number of seconds since shell invocation. If this parameter
is assigned a value, then the value returned upon reference
will be the value that was assigned plus the number of seconds
since the assignment.
)
vindex(SHLVL)
item(tt(SHLVL) <S>)(
Incremented by one each time a new shell is started.
)
vindex(signals)
item(tt(signals))(
An array containing the names of the signals.
)
vindex(TTY)
item(tt(TTY))(
The name of the tty associated with the shell, if any.
)
vindex(TTYIDLE)
item(tt(TTYIDLE) <S>)(
The idle time of the tty associated with the shell in seconds or -1 if there
is no such tty.
)
vindex(UID)
item(tt(UID) <S>)(
The real user ID of the shell process. If you have sufficient privileges,
you may change the user ID of the shell by assigning to this parameter.
Also (assuming sufficient privileges), you may start a single command
under a different
user ID by `tt(LPAR()UID=)var(uid)tt(; command+RPAR())'
)
vindex(USERNAME)
item(tt(USERNAME) <S>)(
The username corresponding to the real user ID of the shell process. If you
have sufficient privileges, you may change the username (and also the
user ID and group ID) of the shell by assigning to this parameter.
Also (assuming sufficient privileges), you may start a single command
under a different username (and user ID and group ID)
by `tt(LPAR()USERNAME=)var(username)tt(; command+RPAR())'
)
vindex(VENDOR)
item(tt(VENDOR))(
The vendor, as determined at compile time.
)
vindex(ZSH_NAME)
item(tt(ZSH_NAME))(
Expands to the basename of the command used to invoke this instance
of zsh.
)
vindex(ZSH_VERSION)
item(tt(ZSH_VERSION))(
The version number of this zsh.
)
enditem()
texinode(Parameters Used By The Shell)()(Parameters Set By The Shell)(Parameters)
sect(Parameters Used By The Shell)
The following parameters are used by the shell:
startitem()
vindex(ARGV0)
item(tt(ARGV0))(
If exported, its value is used as tt(argv[0]) of external commands.
Usually used in constructs like `tt(ARGV0=emacs nethack)'.
)
vindex(BAUD)
item(tt(BAUD))(
The baud rate of the current connection. Used by the line editor
update mechanism to compensate for a slow terminal by delaying
updates until necessary. This may be profitably set to a lower value
in some circumstances, e.g.
for slow modems dialing into a communications server which is connected
to a host via a fast link; in this case, this variable
would be set by default to the speed of the fast link, and not
the modem.
This parameter should be set to the baud
rate of the slowest part of the link for best performance. The compensation
mechanism can be turned off by setting the variable to zero.
)
vindex(cdpath)
vindex(CDPATH)
item(tt(cdpath) <S> <Z> (tt(CDPATH) <S>))(
An array (colon-separated list)
of directories specifying the search path for the tt(cd) command.
)
vindex(COLUMNS)
item(tt(COLUMNS) <S>)(
The number of columns for this terminal session.
Used for printing select lists and for the line editor.
)
vindex(DIRSTACKSIZE)
item(tt(DIRSTACKSIZE))(
The maximum size of the directory stack. If the
stack gets larger than this, it will be truncated automatically.
This is useful with the tt(AUTO_PUSHD) option.
pindex(AUTO_PUSHD, use of)
)
vindex(FCEDIT)
item(tt(FCEDIT))(
The default editor for the tt(fc) builtin.
)
vindex(fignore)
vindex(FIGNORE)
item(tt(fignore) <S> <Z> (tt(FIGNORE) <S>))(
An array (colon separated list)
containing the suffixes of files to be ignored
during filename completion. However, if the completion generates only files
which would match if this variable would be ignored, than these files are
completed anyway.
)
vindex(fpath)
vindex(FPATH)
item(tt(fpath) <S> <Z> (tt(FPATH) <S>))(
An array (colon separated list)
of directories specifying the search path for
function definitions. This path is searched when a function
with the tt(-u) attribute is referenced. If an executable
file is found, then it is read and executed in the current environment.
)
vindex(histchars)
item(tt(histchars) <S>)(
Three characters used by the shell's history and lexical analysis
mechanism. The first character signals the start of a history
substitution (default `tt(!)'). The second character signals the
start of a quick history substitution (default `tt(^)'). The third
character is the comment character (default `tt(#)').
)
vindex(HISTCHARS)
item(tt(HISTCHARS) <S> <Z>)(
Same as tt(histchars). (Deprecated.)
)
vindex(HISTFILE)
item(tt(HISTFILE))(
The file to save the history in when an interactive shell exits.
If unset, the history is not saved.
)
vindex(HISTSIZE)
item(tt(HISTSIZE) <S>)(
The maximum size of the history list.
)
vindex(HOME)
item(tt(HOME) <S>)(
The default argument for the tt(cd) command.
)
vindex(IFS)
item(tt(IFS) <S>)(
Internal field separators (by default space, tab, newline and NUL), that
are used to separate words which result from
command or parameter substitution and words read by
the tt(read) builtin. Any characters from the set space, tab and
newline that appear in the IFS are called em(IFS white space).
One or more IFS white space characters or one non-IFS white space
character together with any adjacent IFS white space character delimit
a field. If an IFS white space character appears twice consecutively
in the IFS, this character is treated as if it were not an IFS white
space character.
)
vindex(KEYTIMEOUT)
item(tt(KEYTIMEOUT))(
The time the shell waits, in hundredths of seconds, for another key to
be pressed when reading bound multi-character sequences.
)
vindex(LANG)
item(tt(LANG) <S>)(
This variable determines the locale category for any category not
specifically selected via a variable starting with `tt(LC_)'.
)
vindex(LC_ALL)
item(tt(LC_ALL) <S>)(
This variable overrides the value of the `tt(LANG)' variable and the value
of any of the other variables starting with `tt(LC_)'.
)
vindex(LC_COLLATE)
item(tt(LC_COLLATE) <S>)(
This variable determines the locale category for character collation
information within ranges in glob brackets and for sorting.
)
vindex(LC_CTYPE)
item(tt(LC_CTYPE) <S>)(
This variable determines the locale category for character handling
functions.
)
vindex(LC_MESSAGES)
item(tt(LC_MESSAGES) <S>)(
This variable determines the language in which messages should be
written. Note that zsh does not use message catalogs.
)
vindex(LC_TIME)
item(tt(LC_TIME) <S>)(
This variable determines the locale category for date and time
formatting in prompt escape sequences.
)
vindex(LINES)
item(tt(LINES) <S>)(
The number of lines for this terminal session.
Used for printing select lists and for the line editor.
)
vindex(LISTMAX)
item(tt(LISTMAX))(
In the line editor, the number of filenames to list without asking first.
If set to zero, the shell asks only if the top of the listing would scroll
off the screen.
)
vindex(LOGCHECK)
item(tt(LOGCHECK))(
The interval in seconds between checks for login/logout activity
using the tt(watch) parameter.
)
vindex(MAIL)
item(tt(MAIL))(
If this parameter is set and tt(mailpath) is not set,
the shell looks for mail in the specified file.
)
vindex(MAILCHECK)
item(tt(MAILCHECK))(
The interval in seconds between checks for new mail.
)
vindex(mailpath)
vindex(MAILPATH)
item(tt(mailpath) <S> <Z> (tt(MAILPATH) <S>))(
An array (colon-separated list) of filenames to check for
new mail. Each filename can be followed by a `tt(?)' and a
message that will be printed. The message will undergo
parameter expansion, command substitution and arithmetic
substitution with the variable tt($_) defined as the name
of the file that has changed. The default message is
`tt(You have new mail)'. If an element is a directory
instead of a file the shell will recursively check every
file in every subdirectory of the element.
)
vindex(manpath)
vindex(MANPATH)
item(tt(manpath) <S> <Z> (tt(MANPATH) <S> <Z>))(
An array (colon-separated list)
whose value is not used by the shell. The tt(manpath)
array can be useful, however, since setting it also sets
tt(MANPATH), and vice versa.
)
vindex(module_path)
vindex(MODULE_PATH)
item(tt(module_path) <S> <Z> (tt(MODULE_PATH) <S>))(
An array (colon-separated list)
of directories that tt(zmodload)
searches for dynamically loadable modules.
This is initialised to a standard pathname,
usually `tt(/usr/local/lib/zsh/$ZSH_VERSION)'.
(The `tt(/usr/local/lib)' part varies from installation to installation.)
For security reasons, any value set in the environment when the shell
is started will be ignored.
These parameters only exist if the installation supports dynamic
module loading.
)
vindex(NULLCMD)
cindex(null command style)
cindex(csh, null command style)
cindex(ksh, null command style)
item(tt(NULLCMD) <S>)(
The command name to assume if a redirection is specified
with no command. Defaults to tt(cat). For bf(sh)/bf(ksh)
behavior, change this to tt(:). For bf(csh)-like
behavior, unset this parameter; the shell will print an
error message if null commands are entered.
)
vindex(path)
vindex(PATH)
item(tt(path) <S> <Z> (tt(PATH) <S>))(
An array (colon-separated list)
of directories to search for commands.
When this parameter is set, each directory is scanned
and all files found are put in a hash table.
)
vindex(POSTEDIT)
item(tt(POSTEDIT) <S>)(
This string is output whenever the line editor exits.
It usually contains termcap strings to reset the terminal.
)
vindex(PS1)
item(tt(PS1) <S>)(
The primary prompt string, printed before a command is read.
the default is `tt(%m%# )'. It undergoes a special form of expansion
before being displayed; see noderef(Prompt Expansion).
)
vindex(PS2)
item(tt(PS2) <S>)(
The secondary prompt, printed when the shell needs more information
to complete a command.
It is expanded in the same way as tt(PS1).
The default is `tt(%_> )', which displays any shell constructs or quotation
marks which are currently being processed.
)
vindex(PS3)
item(tt(PS3) <S>)(
Selection prompt used within a tt(select) loop.
It is expanded in the same way as tt(PS1).
The default is `tt(?# )'.
)
vindex(PS4)
item(tt(PS4) <S>)(
The execution trace prompt. Default is `tt(PLUS() )'.
)
vindex(PROMPT)
xitem(tt(PROMPT) <S> <Z>)
vindex(PROMPT2)
xitem(tt(PROMPT2) <S> <Z>)
vindex(PROMPT3)
xitem(tt(PROMPT3) <S> <Z>)
vindex(PROMPT4)
item(tt(PROMPT4) <S> <Z>)(
Same as tt(PS1), tt(PS2), tt(PS3) and tt(PS4),
respectively.
)
vindex(psvar)
vindex(PSVAR)
item(tt(psvar) <S> <Z> (tt(PSVAR) <S>))(
An array (colon-separated list) whose first nine values can be used in
tt(PROMPT) strings. Setting tt(psvar) also sets tt(PSVAR), and
vice versa.
)
vindex(prompt)
item(tt(prompt) <S> <Z>)(
Same as tt(PS1).
)
vindex(READNULLCMD)
item(tt(READNULLCMD) <S>)(
The command name to assume if a single input redirection
is specified with no command. Defaults to tt(more).
)
vindex(REPORTTIME)
item(tt(REPORTTIME))(
If nonnegative, commands whose combined user and system execution times
(measured in seconds) are greater than this value have timing
statistics printed for them.
)
vindex(RPROMPT)
xitem(tt(RPROMPT) <S>)
vindex(RPS1)
item(tt(RPS1) <S>)(
This prompt is displayed on the right-hand side of the screen
when the primary prompt is being displayed on the left.
This does not work if the tt(SINGLELINEZLE) option is set.
It is expanded in the same way as tt(PS1).
)
vindex(SAVEHIST)
item(tt(SAVEHIST))(
The maximum number of history events to save in the history file.
)
vindex(SPROMPT)
item(tt(SPROMPT) <S>)(
The prompt used for spelling correction. The sequence
`tt(%R)' expands to the string which presumably needs spelling
correction, and `tt(%r)' expands to the proposed correction.
All other prompt escapes are also allowed.
)
vindex(STTY)
item(tt(STTY))(
If this parameter is set in a command's environment, the shell runs the
tt(stty) command with the value of this parameter as arguments in order to
set up the terminal before executing the command. The modes apply only to the
command, and are reset when it finishes or is suspended. If the command is
suspended and continued later with the tt(fg) or tt(wait) builtins it will
see the modes specified by tt(STTY), as if it were not suspended. This
(intentionally) does not apply if the command is continued via `tt(kill -CONT)'.
tt(STTY) is ignored if the command is run in the background, or if it is in the
environment of the shell but not explicitly assigned to in the input line. This
avoids running stty at every external command by accidentally exporting it.
Also note that tt(STTY) should not be used for window size specifications; these
will not be local to the command.
)
vindex(TERM)
item(tt(TERM) <S>)(
The type of terminal in use. This is used when looking up termcap sequences.
)
vindex(TIMEFMT)
item(tt(TIMEFMT))(
The format of process time reports with the tt(time) keyword.
The default is `tt(%E real %U user %S system %P %J)'.
Recognizes the following escape sequences:
startsitem()
sitem(tt(%%))(A `tt(%)'.)
sitem(tt(%U))(CPU seconds spent in user mode.)
sitem(tt(%S))(CPU seconds spent in kernel mode.)
sitem(tt(%E))(Elapsed time in seconds.)
sitem(tt(%P))(The CPU percentage, computed as (tt(%U)PLUS()tt(%S))/tt(%E).)
sitem(tt(%J))(The name of this job.)
endsitem()
A star may be inserted between the percent sign and flags printing time.
This cause the time to be printed in
`var(hh)tt(:)var(mm)tt(:)var(ss)tt(.)var(ttt)'
format (hours and minutes are only printed if they are not zero).
)
vindex(TMOUT)
item(tt(TMOUT))(
If this parameter is nonzero, the shell will receive an tt(ALRM)
signal if a command is not entered within the specified number of
seconds after issuing a prompt. If there is a trap on tt(SIGALRM), it
will be executed and a new alarm is scheduled using the value of the
tt(TMOUT) parameter after executing the trap. If no trap is set, and
the idle time of the terminal is not less than the value of the
tt(TMOUT) parameter, zsh terminates. Otherwise a new alarm is
scheduled to tt(TMOUT) seconds after the last keypress.
)
vindex(TMPPREFIX)
item(tt(TMPPREFIX))(
A pathname prefix which the shell will use for all temporary files.
Note that this should include an initial part for the file name as
well as any directory names. The default is `tt(/tmp/zsh)'.
)
vindex(watch)
vindex(WATCH)
item(tt(watch) <S> <Z> (tt(WATCH) <S>))(
An array (colon-separated list) of login/logout events to report.
If it contains the single word `tt(all)', then all login/logout events
are reported. If it contains the single word `tt(notme)', then all
events are reported as with `tt(all)' except tt($USERNAME).
An entry in this list may consist of a username,
an `tt(@)' followed by a remote hostname,
and a `tt(%)' followed by a line (tty).
Any or all of these components may be present in an entry;
if a login/logout event matches all of them,
it is reported.
)
vindex(WATCHFMT)
item(tt(WATCHFMT))(
The format of login/logout reports if the tt(watch) parameter is set.
Default is `tt(%n has %a %l from %m)'.
Recognizes the following escape sequences:
startitem()
item(tt(%n))(
The name of the user that logged in/out.
)
item(tt(%a))(
The observed action, i.e. "logged on" or "logged off".
)
item(tt(%l))(
The line (tty) the user is logged in on.
)
item(tt(%M))(
The full hostname of the remote host.
)
item(tt(%m))(
The hostname up to the first `tt(.)'. If only the
IP address is available or the utmp field contains
the name of an X-windows display, the whole name is printed.
em(NOTE:)
The `tt(%m)' and `tt(%M)' escapes will work only if there is a host name
field in the utmp on your machine. Otherwise they are
treated as ordinary strings.
)
item(tt(%S) LPAR()tt(%s)RPAR())(
Start (stop) standout mode.
)
item(tt(%U) LPAR()tt(%u)RPAR())(
Start (stop) underline mode.
)
item(tt(%B) LPAR()tt(%b)RPAR())(
Start (stop) boldface mode.
)
xitem(tt(%t))
item(tt(%@))(
The time, in 12-hour, am/pm format.
)
item(tt(%T))(
The time, in 24-hour format.
)
item(tt(%w))(
The date in `var(day)tt(-)var(dd)' format.
)
item(tt(%W))(
The date in `var(mm)tt(/)var(dd)tt(/)var(yy)' format.
)
item(tt(%D))(
The date in `var(yy)tt(-)var(mm)tt(-)var(dd)' format.
)
item(tt(%LPAR())var(x)tt(:)var(true-text)tt(:)var(false-text)tt(RPAR()))(
Specifies a ternary expression.
The character following the var(x) is
arbitrary; the same character is used to separate the text
for the "true" result from that for the "false" result.
Both the separator and the right parenthesis may be escaped
with a backslash.
Ternary expressions may be nested.
The test character var(x) may be any one of `tt(l)', `tt(n)', `tt(m)'
or `tt(M)', which indicate a `true' result if the corresponding
escape sequence would return a non-empty value; or it may be `tt(a)',
which indicates a `true' result if the watched user has logged in,
or `false' if he has logged out.
Other characters evaluate to neither true nor false; the entire
expression is omitted in this case.
If the result is `true', then the var(true-text)
is formatted according to the rules above and printed,
and the var(false-text) is skipped.
If `false', the var(true-text) is skipped and the var(false-text)
is formatted and printed.
Either or both of the branches may be empty, but
both separators must be present in any case.
)
enditem()
)
vindex(WORDCHARS)
item(tt(WORDCHARS) <S>)(
A list of non-alphanumeric characters considered part of a word
by the line editor.
)
vindex(ZDOTDIR)
item(tt(ZDOTDIR))(
The directory to search for shell startup files (.zshrc, etc),
if not tt($HOME).
)
enditem()

209
Doc/Zsh/prompt.yo Normal file
View file

@ -0,0 +1,209 @@
texinode(Prompt Expansion)(Restricted Shell)(Compatibility)(Top)
chapter(Prompt Expansion)
ifzman(\
sect(Prompt Expansion)
)\
Prompt sequences undergo a special form of expansion. This type of expansion
is also available using the tt(-P) option to the tt(print) builtin.
pindex(PROMPT_SUBST, use of)
If the tt(PROMPT_SUBST) option is set, the prompt string is first subjected to
em(parameter expansion),
em(command substitution) and
em(arithmetic expansion).
See
ifzman(\
zmanref(zshexpn).
)\
ifnzman(\
noderef(Expansion).
)\
Certain escape sequences may be recognised in the prompt string.
pindex(PROMPT_BANG, use of)
If the tt(PROMPT_BANG) option is set, a `tt(!)' in the prompt is replaced
by the current history event number. A literal `tt(!)' may then be
represented as `tt(!!)'.
pindex(PROMPT_PERCENT, use of)
If the tt(PROMPT_PERCENT) option is set, certain escape sequences that
start with `tt(%)' are expanded.
Some escapes take an optional integer argument, which
should appear between the `tt(%)' and the next character of the
sequence. The following escape sequences are recognized:
startitem()
item(tt(%%))(
A `tt(%)'.
)
item(tt(%RPAR()))(
A `tt(RPAR())'.
)
xitem(tt(%d))
item(tt(%/))(
Present working directory (tt($PWD)).
)
item(tt(%~))(
tt($PWD).
If it has a named directory as its prefix, that part is replaced
by a `tt(~)' followed by the name of the directory.
If it starts with tt($HOME), that part is
replaced by a `tt(~)'.
)
xitem(tt(%c))
xitem(tt(%.))
item(tt(%C))(
Trailing component of tt($PWD).
An integer may follow the `tt(%)' to get more than one component.
Unless `tt(%C)' is used, tilde contraction is performed first.
)
xitem(tt(%h))
item(tt(%!))(
Current history event number.
)
item(tt(%L))(
The current value of tt($SHLVL).
)
item(tt(%M))(
The full machine hostname.
)
item(tt(%m))(
The hostname up to the first `tt(.)'.
An integer may follow the `tt(%)' to specify
how many components of the hostname are desired.
)
item(tt(%S) LPAR()tt(%s)RPAR())(
Start (stop) standout mode.
)
item(tt(%U) LPAR()tt(%u)RPAR())(
Start (stop) underline mode.
)
item(tt(%B) LPAR()tt(%b)RPAR())(
Start (stop) boldface mode.
)
xitem(tt(%t))
item(tt(%@))(
Current time of day, in 12-hour, am/pm format.
)
item(tt(%T))(
Current time of day, in 24-hour format.
)
item(tt(%*))(
Current time of day in 24-hour format, with seconds.
)
item(tt(%n))(
tt($USERNAME).
)
item(tt(%w))(
The date in var(day)tt(-)var(dd) format.
)
item(tt(%W))(
The date in var(mm)tt(/)var(dd)tt(/)var(yy) format.
)
item(tt(%D))(
The date in var(yy)tt(-)var(mm)tt(-)var(dd) format.
)
item(tt(%D{)var(string)tt(}))(
var(string) is formatted using the tt(strftime) function.
See manref(strftime)(3) for more details. Three additional codes are
available: tt(%f) prints the day of the month, like tt(%e) but
without any preceding space if the day is a single digit, and
tt(%K)/tt(%L) correspond to tt(%k)/tt(%l) for the hour of the day
(24/12 hour clock) in the same way.
)
item(tt(%l))(
The line (tty) the user is logged in on.
)
item(tt(%?))(
The return code of the last command executed just before the prompt.
)
item(tt(%_))(
The status of the parser, i.e. the shell constructs (like `tt(if)' and
`tt(for)') that have been started on the command line. If given an integer
number that many strings will be printed; zero or no integer means
print as many as there are.
)
item(tt(%E))(
Clears to end of line.
)
item(tt(%#))(
A `tt(#)' if the shell is running with privileges, a `tt(%)' if not.
Equivalent to `tt(%(!.#.%%))'.
The definition of `privileged', for these purposes, is that either the
effective user ID is zero, or, if POSIX.1e capabilities are supported, that
at least one capability is raised in either the Effective or Inheritable
capability vectors.
)
item(tt(%v))(
vindex(psvar, use of)
The value of the first element of the tt(psvar) array parameter. Following
the `tt(%)' with an integer gives that element of the array.
)
item(tt(%{)...tt(%}))(
Include a string as a literal escape sequence.
The string within the braces should not change the cursor
position. Brace pairs can nest.
)
item(tt(%LPAR())var(x.true-text.false-text)tt(RPAR()))(
Specifies a ternary expression. The character following the var(x) is
arbitrary; the same character is used to separate the text for the
`true' result from that for the `false' result.
This separator may not appear in the var(true-text), except as part of a
%-escape
sequence. A `tt(RPAR())' may appear in the var(false-text) as `tt(%RPAR())'.
var(true-text)
and var(false-text) may both contain arbitrarily-nested escape
sequences, including further ternary expressions.
The left
parenthesis may be preceded or followed by a positive integer var(n),
which defaults to zero. The test character var(x) may be any of the
following:
startsitem()
sxitem(tt(c))
sxitem(tt(.))
sitem(tt(~))(True if the current path, with prefix replacement, has at least var(n) elements.)
sxitem(tt(/))
sitem(tt(C))(True if the current absolute path has at least var(n) elements.)
sitem(tt(t))(True if the time in minutes is equal to var(n).)
sitem(tt(T))(True if the time in hours is equal to var(n).)
sitem(tt(d))(True if the day of the month is equal to var(n).)
sitem(tt(D))(True if the month is equal to var(n) (January = 0).)
sitem(tt(w))(True if the day of the week is equal to var(n) (Sunday = 0).)
sitem(tt(?))(True if the exit status of the last command was var(n).)
sitem(tt(#))(True if the effective uid of the current process is var(n).)
sitem(tt(g))(True if the effective gid of the current process is var(n).)
sitem(tt(L))(True if the tt(SHLVL) parameter is at least var(n).)
sitem(tt(S))(True if the tt(SECONDS) parameter is at least var(n).)
sitem(tt(v))(True if the array tt(psvar) has at least var(n) elements.)
sitem(tt(_))(True if at least var(n) shell constructs were started.)
sitem(tt(!))(True if the shell is running with privileges.)
endsitem()
)
xitem(tt(%<)var(string)tt(<))
xitem(tt(%>)var(string)tt(>))
item(tt(%[)var(xstring)tt(]))(
Specifies truncation behaviour.
The third, deprecated, form is equivalent to `tt(%)var(xstringx)',
i.e. var(x) may be `tt(<)' or `tt(>)'.
The numeric argument, which in the third form may appear immediately
after the `tt([)', specifies the maximum permitted length of
the various strings that can be displayed in the prompt. If this
integer is zero, or missing, truncation is disabled. Truncation is
initially disabled.
The var(string) will be displayed in
place of the truncated portion of any string.
The forms with `tt(<)' truncate at the left of the string,
and the forms with `tt(>)' truncate at the right of the string.
For example, if the current directory is `tt(/home/pike)',
the prompt `tt(%8<..<%/)' will expand to `tt(..e/pike)'.
In this string, the terminating character (`tt(<)', `tt(>)' or `tt(])'),
or in fact any character, may be quoted by a preceding `tt(\)'.
% escapes are em(not) recognised.
If the var(string) is longer than the specified truncation length,
it will appear in full, completely replacing the truncated string.
)
enditem()

183
Doc/Zsh/redirect.yo Normal file
View file

@ -0,0 +1,183 @@
texinode(Redirection)(Command Execution)(Shell Grammar)(Top)
chapter(Redirection)
cindex(redirection)
ifzman(\
sect(Redirection)
)\
cindex(file descriptors)
cindex(descriptors, file)
If a command is followed by tt(&)
and job control is not active,
then the default standard input
for the command is the empty file tt(/dev/null).
Otherwise, the environment for the execution of a command contains the
file descriptors of the invoking shell as modified by
input/output specifications.
The following may appear anywhere in a simple command
or may precede or follow a complex command.
Substitution occurs before var(word) or var(digit)
is used except as noted below.
If the result of substitution on var(word)
produces more than one filename,
redirection occurs for each
separate filename in turn.
startitem()
item(tt(<) var(word))(
Open file var(word) for reading as standard input.
)
item(tt(<>) var(word))(
Open file var(word) for reading and writing as standard input.
If the file does not exist then it is created.
)
item(tt(>) var(word))(
Open file var(word) for writing as standard output.
If the file does not exist then it is created.
If the file exists, and the tt(CLOBBER) option is unset,
this causes an error;
otherwise, it is truncated to zero length.
)
xitem(tt(>|) var(word))
item(tt(>!) var(word))(
Same as tt(>), except that the file is truncated to zero length
if it exists, even if tt(CLOBBER) is unset.
)
item(tt(>>) var(word))(
Open file var(word) for writing in append mode as standard output.
If the file does not exist, and the tt(CLOBBER)
option is unset, this causes an error;
otherwise, the file is created.
)
xitem(tt(>>|) var(word))
item(tt(>>!) var(word))(
Same as tt(>>), except that the file is created if it does not
exist, even if tt(CLOBBER) is unset.
)
item(tt(<<)[tt(-)] var(word))(
The shell input is read up to a line that is the same as
var(word), or to an end-of-file.
No parameter substitution, command substitution or
filename generation is performed on var(word).
The resulting document, called a
em(here-document), becomes the standard input.
If any character of var(word) is quoted with
single or double quotes or a `tt(\)',
no interpretation is placed upon the characters of the document.
Otherwise, parameter and command substitution
occurs, `tt(\)' followed by a newline is removed,
and `tt(\)' must be used to quote the characters
`tt(\)', `tt($)', `tt(`)' and the first character of var(word).
If tt(<<-) is used, then all leading
tabs are stripped from var(word) and from the document.
)
item(tt(<<<) var(word))(
Perform shell expansion on var(word) and pass the result
to standard input. This is known as a em(here-string).
)
xitem(tt(<&) var(digit))
item(tt(>&) var(digit))(
The standard input/output is duplicated from file descriptor
var(digit) (see manref(dup)(2)).
)
xitem(tt(<& -))
item(tt(>& -))(
Close the standard input/output.
)
xitem(tt(<& p))
item(tt(>& p))(
The input/output from/to the coprocess is moved to the standard input/output.
)
item(tt(>&) var(word))(
Same as `tt(>) var(word) tt(2>&1)'.
)
item(tt(>>&) var(word))(
Same as `tt(>>) var(word) tt(2>&1)'.
)
enditem()
If one of the above is preceded by a digit, then the file
descriptor referred to is that specified by the digit
instead of the default 0 or 1.
The order in which redirections are specified is significant.
The shell evaluates each redirection in terms of the
(em(file descriptor), em(file))
association at the time of evaluation.
For example:
nofill(... tt(1>)var(fname) tt(2>&1))
first associates file descriptor 1 with file var(fname).
It then associates file descriptor 2 with the file associated with file
descriptor 1 (that is, var(fname)).
If the order of redirections were reversed,
file descriptor 2 would be associated
with the terminal (assuming file descriptor 1 had been)
and then file descriptor 1 would be associated with file var(fname).
sect(Multios)
pindex(MULTIOS, use of)
If the user tries to open a file descriptor for writing more than once,
the shell opens the file descriptor as a pipe to a process that copies
its input to all the specified outputs, similar to bf(tee),
provided the tt(MULTIOS) option is set. Thus:
nofill(tt(date >foo >bar))
writes the date to two files, named `tt(foo)' and `tt(bar)'.
Note that a pipe is an implicit redirection; thus
nofill(tt(date >foo | cat))
writes the date to the file `tt(foo)', and also pipes it to cat.
If the tt(MULTIOS)
option is set, the word after a redirection operator is also subjected
to filename generation (globbing). Thus
nofill(tt(: > *))
will truncate all files in the current directory,
assuming there's at least one. (Without the tt(MULTIOS)
option, it would create an empty file called `tt(*)'.)
Similarly, you can do
nofill(tt(echo exit 0 >> *.sh))
If the user tries to open a file descriptor for reading more than once,
the shell opens the file descriptor as a pipe to a process that copies
all the specified inputs to its output in the order
specified, similar to bf(cat),
provided the tt(MULTIOS) option is set. Thus
nofill(tt(sort <foo <fubar))
or even
nofill(tt(sort <f{oo,ubar}))
is equivalent to `tt(cat foo fubar | sort)'.
Note that a pipe is an implicit redirection; thus
nofill(tt(cat bar | sort <foo))
is equivalent to `tt(cat bar foo | sort)' (note the order of the inputs).
If the tt(MULTIOS) option is em(un)set,
each redirection replaces the previous redirection for that file descriptor.
However, all files redirected to are actually opened, so
nofill(tt(echo foo > bar > baz))
when tt(MULTIOS) is unset will truncate bar, and write `tt(foo)' into baz.
If a simple command consists of one or more redirection operators
and zero or more parameter assignments, but no command name,
the command named in the shell variable tt(READNULLCMD) is assumed.
(If tt(READNULLCMD) is empty or not set, `tt(cat)' is used.) Thus
nofill(tt(< file))
prints the contents of tt(file).

44
Doc/Zsh/restricted.yo Normal file
View file

@ -0,0 +1,44 @@
texinode(Restricted Shell)(Expansion)(Prompt Expansion)(Top)
chapter(Restricted Shell)
ifzman(\
sect(Restricted Shell)
)\
cindex(restricted shell)
pindex(RESTRICTED)
When the basename of the command used to invoke zsh starts with the letter
`tt(r)' or the `tt(-r)' command line option is supplied at invocation, the
shell becomes restricted. Emulation mode is determined after stripping the
letter `tt(r)' from the invocation name. The following are disabled in
restricted mode:
startitemize()
itemiz(changing directories with the tt(cd) builtin)
itemiz(changing or unsetting the tt(PATH), tt(path), tt(MODULE_PATH),
tt(module_path), tt(SHELL), tt(HISTFILE), tt(HISTSIZE), tt(GID), tt(EGID),
tt(UID), tt(EUID), tt(USERNAME), tt(LD_LIBRARY_PATH),
tt(LD_AOUT_LIBRARY_PATH), tt(LD_PRELOAD) and tt(LD_AOUT_PRELOAD)
parameters)
itemiz(specifying command names containing tt(/))
itemiz(specifying command pathnames using tt(hash))
itemiz(redirecting output to files)
itemiz(using the tt(exec) builtin command to replace the shell with another
command)
itemiz(using tt(jobs -Z) to overwrite the shell process' argument and
environment space)
itemiz(using the tt(ARGV0) parameter to override tt(argv[0]) for external
commands)
itemiz(turning off restricted mode with tt(set +r) or tt(unsetopt
RESTRICTED))
itemiz(specifying modules to be loaded with an explicitly given
pathname containing slashes)
enditemize()
These restrictions are enforced after processing the startup files. The
startup files should set up tt(PATH) to point to a directory of commands
which can be safely invoked in the restricted environment. They may also
add further restrictions by disabling selected builtins.
Restricted mode can also be activated any time by setting the
tt(RESTRICTED) option. This immediately enables all the restrictions
described above even if the shell still have not processed all startup
files.

25
Doc/Zsh/seealso.yo Normal file
View file

@ -0,0 +1,25 @@
texinode(See Also)()(The Zsh Web Page)(Introduction)
sect(See Also)
manref(sh)(1),
manref(csh)(1),
manref(tcsh)(1),
manref(rc)(1),
manref(bash)(1),
manref(ksh)(1)\
ifzshone(\
,
zmanref(zshbuiltins),
zmanref(zshcompctl),
zmanref(zshexpn),
zmanref(zshmisc),
zmanref(zshmodules),
zmanref(zshoptions),
zmanref(zshparam),
zmanref(zshzle)\
)\
bf(IEEE Standard for information Technology -
Portable Operating System Interface (POSIX) -
Part 2: Shell and Utilities),
IEEE Inc, 1993, ISBN 1-55937-255-9.

1076
Doc/Zsh/zle.yo Normal file

File diff suppressed because it is too large Load diff

2701
Doc/intro.ms Normal file

File diff suppressed because it is too large Load diff

32
Doc/zmacros.yo Normal file
View file

@ -0,0 +1,32 @@
STARTDEF()
DEFINEMACRO(includefile)(1)(\
TYPEOUT(Including file ARG1)\
comment(Yodl file: ARG1)NL()\
INCLUDEFILE(ARG1)\
)
DEFINEMACRO(def)(3)(\
DEFINEMACRO(ARG1)(ARG2)(ARG3)\
)
DEFINEMACRO(undef)(1)(\
UNDEFINEMACRO(ARG1)\
)
DEFINEMACRO(redef)(3)(\
UNDEFINEMACRO(ARG1)\
DEFINEMACRO(ARG1)(ARG2)(ARG3)\
)
DEFINEMACRO(LPAR)(0)(CHAR(40))
DEFINEMACRO(RPAR)(0)(CHAR(41))
DEFINEMACRO(PLUS)(0)(CHAR(+))
DEFINEMACRO(NL)(0)(
)
DEFINEMACRO(ifzman)(1)()
DEFINEMACRO(ifnzman)(1)(ARG1)
DEFINEMACRO(ifztexi)(1)()
DEFINEMACRO(ifnztexi)(1)(ARG1)
ENDDEF()

192
Doc/zman.yo Normal file
View file

@ -0,0 +1,192 @@
STARTDEF()
TYPEOUT(Zsh Yodl-to-man converter)
DEFINESYMBOL(zman)
INCLUDEFILE(zmacros)
redef(ifzman)(1)(ARG1)
redef(ifnzman)(1)()
def(CMT)(0)(NOTRANS(.'))
COMMENT(--- character translation ---)
DEFINECHARTABLE(standard)(
'' = ".' (avoiding a yodl bug)"
'\\' = "\\e"
'.' = "\\&."
'-' = "\\-"
)
USECHARTABLE(standard)
def(STDPAR)(0)(\
redef(PARAGRAPH)(0)(NL()NOTRANS(.PP)NL())\
)
COMMENT(--- emphasised text ---)
def(em)(1)(NOTRANS(\fI)ARG1NOTRANS(\fP))
def(bf)(1)(NOTRANS(\fB)ARG1NOTRANS(\fP))
def(tt)(1)(NOTRANS(\fB)ARG1NOTRANS(\fP))
def(var)(1)(NOTRANS(\fI)ARG1NOTRANS(\fP))
COMMENT(--- man page headers ---)
def(manpage)(4)(\
NOTRANS(.TH ")ARG1" "ARG2" "ARG3" "ARG4"\
)
def(manpagename)(2)(\
sect(NAME)NL()\
ARG1 - ARG2\
)
COMMENT(--- TeXinfo headers and conditionals ---)
def(texinfo)(2)(CMT())
def(texiifinfo)(1)()
def(texiiftex)(1)()
def(texipage)(0)(CMT())
def(texititlepage)(0)(CMT())
def(texiendtitlepage)(0)(CMT())
def(texititle)(1)(CMT())
def(texisubtitle)(1)(CMT())
def(texiauthor)(1)(CMT())
def(texinode)(4)(CMT())
def(texitop)(1)(CMT())
COMMENT(--- section divisions ---)
def(chapter)(1)(CMT())
def(sect)(1)(\
NOTRANS(.SH ")UPPERCASE(ARG1)(0)"NL()\
STDPAR()\
CMT()\
)
def(subsect)(1)(\
NOTRANS(.SS ")ARG1"NL()\
CMT()\
)
COMMENT(--- comment output ---)
DEFINECHARTABLE(roffcomment)(
'\n' = "\n.\\\" "
)
def(comment)(1)(\
USECHARTABLE(roffcomment)\
NOTRANS(.\" )ARG1\
USECHARTABLE(standard)\
)
COMMENT(--- cross-references ---)
def(manref)(2)(\
NOTRANS(\fI)ARG1NOTRANS(\fP)(ARG2)\
)
def(zmanref)(1)(manref(ARG1)(1))
def(noderef)(1)(the section `ARG1')
COMMENT(--- lists ---)
def(startitem)(0)(\
NOTRANS(.PD 0)\
redef(ITEM)(0)(NOTRANS(.PD)NL())\
)
def(enditem)(0)(\
ENDITEM()\
STDPAR()\
redef(ENDITEM)(0)(NOTRANS(.RE)STDPAR())\
)
def(item)(2)(\
NOTRANS(.TP)NL()\
ITEM()\
redef(ITEM)(0)()\
ARG1\
redef(ENDITEM)(0)(CMT())\
redef(PARAGRAPH)(0)(\
NL()NOTRANS(.RS)NL()NOTRANS(.PP)NL()\
STDPAR()\
redef(ENDITEM)(0)(NOTRANS(.RE)STDPAR())\
)\
ARG2\
ENDITEM()\
)
def(xitem)(1)(\
NOTRANS(.TP)NL()\
NOTRANS(.PD 0)NL()\
redef(ITEM)(0)(NOTRANS(.PD)NL())\
ARG1\
)
def(startsitem)(0)(\
NOTRANS(.PD 0)\
)
def(endsitem)(0)(\
NOTRANS(.PD)\
)
def(sitem)(2)(\
NOTRANS(.TP)NL()\
ARG1NL()\
ARG2\
)
def(sxitem)(1)(\
NOTRANS(.TP)NL()\
ARG1\
)
def(startlist)(0)(\
NOTRANS(.PD 0)\
)
def(endlist)(0)(\
NOTRANS(.PD)\
)
def(list)(1)(\
NOTRANS(.TP)NL()\
ARG1\
)
def(startitemize)(0)(\
startitem()\
)
def(enditemize)(0)(\
enditem()\
)
def(itemiz)(1)(\
item(NOTRANS(\)LPAR()NOTRANS(bu))(NL()ARG1NL())\
)
COMMENT(--- special effects ---)
def(nofill)(1)(\
NOTRANS(.nf)NL()\
ARG1\
NL()NOTRANS(.fi)\
)
def(indent)(1)(\
NOTRANS(.RS)\
ARG1\
NOTRANS(.RE)\
)
COMMENT(--- hyperlink menus ---)
def(startmenu)(0)(CMT())
def(endmenu)(0)(CMT())
def(menu)(1)(CMT())
COMMENT(--- indices ---)
def(cindex)(1)(CMT())
def(findex)(1)(CMT())
def(kindex)(1)(CMT())
def(pindex)(1)(CMT())
def(tindex)(1)(CMT())
def(vindex)(1)(CMT())
ENDDEF()\

83
Doc/zsh.yo Normal file
View file

@ -0,0 +1,83 @@
ifzman(\
IFDEF(ZSHALL)(\
def(ifzshone)(1)()\
def(ifzshall)(1)(ARG1)\
manpage(ZSHALL)(1)(date())(zsh version())
manpagename(zshall)(the Z shell meta-man page)
)(\
def(ifzshone)(1)(ARG1)\
def(ifzshall)(1)()\
manpage(ZSH)(1)(date())(zsh version())
manpagename(zsh)(the Z shell)
)\
)\
ifnzman(\
def(ifzshone)(1)()\
def(ifzshall)(1)()\
)\
ifztexi(\
texinfo(zsh.info)(zsh)
NOTRANS(@setchapternewpage odd
@iftex
@finalout
@afourpaper
@end iftex)
texititlepage()
texititle(The Z Shell Guide)
texisubtitle(Version version())
texisubtitle(Updated date())
texiauthor(Original documentation by Paul Falstad)
texipage()
This is a texinfo version of the documentation for the Z Shell, originally by
Paul Falstad.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided also that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions.
texiendtitlepage()
)\
ifnzman(includefile(Zsh/guide.yo))
includefile(Zsh/intro.yo)
includefile(Zsh/invoke.yo)
includefile(Zsh/files.yo)
ifnzman(includefile(Zsh/grammar.yo))
ifnzman(includefile(Zsh/redirect.yo))
ifnzman(includefile(Zsh/exec.yo))
ifnzman(includefile(Zsh/func.yo))
ifnzman(includefile(Zsh/jobs.yo))
ifnzman(includefile(Zsh/arith.yo))
ifnzman(includefile(Zsh/cond.yo))
ifnzman(includefile(Zsh/compat.yo))
ifnzman(includefile(Zsh/prompt.yo))
ifnzman(includefile(Zsh/restricted.yo))
ifnzman(includefile(Zsh/expn.yo))
ifnzman(includefile(Zsh/params.yo))
ifnzman(includefile(Zsh/options.yo))
ifnzman(includefile(Zsh/builtins.yo))
ifnzman(includefile(Zsh/zle.yo))
ifnzman(includefile(Zsh/compctl.yo))
ifnzman(includefile(Zsh/modules.yo))
ifzshall(\
def(source)(1)(NOTRANS(.so )man1/ARG1NOTRANS(.)1)\
CMT()
source(zshmisc)
source(zshexpn)
source(zshparam)
source(zshoptions)
source(zshbuiltins)
source(zshzle)
source(zshcompctl)
source(zshmodules)
manpage(ZSHALL)(1)(date())(zsh version())
)\
ifzman(includefile(Zsh/filelist.yo))
ifzman(includefile(Zsh/seealso.yo))
ifnzman(includefile(Zsh/index.yo))

3
Doc/zshbuiltins.yo Normal file
View file

@ -0,0 +1,3 @@
manpage(ZSHBUILTINS)(1)(date())(zsh version())
manpagename(zshbuiltins)(zsh built-in commands)
includefile(Zsh/builtins.yo)

3
Doc/zshcompctl.yo Normal file
View file

@ -0,0 +1,3 @@
manpage(ZSHCOMPCTL)(1)(date())(zsh version())
manpagename(zshcompctl)(zsh programmable completion)
includefile(Zsh/compctl.yo)

3
Doc/zshexpn.yo Normal file
View file

@ -0,0 +1,3 @@
manpage(ZSHEXPN)(1)(date())(zsh version())
manpagename(zshexpn)(zsh expansion and substitution)
includefile(Zsh/expn.yo)

12
Doc/zshmisc.yo Normal file
View file

@ -0,0 +1,12 @@
manpage(ZSHMISC)(1)(date())(zsh version())
manpagename(zshmisc)(everything and then some)
includefile(Zsh/grammar.yo)
includefile(Zsh/redirect.yo)
includefile(Zsh/exec.yo)
includefile(Zsh/func.yo)
includefile(Zsh/jobs.yo)
includefile(Zsh/arith.yo)
includefile(Zsh/cond.yo)
includefile(Zsh/compat.yo)
includefile(Zsh/prompt.yo)
includefile(Zsh/restricted.yo)

3
Doc/zshmodules.yo Normal file
View file

@ -0,0 +1,3 @@
manpage(ZSHMODULES)(1)(date())(zsh version())
manpagename(zshmodules)(zsh loadable modules)
includefile(Zsh/modules.yo)

3
Doc/zshoptions.yo Normal file
View file

@ -0,0 +1,3 @@
manpage(ZSHOPTIONS)(1)(date())(zsh version())
manpagename(zshoptions)(zsh options)
includefile(Zsh/options.yo)

3
Doc/zshparam.yo Normal file
View file

@ -0,0 +1,3 @@
manpage(ZSHPARAM)(1)(date())(zsh version())
manpagename(zshparam)(zsh parameters)
includefile(Zsh/params.yo)

3
Doc/zshzle.yo Normal file
View file

@ -0,0 +1,3 @@
manpage(ZSHZLE)(1)(date())(zsh version())
manpagename(zshzle)(zsh command line editor)
includefile(Zsh/zle.yo)

246
Doc/ztexi.yo Normal file
View file

@ -0,0 +1,246 @@
STARTDEF()
TYPEOUT(Zsh Yodl-to-TeXinfo converter)
DEFINESYMBOL(ztexi)
INCLUDEFILE(zmacros)
redef(ifztexi)(1)(ARG1)
redef(ifnztexi)(1)()
def(CMT)(0)(NOTRANS(@c))
ATEXIT(\
NL()\
NOTRANS(@setchapternewpage odd)NL()\
NOTRANS(@contents)NL()\
NOTRANS(@bye)NL()\
)
COMMENT(--- character translation ---)
DEFINECHARTABLE(standard)(
'' = "@c (avoiding a yodl bug)"
'@' = "@@"
'{' = "@{"
'}' = "@}"
)
USECHARTABLE(standard)
SUBST('')(NOTRANS(@value{dsq}))
def(STDPAR)(0)(redef(PARAGRAPH)(0)(NL()NL()NOTRANS(@noindent)NL()))
COMMENT(--- emphasised text ---)
def(em)(1)(NOTRANS(@emph{)ARG1NOTRANS(}))
def(bf)(1)(NOTRANS(@cite{)ARG1NOTRANS(}))
def(tt)(1)(NOTRANS(@code{)ARG1NOTRANS(}))
def(var)(1)(NOTRANS(@var{)ARG1NOTRANS(}))
COMMENT(--- man page headers ---)
def(manpage)(4)(STDPAR())
def(manpagename)(2)()
COMMENT(--- TeXinfo headers and conditionals ---)
def(texinfo)(2)(\
STDPAR()\
NOTRANS(\input texinfo.tex)NL()\
NOTRANS(@c %**start of header)NL()\
NOTRANS(@setfilename )ARG1NL()\
NOTRANS(@settitle )ARG2NL()\
NOTRANS(@c %**end of header)NL()\
NL()\
NOTRANS(@ifinfo)NL()\
NOTRANS(@set dsq @'@')NL()\
NOTRANS(@end ifinfo)NL()\
NOTRANS(@iftex)NL()\
NOTRANS(@set dsq '{}')NL()\
NOTRANS(@end iftex)NL()\
)
def(texiifinfo)(1)(\
NOTRANS(@ifinfo)NL()\
ARG1\
NOTRANS(@end ifinfo)NL()\
)
def(texiiftex)(1)(\
NOTRANS(@iftex)NL()\
ARG1\
NOTRANS(@end iftex)NL()\
)
def(texipage)(0)(\
NOTRANS(@page)\
)
def(texititlepage)(0)(\
NOTRANS(@titlepage)\
)
def(texiendtitlepage)(0)(\
NOTRANS(@end titlepage)\
)
def(texititle)(1)(\
NOTRANS(@title )ARG1\
)
def(texisubtitle)(1)(\
NOTRANS(@subtitle )ARG1\
)
def(texiauthor)(1)(\
NOTRANS(@author )ARG1\
)
def(texinode)(4)(\
NOTRANS(@node )ARG1, ARG2, ARG3, ARG4\
)
def(texitop)(1)(\
NOTRANS(@top )ARG1\
)
COMMENT(--- section divisions ---)
def(chapter)(1)(\
NL()\
NOTRANS(@chapter )ARG1NL()\
NOTRANS(@noindent)\
)
def(sect)(1)(\
NL()\
NOTRANS(@section )ARG1NL()\
NOTRANS(@noindent)\
)
def(subsect)(1)(\
NL()\
NOTRANS(@subsection )ARG1NL()\
NOTRANS(@noindent)\
)
COMMENT(--- comment output ---)
DEFINECHARTABLE(texicomment)(
'\n' = "\n@c "
)
def(comment)(1)(\
USECHARTABLE(texicomment)\
NOTRANS(@c )ARG1\
USECHARTABLE(standard)\
)
COMMENT(--- cross-references ---)
def(manref)(2)(man page ARG1LPAR()ARG2RPAR())
def(zmanref)(1)(manref(ARG1)(1))
def(noderef)(1)(\
NOTRANS(@ref{)ARG1NOTRANS(})\
)
COMMENT(--- lists ---)
def(startitem)(0)(\
NOTRANS(@table @asis)\
redef(ITEMX)(0)()\
)
def(enditem)(0)(\
NOTRANS(@end table)\
)
def(item)(2)(\
NOTRANS(@item)ITEMX() ARG1\
ARG2\
redef(ITEMX)(0)()\
)
def(xitem)(1)(\
NOTRANS(@item)ITEMX() ARG1\
redef(ITEMX)(0)(x)\
)
def(startsitem)(0)(\
startitem()\
)
def(endsitem)(0)(\
enditem()\
)
def(sitem)(2)(\
item(ARG1)(NL()ARG2)\
)
def(sxitem)(1)(\
xitem(ARG1)\
)
def(startlist)(0)(\
startitem()\
)
def(endlist)(0)(\
enditem()\
)
def(list)(1)(\
item(ARG1)()\
)
def(startitemize)(0)(\
NOTRANS(@itemize @bullet)NL()\
)
def(enditemize)(0)(\
NOTRANS(@end itemize)\
)
def(itemiz)(1)(\
sitem()(ARG1)\
)
COMMENT(--- special effects ---)
DEFINECHARTABLE(nofillchars)(
'@' = "@@"
'{' = "@{"
'}' = "@}"
'\n' = "@*\n"
)
def(nofill)(1)(\
USECHARTABLE(nofillchars)\
ARG1\
USECHARTABLE(standard)\
)
def(indent)(1)(\
ARG1\
)
COMMENT(--- hyperlink menus ---)
def(startmenu)(0)(\
NOTRANS(@menu)\
)
def(endmenu)(0)(\
NOTRANS(@end menu)\
)
def(menu)(1)(\
* ARG1NOTRANS(::)\
)
COMMENT(--- indices ---)
def(cindex)(1)(\
NOTRANS(@cindex )ARG1\
)
def(findex)(1)(\
NOTRANS(@findex )ARG1\
)
def(kindex)(1)(\
NOTRANS(@kindex )ARG1\
)
def(pindex)(1)(\
NOTRANS(@pindex )ARG1\
)
def(tindex)(1)(\
NOTRANS(@tindex )ARG1\
)
def(vindex)(1)(\
NOTRANS(@vindex )ARG1\
)
ENDDEF()\

3
Etc/.cvsignore Normal file
View file

@ -0,0 +1,3 @@
Makefile
FAQ
FAQ.html

5
Etc/.distfiles Normal file
View file

@ -0,0 +1,5 @@
DISTFILES_SRC='
.cvsignore .distfiles Makefile.in
BUGS CONTRIBUTORS FAQ FAQ.yo FEATURES MACHINES NEWS
FTP-README pubring.pgp
'

41
Etc/BUGS Normal file
View file

@ -0,0 +1,41 @@
-----------------
KNOWN BUGS IN ZSH
-----------------
------------------------------------------------------------------------
Completion has a habit of doing the wrong thing after a
backslash/newline.
------------------------------------------------------------------------
If you suspend "man", zle seems to get into cooked mode. It works ok
for plain "less".
It is not specific neither to man nor to zsh.
E.g. call the following program foo:
#include <sys/wait.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
int status;
if (!fork()) /* child */
execvp(argv[1], argv + 1);
else /* parent */
wait(&status);
}
Then if you suspend
% foo less something
from zsh/bash, zle/readline gets into cooked mode.
------------------------------------------------------------------------
% zsh -c 'cat a_long_file | less ; :'
can be interrupted with ^C. The prompt comes back and less is orphaned.
If you go to the end of the file with less and cat terminates, ^C
will not terminate less. The `; :' after less forces zsh to fork before
executing less.
------------------------------------------------------------------------
The pattern %?* matches names beginning with %? instead of names with at
least two characters beginning with %. This is a hack to allow %?foo job
substitution without quoting. This behaviour is incompatible with sh
and ksh and may be removed in the future. A good fix would be to keep
such patterns unchanged if they do not match regardless of the state of
the nonomatch and nullglob options.
------------------------------------------------------------------------

127
Etc/CONTRIBUTORS Normal file
View file

@ -0,0 +1,127 @@
----------------
ZSH CONTRIBUTORS
----------------
Zsh was originally written by Paul Falstad <pf@zsh.org>. Zsh is
now maintained by the members of the zsh-workers mailing list
<zsh-workers@math.gatech.edu>. The development is currently coordinated
by Andrew Main (Zefram) <zefram@zsh.org>.
This file credits only the major contributors to the current release.
See the ChangeLog files for a complete list of people who have submitted
patches. Note that email addresses below and in the ChangeLog file
are included for disambiguation purposes only, and are not guaranteed
to be currently accurate. If you feel that you or someone else have
been unfairly omitted from this list please mail the current maintainer
at <coordinator@zsh.org>.
Version 3.0
-----------
* Richard Coleman <coleman@math.gatech.edu> maintained the code till the
release of zsh-2.6-beta16. Converted zsh to use autoconf thus greatly
improving the portability. Rewrote signal handling code. Reorganized
internal hash tables and rewrote the related builtins (enable, disable,
hash, unhash). Made some cleanups in exec.c.
* Zoltán Hidvégi <hzoli@cs.elte.hu> maintained zsh from version
2.6-beta16. Rewrote most of the lexer and substitution and the related
completion code. Improved sh/ksh/POSIX compatibility. Fixed lots
of bugs in completion, parameter and history code. Made zsh fully
8-bit clean. Made some reorganizations in exec.c. Fixed signal
handling bugs. Fixed lots of bugs in various places.
* Peter W. Stephenson <pws@ifh.de> the maintainer of the zsh FAQ.
Reorganizations in exec.c. Rewrote and reorganized the history code.
Rewrote the zshcompctl manual page. Fixed several bugs related to
programmable completion. Fixed several signal handling bugs. Rewrote
test and read builtins. Lots of other bugfixes.
* Andrew Main (Zefram) <zefram@fysh.org> reorganized builtin.c.
Rewrote large parts of the zle vi mode. Redirection fixes. Reorganized
parts of the completion code, added some enhancements and fixed lots of
bugs. Made zle fully 8-bit clean. Fixed several zle bugs. Reorganized
zsh option handling. Lots of other bugfixes.
* Sven Wischnowsky <wischnow@informatik.hu-berlin.de> wrote most of the
programmable completion code in zsh-2.5.0. Several bugfixes in exec.c
and jobs.c. Lots of completion bugfixes and enhancements.
* Geoff Wing <mason@werple.net.au> rewrote most of zle_refresh.c. Some
other bugfixes.
* Clive Messer <clive@epos.demon.co.uk> brought the texinfo documentation
up-to-date.
* Mark Borges <mdb@cdc.noaa.gov> maintains the zsh web page
(http://www.mal.com/zsh/). Several documentation fixes. Maintains the
texinfo documentation together with Clive.
* Wayne Davison <wayne@clari.net> improved the the zle search functions
and made them 8-bit clean. Some other little bugfixes.
* Bart Schaefer <schaefer@candle.brasslantern.com> submitted several
bugfixes, reported lots of bugs and gave many very useful suggestions.
Version 2.5
-----------
Bas de Bakker maintained zsh till the release of zsh-2.5.0. People who
have contributed to zsh-2.5.0 are (in lexical order):
Chris.Moore@src.bae.co.uk (Chris Moore)
Harald.Eikrem@delab.sintef.no
Irving_Wolfe@happy-man.com (Irving Wolfe)
Jarkko.Hietaniemi@hut.fi (Jarkko Hietanimi)
P.Stephenson@swansea.ac.uk (Peter Stephenson)
Richard.Sharman@software.mitel.com (Richard Sharman)
Tero_Kivinen@hut.FI (Tero Kivinen)
arf@maths.nott.ac.uk (Anthony Iano-Fletcher)
bas@phys.uva.nl (Bas de Bakker)
benson@odi.com (Benson Margulies)
billb@bedford.progress.com (Bill Burton)
brown@wi.extrel.com (M. Brown)
carlos@snfep1.if.usp.br (Carlos Carvalho)
cedman@capitalist.princeton.edu (Carl Edman)
chip%fin@myrddin.sybus.com (Chip Salzenberg)
chs@apu.fi (Hannu Strang)
coleman@math.gatech.edu (Richard Coleman)
cross@eng.umd.edu (Chris Ross)
dm@cs.brown.edu (Dimitris Michailidis)
dmm0t@rincewind.mech.virginia.edu (David M. Meyer)
esky@CS.UCLA.EDU (Eskandar Ensafi)
franl@centerline.com (Fran Litterio)
gansevle@cs.utwente.nl (Fred Gansevles)
gnohmon@ssiny.com (Ralph Betza)
guillaum@clipper.ens.fr (Florent Guillaume)
guthrie@math.upenn.edu (John Guthrie)
hegedus@celeste.eng.yale.edu (Peter Hegedus)
henryg@tusc.com.au (Henry Guillaume)
hoh@approve.se (Goran Larsson)
hooft@chem.ruu.nl (Rob Hooft)
hsw1@papa.attmail.com (Stephen Harris)
irving@happy-man.com (Irving Wolfe)
jch@cs.cmu.edu (Jonathan Hardwick)
jos@oce.nl (Jos Backus)
liblit@cs.psu.edu (Benjamin Liblit)
marc@cam.org (Marc Boucher)
mason@werple.apana.org.au (Geoff Wing)
mycroft@gnu.ai.mit.edu (Charles Hannum)
mystic@axposf.pa.dec.com (D. Hall)
norbert@i3.informatik.rwth-aachen.de (Norbert Kiesel)
oberon@cs.tu-berlin.de (Sven Wischnowsky)
pclink@qld.tne.oz.au (Rick)
pem@aaii.oz.au (Paul Maisano)
per@efd.lth.se (Per Foreby)
pf@z-code.com (Paul Falstad)
roderick@ibcinc.com (Roderick Schertler)
schaefer@z-code.com (Bart Schaefer)
schlangm@informatik.uni-muenchen.de (Harald Schlangmann)
seniorr@teleport.com (Russell Senior)
sinclair@dcs.gla.ac.uk (Duncan Sinclair)
sterling@oldcolo.com (Bruce Sterling Woodcock)
suzuki@otsl.oki.co.jp (Hisao Suzuki)
tsm@cs.brown.edu (Timothy Miller)
vogelke@c17mis.wpafb.af.mil (Karl E. Vogel)
wacker@physik.uni-dortmund.de (Klaus Wacker)
wacren@cis10.ens-cachan.fr (Laurent Wacrenier)

2018
Etc/FAQ.yo Normal file

File diff suppressed because it is too large Load diff

74
Etc/FEATURES Normal file
View file

@ -0,0 +1,74 @@
------------
ZSH FEATURES
------------
very close to ksh/sh grammar, with csh additions
most features of ksh, bash, and tcsh
can emulate ksh or POSIX sh
81 builtins, 102 options, 162 key bindings
short for loops, ex: for i (*.c) echo $i
select
shell functions
conditional expressions (test builtin, [ ... ], and ksh-style [[ ... ]])
global aliases (may be expanded anywhere on the line)
directory stack access with =num
process substitution (vi =(cmd) edits the output of cmd)
generalized pipes (ls foo >>(cmd1) 2>>(cmd2) pipes stdout to cmd1
and stderr to cmd2)
arithmetic expressions
advanced globbing:
ls **/file searches recursively for "file" in subdirectories
ls file<20-> matches file20, file30, file100, etc.
ls *.(c|pro) matches *.c and *.pro
ls *(R) matches only world-readable files
ls *.c~lex.c matches all .c files except lex.c
null command shorthands:
"< file" is same as "more <file"
"> file" is same as "cat >file"
">> file" is same as "cat >>file"
ksh-style coprocesses
automatic file stream teeing (ls >foo >bar puts output in two places)
chpwd() function run every time you change directory (useful for
updating the status line)
job control
csh-style history
full vi line editing, including "c2w" and "y$" and such things
full emacs line editing
incremental history search
magic-space history
spelling correction
array parameters
$MACHTYPE, $VENDOR and $OSTYPE identify the host machine
$LINENO, $RANDOM, $SECONDS, $cdpath, $COLUMNS, $fignore, $HISTCHARS, $mailpath
$UID, $EUID, $GID, $EGID and $USERNAME can be assigned to
with autocd option, typing a directory name by itself is the same as
typing "cd dirname"
menu completion: pressing TAB repeatedly cycles through the possible matches
incremental path hashing
automatic process time reporting for commands that run over a certain limit
full tcsh-style prompt substitution
utmp login/logout reporting
with histverify option, performing csh-style history expansions causes the
input line to be brought up for editing instead of being executed
with sunkeyboardhack option, accidentally typed trailing ` characters
are removed from the input line (for those of you with Sun keyboards :-) )
autoloaded functions (loaded from a file when they are first referenced)
"cd old new" replaces "old" with "new" in directory string
generalized argument completion, including:
- command name completion
- filename and path completion
- hostname completion
- key binding completion
- option completion
- variable name completion
- user-specified keyword completion
- anything else you can think of
prompt on right side of screen
directory stacks
history datestamps and execution time records
command scheduling (like at(1), but in the shell's context)
tty mode freezing
up to 9 startup files (but you only need 1 or 2)
really 8-bit clean, and we mean it this time
which -a cmd lists all occurrences of "cmd" in the path
dynamically loadable binary modules

61
Etc/FTP-README Normal file
View file

@ -0,0 +1,61 @@
-------------------
FTP ARCHIVE FOR ZSH
-------------------
General
-------
README
You're reading it.
META-FAQ
Information about zsh ftp sites, web sites, and mailing lists.
FAQ
The zsh Frequently Asked Questions (FAQ) list.
pubring.pgp
PGP keys of some major Zsh developers.
MD5SUM
MD5 checksums of each file.
Source Code
-----------
zsh.tar.gz
Latest production release of zsh. Includes the source files of all
documentation.
zsh-beta.tar.gz
The current development version of zsh. Not guaranteed to be stable.
zsh-*.tar.gz
Specific zsh versions. If you just want the latest zsh then use
zsh.tar.gz or zsh-beta.tar.gz.
zsh-*-*.diff.gz
Context diffs between releases. Note that if you use this for
upgrading and you do not have the latest version of GNU autoconf
installed on your system you have to touch stamp.h.in and configure
in the main directory after applying the patches otherwise make will
think that these files are not up-to-date and will try to remake them.
Do not forget to specify the -p0 flag to patch. Without -p0 new
files will be created in the current directory.
old/*
Older zsh versions. Of historical interest only.
Documentation
-------------
zsh-doc.tar.gz
Pre-built Postscript, Info, DVI and HTML versions of the documentation
contained in the stable zsh distribution zsh.tar.gz.
zsh-beta-doc.tar.gz
Pre-built Postscript, Info, DVI and HTML versions of the documentation
contained in the beta zsh distribution zsh-beta.tar.gz.
zsh-*-doc.tar.gz
Pre-built documentation for specific zsh versions.

94
Etc/MACHINES Normal file
View file

@ -0,0 +1,94 @@
-----------------------------
ZSH ON SPECIFIC ARCHITECTURES
-----------------------------
These are the OSes that zsh has been tried on. If you succeed in getting
zsh to work on an OS not listed, let us know.
On all machines if you use gcc and upgrade your OS you must rebuild gcc
after the OS upgrade. A gcc left from a previous OS may seem to work
but compiling more complex programs may fail mysteriously.
The format of entries is thus:
Vendor: OS & version (hardware type) [zsh version tried]
information
Machines
--------
Cray: Unicos (C90 and T90)
Should build `out-of-the-box'.
Data General: DG/UX 5.4R3.10 MU01 (various AViiONs)
Should build `out-of-the-box'.
DEC: Ultrix (Alpha or DECstation)
DEC: Mach 3.0 (DECstation 5000/25)
DEC: OSF/1 1.2, 1.3, 2.0, 3.*, DEC Unix 4.* (Alpha)
In OSF/1 3.x, there is apparently a bug in the header file
/usr/include/rpcsvc/ypclnt.h; the prototype for yp_all() has a
struct ypall_callback as its final argument, which should be a
pointer (struct ypall_callback *). This prevents compilation of
one of zsh' files (zle_tricky.c). If you can't modify the header
file, create a directory called `rpcsvc' in zsh's Src subdirectory
and put a fixed version of the header file to it before compiling.
The strip coming with gcc-2.7.2 seems to create unusable binaries.
This problem is not related to zsh. If you have such problems,
remove the bogus strip and use /bin/strip instead.
FreeBSD: FreeBSD 2.2.7 [3.1.4]
Should build `out-of-the-box'.
HP: HP-UX 9, 10.20
Should build `out-of-the-box'.
IBM: AIX
Should build `out-of-the-box'.
Linux: Linux (i386) [3.1.4]
If you are using an early minor version of libc 5, then a bug
in the auto-configuration process may cause zsh to think that
your system doesn't support the lstat function. If the configure
process reports that there is no lstat, edit config.h and change
HAVE_LSTAT to 1. libc-5.2.18 or later does not have this problem.
NetBSD: NetBSD 1.*
Should build `out-of-the-box'.
Next: NextStep 3.*
Should build `out-of-the-box', but the zsh malloc routines are
not recommended.
Reliant: Reliant UNIX
Should build `out-of-the-box'.
Reliant: SINIX
Should build `out-of-the-box'. There is a bad combination of
static and shared libraries that prevents the use of dynamic
linking; configure now detects this and will disable dynamic
linking even if you requested it.
SGI: IRIX 5.1.1.1, 5.2, 5.3, 6.2, 6.3
Should build `out-of-the-box'.
Sun: SunOS 4.1.*
Under 4.1.3 if yellow pages is used, username completion may cause
segmentation violation. This is a bug in the shared library not
in zsh. Some libc.so.1.9.* has this bug (it fails in yp_all).
Statically linked binaries will work if linked with libc.so.1.8.1
(which means that if you can get a statically linked binary
compiled under 4.1.2 that it will probably work). An alternative
but untested solution may be to undefine HAVE_NIS in config.h.
This may work, but the first username completion will be _very_
slow (as slow as in tcsh).
Sun: Solaris 2.*
The UCB versions of the routines for reading directories are not
usable (the struct definitions are incompatible with the ones
assumed by zsh). The symptom of this is that globbed filenames in
the compiled version of zsh will be missing the first two letters.
To avoid this, make sure you compile zsh without any reference
to /usr/ucblib in your LD_LIBRARY_PATH. You can easily do this
by just unsetting LD_LIBRARY_PATH before building zsh.

59
Etc/Makefile.in Normal file
View file

@ -0,0 +1,59 @@
#
# Makefile for Etc subdirectory
#
# Copyright (c) 1995-1997 Richard Coleman
# All rights reserved.
#
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and to distribute modified versions of this software for any
# purpose, provided that the above copyright notice and the following
# two paragraphs appear in all copies of this software.
#
# In no event shall Richard Coleman or the Zsh Development Group be liable
# to any party for direct, indirect, special, incidental, or consequential
# damages arising out of the use of this software and its documentation,
# even if Richard Coleman and the Zsh Development Group have been advised of
# the possibility of such damage.
#
# Richard Coleman and the Zsh Development Group specifically disclaim any
# warranties, including, but not limited to, the implied warranties of
# merchantability and fitness for a particular purpose. The software
# provided hereunder is on an "as is" basis, and Richard Coleman and the
# Zsh Development Group have no obligation to provide maintenance,
# support, updates, enhancements, or modifications.
#
subdir = Etc
dir_top = ..
SUBDIRS =
@@version.mk@@
@@defs.mk@@
# ========== DEPENDENCIES FOR BUILDING ==========
all: FAQ
FAQ: FAQ.yo
cd $(sdir) && $(YODL2TXT) FAQ.yo && mv -f FAQ.txt FAQ
FAQ.html: FAQ.yo
$(YODL2HTML) $(sdir)/FAQ.yo
# ========== DEPENDENCIES FOR CLEANUP ==========
@@clean.mk@@
mostlyclean-here:
rm -f FAQ.html
distclean-here:
rm -f Makefile
realclean-here:
rm -f FAQ
# ========== DEPENDENCIES FOR MAINTENANCE ==========
@@config.mk@@

203
Etc/NEWS Normal file
View file

@ -0,0 +1,203 @@
-------------------------------------
CHANGES FROM PREVIOUS VERSIONS OF ZSH
-------------------------------------
New features in zsh version 3.1 (beta version)
----------------------------------------------
On most operating systems zsh can load binary modules dynamically at
run-time. ZLE and the compctl builtin are now reside in a separate
module which is loaded automatically on demand.
for ((expr; expr; expr)) do ... done loop syntax from AT&T ksh93 is
now supported.
POSIX globbing character classes ([:alnum:] etc.) are now supported.
ksh's case fall-through feature (;&) is supported.
ksh93's $'' quoting syntax is supported.
Restricted mode is now supported. This is controlled by the new option
RESTRICTED (-r).
New options BARE_GLOB_QUAL, HIST_NO_FUNCTIONS (alias NO_LOG), KSH_GLOB,
PRINT_EIGHT_BIT, PROMPT_BANG, PROMPT_PERCENT, RM_STAR_WAIT.
Options ALWAYS_LAST_PROMPT, APPEND_HISTORY, AUTO_LIST, AUTO_MENU,
AUTO_PARAM_KEYS, AUTO_PARAM_SLASH, AUTO_REMOVE_SLASH, LIST_AMBIGUOUS
and LIST_TYPES are now on by default.
In ZLE, arbitrarily many keymaps can be defined. Multi-character
keybindings now work.
Completion can be performed within a brace expansion.
EMACS-like universal-argument function.
New features in zsh version 3.0
-------------------------------
Trailing "/" in a glob pattern now works like in other shell thus it
can no longer be used as a sorthand for "(/)".
Much improved sh/ksh emulation. When zsh is invoked as sh it mostly
conforms to POSIX 1003.2.
Enhanced parameter expansion features: new flags: A, @, e, W, p, f, F.
Expansions can be nested. For example,
"${${(M)${(f@)$(<builtin.pro)}:#char*}[2][(w)3]}" expands to the third
word of the second line of builtin.pro which begins with char. See
zshexpn(1) for the details.
***/foo glob does recursive directory search following symbolic links.
Traps defined by the trap builtin are now executed in the current shell
environment and not as a shell function. This means that $1 is not set
to the signal number. Of course the TRAPxxx functions continue working
as before.
Traps defined by the trap builtin are reset to their default values in
subshells.
Option names can be prefixed by `no' to unset an option.
setopt no_option_name is the same as unsetopt option_name.
This change affects the output of the setopt and unsetopt
builtins when these are invoked without arguments. See
the zshoptions manual page for more explanation.
!, {, } and [[ are now reserved words. Things like [[-z $foo]] or {foo}
should not be used. {foo} still works if the IGNORE_BRACES option is not
set but this feature may be removed in the future. [[ -z $foo ]] and
{ foo } should be used instead.
HOSTTYPE special parameter is removed. The new OSTYPE, MACHTYPE and
VENDOR parameters should be used instead.
VERSION parameter is renamed to ZSH_VERSION
exec now saves the history in interactive shells. If you do not like this
behaviour you can alias exec to 'unset HISTFILE ; exec'.
${~spec}, ${=spec} and ${^spec} used to toggle the effect of
globsubst/shwordsplit/rcexpandparam. Now these force the corresponding
option on. ~, = or ^ can be doubled to force the relevant option off for
the substitution.
Explicitly requested word splitting like ${=spec} or ${(s:delim:)spec}
will be executed even if the substitution is double quoted.
The right-hand side of assignments are no longer globbed by default hence
assignment foo=* will assign '*' as a value of foo. Use the foo=( * )
array assignment syntax to get the old behaviour. Alternatively the
GLOB_ASSIGN can be set to emulate the old behaviour but the usage of this
option is strongly discouraged and this option may be completely removed in
the future.
foo=$bar no longer creates an array even if bar is an array. Use
foo=( $bar ) or even better, foo=( "$bar[@]" ) instead.
When foo is an array parameter ${#foo} will always return the length of the
array even if the substitution is double quoted. ${(c)#foo} should be used
to get back the old behaviour.
When the prompt_subst option is set prompts are fully expanded using
parameter expansion, command substitution and arithmetic expansion.
In 2.5 backquote substitution was not performed in the prompts so this
change might cause problems in some startup scripts if ` is used literally
in prompts.
History substitution is now not performed if the history escape character
appears in a single-quoted string. This may break some interactive shell
functions which use \! in single-quoted strings.
The UID, EUID, GID, EGID parameters can be assigned now. The assignment
executes the setuid(), seteuid(), setgid(), setegid() respectively. On
systems where setuid and seteuid is not supported these functions are
emulated using setreuid or setresuid which may result in a different
behaviour.
Assigning the USERNAME parameter will call setuid(uid) where uid is the
user id of the specified user.
The privileged (-p) option is automatically set on invocation if euid != uid
or egid != gid. If this option is set no user startup files are sourced.
The shell will drop privileges when this option is unset by resetting its
euid to uid and its egid to gid.
The =number substitution for accessing the directory stack is changed to
~number to allow =command substitution when a command name begins with a
digit.
<> is a redirection operator which opens the standard input for both
reading and writing. To match a number use <->.
Option letters -1 and -C for PRINT_EXIT_VALUE and NO_CLOBBER are swapped:
`set -C' sets NO_CLOBBER and `set -1' sets PRINT_EXIT_VALUE.
AUTO_PUSHD behaviour is changed. Now cd without arguments will always go
to the $HOME directory even if AUTO_PUSHD is set and PUSHD_TO_HOME is not
set. If you preferred the old behaviour you can alias cd to pushd.
IFS word splitting with SH_WORD_SPLIT and the splitting of the input in the
read builtin has changed in cases when IFS contains characters other than
<space>, <tab>, <newline>. See the description of IFS in the zshparam
manual page for more details.
New features in zsh version 2.5
-------------------------------
Greatly expanded completion possibilities. Programmable completion
allows detailed control over what arguments of what commands can be
completed to what. See dots/zcomp in the distribution for examples.
Expand filenames with ~ and = on the right hand side of parameter
assignments. New option MAGIC_EQUAL_SUBST to do it in all
identifier=expression arguments.
${+name} becomes 1 or 0 if name is set or unset. ${~spec} toggles
GLOB_SUBST in substitution. Parameter substitution takes lots
of flags in the format ${(flags)name}.
New glob qualifiers for block/character special files, times in glob
qualifiers can be in months, weeks, days, hours, minutes. Qualifiers can
work on links or on what they point to. Qualifiers separated by commas
are or-ed.
New parameter substitution modifiers (fFwW) to repeat actions. New
option CSH_JUNKIE_HISTORY.
New line editor functions history-beginning-search-backward,
history-beginning-search-forward, expand-or-complete-prefix, push-input,
push-line-or-edit.
Assign to part of a string, use qualifiers on string subscription with
$foo[(qual)2,5]
New parameters: EGID, EUID, KEYTIMEOUT
New prompt escape sequence %_ to get constructs like for and while in
the secondary prompt. %E in prompt clears to end of screen.
Conditional expressions in PROMPT and WATCHFMT.
New options ALWAYS_LAST_PROMPT, ALWAYS_TO_END, AUTO_PARAM_KEYS,
COMPLETE_ALIASES, COMPLETE_IN_WORD, CSH_JUNKIE_HISTORY, GLOB_SUBST,
LIST_AMBIGUOUS, MAGIC_EQUAL_SUBST, NO_FLOW_CONTROL, PROMPT_SUBST
New option -m to many builtins makes arguments subject to pattern
matching.
Bindkey can now bind both key sequences and prefixes of those. You can
for example bind ESC and function keys sending ESC sequences.
Additional options to read builtin to use in functions called by
completion.
New options to print to sort arguments and print them in columns.
Some additional resource limits can be specified.
Some editor functions now work in the minibuffer.

150
Etc/pubring.pgp Normal file
View file

@ -0,0 +1,150 @@
Type Bits KeyID Created Expires Algorithm Use
pub 2048 0x8E1E1EC1 1997-05-15 ---------- RSA Sign & Encrypt
uid Andrew Main <zefram@fysh.org>
pub 2048 0x0FD2FDD5 1998-04-22 ---------- RSA Sign & Encrypt
uid Geoff C. Wing <gcw@pobox.com>
pub 1024 0xEE305E20 1998-04-22 ---------- DSS Sign & Encrypt
sub 2048 0xB1A6D227 1998-04-22 ---------- Diffie-Hellman
uid Geoff C. Wing <mason@primenet.com.au>
pub 1024 0x71FB29E1 1994-10-10 ---------- RSA Sign & Encrypt
uid Richard J. Coleman <coleman@math.gatech.edu>
pub 1024 0x8B37BE3D 1995-11-20 ---------- RSA Sign & Encrypt
uid Zoltan Hidvegi <hzoli@cs.elte.hu>
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: PGPfreeware 5.0i for non-commercial use
mQCNAzCw9pkAAAEEAKzybIrP6bvoDF7kJjTVgErU59QOsDQuQAFyPYxx9TrGST9Y
5kVtimMFiHmOaePtLzEMlJvAqHNnYGQge2WmH7V/jC678wdTlSouBoPN/6U8qq5N
+9BsW/pVvFOEJ4vhEXdOnj5Jcmp4+M6/Tb4c/rS5SdyZPP9yhQupSCiLN749AAUR
tCFab2x0YW4gSGlkdmVnaSA8aHpvbGlAY3MuZWx0ZS5odT6JAJUDBRAwv1zNC6lI
KIs3vj0BAaObA/9nFIIRGrP9wlCAuxQDwqGTuNKVUeKVyzuaj9zwsUULABGITZGT
tASMEb0X1HA2I822PZ8b6m1xj7idlwOSmCrO9gNgWr2VblynZo9LAZflwcTxr/9e
0oC+3owLFXadg7zUrYeRc9EJrhQ299nNoqkjOZbUQtZ97xcRfoMs0brpHpkAjQMu
mbisAAABBADshMnQari3rUDdHrxfSUlCO/nWJ4E/pcKPOnft2SUWaTC5q6IzaTUK
FauLy0DxRSIgO3w2Cd7ynm8rwtSXIvUvJg3X+fO1lm8MwePazh3A0DQxqSV2IsXb
I7yLq5IUWHSFIEZkQ9+hR7mi1Sx0dJ3WfnEh8LA/glkOAgIJcfsp4QAFEbQsUmlj
aGFyZCBKLiBDb2xlbWFuIDxjb2xlbWFuQG1hdGguZ2F0ZWNoLmVkdT6JAJUDBRAw
sPeuC6lIKIs3vj0BAZNeA/4pezBr5xMV/HX1P/u1YZMkFE/XV33svOggOUOhui0F
m1MD64D6oofjO2j0L8cV/YWwzT+pNB0JANH67MPaeK/zPffFDeq1yVumR6jmBoWR
L2IgTS5t2+5oC7T7lXRKu1JF0F8lY+jfDc+ZnjwL/WIcZqf0PYoLwWBcA3bES1T/
yIkAlQMFEC8TK1KxPDjWo/GviQEBGgwEAJvnaxkio5hj4I55NSDVFlvr98OttR5C
awR/TmWoAPUumpJ4QfErnnS7Ucv8thGRb62Mj+nF+T9/Tyj2piv1yHYPdyWqlhps
L3oxU7WG4dqv1KrfaxvLulHyrveYTdW1BQ+WzD7tQ4DOxpCUcfTxAwZ61cAQEiVd
JepcOUVes+SjiQCVAwUQLw9QuQ4CAglx+ynhAQGi9gQAxBOzT2OwGu7Ri9NuIk47
BfONzb0mPIrEPG6ztKNN0h5m/VZxqKh0kQSXTk4QCt5LCBqdunZY86DJxHckHYd0
l5Tt22gALhmJL0+pi7t6A5YOonW83LXxYlxpCPxoElxerE/gfb5xiXZ9qgL1GGvO
HD8l8WTImMGlkGDdRqNYn0GZAaIENT3vPBEEANHaBoXO7hHxcynHhNPxG+4NvPb9
RhINSM1t+yC9GFKWNXv4mSbGqEIcFo0jsOQQFd3m5ETMBHbFy2hwlzxOYQTSzgGO
b5ULWJeGCYQ1tsZwAAdyFFh5hwOWiB9+KM5NXT8WcvF8KLZbvY3cFVSGJFnxtRn4
olWhtdzMx1WRa+4/AKD/+KLMt958vS/YWxeKC+wt822GgwP+PpW2NeAHpheDoNnP
P/wpPjuYytdc2M+XwNaq1bcxJXfrOqT6ZY1QnwxzHIeGCgZ78XR5kduRJHDkq7/X
zYaEooCuuKZf8+raJ+egycYS/Oqc9fQitsQbvetzvGDJUIBYXrePwKpK9QxMh77+
OeaOV8n+MjA8RA4nPWmhw7540twEAIzn42webcFtUbTWy+zXCp7fPw4lBDAXMRPZ
D8wIjzzn4z/c9o0ypiwAjKVu5V8aWwjcVJICyvCU4H34yoUb3xFg2UL/VGa72LbY
sccmuGdAsqkn1nCVnjV/IACVVZLfYZMBGQQdAmkKBDQ040itSse2Z3+ND9OlN1d/
DnCGa4cwtCVHZW9mZiBDLiBXaW5nIDxtYXNvbkBwcmltZW5ldC5jb20uYXU+iQBL
BBARAgALBQI1Pe88BAsDAQIACgkQs67qk+4wXiA3+wCfWwTNkmLlcR8amztHk6Nu
KA4LPusAoIkx+pq8j7762htEs6tGfyscJqFGiQEVAwUQNT3vnw8wSIEP0v3VAQHs
nQf8CzJbDpKHSYSUf12dsJdLa6ewcacf9OKVobl3EIbpNdov+1C6QgAQsWogPrcA
z/2bzLPCJ+CilxcK4Rk4vywi8riuJm7ROEiBSsdhIDY0nBQHL4rqFFGlnq5/DzXO
jyLmJs4X6noWKJ1rFWxPFGzy8kICuKAXuQvzX0a1VqgKgIovCgbUJJg8Et1MHZsS
LeHhenNLAT0lNRbEyizDgxkZWvTqsmkLtlKkVxEyGjtl2l+2hSLgT6zuaSWNqQjB
XFyo4wzQLy+zmqTEseI3bVqYVsQv8LCkLNn8dCDqysbTd1bIbOzcGIxBlZYML2a6
MxAebh2GTfkRnJE+2fQ7Tw6GKrkCDQQ1Pe9AEAgA9kJXtwh/CBdyorrWqULzBej5
UxE5T7bxbrlLOCDaAadWoxTpj0BV89AHxstDqZSt90xkhkn4DIO9ZekX1KHTUPj1
WV/cdlJPPT2N286Z4VeSWc39uK50T8X8dryDxUcwYc58yWb/Ffm7/ZFexwGq01ue
jaClcjrUGvC/RgBYK+X0iP1YTknbzSC0neSRBzZrM2w4DUUdD3yIsxx8Wy2O9vPJ
I8BD8KVbGI2Ou1WMuF040zT9fBdXQ6MdGGzeMyEstSr/POGxKUAYEY18hKcKctaG
xAMZyAcpesqVDNmWn6vQClCbAkbTCD1mpF1Bn5x8vYlLIhkmuquiXsNV6TILOwAC
AggA9d0Df2yhKHDKkEejKtPIDlgaAcHMOzNekpzLwiRYv9C/mpTtbcWg4wMcP2WX
7rbkhsqXrQdcSqGtRDR83bt2ku1wu+bWyjcXeoR5azGjl5as/0oqD9qhl0yANnia
F+LwSrpjf8fn/Xor3TIQIOkNIUsYndVlsSws+OlWzZNsuT5leuL2ULIkf3IkkaxN
QuoZJfb5t+MHGzTmPr+nv2aufoIsgrMkYIjRU66jfaB+8t9dec8dusXDbxYdzkMw
rZ2FopY555yWGa35gIqlR0vLicqMVCxKlBGdVywgm88ivvRM0zIsQeKrDwjVX+72
c6DpgGsUewyCVTcKrg6uAoxT24kAPwMFGDU970CzruqT7jBeIBEC8XoAoI+NzBGk
7TyKFeRu6cs9QanAlxd5AKDImBDYzuBL6Emr96VkyNXTMtOPK5kBDQM1PexvAAAB
CAC85eki1QHZQTQ10nYQ9Obu436/limVDqgCcefn7863bUFveY8uYhdB+rmd0+wa
ltUYHWrA4e7Tt0v/2V40KDB9xQeQlU4rXVGVSg9ffzuVHhBObvzCbyAQWVRezv8S
p4b7e/9nJSthy/Sovy/WE6svuwbiL2y3mFyYYE3z5WUCIXwpNXnTmmwyExduNtvy
GzLhiieVsQKLFnGiRgadzJxPu3bXxomJTbqeC91s5vtTL2X5pmFNVL+jWL2O4sev
E66XFPFdHSDnj9jnXBc051TGmemuyRsukAknXQCApRTc3nyiK8rVQP27OwEmy4rq
xe8MgnDTWq6QiQ8wSIEP0v3VAAURtB1HZW9mZiBDLiBXaW5nIDxnY3dAcG9ib3gu
Y29tPokBFQMFEDU97G8PMEiBD9L91QEBn74H/3e6mzIU5oIljf6Ycs00HP0MRHqh
pSvOeDR7oHZOVJTIWy/qkQ8QxCw9zyA+GQ/zWc/Db9VlUZvdYZbnHJG19WyVB3Y/
nVYwP6TQqq/sfgweHhFlUvRJStbGXYdTjGPWxpd6Qn+G8XwCr9/4tS23rM9VPd4I
gMUbQH6ruCzrHI+G5BJE1IHShbK7i2RmZfdB6Yv06PpddB1BetJO77E/fwPneTvk
A7dD3s5El2RHTM2c0Z1Jpvg8YHLrUcXmfNKXa8hD8wRRavyIoHfvPtmjHj+dt1lE
T8B0o6bH/DPT027nT7Qo5k6rmHg3Qk1398794vhpBgwxpEC77OVUzMwOPhqJAD8D
BRA1Pe+0s67qk+4wXiARAoXsAJ9DYXxh0GN9FbE7Z2U5beFf37BPGgCeJPVD9rSr
gGtuca/4DEhDAGSAfn+ZAQ0DM3r8XAAAAQgApHzqec/wFmjoEDIX93y8L4fvVs13
qzKFvdsGeTSiPAjKfEyw9rELlzAwtqWdkDUBeU6tld342GjcDCVKKY5snun1746Z
Ui6rkjnFdPimv8fwJc6tAC4NoWerVC9bbpdsDbbzdaxf1RATmB8B81vY7+3NNegk
WuxTBwl/QV7aS5qZ+kFpsP5ANYnjcBQeL2ejzmmLMU9ntdRa7XAHUvsUobV3bgP7
8fdz6w+LEs5wHcD5FGBEOrmr5rk9AYErds/i2vCOKB66QrqzfXSg8AfY9CqfVn8p
o3os/GiXtLYS86vg44S8P9Vel2ajW8kWwjQhXLxjBB422B6ZpPRnjh4ewQAFEbQd
QW5kcmV3IE1haW4gPHplZnJhbUBmeXNoLm9yZz6JAJUDBRA0Ygop5kcdJXa50hkB
ARugBACiuBehrCsCJ9eskOIGYijVyOkw0ds+Rl/f491CoK4At7oAQzESR4sfBKRo
PpnCLGVen01dgshcf00lM+Yp8qrjT/BSrD58L98aaig7pBD5t5KwePjwhS+kB/tc
41SiCsXhcuzsacqsUhhZ0SoUtD7Dq901KCrhvmSLK0DGrI+dr4kAlQMFEDRfSDpL
2cze8VY7wQEBt0AD/06seQfvtDwduYd9xoUc9EHFmtJH1RkR4fn+KKngyKPZVUwn
38cHa5CfbEUhF2bD0ADFHcOMiaO2k6yHT9EG3FWRyGsF6lAAlUK6NqtTymA2sFig
R7VTbq25V4CjOFRSti8d2yeDPJ5nyj5YzTzkx0XHl2//hF6QrROIv3YYh16wiQCV
AgUQNF9FqnCjAd4lTWyNAQGAzgQAguA8BzjPfca6TDJbuj5fQdTwEJuMHZ9asQQf
zy43q9qHUINRy0LlyqiIEQtggQIbp20pvHtnUwBaK00y2wOToe3kprCym4NEuT/g
wMRXGiGF2cBJzWNXWn7aNXnGp1UP1Yb9C9zHIgCApFHd8d0qzQNQONN5vYTa6BRS
UzkCvkqJARUDBRAzhKKK1b5+4POEA70BASZqB/49jNe6xRyUe+3u3IiOiYjLRRLz
VkyA4x9xIURHsKE3oUa0vI6wyGhQzHWFuKom9mqQKDR12T9LYoVvNi94qixTgBlD
Fw+Tm+FfxmguQCTPgY9MRGGS6A9fuSd/kbyjn+w1HY9nVM4B2Nrn0xPQ/7uUZ0a1
7cUBi5+jk6r9xDTfRkP7wn+LEA3rg6tNkn6apfsDyHOSHPr8GZKBdmqthAJQP6eF
im3k6pPzv+232XyejDBlHiPloGrX4bA6C69pqazyoH4YD5knZU0gYsF6DJfRsruB
lw9YIKj+lw6AwYRAO+2PgHjIY9sEFDuCZn2IFr/gwGSAVBRVtG9YZkA+l23ziQCV
AwUQM4HINSV6yMkAhfdJAQFBYQQAsu0G4HUtlUM92p4qxAVjG9mmdZRmb9YNfr1G
AQX9vgx7R2oJ+CwiGfmO1lUtvhJUQNbjZTCmF3n14/5gbJ1loOh7KUGE/wJHqeUJ
n6ziMkpR4Rzff6LmCr5zDsW8ZjTz+B8Cfar+SFWuNbue35tFmqVOvxv724eSCb47
aHwlMkOJAJUDBRAzg6nxc4ScsTlXuf0BAST+A/4vQUMaVFYuKyNcgOkilcSOLHYE
g+jIlGoBBi6Khi+P0iFVUde0xr61WiSxsbTSTYLmHnGi7fQ+iqPBFzb6NuyJ4R3t
96SiFeD3Oe3znN11gF1AtR86wc3m3cymvwrMOzfK0vkN7iudv9jkrtbk4x8JAPTL
MfT6adD4NkFr7pZA6IkBFQMFEDOC9G+ZamtmIJq5/QEBN6wH/3isXVyHRue7uKDA
vsGnb4GmTazwuK1lmREaZ1ZL/609VCp0zo0osrjrDsWiqnU9zve1ZHrImr3BELCG
LrkaE+mjoK80reGc0hdQF0/mwBZrIkT8Pcncjv8vE6b9IuacWJf+S/HpFnfv+RxB
k57A7uAOJLP1vhI/Mq9B/TARdkmqDmKcTpYGIxYjhvRPV07aD/K7fRivhNBibCgm
n97sSBEdf4Nq3NTbByetTuktUoPEn3MpqnUjxnqrmt7HztRq96XXjz/gZdYVtI9o
nzuP92H6YKJcCUVZMt4zzhEOw8iDsrIGfGcje5UW3qSHI6JUOTmyGCd1mzLDsqMK
kaElcWiJAJUDBRAzgYq2TQiMTNnrYBEBAS1OBACOdN3qf88fl7bJtsZNqY6jQEQ3
GPJrtUroP7vWSxnV8jKO2egxfAbmp+UGZoD6imoH89TU9Ny/E1/nsRWriWx4hZOJ
hUDA4TOUOX0nhfeeC43u2t+D/v36JDjUzipWL2mGe6B8jrElgqb71gT/qgT/yV81
wPuHDO9zih/m69p2rokBFQMFEDOAxoyGWkrM32Hp2QEBGnMIAJ4k3kL3xVOxa+bM
5uXe57leOX6dsut4QKnrsQ862VYHhF7N4ZYQs3lv4ygLguqTZ02fcZyr6l9q102s
87AoY8RfE/ESewepTcqLT4Dm5K7EAoRdGZ/2yWrA8fHdVGKHl7UO5IqcTLQ5AOOg
lhAgy+GPx3UcN+EPNgLNd3pMvIG2NnBGwhP88sa4R9JfvK0eGAE9ElbTdbR6xBKn
JneuAQPUIdO0GVgowrDfiSlupjFhW+CeKfDix3isJEnRbohNq4BawSL2aC88UOIE
X7osbVd8nFufPlEKaN6EhaIWiixF1W3LI/wiF5HV0u3nwaN4Qy15OXjcD/7urbuQ
cU+B2yCJAJUDBRAzgN6EolKYYFEYdpEBAZc2BAClMzFxU50TN54jp444QicsjtlS
IioqQMchFq30WSwxkeZOE7QGAqX9pBxSoCjbK0mf2UXM/V+8dhIfl0Y/EQchNFyL
qv01GnMiW5r/pXm4eZoMw9atpXx+kuvEO7N5VgvdrBgix3PUSX9pYHSxeNVhrV9M
YZMzMaPoB36t1B+rkokBFQMFEDOA3nnZ/s5HNAtHpQEBXxcH/RoVXW1jg9PoJhTh
Ab4xO95QKPILKwNGUBTdMOZbwDKFmbfjAxOU0VSJqp7U5aQeHCHsm3lLCF/4gWE/
FDEq7goNj/COivg6egB1ZTfgBFdpHbGqQhPJgvUoh7uufPIqNej2h0Vi4JeLyyp/
Pdw8i7lvaMRp8W8q9votJ6ma3Nm8zNOXbr7hNl9LBLNrL6928s9RCT8GbrPoZqDZ
vs5AUhUxOuVgLmqxsw2jjQp9grqkIPsC46ANlyyGe+Iyfhnyc2EGuF0TpBSjJC8e
uQKmLagjGaW5qBZPqnut24z2YAyPxpPffQbkKmNuy0DCYM1vMeW3/5uPvHPsIA7w
/Tp++UiJAJUDBRAze0HFa/97sSWYQUUBAUp5A/9Ae02CVK2dTO2uNWE5V4DgFIcq
85xTd2LFw3lWs8dP5wNCINo+FYaxhQxlj7uzE7InVSMTmO1nOlHo/SB4DmwIRSEh
q2mZCMABjbQW1AyU0q8VRgtY3y/wfGpzeXTKNsf7ab2BkjLf63XeZcIY3UDjoJts
XHO8K5Z8CnUu8e4HMYkAlQMFEDN6/Yxw//hyU6VP4QEBvWsD+wWXB8Xtu0DPIvoy
ZvgjuhLcmibLcUNeD7piEh5WrXdjiUIJxwkw4X7eMqirvqCQLaKEoN6XJob+8KT9
NCOB4ErTPGnzWM2vYApy8sra833xP3evOmN4bT5DuZpkN+RVRAGLa95RU4Q4eZnY
MSxtEk/f09l5pWyuPvDJUCZdzYD/iQEVAwUQM3r8XJmk9GeOHh7BAQEUmAgAly7y
5pNJBs24zzr46fGBLLwhrkzTRyhwIkgEI9cYMpRbV1E5XgqaOjS11vKnmSu+pEql
XMJUV7MlM5p52YtaEx7C5u+WK6eK6hIP0eFi6kehuegqdRfIKfAz6aeu80Zutu/K
i2vOA0O2+hRJnDRsqGBlx8KRQl5c8Vo2OkK8kxk+PVbbgYf5HZRF0yGxdaE4kxG2
F14sL0DKmY99b+RPeu4v3Gz1rPz8lTetlIXaXJoFrgF8gCk+IDNB5aen69WoAQeP
yHE6uCn6a1RC+rM8Jhv/PI/lKEQabekGYC5gP7QEIYqcmwdKTv0pzP1FY9/tmVsB
C4+RT5QRIxKJMxXh6Q==
=/T9G
-----END PGP PUBLIC KEY BLOCK-----

5
Functions/.distfiles Normal file
View file

@ -0,0 +1,5 @@
DISTFILES_SRC='
.distfiles
acx cat cdmatch cdmatch2 checkmail cx harden mere multicomp proto
pushd randline run-help yp yu zed zls
'

6
Functions/acx Executable file
View file

@ -0,0 +1,6 @@
#! /bin/sh
#
# zsh shell function to make its arguments 755
# also works as an sh script
#
chmod 755 $*

16
Functions/cat Normal file
View file

@ -0,0 +1,16 @@
#! /usr/local/bin/zsh -f
local file
if ((! ARGC)) then
set -- -
fi
for file
do
if [[ "$file" == - ]] then
while read -u0ek 4096; do ; done
else
while read -u0ek 4096; do ; done < "$file"
fi
done

23
Functions/cdmatch Executable file
View file

@ -0,0 +1,23 @@
# Start of cdmatch.
# Save in your functions directory and autoload, then do
# compctl -x 'S[/][~][./][../]' -g '*(-/)' - \
# 'n[-1,/], s[]' -K cdmatch -S '/' -- cd pushd
#
# Completes directories for cd, pushd, ... anything which knows about cdpath.
# You do not have to include `.' in your cdpath.
#
# It works properly only if $ZSH_VERSION > 3.0-pre4. Remove `emulate -R zsh'
# for all other values of $ZSH_VERSION > 2.6-beta2. For earlier versions
# it still works if RC_EXPAND_PARAM is not set or when cdpath is empty.
emulate -R zsh
setopt localoptions
local narg pref cdp
read -nc narg
read -Ac pref
cdp=(. $cdpath)
reply=( ${^cdp}/${pref[$narg]%$2}*$2(-/DN^M:t) )
return
# End of cdmatch.

15
Functions/cdmatch2 Normal file
View file

@ -0,0 +1,15 @@
# This function should be called from compctl to complete the
# second argument of cd and pushd.
emulate -R zsh # Requires zsh 3.0-pre4 or later
setopt localoptions
local from
read -Ac from
from="${from[2]}"
eval "reply=( \${PWD:s@$from@$1*$2@}~$PWD(ND-/:) )"
reply=( "${${reply[@]#${PWD%%$from*}}%${PWD#*$from}}" )
[[ ${#reply[(r),-1]} != 0 ]] && reply[(r)]="''"
return

26
Functions/checkmail Normal file
View file

@ -0,0 +1,26 @@
#! /usr/local/bin/zsh
#
# This autoloadable function checks the folders specified as arguments
# for new mails. The arguments are interpeted in exactly the same way
# as the mailpath special zsh parameter (see zshparam(1)).
#
# If no arguments are given mailpath is used. If mailpath is empty, $MAIL
# is used and if that is also empty, /var/spool/mail/$LOGNAME is used.
# This function requires zsh-3.0.1 or newer.
#
local file message
for file in "${@:-${mailpath[@]:-${MAIL:-/var/spool/mail/$LOGNAME}}}"
do
message="${${(M)file%%\?*}#\?}"
file="${file%%\?*}"
if [[ -d "$file" ]] then
file=( "$file"/**/*(.ND) )
if (($#file)) then
checkmail "${^file}\?$message"
fi
elif test -s "$file" -a -N "$file"; then # this also sets $_ to $file
print -r -- "${(e)message:-You have new mail.}"
fi
done

6
Functions/cx Executable file
View file

@ -0,0 +1,6 @@
#! /bin/sh
#
# zsh shell function to make its arguments executable
# also works as a sh script
#
chmod +x $*

6
Functions/harden Executable file
View file

@ -0,0 +1,6 @@
#! /bin/sh
# harden a link (convert it to a singly linked file)
cp $1 $1.foo
rm $1
mv $1.foo $1

3
Functions/mere Executable file
View file

@ -0,0 +1,3 @@
#! /bin/sh
# read a man page in the current directory
nroff -man -Tman $1 | less -s

80
Functions/multicomp Executable file
View file

@ -0,0 +1,80 @@
# multicomp() {
# Completes all manner of files given prefixes for each path segment.
# e.g. s/z/s -> src/zsh-2.4/src
#
# Usage: e.g.
# compctl -D -f + -U -Q -S '' -K multicomp
#
# Note that exactly matched directories are not expanded, e.g.
# s/zsh-2.4/s<TAB> will not expand to src/zsh-2.4old/src.
# Will expand glob patterns already in the word, but use complete-word,
# not TAB (expand-or-complete), or you will get ordinary glob expansion.
# Requires the -U option to compctl.
# Menucompletion is highly recommended for ambiguous matches.
# Liable to screw up escaped metacharacters royally.
# $fignore is not used: feel free to add your own bit.
emulate -R zsh # Requires zsh 3.0-pre4 or later
local pref head sofar origtop newtop globdir="(-/)" wild
setopt localoptions nullglob rcexpandparam globdots
unsetopt markdirs globsubst shwordsplit nounset
pref="${1}$2"
# Hack to allow programmable completion to select multicomp after a :
# (e.g.
# compctl -D -f -x 's[:]' -U -Q -S '' -K multicomp
# )
pref="${pref#:}"
sofar=('')
reply=('')
if [[ "$pref" = \~* ]]; then
# If the string started with ~, save the head and what it will become.
origtop="${pref%%/*}"
eval "newtop=$origtop"
# Save the expansion as the bit matched already
sofar=($newtop)
pref="${pref#$origtop}"
fi
while [[ -n "$pref" ]]; do
[[ "$pref" = /* ]] && sofar=(${sofar}/) && pref="${pref#/}"
head="${pref%%/*}"
pref="${pref#$head}"
if [[ -n "$pref" && -z $sofar[2] && -d "${sofar}$head" ]]; then
# Exactly matched directory: don't try to glob
reply=("${sofar}$head")
else
[[ -z "$pref" ]] && globdir=
# if path segment contains wildcards, don't add another.
if [[ "$head" = *[\[\(\*\?\$\~]* || -z "$head" ]]; then
wild=$head
else
# Simulate case-insensitive globbing for ASCII characters
wild="[${(j(][))${(s())head:l}}]*" # :gs/a/[a]/ etc.
# The following could all be one expansion, but for readability:
wild=$wild:gs/a/aA/:gs/b/bB/:gs/c/cC/:gs/d/dD/:gs/e/eE/:gs/f/fF/
wild=$wild:gs/g/gG/:gs/h/hH/:gs/i/iI/:gs/j/jJ/:gs/k/kK/:gs/l/lL/
wild=$wild:gs/m/mM/:gs/n/nN/:gs/o/oO/:gs/p/pP/:gs/q/qQ/:gs/r/rR/
wild=$wild:gs/s/sS/:gs/t/tT/:gs/u/uU/:gs/v/vV/:gs/w/wW/:gs/x/xX/
wild=$wild:gs/y/yY/:gs/z/zZ/:gs/-/_/:gs/_/-_/:gs/[]//
# Expand on both sides of '.' (except when leading) as for '/'
wild="${${wild:gs/[.]/*.*/}#\*}"
fi
reply=(${sofar}"${wild}${globdir}")
reply=(${~reply})
fi
[[ -z $reply[1] ]] && reply=() && break
[[ -n $pref ]] && sofar=($reply)
done
# Restore ~'s in front if there were any.
# There had better not be anything funny in $newtop.
[[ -n "$origtop" ]] && reply=("$origtop"${reply#$newtop})
# }

8
Functions/proto Executable file
View file

@ -0,0 +1,8 @@
#! /bin/sh
# generate prototypes, if your style is the same as mine
for i
do
rm $i:r.pro 2>/dev/null
grep -v '[{};:#]' $i | grep '^[A-Za-z]' |
grep -v static | sed 's/$/;/' >! $i:r.pro
done

13
Functions/pushd Normal file
View file

@ -0,0 +1,13 @@
# pushd function to emulate the old zsh behaviour. With this function
# pushd +/-n just lifts the selected element to the top of the stack
# instead of just cycling the stack.
emulate -R zsh
setopt localoptions
if [[ ARGC -eq 1 && "$1" == [+-]<-> ]] then
setopt pushdignoredups
builtin pushd ~$1
else
builtin pushd "$@"
fi

3
Functions/randline Executable file
View file

@ -0,0 +1,3 @@
# get a random line from a file
integer z=$(wc -l <$1)
sed -n $[RANDOM%z+1]p $1

72
Functions/run-help Executable file
View file

@ -0,0 +1,72 @@
#!/usr/local/bin/zsh
#
# Figure out where to get the best help, and get it.
#
# Install this function by placing it in your FPATH and then
# adding to your .zshrc the lines:
# unalias run-help
# autoload run-help
#
emulate -R zsh
setopt localoptions
# Check whether Util/helpfiles has been used to generate zsh help
if [[ $1 == "-l" ]]
then
if [[ -n "${HELPDIR:-}" ]]
then
echo 'Here is a list of topics for which help is available:'
echo ""
print -rc $HELPDIR/*(:t)
else
echo 'There is no list of help topics available at this time'
fi
return 0
elif [[ -n "${HELPDIR:-}" && -r $HELPDIR/$1 && $1 != compctl ]]
then
${=PAGER:-more} $HELPDIR/$1
return $?
fi
# No zsh help, use "whence" to figure out where else we might look
local what places newline='
'
integer i=0 didman=0
places=( "${(@f)$(builtin whence -va $1)}" )
while ((i++ < $#places))
do
what=$places[$i]
builtin print -r $what
case $what in
(*( is an alias)*)
[[ ${what[(w)6]:t} != ${what[(w)1]} ]] && run-help ${what[(w)6]:t}
;;
(*( is a * function))
builtin functions ${what[(w)1]} | ${=PAGER:-more}
;;
(*( is a * builtin))
case ${what[(w)1]} in
(compctl) man zshcompctl;;
(bindkey) man zshzle;;
(*setopt) man zshoptions;;
(*) man zshbuiltins;;
esac
;;
(*( is hashed to *))
man ${what[(w)-1]:t}
;;
(*)
((! didman++)) && man $1
;;
esac
if ((i < $#places && ! didman))
then
builtin print -nP "%SPress any key for more help or q to quit%s"
builtin read -k what
[[ $what != $newline ]] && echo
[[ $what == [qQ] ]] && break
fi
done

2
Functions/yp Executable file
View file

@ -0,0 +1,2 @@
#! /bin/sh
ypmatch $1 passwd

2
Functions/yu Executable file
View file

@ -0,0 +1,2 @@
#! /bin/sh
ypmatch $1 passwd.byuid

65
Functions/zed Executable file
View file

@ -0,0 +1,65 @@
#
# zed
#
# No other shell could do this.
# Edit small files with the command line editor.
# Use ^X^W to save, ^C to abort.
# Option -f: edit shell functions. (Also if called as fned.)
#
# Completion: use
# compctl -f -x 'w[1,-f]' -F -- zed
#
local var fun cleanup
# We do not want timeout while we are editing a file
integer TMOUT=0
[[ $1 = -f || $0 = fned ]] && fun=1
[[ $1 = -(|-|f) ]] && shift
[[ -z "$1" ]] && echo 'Usage: "zed filename" or "zed -f function"' && return 1
# catch interrupts
cleanup="$(bindkey -L "^M"; bindkey -L -M emacs "^X^W"; bindkey -aL "ZZ"
echo "trap - INT EXIT"; trap)"
trap "return 130" INT
trap "$cleanup" EXIT
# don't mangle !'s
setopt localoptions nobanghist
bindkey "^M" self-insert-unmeta
# Depending on your stty's, you may be able to use ^J as accept-line, else:
bindkey -M emacs "^X^W" accept-line
bindkey -a "ZZ" accept-line
if ((fun)) then
var="$(functions $1)"
# If function is undefined but autoloadable, load it
if [[ $var = undefined* ]] then
local dir
for dir in $fpath; do
if [[ -f $dir/$1 ]] then
var="$1() {
$(<$dir/$1)
}"
break
fi
done
elif [[ -z $var ]] then
var="$1() {
}"
fi
vared var && eval function "$var"
else
[[ -f $1 ]] && var="$(<$1)"
while vared var
do
(print -r -- "$var" >| $1) && break
echo -n -e '\a'
done
fi
return 0
# End of zed

55
Functions/zls Normal file
View file

@ -0,0 +1,55 @@
# zls () {
# simple internal ls using the stat module
zmodload -i stat || return 1
emulate -R zsh
setopt localoptions
local f stat opts='' L=L mod=: dirs list
dirs=()
list=()
while getopts ailLFd f
do
opts=$opts$f
if [[ $f == '?' ]] then
echo Usage: $0 [ -ailLFd ] [ filename ... ]
return 1
fi
done
shift OPTIND-1
[[ $opts == *L* ]] && L=''
[[ $opts == *F* ]] && mod=T$mod
[[ $opts == *a* ]] && setopt globdots
if ((! ARGC)) then
set *
opts=d$opts
fi
for f in $*
do
stat -s$L -A stat -F "%b %e %H:%M" - $f || continue
if [[ $opts != *d* && $stat[3] == d* ]] then
dirs=( $dirs $f )
elif [[ $opts == *l* ]] then
[[ $opts == *i* ]] && print -n "${(l:7:)stat[2]} "
[[ -n $stat[14] ]] && f=( $f '->' $stat[14] ) || f=( $f($mod) )
print -r -- "$stat[3] ${(l:3:)stat[4]} ${(r:8:)stat[5]} " \
"${(r:8:)stat[6]} ${(l:8:)stat[8]} $stat[10] $f"
else
f=( $f($mod) )
list=( "$list[@]" "${${(M)opts:%*i*}:+${(l:7:)stat[2]} }$f" )
fi
done
(($#list)) && print -cr -- "$list[@]"
while (($#dirs)) do
((ARGC > $#dirs)) && echo
((ARGC > 1)) && echo $dirs[1]:
(cd $dirs[1] && $0 -d$opts)
shift dirs
done
# }

242
INSTALL Normal file
View file

@ -0,0 +1,242 @@
--------------
INSTALLING ZSH
--------------
Check MACHINES File
-------------------
Check the file MACHINES in the subdirectory Etc to see the architectures
that zsh is known to compile on, as well as any special instructions
for your particular architecture. Most architectures will not require any
special instructions.
Configuring Zsh
---------------
To configure zsh, from the top level directory, do the command:
./configure
Configure accepts several options (explained below). To display
currently available options, do the command:
./configure --help
Most of the interesting configuration options can be added after running
configure by editing the user configuration section of config.h and the
top level Makefile.
Dynamic loading
---------------
Zsh-3.1 has support for dynamically loadable modules. To enable this run
configure with the --enable-dynamic option. Note that dynamic loading
does not work on all systems. On these systems this option will have no
effect, so it is always safe to use --enable-dynamic. When dynamic
loading is enabled, major parts of zsh (including the Zsh Line Editor) are
compiled into modules and not included into the main zsh binary. Zsh
autoloads these modules when they are required. This means that you have
to execute make install.modules before you try the newly compiled zsh
executable.
Adding more modules
-------------------
The zsh distribution contains several modules, in the Src/Builtins,
Src/Modules and Src/Zle directories. If you have any additional zsh
modules that you wish to compile for this version of zsh, create another
subdirectory of the Src directory and put them there. You can create
as many extra subdirectory hierarchies as you need. The subdirectories
must be actual directories; symbolic links will not work.
If you wish to add or remove modules or module directories after you
have already run make, then after adding or removing the modules run:
make prep
Controlling what is compiled into the main zsh binary
-----------------------------------------------------
By default the comp1, compctl, zle, sched and rlimits modules are compiled
into non-dynamic zsh and no modules are compiled into the main binary if
dynamic loading is available. This can be overridden by creating the
Src/modules-bltin file with the list of modules which are to be compiled
into the main binary. See the zshmodules manual page for the list of
available modules.
Compiler Options or Using a Different Compiler
----------------------------------------------
By default, configure will use the "gcc" compiler if found. You can use a
different compiler, or add unusual options for compiling or linking that
the "configure" script does not know about, by either editing the user
configuration section of the top level Makefile (after running configure)
or giving "configure" initial values for these variables by setting them
in the environment. Using a Bourne-compatible shell (such as sh,ksh,zsh),
you can do that on the command line like this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the "env" program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Check Generated Files
---------------------
Configure will probe your system and create a "config.h" header file.
You should check the user configuration section at the beginning of
this include file. You should also examine the values (determined by
configure) of HOSTTYPE, OSTYPE, MACHTYPE, and VENDOR to make sure they
are correct. The value of these #defines's is used only to initialize
the corresponding default shell parameters. Since these shell parameters
are only for informational purposes, you can change them to whatever
you feel is appropriate.
Also configure will create a Makefile in the top level directory as well
as in the various subdirectories. You should check the user configuration
section of the top level Makefile.
Compiling Zsh
-------------
After configuring, to build zsh, do the command:
make
Installing Zsh
--------------
If no make/compilation errors occur, then to install the zsh binary, do
the command:
make install.bin
Any previous copy of zsh will be renamed "zsh.old"
To install the dynamically-loadable modules, do the command:
make install.modules
To install the zsh man page, do the command:
make install.man
To install the zsh info files, do the command:
make install.info
Or alternatively, you can install all the above with the command:
make install
"make install.info" will only move the info files into the info directory.
You will have to edit the topmost node of the info tree "dir" manually
in order to have the zsh info files available to your info reader.
Building Zsh On Additional Architectures
----------------------------------------
To build zsh on additional architectures, you can do a "make distclean".
This should restore the zsh source distribution back to its original
state. You can then configure zsh as above on other architectures in
which you wish to build zsh. Or alternatively, you can use a different
build directory for each architecture.
Using A Different Build Directory
---------------------------------
You can compile the zsh in a different directory from the one containing
the source code. Doing so allows you to compile it on more than one
architecture at the same time. To do this, you must use a version of
"make" that supports the "VPATH" variable, such as GNU "make". "cd" to
the directory where you want the object files and executables to go and
run the "configure" script. "configure" automatically checks for the
source code in the directory that "configure" is in. For example,
cd /usr/local/SunOS/zsh
/usr/local/src/zsh-3.0/configure
make
Memory Routines
---------------
Included in this release are alternate malloc and associated functions
which reduce memory usage on some systems. To use these, add the option
--enable-zsh-mem
when invoking "configure".
You should check Etc/MACHINES to see if there are specific recommendations
about using the zsh malloc routines on your particular architecture.
Debugging Routines
------------------
You can turn on various debugging options when invoking "configure".
To turn on some extra checking in the memory management routines, you
can use the following options when invoking "configure".
--enable-zsh-mem-warning # turn on warnings of memory allocation errors
--enable-zsh-secure-free # turn on memory checking of free()
If you are using zsh's memory allocation routines (--enable-zsh-mem), you
can turn on debugging of this code. This enables the builtin "mem".
--enable-zsh-mem-debug # debug zsh's memory allocators
You can turn on some debugging information of zsh's internal hash tables.
This enables the builtin "hashinfo".
--enable-zsh-hash-debug # turn on debugging of internal hash tables
To add some sanity checks and generate debugging information for debuggers
you can use the following option. This also disables optimization.
--enable-zsh-debug # use it if you want to debug zsh
Startup/shutdown files
----------------------
Zsh has several startup/shutdown files which are in /etc by default. This
can be overriden using one of the options below when invoking "configure".
--enable-etcdir=directory # default directory for global zsh scripts
--enable-zshenv=pathname # the full pathname of the global zshenv script
--enable-zshrc=pathname # the full pathname of the global zshrc script
--enable-zlogin=pathname # the full pathname of the global zlogin script
--enable-zprofile=pathname # the full pathname of the global zprofile script
--enable-zlogout=pathname # the full pathname of the global zlogout script
Any startup/shutdown script can be disabled by giving the
--disable-scriptname option to "configure". The --disable-etcdir option
disables all startup/shutdown files which are not explicitely enabled.
Options For Configure
---------------------
The `configure' program accepts many options, not all of which are useful
or relevant to zsh. To get the complete list of configure options, run
"./configure --help". The following list should contain most of the
options of interest for configuring zsh.
Configuration:
--cache-file=FILE # cache test results in FILE
--help # print a help message
--version # print the version of autoconf that create configure
--quiet, --silent # do not print `checking...' messages
--no-create # do not create output files
Directories:
--prefix=PREFIX # install host independent files in PREFIX [/usr/local]
--exec-prefix=EPREFIX # install host dependent files in EPREFIX [same as prefix]
--bindir=DIR # install user executables in DIR [EPREFIX/bin]
--infodir=DIR # install info documentation in DIR [PREFIX/info]
--mandir=DIR # install man documentation in DIR [PREFIX/man]
--srcdir=DIR # find the sources in DIR [configure dir or ..]
Features:
--enable-FEATURE # enable use of this feature
--disable-FEATURE # disable use of this feature
The FEATURES currently supported are:
zsh-debug # use it if you want to debug zsh
zsh-mem # use zsh's memory allocators
zsh-mem-debug # debug zsh's memory allocators
zsh-mem-warning # turn on warnings of memory allocation errors
zsh-secure-free # turn on memory checking of free()
zsh-hash-debug # turn on debugging of internal hash tables
etcdir=directory # default directory for global zsh scripts
zshenv=pathname # the full pathname of the global zshenv script
zshrc=pathname # the full pathname of the global zshrc script
zlogin=pathname # the full pathname of the global zlogin script
zprofile=pathname # the full pathname of the global zprofile script
zlogout=pathname # the full pathname of the global zlogout script
dynamic # allow dynamically loaded binary modules

124
Makefile.in Normal file
View file

@ -0,0 +1,124 @@
#
# Makefile for top level of zsh distribution
#
# Copyright (c) 1995-1997 Richard Coleman
# All rights reserved.
#
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and to distribute modified versions of this software for any
# purpose, provided that the above copyright notice and the following
# two paragraphs appear in all copies of this software.
#
# In no event shall Richard Coleman or the Zsh Development Group be liable
# to any party for direct, indirect, special, incidental, or consequential
# damages arising out of the use of this software and its documentation,
# even if Richard Coleman and the Zsh Development Group have been advised of
# the possibility of such damage.
#
# Richard Coleman and the Zsh Development Group specifically disclaim any
# warranties, including, but not limited to, the implied warranties of
# merchantability and fitness for a particular purpose. The software
# provided hereunder is on an "as is" basis, and Richard Coleman and the
# Zsh Development Group have no obligation to provide maintenance,
# support, updates, enhancements, or modifications.
#
subdir = .
dir_top = .
SUBDIRS = Doc Etc Src
@@version.mk@@
@@defs.mk@@
# ========== DEPENDENCIES FOR BUILDING ==========
# default target
all: config.h
@for subdir in Src Doc; do \
(cd $$subdir && $(MAKE) $(MAKEDEFS) $@) || exit 1; \
done
check test:
@echo zsh test suite not available yet
# prepare module configuration
prep:
@cd Src && $(MAKE) $(MAKEDEFS) $@
META-FAQ: FORCE
@cd Doc && $(MAKE) $(MAKEDEFS) ../META-FAQ
# ========== DEPENDENCIES FOR INSTALLING ==========
# install/uninstall everything
install: install.bin install.modules install.man install.info
uninstall: uninstall.bin uninstall.modules uninstall.man uninstall.info
# install/uninstall just the binary
install.bin uninstall.bin:
@cd Src && $(MAKE) $(MAKEDEFS) $@
# install/uninstall just the modules
install.modules uninstall.modules:
@cd Src && $(MAKE) $(MAKEDEFS) $@
# install/uninstall just the man pages
install.man uninstall.man:
@cd Doc && $(MAKE) $(MAKEDEFS) $@
# install/uninstall just the info pages
install.info uninstall.info:
@cd Doc && $(MAKE) $(MAKEDEFS) $@
# ========== DEPENDENCIES FOR CLEANUP ==========
@@clean.mk@@
distclean-here:
rm -f Makefile config.h config.status config.log config.cache stamp-h
realclean-here:
cd $(sdir) && rm -f config.h.in stamp-h.in configure
# ========== DEPENDENCIES FOR MAINTENANCE ==========
@@config.mk@@
config: config.h
config.status: configure
./config.status --recheck
configure: configure.in aclocal.m4 aczsh.m4
cd $(sdir) && autoconf
config.h: stamp-h
stamp-h: config.h.in config.status
cd $(dir_top) && \
CONFIG_FILES= CONFIG_HEADERS=$(subdir)/config.h ./config.status
config.h.in: stamp-h.in
stamp-h.in: configure.in acconfig.h aclocal.m4 aczsh.m4
cd $(sdir) && autoheader
echo > $@
# ========== DEPENDENCIES FOR DISTRIBUTION ==========
DISTNAME = zsh-$(VERSION)
targz-src: $(DISTNAME).tar.gz
$(DISTNAME).tar.gz: FORCE
@$(sdir_top)/Util/mkdisttree.sh $(DISTNAME) $(sdir_top) $(dir_top) SRC \
$(MAKE) $(MAKEDEFS)
tar cf - $(DISTNAME) | gzip -9 > $@
rm -rf $(DISTNAME)
targz-doc: $(DISTNAME)-doc.tar.gz
$(DISTNAME)-doc.tar.gz: FORCE
@$(sdir_top)/Util/mkdisttree.sh $(DISTNAME) $(sdir_top) $(dir_top) DOC \
$(MAKE) $(MAKEDEFS)
tar cf - $(DISTNAME) | gzip -9 > $@
rm -rf $(DISTNAME)
FORCE:

4
Misc/.distfiles Normal file
View file

@ -0,0 +1,4 @@
DISTFILES_SRC='
.distfiles
c2z compctl-examples globtests globtests.ksh lete2ctl
'

2
Misc/.lastloc Normal file
View file

@ -0,0 +1,2 @@
(("/home/user2/pws/src/zsh-3.1.5/Misc/globtests.ksh" . 2763)
("/home/user2/pws/src/zsh-3.1.5/Misc/globtests" . 3123))

128
Misc/c2z Executable file
View file

@ -0,0 +1,128 @@
#! /bin/sh
#
# c2z - environment conversion tool
# Contributed by Bart Schaefer
# (Tweaked a bit by Paul Falstad)
#
# This is a quick script to convert csh aliases to zsh aliases/functions.
# It also converts the csh environment and local variables to zsh. c2z
# uses the csh to parse its own dot-files, then processes csh output to
# convert the csh settings to zsh.
#
# When run as a zsh fuction, c2z runs csh as if it were an interactive
# shell whenever the parent zsh is interactive. When run as a shell
# script, the -i switch can be used to force this behavior.
#
# The -l (login) switch causes csh to run as if it were a login shell.
# This is done "properly" if c2z is used as a zsh function, otherwise
# it's faked by explicitly sourcing .login. Use with caution if your
# .login initializes an X server or does other one-time-only startup
# procedures.
#
# usage:
# c2z [-i | -l | filename]
#
# You can use this script in your .zshrc or .zlogin files to load your
# regular csh environment into zsh; for example, in .zlogin:
#
# . =(c2z -l)
#
# This is not perfect, but it gets most common aliases and variables.
# It's also rather time-consuming to do this every time you log in.
# However, if you're moving from csh to zsh for the first time, this
# can get you started with a familiar environment right away.
#
# In case your mailer eats tabs, $T is set to expand to a tab.
#
T="`echo x | tr x '\011'`"
# If we're zsh, we can run "- csh" to get the complete environment.
#
MINUS=""
LOADFILE=""
INTERACT=""
CSH=csh
case "$ZSH_NAME$ZSH_VERSION$VERSION" in
zsh*)
case $1 in
-l*) MINUS="-" ;;
-i*) INTERACT="-i" ;;
*) LOADFILE="source $1" CSH="csh -f";;
esac
if [[ -o INTERACTIVE ]]; then INTERACT="-i"; fi
setopt nobanghist
;;
*)
case $1 in
-l*) LOADFILE="source ~/.login" ;;
-i*) INTERACT="-i" ;;
*) LOADFILE="source $1" CSH="csh -f";;
esac
;;
esac
( eval $MINUS $CSH $INTERACT ) <<EOF 2>&1 >/dev/null
$LOADFILE
alias >! /tmp/cz$$.a
setenv >! /tmp/cz$$.e
set >! /tmp/cz$$.v
EOF
# save stdin
exec 9<&0
# First convert aliases
exec < /tmp/cz$$.a
# Taken straight from ctoz except for $T and "alias --"
sed -e 's/'"$T"'(\(.*\))/'"$T"'\1/' >/tmp/cz$$.1
grep ! /tmp/cz$$.1 >/tmp/cz$$.2
grep -v ! /tmp/cz$$.1 >/tmp/cz$$.3
sed -e "s/'/'"\\\\"''"/g \
-e 's/^\([^'"$T"']*\)'"$T"'\(.*\)$/alias -- \1='"'\2'/" \
/tmp/cz$$.3
sed -e 's/![:#]*/$/g' \
-e 's/\$cwd/$PWD/' \
-e 's/^\([^'"$T"']*\)'"$T"'\(.*\)$/\1 () { \2 }/' \
/tmp/cz$$.2
# Next, convert environment variables
exec < /tmp/cz$$.e
# Would be nice to deal with embedded newlines, e.g. in TERMCAP, but ...
sed -e '/^SHLVL/d' \
-e '/^PWD/d' \
-e "s/'/'"\\\\"''"/g \
-e "s/^\([A-Za-z0-9_]*=\)/export \1'/" \
-e "s/$/'/"
# Finally, convert local variables
exec < /tmp/cz$$.v
sed -e 's/'"$T"'/=/' \
-e "s/'/'"\\\\"''"/g \
-e '/^[A-Za-z0-9_]*=[^(]/{
s/=/='"'/"'
s/$/'"'/"'
}' |
sed -e '/^argv=/d' -e '/^cwd=/d' -e '/^filec=/d' -e '/^status=/d' \
-e '/^autolist=/s/.*/setopt autolist/' \
-e '/^correct=all/s//setopt correctall/' \
-e '/^correct=/s//setopt correct/' \
-e '/^histchars=/s//HISTCHARS=/' \
-e '/^history=/s//HISTSIZE=/' \
-e '/^home=/s//HOME=/' \
-e '/^ignoreeof=/s/.*/setopt ignoreeof/' \
-e '/^noclobber=/s/.*/setopt noclobber/' \
-e '/^notify=/d' \
-e '/^prompt=/s/!/%h/' \
-e 's/^prompt/PROMPT/' \
-e '/^showdots=/s/.*/setopt globdots/' \
-e '/^savehist=/s//HISTFILE=\~\/.zhistory SAVEHIST=/' \
-e '/^who=/s//WATCHFMT=/'
exec 0<&9
rm /tmp/cz$$.?
exit

716
Misc/compctl-examples Normal file
View file

@ -0,0 +1,716 @@
#
# This file gives examples of possible programmable completions (compctl).
# You can either put the compctl commands in your .zshrc file, or put them
# in a separate file (say .zcompctl) and source it from your .zshrc file.
#
# These are just examples. Use and modify to personal taste. Copying
# this file without thought will needlessly increase zsh's memory usage
# and startup time.
#
# For a detailed description of how these work, check the zshcompctl man
# page.
#
#------------------------------------------------------------------------------
hosts=("${${(s: :)${(s: :)${${(f)$(</etc/hosts)}%%\#*}#*[ ]*}}:#}")
ports=( "${${${(f)$(</etc/services)}:#\#*}%%[ ]*}" )
# groups=( $(cut -d: -f1 /etc/group) )
# groups=( $(ypcat group.byname | cut -d: -f1) ) # if you use NIS
# It can be done without forking, but it used too much memory in old zsh's:
groups=( "${${(f)$(</etc/group)}%%:*}" )
#groups=( "${${(f)$(ypcat groups)}%%:*}" ) # if you use NIS
# Completion for zsh builtins.
compctl -z -P '%' bg
compctl -j -P '%' fg jobs disown
compctl -j -P '%' + -s '`ps -x | tail +2 | cut -c1-5`' wait
compctl -A shift
compctl -c type whence where which
compctl -m -x 'W[1,-*d*]' -n - 'W[1,-*a*]' -a - 'W[1,-*f*]' -F -- unhash
compctl -m -q -S '=' -x 'W[1,-*d*] n[1,=]' -/ - \
'W[1,-*d*]' -n -q -S '=' - 'n[1,=]' -/g '*(*)' -- hash
compctl -F functions unfunction
compctl -k '(al dc dl do le up al bl cd ce cl cr
dc dl do ho is le ma nd nl se so up)' echotc
compctl -a unalias
compctl -v getln getopts read unset vared
compctl -v -S '=' -q declare export integer local readonly typeset
compctl -eB -x 'p[1] s[-]' -k '(a f m r)' - \
'C[1,-*a*]' -ea - 'C[1,-*f*]' -eF - 'C[-1,-*r*]' -ew -- disable
compctl -dB -x 'p[1] s[-]' -k '(a f m r)' - \
'C[1,-*a*]' -da - 'C[1,-*f*]' -dF - 'C[-1,-*r*]' -dw -- enable
compctl -k "(${(j: :)${(f)$(limit)}%% *})" limit unlimit
compctl -l '' -x 'p[1]' -f -- . source
# Redirection below makes zsh silent when completing unsetopt xtrace
compctl -s '$({ unsetopt kshoptionprint; setopt } 2>/dev/null)' + -o + -x 's[no]' -o -- unsetopt
compctl -s '$({ unsetopt kshoptionprint; unsetopt } 2>/dev/null)' + -o + -x 's[no]' -o -- setopt
compctl -s '${^fpath}/*(N:t)' autoload
compctl -b -x 'W[1,-*[DAN]*],C[-1,-*M]' -s '$(bindkey -l)' -- bindkey
compctl -c -x 'C[-1,-*k]' -A - 'C[-1,-*K]' -F -- compctl
compctl -x 'C[-1,-*e]' -c - 'C[-1,-[ARWI]##]' -f -- fc
compctl -x 'p[1]' - 'p[2,-1]' -l '' -- sched
compctl -x 'C[-1,[+-]o]' -o - 'c[-1,-A]' -A -- set
compctl -b -x 'w[1,-N] p[3]' -F -- zle
compctl -s '${^module_path}/*(N:t:r)' -x \
'W[1,-*(a*u|u*a)*],W[1,-*a*]p[3,-1]' -B - \
'W[1,-*u*]' -s '$(zmodload)' -- zmodload
# Anything after nohup is a command by itself with its own completion
compctl -l '' nohup noglob exec nice eval - time rusage
compctl -l '' -x 'p[1]' -eB -- builtin
compctl -l '' -x 'p[1]' -em -- command
compctl -x 'p[1]' -c - 'p[2,-1]' -k signals -- trap
#------------------------------------------------------------------------------
# kill takes signal names as the first argument after -, but job names after %
# or PIDs as a last resort
compctl -j -P '%' + -s '`ps -x | tail +2 | cut -c1-5`' + \
-x 's[-] p[1]' -k "($signals[1,-3])" -- kill
#------------------------------------------------------------------------------
compctl -s '$(groups)' + -k groups newgrp
compctl -f -x 'p[1], p[2] C[-1,-*]' -k groups -- chgrp
compctl -f -x 'p[1] n[-1,.], p[2] C[-1,-*] n[-1,.]' -k groups - \
'p[1], p[2] C[-1,-*]' -u -S '.' -q -- chown
compctl -/g '*.x' rpcgen
compctl -u -x 's[+] c[-1,-f],s[-f+]' -W ~/Mail -f - \
's[-f],c[-1,-f]' -f -- mail elm
compctl -x 'c[-1,-f]' -W ~/Mail -f -- pine
#------------------------------------------------------------------------------
compctl -s "\$(awk '/^[a-zA-Z0-9][^ ]+:/ {print \$1}' FS=: [mM]akefile)" -x \
'c[-1,-f]' -f -- make gmake pmake
#------------------------------------------------------------------------------
# tar
tarnames () {
# Completion function for use with tar:
# get the names of files in the tar archive to extract.
#
# The main claim to fame of this particular function is that it
# completes directories in the tar-file in a manner very roughly
# consistent with `compctl -f'. There are two bugs: first, the whole
# path prefix up to the present is listed with ^D, not just the new
# part to add; second, after a unique completion a space is always
# inserted, even if the completion ends with a slash. These are
# currently limitations of zsh.
#
# This only works for the (fairly common) tar argument style where
# the arguments are bunched into the first argument, and the second
# argument is the name of the tarfile. For example,
# tar xvzf zsh-3.1.2.tar.gz ...
# You can only use compressed/gzipped files if tar is GNU tar,
# although the correct name for the tar programme will be inferred.
local line list=tf
read -cA line
# $line[2] is the first argument: check for possible compression args.
# (This is harmless when used with non-GNU tar, but then the file must
# be uncompressed to be able to use it with tar anyway.)
[[ $line[2] = *[Zz]* ]] && list=tfz
# $line[1] is the command name: something like tar or gnutar.
# $line[3] is the name of the tar archive.
# cache contents for multiple completion: note tar_cache_name
# and tar_cache_list are not local. Assumes all files with the
# same name are the same file, even if in different directories:
# you can trick it with $PWD/file on the command line.
if [[ $line[3] != $tar_cache_name ]]; then
tar_cache_list=($($line[1] $list $line[3]))
tar_cache_name=$line[3]
fi
# Now prune the list to include only appropriate directories.
local file new
reply=()
if [[ $1 = */* ]]; then
local sofar=${1%/*}/
for file in $tar_cache_list; do
if [[ $file = $sofar* ]]; then
new=${file#$sofar}
if [[ $new = */* ]]; then
new=$sofar${new%%/*}/
else
new=$file
fi
if [[ $1 != */ || $new != $1 ]]; then
reply=($reply $new)
fi
fi
done
else
for file in $tar_cache_list; do
if [[ $file = */* ]]; then
new=${file%%/*}/
else
new=$file
fi
reply=($reply $new)
done
fi
}
compctl -f \
-x 'p[2] C[-1,*(z*f|f*z)*]' -/g '*.(taz|tar.(gz|z|Z)|tgz)' \
- 'p[2] C[-1,*(Z*f|f*Z)*]' -/g '*.(tar.Z|taz)' \
- 'p[2] C[-1,*f*]' -/g '*.tar' \
- 'p[1] N[-1,ctxvzZ]' -k "(v z f)" \
- 'p[1] s[]' -k "(c t x)" -S '' \
- 'p[3,-1] W[1,*x*]' -K tarnames \
-- tar gtar gnutar
#------------------------------------------------------------------------------
# rmdir only real directories
compctl -/g '*(/)' rmdir dircmp
#------------------------------------------------------------------------------
# cd/pushd only directories or symbolic links to directories
compctl -/ cd chdir dirs pushd
# Another possibility for cd/pushd is to use it in conjunction with the
# cdmatch function (in the Functions subdirectory of zsh distribution).
compctl -K cdmatch -S '/' -q -x 'p[2]' -Q -K cdmatch2 - \
'S[/][~][./][../]' -g '*(-/)' + -g '*(-/D)' - \
'n[-1,/]' -K cdmatch -S '/' -q -- cd chdir pushd
#------------------------------------------------------------------------------
# If the command is rsh, make the first argument complete to hosts and treat the
# rest of the line as a command on its own.
compctl -k hosts -x 'p[2,-1]' -l '' -- rsh
# rlogin takes hosts and users after `-l'
compctl -k hosts -x 'c[-1,-l]' -u -- rlogin
# rcp: match users, hosts and files initially. Match files after a :, or hosts
# after an @. If one argument contains a : then the other matches files only.
# Not quite perfect; compctl just isn't up to it yet.
compctl -u -k hosts -f -x 'n[1,:]' -f - 'n[1,@]' -k hosts -S ':' - \
'p[1] W[2,*:*]' -f - 'p[1] W[2,*?*]' -u -k hosts -S ':' - \
'p[2] W[1,*:*]' -f - 'p[2] W[1,*?*]' -u -k hosts -S ':' -- rcp
compctl -k hosts host rup rusers ping
#------------------------------------------------------------------------------
# strip, profile, and debug only executables. The compctls for the
# debuggers could be better, of course.
compctl -/g '*(*)' strip gprof adb dbx xdbx ups
compctl -/g '*.[ao]' -/g '*(*)' nm
#------------------------------------------------------------------------------
# shells: compctl needs some more enhancement to do -c properly.
compctl -f -x 'C[-1,-*c]' -c - 'C[-1,[-+]*o]' -o -- bash ksh sh zsh
#------------------------------------------------------------------------------
# su takes a username and args for the shell.
compctl -u -x 'w[1,-]p[3,-1]' -l sh - 'w[1,-]' -u - 'p[2,-1]' -l sh -- su
#------------------------------------------------------------------------------
# Run ghostscript on postscript files, but if no postscript file matches what
# we already typed, complete directories as the postscript file may not be in
# the current directory.
compctl -/g '*.(e|E|)(ps|PS)' \
gs ghostview nup psps pstops psmulti psnup psselect
#------------------------------------------------------------------------------
# Similar things for tex, texinfo and dvi files.
compctl -/g '*.tex*' {,la,gla,ams{la,},{g,}sli}tex texi2dvi
compctl -/g '*.dvi' xdvi dvips
#------------------------------------------------------------------------------
# For rcs users, co and rlog from the RCS directory. We don't want to see
# the RCS and ,v though.
compctl -g 'RCS/*(:s@RCS/@@:s/,v//)' co rlog rcs rcsdiff
#------------------------------------------------------------------------------
# gzip uncompressed files, but gzip -d only gzipped or compressed files
compctl -x 'R[-*[dt],^*]' -/g '*.(gz|z|Z|t[agp]z|tarZ|tz)' + -f - \
's[]' -/g '^*(.(tz|gz|t[agp]z|tarZ|zip|ZIP|jpg|JPG|gif|GIF|[zZ])|[~#])' \
+ -f -- gzip
compctl -/g '*.(gz|z|Z|t[agp]z|tarZ|tz)' gunzip gzcat zcat
compctl -/g '*.Z' uncompress zmore
compctl -/g '*.F' melt fcat
#------------------------------------------------------------------------------
# ftp takes hostnames
ftphosts=(prep.ai.mit.edu wuarchive.wustl.edu ftp.uu.net ftp.math.gatech.edu)
compctl -k ftphosts ftp
# Some systems have directories containing indices of ftp servers.
# For example: we have the directory /home/ftp/index/INDEX containing
# files of the form `<name>-INDEX.Z', this leads to:
#compctl -g '/home/ftp/index/INDEX/*-INDEX.Z(:t:r:s/-INDEX//)' ftp tftp
#------------------------------------------------------------------------------
# Change default completion (see the multicomp function in the Function
# subdirectory of the zsh distribution).
#compctl -D -f + -U -K multicomp
# If completion of usernames is slow for you, you may want to add something
# like
# -x 'C[0,*/*]' -f - 's[~]' -S/ -k users + -u
# where `users' contains the names of the users you want to complete often.
# If you want to use this and to be able to complete named directories after
# the `~' you should add `+ -n' at the end
#------------------------------------------------------------------------------
# This is to complete all directories under /home, even those that are not
# yet mounted (if you use the automounter).
# This is for NIS+ (e.g. Solaris 2.x)
#compctl -Tx 's[/home/] C[0,^/home/*/*]' -S '/' -s '$(niscat auto_home.org_dir | \
# awk '\''/export\/[a-zA-Z]*$/ {print $NF}'\'' FS=/)'
# And this is for YP (e.g. SunOS4.x)
#compctl -Tx 's[/home/] C[0,^/home/*/*]' -S '/' -s '$(ypcat auto.home | \
# awk '\''/export\/[a-zA-Z]*$/ {print $NF}'\'' FS=/)'
#------------------------------------------------------------------------------
# Find is very system dependent, this one is for GNU find.
# Note that 'r[-exec,;]' must come first
if [[ -r /proc/filesystems ]]; then
# Linux
filesystems='"${${(f)$(</proc/filesystems)}#* }"'
else
filesystems='ufs 4.2 4.3 nfs tmp mfs S51K S52K'
fi
compctl -x 'r[-exec,;][-ok,;]' -l '' - \
's[-]' -s 'daystart {max,min,}depth follow noleaf version xdev
{a,c,}newer {a,c,m}{min,time} empty false {fs,x,}type gid inum links
{i,}{l,}name {no,}{user,group} path perm regex size true uid used
exec {f,}print{f,0,} ok prune ls' - \
'p[1]' -g '. .. *(-/)' - \
'C[-1,-((a|c|)newer|fprint(|0|f))]' -f - \
'c[-1,-fstype]' -s $filesystems - \
'c[-1,-group]' -k groups - \
'c[-1,-user]' -u -- find
#------------------------------------------------------------------------------
# Generic completion for C compiler.
compctl -/g "*.[cCoa]" -x 's[-I]' -/ - \
's[-l]' -s '${(s.:.)^LD_LIBRARY_PATH}/lib*.a(:t:r:s/lib//)' -- cc
#------------------------------------------------------------------------------
# GCC completion, by Andrew Main
# completes to filenames (*.c, *.C, *.o, etc.); to miscellaneous options after
# a -; to various -f options after -f (and similarly -W, -g and -m); and to a
# couple of other things at different points.
# The -l completion is nicked from the cc compctl above.
# The -m completion should be tailored to each system; the one below is i386.
compctl -/g '*.([cCmisSoak]|cc|cxx|ii|k[ih])' -x \
's[-l]' -s '${(s.:.)^LD_LIBRARY_PATH}/lib*.a(:t:r:s/lib//)' - \
'c[-1,-x]' -k '(none c objective-c c-header c++ cpp-output
assembler assembler-with-cpp)' - \
'c[-1,-o]' -f - \
'C[-1,-i(nclude|macros)]' -/g '*.h' - \
'C[-1,-i(dirafter|prefix)]' -/ - \
's[-B][-I][-L]' -/ - \
's[-fno-],s[-f]' -k '(all-virtual cond-mismatch dollars-in-identifiers
enum-int-equiv external-templates asm builtin strict-prototype
signed-bitfields signd-char this-is-variable unsigned-bitfields
unsigned-char writable-strings syntax-only pretend-float caller-saves
cse-follow-jumps cse-skip-blocks delayed-branch elide-constructors
expensive-optimizations fast-math float-store force-addr force-mem
inline-functions keep-inline-functions memoize-lookups default-inline
defer-pop function-cse inline peephole omit-frame-pointer
rerun-cse-after-loop schedule-insns schedule-insns2 strength-reduce
thread-jumps unroll-all-loops unroll-loops)' - \
's[-g]' -k '(coff xcoff xcoff+ dwarf dwarf+ stabs stabs+ gdb)' - \
's[-mno-][-mno][-m]' -k '(486 soft-float fp-ret-in-387)' - \
's[-Wno-][-W]' -k '(all aggregate-return cast-align cast-qual
char-subscript comment conversion enum-clash error format id-clash-6
implicit inline missing-prototypes missing-declarations nested-externs
import parentheses pointer-arith redundant-decls return-type shadow
strict-prototypes switch template-debugging traditional trigraphs
uninitialized unused write-strings)' - \
's[-]' -k '(pipe ansi traditional traditional-cpp trigraphs pedantic
pedantic-errors nostartfiles nostdlib static shared symbolic include
imacros idirafter iprefix iwithprefix nostdinc nostdinc++ undef)' \
-X 'Use "-f", "-g", "-m" or "-W" for more options' -- gcc g++
#------------------------------------------------------------------------------
# There are (at least) two ways to complete manual pages. This one is
# extremely memory expensive if you have lots of man pages
man_var() {
man_pages=( ${^manpath}/man*/*(N:t:r) )
compctl -k man_pages -x 'C[-1,-P]' -m - \
'R[-*l*,;]' -/g '*.(man|[0-9](|[a-z]))' -- man
reply=( $man_pages )
}
compctl -K man_var -x 'C[-1,-P]' -m - \
'R[-*l*,;]' -/g '*.(man|[0-9](|[a-z]))' -- man
# This one isn't that expensive but somewhat slower
man_glob () {
local a
read -cA a
if [[ $a[2] = -s ]] then # Or [[ $a[2] = [0-9]* ]] for BSD
reply=( ${^manpath}/man$a[3]/$1*$2(N:t:r) )
else
reply=( ${^manpath}/man*/$1*$2(N:t:r) )
fi
}
#compctl -K man_glob -x 'C[-1,-P]' -m - \
# 'R[-*l*,;]' -/g '*.(man|[0-9nlpo](|[a-z]))' -- man
#------------------------------------------------------------------------------
# xsetroot: gets possible colours, cursors and bitmaps from wherever.
# Uses two auxiliary functions. You might need to change the path names.
Xcolours() {
reply=( ${(L)$(awk '{ if (NF = 4) print $4 }' \
< /usr/openwin/lib/X11/rgb.txt)} )
}
Xcursor() {
reply=( $(sed -n 's/^#define[ ][ ]*XC_\([^ ]*\)[ ].*$/\1/p' \
< /usr/include/X11/cursorfont.h) )
}
compctl -k '(-help -def -display -cursor -cursor_name -bitmap -mod -fg -bg
-grey -rv -solid -name)' -x \
'c[-1,-display]' -s '$DISPLAY' -k hosts -S ':0' - \
'c[-1,-cursor]' -f - 'c[-2,-cursor]' -f - \
'c[-1,-bitmap]' -g '/usr/include/X11/bitmaps/*' - \
'c[-1,-cursor_name]' -K Xcursor - \
'C[-1,-(solid|fg|bg)]' -K Xcolours -- xsetroot
#------------------------------------------------------------------------------
# dd
compctl -k '(if of conv ibs obs bs cbs files skip file seek count)' \
-S '=' -x 's[if=], s[of=]' -f - 'C[0,conv=*,*] n[-1,,], s[conv=]' \
-k '(ascii ebcdic ibm block unblock lcase ucase swap noerror sync)' \
-q -S ',' - 'n[-1,=]' -X '<number>' -- dd
#------------------------------------------------------------------------------
# Various MH completions by Peter Stephenson
# You may need to edit where it says *Edit Me*.
# The following three functions are best autoloaded.
# mhcomp completes folders (including subfolders),
# mhfseq completes sequence names and message numbers,
# mhfile completes files in standard MH locations.
function mhcomp {
# Completion function for MH folders.
# Works with both + (rel. to top) and @ (rel. to current).
local nword args pref char mhpath
read -nc nword
read -cA args
pref=$args[$nword]
char=$pref[1]
pref=$pref[2,-1]
# The $(...) here accounts for most of the time spent in this function.
if [[ $char = + ]]; then
# mhpath=$(mhpath +)
# *Edit Me*: use a hard wired value here: it's faster.
mhpath=~/Mail
elif [[ $char = @ ]]; then
mhpath=$(mhpath)
fi
eval "reply=($mhpath/$pref*(N-/))"
# I'm frankly amazed that this next step works, but it does.
reply=(${reply#$mhpath/})
}
mhfseq() {
# Extract MH message names and numbers for completion. Use of the
# correct folder, if it is not the current one, requires that it
# should be the previous command line argument. If the previous
# argument is `-draftmessage', a hard wired draft folder name is used.
local folder foldpath words pos nums
read -cA words
read -cn pos
# Look for a folder name.
# First try the previous word.
if [[ $words[$pos-1] = [@+]* ]]; then
folder=$words[$pos-1]
# Next look and see if we're looking for a draftmessage
elif [[ $words[$pos-1] = -draftmessage ]]; then
# *Edit Me*: shortcut -- hard-wire draftfolder here
# Should really look for a +draftfolder argument.
folder=+drafts
fi
# Else use the current folder ($folder empty)
if [[ $folder = +* ]]; then
# *Edit Me*: use hard-wired path with + for speed.
foldpath=~/Mail/$folder[2,-1]
else
foldpath=$(mhpath $folder)
fi
# Extract all existing message numbers from the folder.
nums=($foldpath/<->(N:t))
# If that worked, look for marked sequences.
# *Edit Me*: if you never use non-standard sequences, comment out
# or delete the next three lines.
if (( $#nums )); then
nums=($nums $(mark $folder | awk -F: '{print $1}'))
fi
# *Edit Me*: `unseen' is the value of Unseen-Sequence, if it exists;
set -A reply next cur prev first last all unseen $nums
}
mhfile () {
# Find an MH file; for use with -form arguments and the like.
# Use with compctl -K mhfile.
local mhfpath file
# *Edit Me*: Array containing all the places MH will look for templates etc.
mhfpath=(~/Mail /usr/local/lib/MH)
# Emulate completeinword behaviour as appropriate
local wordstr
if [[ -o completeinword ]]; then
wordstr='$1*$2'
else
wordstr='$1$2*'
fi
if [[ $1$2 = */* ]]; then
# path given: don't search MH locations
eval "reply=($wordstr(.N))"
else
# no path: only search MH locations.
eval "reply=(\$mhfpath/$wordstr(.N:t))"
fi
}
# Note: you must type the initial + or @ of a folder name to get
# completion, even in places where only folder names are allowed.
# Abbreviations for options are not recognised. Hit tab to complete
# the option name first.
compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \
's[-]' -k "(all fast nofast header noheader help list nolist \
pack nopack pop push recurse norecurse total nototal)" -- folder
compctl -K mhfseq -x 's[+][@],c[-1,-draftfolder] s[+][@]' \
-K mhcomp -S / -q - 'c[-1,-draftmessage]' -K mhfseq - \
'C[-1,-(editor|whatnowproc)]' -c - \
's[-]' -k "(draftfolder draftmessage nodraftfolder editor noedit \
file form use nouse whatnowproc nowhatnowproc help)" - \
'c[-1,-form]' -K mhfile -- comp
compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \
's[-]' -k "(audit noaudit changecur nochangecur form format \
file silent nosilent truncate notruncate width help)" - \
'C[-1,-(audit|form)]' -K mhfile - 'c[-1,-file]' -f + -- inc
compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \
's[-]' -k "(sequence add delete list public nopublic zero nozero help)" -- \
mark
compctl -K mhfseq -x 's[+][@]' \
-K mhcomp -S / -q - 'c[-1,-file]' -f - 'c[-1,-rmmprov]' -c - \
's[-]' -k "(draft link nolink preserve nopreserve src file \
rmmproc normmproc help)" -- refile
compctl -K mhfseq -x 's[+][@]' \
-K mhcomp -S / -q - 'c[-1,-draftmessage]' -K mhfseq -\
's[-]' -k "(annotate noannotate cc nocc draftfolder nodraftfolder \
draftmessage editor noedit fcc filter form inplace noinplace query \
noquery width whatnowproc nowhatnowproc help)" - 'c[-1,(cc|nocc)]' \
-k "(all to cc me)" - 'C[-1,-(filter|form)]' -K mhfile - \
'C[-1,-(editor|whatnowproc)]' -c -- repl
compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \
's[-]' -k "(clear noclear form format header noheader reverse noreverse \
file help width)" - 'c[-1,-file]' -f - 'c[-1,-form]' -K mhfile -- scan
compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \
's[-]' -k "(draft form moreproc nomoreproc header noheader \
showproc noshowproc length width help)" - 'C[-1,-(show|more)proc]' -c - \
'c[-1,-file]' -f - 'c[-1,-form]' -K mhfile - \
'c[-1,-length]' -s '$LINES' - 'c[-1,-width]' -s '$COLUMNS' -- show next prev
compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - 's[-]' \
-k "(help)" -- rmm
compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - \
's[-]' -k "(after before cc date datefield from help list nolist \
public nopublic search sequence subject to zero nozero not or and \
lbrace rbrace)" -- pick
compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - 's[-]' \
-k "(alias check draft draftfolder draftmessage help nocheck \
nodraftfolder)" -- whom
compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - 's[-]' \
-k "(file part type list headers noheaders realsize norealsize nolist \
show serialonly noserialonly form pause nopause noshow store auto noauto \
nostore cache nocache rcache wcache check nocheck ebcdicsafe noebcdicsafe \
rfc934mode norfc934mode verbose noverbose help)" - \
'c[-1,-file]' -f - 'c[-1,-form]' -K mhfile - \
'C[-1,-[rw]cache]' -k '(public private never ask)' -- mhn
compctl -K mhfseq -x 's[+][@]' -K mhcomp -S / -q - 's[-]' -k '(help)' -- mhpath
#------------------------------------------------------------------------------
# CVS
#
cvscmds=(add admin rcs checkout commit diff rdiff export history import log rlog
release remove status tag rtag update annotate)
cvsignore="*~ *# .#* *.o *.a CVS . .."
compctl -k cvscmds \
-x "c[-1,-D]" -k '(today yesterday 1\ week\ ago)' \
- "c[-1,-m]" -k '(bugfix cosmetic\ fix ... added\ functionality foo)' \
- "c[-1,-F]" -f \
- "c[-1,-r]" -K cvsrevisions \
- "c[-1,-I]" -f \
- "R[add,;]" -K cvsaddp \
- "R[(admin|rcs),;]" -/K cvstargets \
- "R[(checkout|co),;]" -K cvsrepositories \
- "R[(commit|ci),;]" -/K cvstargets \
- "R[(r|)diff,;]" -/K cvstargets \
- "R[export,;]" -f \
- "R[history,;]" -/K cvstargets \
- "R[history,;] c[-1,-u]" -u \
- "R[import,;]" -K cvsrepositories \
- "R[(r|)log,;]" -/K cvstargets \
- 'R[(r|)log,;] s[-w] n[-1,,],s[-w]' -u -S , -q \
- "R[rel(|ease),;]" -f \
- "R[(remove|rm),;] R[-f,;]" -/K cvstargets \
- "R[(remove|rm),;]" -K cvsremovep \
- "R[status,;]" -/K cvstargets \
- "R[(r|)tag,;]" -/K cvstargets \
- "R[up(|date),;]" -/K cvstargets \
- "R[annotate,;]" -/K cvstargets \
-- cvs
compctl -/K cvstargets cvstest
cvsprefix() {
local nword args f
read -nc nword; read -Ac args
pref=$args[$nword]
if [[ -d $pref:h && ! -d $pref ]]; then
pref=$pref:h
elif [[ $pref != */* ]]; then
pref=
fi
[[ -n "$pref" && "$pref" != */ ]] && pref=$pref/
}
cvsentries() {
setopt localoptions nullglob unset
if [[ -f ${pref}CVS/Entries ]]; then
reply=( "${pref}${^${${${(f@)$(<${pref}CVS/Entries)}:#D*}#/}%%/*}" )
fi
}
cvstargets() {
local pref
cvsprefix
cvsentries
}
cvsrevisions() {
reply=( "${${${(M)${(f)$(cvs -q status -vl .)}:# *}##[ ]##}%%[ ]*}" )
}
cvsrepositories() {
local root=$CVSROOT
[[ -f CVS/Root ]] && root=$(<CVS/Root)
reply=(
$root/^CVSROOT(:t)
"${${(M)${(f)$(<$root/CVSROOT/modules)}:#[^#]*}%%[ ]*}"
)
}
cvsremovep() {
local pref
cvsprefix
cvsentries
setopt localoptions unset
local omit
omit=( ${pref}*(D) )
eval 'reply=( ${reply:#('${(j:|:)omit}')} )'
}
cvsaddp() {
local pref
cvsprefix
cvsentries
setopt localoptions unset
local all omit
all=( ${pref}*(D) )
omit=( $reply ${pref}${^${=cvsignore}} )
[[ -r ~/.cvsignore ]] && omit=( $omit ${pref}${^$(<~/.cvsignore)} )
[[ -r ${pref}.cvsignore ]] && omit=( $omit ${pref}${^$(<${pref}.cvsignore)} )
eval 'reply=( ${all:#('${(j:|:)omit}')} )'
}
#------------------------------------------------------------------------------
# RedHat Linux rpm utility
#
compctl -s '$(rpm -qa)' \
-x 's[--]' -s 'oldpackage percent replacefiles replacepkgs noscripts
root excludedocs includedocs test upgrade test clean
short-circuit sign recompile rebuild resign querytags
queryformat version help quiet rcfile force hash' - \
's[ftp:]' -P '//' -s '$(</u/zsh/ftphosts)' -S '/' - \
'c[-1,--root]' -/ - \
'c[-1,--rcfile]' -f - \
'p[1] s[-b]' -k '(p l c i b a)' - \
'c[-1,--queryformat] N[-1,{]' \
-s '"${${(f)$(rpm --querytags)}#RPMTAG_}"' -S '}' - \
'W[1,-q*] C[-1,-([^-]*|)f*]' -f - \
'W[1,-i*], W[1,-q*] C[-1,-([^-]*|)p*]' \
-/g '*.rpm' + -f -- rpm
#------------------------------------------------------------------------------
compctl -u -x 'c[-1,-w]' -f -- ac
compctl -/g '*.m(.)' mira
#------------------------------------------------------------------------------
# talk completion: complete local users, or users at hosts listed via rwho
compctl -K talkmatch talk ytalk ytalk3
function talkmatch {
local u
reply=($(users))
for u in "${${(f)$(rwho 2>/dev/null)}%%:*}"; do
reply=($reply ${u%% *}@${u##* })
done
}
#------------------------------------------------------------------------------
# Linux mount
comp_fsmount () {
local tmp; if [[ $UID = 0 ]]; then tmp=""; else tmp="user"; fi
sed -n -e "s|^[^# ][^ ]*[ ][ ]*\(/[^ ]*\)[ ].*$tmp.*|\1|p" /etc/fstab
}
comp_nfsmount () {
local cmd args host
read -Ac cmd; read -cn where
host=${${cmd[$where]}%%:*}
reply=("${(@f)$(showmount -e $host | sed -n -e "s|^/\([^ ]*\) .*|$host:/\1|p")}")
}
compctl -s '$(mount | \
sed -e "s/^[^ ]* on \\([^ ]*\\) type.*/\\1/"'"$(
if [[ ! $UID = 0 ]]; then
echo ' | egrep "^${(j:|:)$(comp_fsmount)}\$"'
fi)"')' umount
compctl -s '$(comp_fsmount)' + \
-x 'S[/]' -f -- + \
-x 'C[0,*:*]' -K comp_nfsmount -- + \
-s '$(< /etc/hosts)' \
mount
#------------------------------------------------------------------------------
# Lynx (web browser)
compctl -k '(http:// file: ftp:// gopher:// news://)' -S '' \
-x 's[ftp://]' -k ftphosts -S/ \
- 'n[1,://]' -k hosts -S/ \
- 's[file:/]' -/g '*.html' -W/ \
- 's[file:]' -s '~+' -S '/' \
- 's[-]' -k '(anonymous auth base book buried_news cache case
cfg child cookies crawl display dump editor emacskeys
enable_scrollback error_file fileversions force_html
from ftp get_data head help historical homepage
image_links index link localhost locexec mime_header
minimal newschunksize newsmaxchunk nobrowse noexec
nofilereferer nofilereferer nolist nolog nopause
noprint noredir noreferer nosocks nostatus number_links
popup post_data print pseudo_inlines raw realm reload
restrictions resubmit_posts rlogin selective show_cursor
source startfile_ok telnet term trace traversal underscore
validate version vikeys)' \
-- lynx
#------------------------------------------------------------------------------
# ssh (secure shell)
compctl -k hosts \
-x "c[-1,-l]" -u \
- "c[-1,-i]" -f \
- "c[-1,-e]" -k "(~ none)" \
- "c[-1,-c]" -k "(idea des 3des tss arcfour none)" \
- "c[-1,-p]" -k ports \
- "c[-1,-L] c[-1,-R] c[-1,-o]" -k "()" \
-- ssh
#------------------------------------------------------------------------------
# network stuff
compctl -k hosts \
-x "s[-class=]" -k "(any in chaos hesiod)" \
- "s[-query=]" -k "(a cname hinfo md mx mb mg minfo ns ptr soa txt uinfo wks any)" \
- "s[-]" -Q -S '' -k "(query= all\ class= d2\ nod2\ debug\ nodebug\ defname\ nodefname\ domain= ignoretc\ noignoretc\ )" \
-- nslookup
compctl -k hosts \
-x "C[-1,[^-]*] p[2,-1]" -k ports \
-- telnet
compctl -x 'N[-1,@]' -k hosts - 's[]' -u -qS '@' -- finger
#------------------------------------------------------------------------------
# gdb
compctl -/g "*(*)" \
-x "s[-]" -k "(help nx q batch cd f b tty exec se core symbols c x d)" \
- "C[-1,(-cd|-directory)]" -/ \
- "C[-1,(-core|-c)]" -/g 'core*' \
- "C[-1,(-se|-exec)]" -f \
- "C[-1,(-symbols|-command|-x)]" -f \
- "p[2,-1] C[-1,[^-]*]" -/g "core*" \
-- gdb

Some files were not shown because too many files have changed in this diff Show more