Sophie

Sophie

distrib > Mandriva > 8.1 > i586 > by-pkgid > 628e26a49117deea42e952d5b0d0f0d7 > files > 51

zsh-doc-4.0.2-2mdk.i586.rpm

<HTML>
<HEAD>
<!-- Created by texi2html 1.56k from ./zsh.texi on 26 June 2001 -->

<TITLE>zsh - Shell Builtin Commands</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="zsh_1.html">first</A>, <A HREF="zsh_15.html">previous</A>, <A HREF="zsh_17.html">next</A>, <A HREF="zsh_29.html">last</A> section, <A HREF="zsh_toc.html">table of contents</A>.
<P><HR><P>


<H1><A NAME="SEC83" HREF="zsh_toc.html#TOC83">Shell Builtin Commands</A></H1>
<P>
<A NAME="IDX642"></A>
<A NAME="IDX643"></A>
<DL COMPACT>

<DT><TT>-</TT> <VAR>simple command</VAR>
<DD>
<A NAME="IDX644"></A>
 
See section <A HREF="zsh_5.html#SEC20">Precommand Modifiers</A>.

<A NAME="IDX645"></A>
<DT><TT>.</TT> <VAR>file</VAR> [ <VAR>arg</VAR> ... ]
<DD>
Read commands from <VAR>file</VAR> and execute them in the current shell
environment.

If <VAR>file</VAR> does not contain a slash, or if <TT>PATH_DIRS</TT> is set,
the shell looks in the components of <TT>$path</TT> to find the directory
containing <VAR>file</VAR>.  Files in the current directory are not read
unless `<TT>.</TT>' appears somewhere in <TT>$path</TT>.  If a file named
`<VAR>file</VAR><TT>.zwc</TT>' is found, is newer than <VAR>file</VAR>, and is the
compiled form (created with the <TT>zcompile</TT> builtin) of <VAR>file</VAR>,
then commands are read from that file instead of <VAR>file</VAR>.

If any arguments <VAR>arg</VAR> are given,
they become the positional parameters; the old positional
parameters are restored when the <VAR>file</VAR> is done executing.
The exit status is the exit status of the last command executed.

<A NAME="IDX646"></A>
<A NAME="IDX647"></A>
<A NAME="IDX648"></A>
<A NAME="IDX649"></A>
<DT><TT>:</TT> [ <VAR>arg</VAR> ... ]
<DD>
This command does nothing, although normal argument expansions is performed
which may have effects on shell parameters.  A zero exit code is returned.

<A NAME="IDX650"></A>
<A NAME="IDX651"></A>
<A NAME="IDX652"></A>
<DT><TT>alias</TT> [ {<TT>+|<TT>-</TT></TT>}<TT>gmrL</TT> ] [ <VAR>name</VAR>[<TT>=</TT><VAR>value</VAR>] ... ]
<DD>
For each <VAR>name</VAR> with a corresponding <VAR>value</VAR>, define an alias
with that value.  A trailing space in <VAR>value</VAR> causes the next word
to be checked for alias expansion.  If the <TT>-g</TT> flag is present,
define a global alias; global aliases are expanded even if they do not
occur in command position.

For each <VAR>name</VAR> with no <VAR>value</VAR>,
print the value of <VAR>name</VAR>, if any.  With no arguments, print all
currently defined aliases.  If the <TT>-m</TT> flag is given the arguments
are taken as patterns (they should be quoted to preserve them from being
interpreted as glob patterns), and the aliases matching these patterns
are printed.  When printing aliases and the <TT>-g</TT> or <TT>-r</TT> flags
are present, then restrict the printing to global or regular
aliases, respectively.  Using `<TT>+</TT>' instead of `<TT>-</TT>', or ending
the option list with a single `<TT>+</TT>', prevents the values of the
aliases from being printed.

If the <TT>-L</TT> flag is present, then print each
alias in a manner suitable for putting in a startup script.  The exit
status is nonzero if a <VAR>name</VAR> (with no <VAR>value</VAR>) is given for
which no alias has been defined.

<A NAME="IDX653"></A>
<A NAME="IDX654"></A>
<A NAME="IDX655"></A>
<DT><TT>autoload</TT> [ {<TT>+</TT>|<TT>-</TT>}<TT>UXmt</TT> ] [ <TT>-wkz</TT> ] [ <VAR>name</VAR> ... ]
<DD>
Equivalent to <TT>functions -u</TT>, with the exception of <TT>-X</TT>/<TT>+X</TT>,
<TT>-w</TT>, <TT>-k</TT> and <TT>-z</TT>.

The flag <TT>-X</TT> may be used only inside a shell function, and may not be
followed by a <VAR>name</VAR>.  It causes the calling function to be marked for
autoloading and then immediately loaded and executed, with the current
array of positional parameters as arguments.  This replaces the previous
definition of the function.  If no function definition is found, an error
is printed and the function remains undefined and marked for autoloading.

The flag <TT>+X</TT> attempts to load each <VAR>name</VAR> as an autoloaded function,
but does <EM>not</EM> execute it.  The exit status is zero (success) if the
function was not previously defined <EM>and</EM> a definition for it was found.
This does <EM>not</EM> replace any existing definition of the function.  The
exit status is nonzero (failure) if the function was already defined or
when no definition was found.  In the latter case the function remains
undefined and marked for autoloading.

The flag <TT>+X</TT> may be combined with either <TT>-k</TT> or <TT>-z</TT> to make
the function be loaded using ksh-style or zsh-style autoloading,
respectively. If neither is given, the current setting of the
<TT>KSH_AUTOLOAD</TT> options determines how the function is loaded. With
ksh-style autoloading, the contents of the file will not be executed
immediately. Instead, the function created will contain the contents of 
the file plus a call to the function itself appended to it, thus given 
normal ksh autoloading behaviour on the first call to the function.

With the <TT>-w</TT> flag, the <VAR>name</VAR>s are taken as names of files compiled
with the <TT>zcompile</TT> builtin, and all functions defined in them are
marked for autoloading.

<A NAME="IDX656"></A>
<A NAME="IDX657"></A>
<DT><TT>bg</TT> [ <VAR>job</VAR> ... ]
<DD>
<DT><VAR>job</VAR> ... <TT>&#38;</TT>
<DD>
Put each specified <VAR>job</VAR> in the background,
or the current job if none is specified.

<DT><TT>bindkey</TT>
<DD>
See section <A HREF="zsh_21.html#SEC157">The zsh/zle Module</A>.

<A NAME="IDX658"></A>
<A NAME="IDX659"></A>
<A NAME="IDX660"></A>
<DT><TT>break</TT> [ <VAR>n</VAR> ]
<DD>
Exit from an enclosing <TT>for</TT>, <TT>while</TT>,
<TT>until</TT>, <TT>select</TT> or <TT>repeat</TT> loop.  If <VAR>n</VAR>
is specified, then break <VAR>n</VAR> levels instead of just one.

<A NAME="IDX661"></A>
<DT><TT>builtin</TT> <VAR>name</VAR> [ <VAR>args</VAR> ... ]
<DD>
Executes the builtin <VAR>name</VAR>, with the given <VAR>args</VAR>.

<A NAME="IDX662"></A>
<DT><TT>bye</TT>
<DD>
Same as <TT>exit</TT>.

<DT><TT>cap</TT>
<DD>
See section <A HREF="zsh_21.html#SEC132">The zsh/cap Module</A>.

<A NAME="IDX663"></A>
<A NAME="IDX664"></A>
<DT><TT>cd</TT> [ <TT>-sLP</TT> ] [ <VAR>arg</VAR> ]
<DD>
<DT><TT>cd</TT> [ <TT>-sLP</TT> ] <VAR>old</VAR> <VAR>new</VAR>
<DD>
<DT><TT>cd</TT> [ <TT>-sLP</TT> ] {<TT>+</TT>|<TT>-</TT>}<VAR>n</VAR>
<DD>
Change the current directory.  In the first form, change the
current directory to <VAR>arg</VAR>, or to the value of <TT>$HOME</TT> if
<VAR>arg</VAR> is not specified.  If <VAR>arg</VAR> is `<TT>-</TT>', change to the
value of <TT>$OLDPWD</TT>, the previous directory.
Otherwise, if a directory named <VAR>arg</VAR> is not found in the current
directory and <VAR>arg</VAR> does not begin with a slash, search each
component of the shell parameter <TT>cdpath</TT>.  If no directory is found
and the option <TT>CDABLE_VARS</TT> is set, and a parameter named <VAR>arg</VAR>
exists whose value begins with a slash, treat its value as the
directory.  In that case, the parameter is added to the named
directory hash table.

The second form of <TT>cd</TT> substitutes the string <VAR>new</VAR>
for the string <VAR>old</VAR> in the name of the current directory,
and tries to change to this new directory.

The third form of <TT>cd</TT> extracts an entry from the directory
stack, and changes to that directory.  An argument of the form
`<TT>+</TT><VAR>n</VAR>' identifies a stack entry by counting from the left
of the list shown by the <TT>dirs</TT> command, starting with zero.
An argument of the form `<TT>-</TT><VAR>n</VAR>' counts from the right.
If the <TT>PUSHD_MINUS</TT> option is set, the meanings of `<TT>+</TT>'
and `<TT>-</TT>' in this context are swapped.

If the <TT>-s</TT> option is specified, <TT>cd</TT> refuses to change the current
directory if the given pathname contains symlinks.  If the <TT>-P</TT> option
is given or the <TT>CHASE_LINKS</TT> option is set, symbolic links are resolved
to their true values.  If the <TT>-L</TT> option is given symbolic links are
followed regardless of the state of the <TT>CHASE_LINKS</TT> option.

<A NAME="IDX665"></A>
<DT><TT>chdir</TT>
<DD>
Same as <TT>cd</TT>.

<DT><TT>clone</TT>
<DD>
See section <A HREF="zsh_21.html#SEC133">The zsh/clone Module</A>.

<A NAME="IDX666"></A>
<DT><TT>command</TT> <VAR>simple command</VAR>
<DD>
See section <A HREF="zsh_5.html#SEC20">Precommand Modifiers</A>.

<DT><TT>comparguments</TT>
<DD>
See section <A HREF="zsh_21.html#SEC140">The zsh/computil Module</A>.

<DT><TT>compcall</TT>
<DD>
See section <A HREF="zsh_21.html#SEC134">The zsh/compctl Module</A>.

<DT><TT>compctl</TT>
<DD>
See section <A HREF="zsh_21.html#SEC134">The zsh/compctl Module</A>.

<DT><TT>compdescribe</TT>
<DD>
See section <A HREF="zsh_21.html#SEC140">The zsh/computil Module</A>.

<DT><TT>compfiles</TT>
<DD>
See section <A HREF="zsh_21.html#SEC140">The zsh/computil Module</A>.

<DT><TT>compgroups</TT>
<DD>
See section <A HREF="zsh_21.html#SEC140">The zsh/computil Module</A>.

<DT><TT>compquote</TT>
<DD>
See section <A HREF="zsh_21.html#SEC140">The zsh/computil Module</A>.

<DT><TT>comptags</TT>
<DD>
See section <A HREF="zsh_21.html#SEC140">The zsh/computil Module</A>.

<DT><TT>comptry</TT>
<DD>
See section <A HREF="zsh_21.html#SEC140">The zsh/computil Module</A>.

<DT><TT>compvalues</TT>
<DD>
See section <A HREF="zsh_21.html#SEC140">The zsh/computil Module</A>.

<A NAME="IDX667"></A>
<A NAME="IDX668"></A>
<A NAME="IDX669"></A>
<DT><TT>continue</TT> [ <VAR>n</VAR> ]
<DD>
Resume the next iteration of the enclosing
<TT>for</TT>, <TT>while</TT>, <TT>until</TT>, <TT>select</TT> or
<TT>repeat</TT> loop.  If <VAR>n</VAR> is specified, break out of
<VAR>n</VAR>-1 loops and resume at the <VAR>n</VAR>th enclosing loop.

<A NAME="IDX670"></A>
<DT><TT>declare</TT>
<DD>
Same as <TT>typeset</TT>.

<A NAME="IDX671"></A>
<A NAME="IDX672"></A>
<DT><TT>dirs</TT> [ <TT>-v</TT> ] [ <VAR>arg</VAR> ... ]
<DD>
With no arguments, print the contents of the directory stack.
If the <TT>-v</TT> option is given, number the directories
in the stack when printing.
Directories are added to this stack with the <TT>pushd</TT> command,
and removed with the <TT>cd</TT> or <TT>popd</TT> commands.
If arguments are specified, load them onto the directory stack,
replacing anything that was there, and push the current directory
onto the stack.

<A NAME="IDX673"></A>
<A NAME="IDX674"></A>
<A NAME="IDX675"></A>
<DT><TT>disable</TT> [ <TT>-afmr</TT> ] <VAR>name</VAR> ...
<DD>
Temporarily disable the <VAR>name</VAR>d hash table elements.  The default
is to disable builtin commands.  This allows you to use an external
command with the same name as a builtin command.  The <TT>-a</TT> option
causes <TT>disable</TT> to act on aliases.  The <TT>-f</TT> option causes
<TT>disable</TT> to act on shell functions.  The <TT>-r</TT> options causes
<TT>disable</TT> to act on reserved words.  Without arguments all disabled
hash table elements from the corresponding hash table are printed.
With the <TT>-m</TT> flag the arguments are taken as patterns (which should be
quoted to prevent them from undergoing filename expansion), and all hash
table elements from the corresponding hash table matching these patterns
are disabled.  Disabled objects can be enabled with the <TT>enable</TT>
command.

<A NAME="IDX676"></A>
<A NAME="IDX677"></A>
<DT><TT>disown</TT> [ <VAR>job</VAR> ... ]
<DD>
<DT><VAR>job</VAR> ... <TT>&#38;|</TT>
<DD>
<DT><VAR>job</VAR> ... <TT>&#38;!</TT>
<DD>
Remove the specified <VAR>job</VAR>s from the job table; the shell will
no longer report their status, and will not complain if you
try to exit an interactive shell with them running or stopped.
If no <VAR>job</VAR> is specified, disown the current job.

<A NAME="IDX678"></A>
<DT><TT>echo</TT> [ <TT>-neE</TT> ] [ <VAR>arg</VAR> ... ]
<DD>
Write each <VAR>arg</VAR> on the standard output, with a space separating
each one.
If the <TT>-n</TT> flag is not present, print a newline at the end.
<TT>echo</TT> recognizes the following escape sequences:

<DL COMPACT>

<DT><TT>\a</TT>
<DD>
bell character
<DT><TT>\b</TT>
<DD>
backspace
<DT><TT>\c</TT>
<DD>
suppress final newline
<DT><TT>\e</TT>
<DD>
escape
<DT><TT>\f</TT>
<DD>
form feed
<DT><TT>\n</TT>
<DD>
linefeed (newline)
<DT><TT>\r</TT>
<DD>
carriage return
<DT><TT>\t</TT>
<DD>
horizontal tab
<DT><TT>\v</TT>
<DD>
vertical tab
<DT><TT>\\</TT>
<DD>
backslash
<DT><TT>\0</TT><VAR>NNN</VAR>
<DD>
character code in octal
<DT><TT>\x</TT><VAR>NN</VAR>
<DD>
character code in hexadecimal
</DL>

<A NAME="IDX679"></A>
The <TT>-E</TT> flag, or the <TT>BSD_ECHO</TT> option, can be used to disable
these escape sequences.  In the latter case, <TT>-e</TT> flag can be used to
enable them.

<DT><TT>echotc</TT>
<DD>
See section <A HREF="zsh_21.html#SEC150">The zsh/termcap Module</A>.

<DT><TT>echoti</TT>
<DD>
See section <A HREF="zsh_21.html#SEC151">The zsh/terminfo Module</A>.

<A NAME="IDX680"></A>
<A NAME="IDX681"></A>
<A NAME="IDX682"></A>
<A NAME="IDX683"></A>
<A NAME="IDX684"></A>
<A NAME="IDX685"></A>
<A NAME="IDX686"></A>
<DT><TT>emulate</TT> [ <TT>-LR</TT> ] {<TT>zsh</TT>|<TT>sh</TT>|<TT>ksh</TT>|<TT>csh</TT>}
<DD>
Set up zsh options to emulate the specified shell as much as possible.
<CITE>csh</CITE> will never be fully emulated.
If the argument is not one of the shells listed above, <TT>zsh</TT>
will be used as a default; more precisely, the tests performed on the
argument are the same as those used to determine the emulation at startup
based on the shell name, see
section <A HREF="zsh_3.html#SEC13">Compatibility</A>
.  If the <TT>-R</TT> option is given, all options
are reset to their default value corresponding to the specified emulation
mode, except for certain options describing the interactive
environment; otherwise, only those options likely to cause portability
problems in scripts and functions are altered.  If the <TT>-L</TT> option
is given, the options <TT>LOCAL_OPTIONS</TT> and <TT>LOCAL_TRAPS</TT> will be set as
well, causing the effects of the <TT>emulate</TT> command and any <TT>setopt</TT> and
<TT>trap</TT> commands to be local to the immediately surrounding shell
function, if any; normally these options are turned off in all emulation
modes except <TT>ksh</TT>.

<A NAME="IDX687"></A>
<A NAME="IDX688"></A>
<A NAME="IDX689"></A>
<DT><TT>enable</TT> [ <TT>-afmr</TT> ] <VAR>name</VAR> ...
<DD>
Enable the <VAR>name</VAR>d hash table elements, presumably disabled
earlier with <TT>disable</TT>.  The default is to enable builtin commands.
The <TT>-a</TT> option causes <TT>enable</TT> to act on aliases.  The <TT>-f</TT>
option causes <TT>enable</TT> to act on shell functions.  The <TT>-r</TT>
option causes <TT>enable</TT> to act on reserved words.  Without arguments
all enabled hash table elements from the corresponding hash table are
printed.  With the <TT>-m</TT> flag the arguments are taken as patterns
(should be quoted) and all hash table elements from the corresponding
hash table matching these patterns are enabled.  Enabled objects can be
disabled with the <TT>disable</TT> builtin command.

<A NAME="IDX690"></A>
<A NAME="IDX691"></A>
<DT><TT>eval</TT> [ <VAR>arg</VAR> ... ]
<DD>
Read the arguments as input to the shell and execute the resulting
command in the current shell process.

<A NAME="IDX692"></A>
<DT><TT>exec</TT> <VAR>simple command</VAR>
<DD>
See section <A HREF="zsh_5.html#SEC20">Precommand Modifiers</A>.

<A NAME="IDX693"></A>
<DT><TT>exit</TT> [ <VAR>n</VAR> ]
<DD>
Exit the shell with the exit code specified by <VAR>n</VAR>; if none
is specified, use the exit code from the last command executed.
<A NAME="IDX694"></A>
An EOF condition will also cause the shell to exit, unless
the <TT>IGNORE_EOF</TT> option is set.

<A NAME="IDX695"></A>
<DT><TT>export</TT> [ <VAR>name</VAR>[<TT>=</TT><VAR>value</VAR>] ... ]
<DD>
The specified <VAR>name</VAR>s are marked for automatic export
to the environment of subsequently executed commands.
Equivalent to <TT>typeset -gx</TT>.
If a parameter specified does not
already exist, it is created in the global scope.

<A NAME="IDX696"></A>
<A NAME="IDX697"></A>
<DT><TT>false</TT> [ <VAR>arg</VAR> ... ]
<DD>
Do nothing and return an exit code of 1.

<A NAME="IDX698"></A>
<A NAME="IDX699"></A>
<A NAME="IDX700"></A>
<DT><TT>fc</TT> [ <TT>-e</TT> <VAR>ename</VAR> ] [ <TT>-nlrdDfEim</TT> ] [ <VAR>old</VAR><TT>=</TT><VAR>new</VAR> ... ] [ <VAR>first</VAR> [ <VAR>last</VAR> ] ]
<DD>
<DT><TT>fc</TT> <TT>-ARWI</TT> [ <VAR>filename</VAR> ]
<DD>
Select a range of commands from <VAR>first</VAR> to <VAR>last</VAR> from the
history list.
The arguments <VAR>first</VAR> and <VAR>last</VAR> may be specified as a
number or as a string.  A negative number is used as an offset
to the current history event number.
A string specifies the most recent event beginning with the given string.
All substitutions <VAR>old</VAR><TT>=</TT><VAR>new</VAR>, if any, are then performed
on the commands.

If the <TT>-l</TT> flag is given, the resulting commands are listed on
standard output.
If the <TT>-m</TT> flag is also given the first argument is taken as a
pattern (should be quoted) and only the history events matching this
pattern will be shown.
Otherwise the editor program <VAR>ename</VAR> is invoked on a file containing
these history events.  If <VAR>ename</VAR> is not given, the value
of the parameter <TT>FCEDIT</TT> is used.  If <VAR>ename</VAR> is `<TT>-</TT>',
no editor is invoked.  When editing is complete, the edited
command is executed.

If <VAR>first</VAR> is not specified, it will be set to -1 (the most recent
event), or to -16 if the <TT>-l</TT> flag is given.
If <VAR>last</VAR> is not specified, it will be set to <VAR>first</VAR>,
or to -1 if the <TT>-l</TT> flag is given.

The flag <TT>-r</TT> reverses the order of the commands and the
flag <TT>-n</TT> suppresses command numbers when listing.
Also when listing, <TT>-d</TT> prints timestamps for each command, and
<TT>-f</TT> prints full time-date stamps.  Adding the <TT>-E</TT> flag
causes the dates to be printed as `<VAR>dd</VAR><TT>.</TT><VAR>mm</VAR><TT>.</TT><VAR>yyyy</VAR>',
instead of the default `<VAR>mm</VAR><TT>/</TT><VAR>dd</VAR><TT>/</TT><VAR>yyyy</VAR>'.
Adding the <TT>-i</TT> flag causes the dates to be printed in ISO8601
`<VAR>yyyy</VAR><TT>-</TT><VAR>mm</VAR><TT>-</TT><VAR>dd</VAR>' format.
With the <TT>-D</TT> flag, <TT>fc</TT> prints elapsed times.

<A NAME="IDX701"></A>
<A NAME="IDX702"></A>
`<TT>fc -R</TT>' reads the history from the given file,
`<TT>fc -W</TT>' writes the history out to the given file,
and `<TT>fc -A</TT>' appends the history out to the given file.
If no filename is specified, the <TT>$HISTFILE</TT> is assumed.
If the <TT>-I</TT> option is added to <TT>-R</TT>, only those events that are
not already contained within the internal history list are added.
If the <TT>-I</TT> option is added to <TT>-A</TT> or <TT>-W</TT>, only those
events that are new since last incremental append/write to
the history file are appended/written.
In any case, the created file will have no more than <TT>$SAVEHIST</TT>
entries.

<A NAME="IDX703"></A>
<A NAME="IDX704"></A>
<A NAME="IDX705"></A>
<DT><TT>fg</TT> [ <VAR>job</VAR> ... ]
<DD>
<DT><VAR>job</VAR> ...
<DD>
Bring each specified <VAR>job</VAR> in turn to the foreground.
If no <VAR>job</VAR> is specified, resume the current job.

<A NAME="IDX706"></A>
<DT><TT>float</TT> [ {<TT>+</TT>|<TT>-</TT>}<TT>EFghlrtux</TT> ] [ <VAR>name</VAR>[<TT>=</TT><VAR>value</VAR>] ... ]
<DD>
Equivalent to <TT>typeset -E</TT>, except that options irrelevant to floating
point numbers are not permitted.

<A NAME="IDX707"></A>
<DT><TT>functions</TT> [ {<TT>+</TT>|<TT>-</TT>}<TT>UXmtu</TT> ] [ <VAR>name</VAR> ... ]
<DD>
Equivalent to <TT>typeset -f</TT>.

<DT><TT>getcap</TT>
<DD>
See section <A HREF="zsh_21.html#SEC132">The zsh/cap Module</A>.

<A NAME="IDX708"></A>
<A NAME="IDX709"></A>
<A NAME="IDX710"></A>
<DT><TT>getln</TT> [ <TT>-AclneE</TT> ] <VAR>name</VAR> ...
<DD>
Read the top value from the buffer stack and put it in
the shell parameter <TT>name</TT>.  Equivalent to
<TT>read -zr</TT>.

<A NAME="IDX711"></A>
<A NAME="IDX712"></A>
<DT><TT>getopts</TT> <VAR>optstring</VAR> <VAR>name</VAR> [ <VAR>arg</VAR> ... ]
<DD>
Checks the <VAR>arg</VAR>s for legal options.  If the <VAR>arg</VAR>s are omitted,
use the positional parameters.  A valid option argument
begins with a `<TT>+</TT>' or a `<TT>-</TT>'.  An argument not beginning with
a `<TT>+</TT>' or a `<TT>-</TT>', or the argument `<TT>--</TT>', ends the options.
<VAR>optstring</VAR> contains the letters that <TT>getopts</TT>
recognizes.  If a letter is followed by a `<TT>:</TT>', that option
is expected to have an argument.  The options can be
separated from the argument by blanks.

Each time it is invoked, <TT>getopts</TT> places the option letter it finds
in the shell parameter <VAR>name</VAR>, prepended with a `<TT>+</TT>' when
<VAR>arg</VAR> begins with a `<TT>+</TT>'.  The index of the next <VAR>arg</VAR>
is stored in <TT>OPTIND</TT>.  The option argument, if any,
is stored in <TT>OPTARG</TT>.
<A NAME="IDX713"></A>
<A NAME="IDX714"></A>

The first option to be examined may be changed by explicitly assigning
to <TT>OPTIND</TT>.  <TT>OPTIND</TT> has an initial value of <TT>1</TT>, and is
normally reset to <TT>1</TT> upon exit from a shell function.  <TT>OPTARG</TT>
is not reset and retains its value from the most recent call to
<TT>getopts</TT>.  If either of <TT>OPTIND</TT> or <TT>OPTARG</TT> is explicitly
unset, it remains unset, and the index or option argument is not
stored.  The option itself is still stored in <VAR>name</VAR> in this case.

A leading `<TT>:</TT>' in <VAR>optstring</VAR> causes <TT>getopts</TT> to store the
letter of any invalid option in <TT>OPTARG</TT>, and to set <VAR>name</VAR> to
`<TT>?</TT>' for an unknown option and to `<TT>:</TT>' when a required option is
missing.  Otherwise, <TT>getopts</TT> sets <VAR>name</VAR> to `<TT>?</TT>' and prints
an error message when an option is invalid.  The exit status is
nonzero when there are no more options.

<A NAME="IDX715"></A>
<DT><TT>hash</TT> [ <TT>-Ldfmrv</TT> ] [ <VAR>name</VAR>[<TT>=</TT><VAR>value</VAR>] ] ...
<DD>
<TT>hash</TT> can be used to directly modify the contents of the command
hash table, and the named directory hash table.  Normally one would
modify these tables by modifying one's <TT>PATH</TT>
(for the command hash table) or by creating appropriate shell parameters
(for the named directory hash table).
The choice of hash table to work on is determined by the <TT>-d</TT> option;
without the option the command hash table is used, and with the option the
named directory hash table is used.

Given no arguments, and neither the <TT>-r</TT> or <TT>-f</TT> options,
the selected hash table will be listed in full.

The <TT>-r</TT> option causes the selected hash table to be emptied.
It will be subsequently rebuilt in the normal fashion.
The <TT>-f</TT> option causes the selected hash table to be fully
rebuilt immediately.  For the command hash table this hashes
all the absolute directories in the <TT>PATH</TT>,
and for the named directory hash table this adds all users' home directories.
These two options cannot be used with any arguments.

The <TT>-m</TT> option causes the arguments to be taken as patterns
(which should be quoted) and the elements of the hash table
matching those patterns are printed.  This is the only way to display
a limited selection of hash table elements.

For each <VAR>name</VAR> with a corresponding <VAR>value</VAR>, put `<VAR>name</VAR>' in
the selected hash table, associating it with the pathname `<VAR>value</VAR>'.
In the command hash table, this means that
whenever `<VAR>name</VAR>' is used as a command argument, the shell will try
to execute the file given by `<VAR>value</VAR>'.
In the named directory hash table, this means
that `<VAR>value</VAR>' may be referred to as `<TT>~</TT><VAR>name</VAR>'.

For each <VAR>name</VAR> with no
corresponding <VAR>value</VAR>, attempt to add <VAR>name</VAR> to the hash table,
checking what the appropriate <TT>value</TT> is in the normal manner for
that hash table.  If an appropriate <TT>value</TT> can't be found, then
the hash table will be unchanged.

The <TT>-v</TT> option causes hash table entries to be listed as they are
added by explicit specification.  If has no effect if used with <TT>-f</TT>.

If the <TT>-L</TT> flag is present, then each hash table entry is printed in
the form of a call to hash.

<A NAME="IDX716"></A>
<DT><TT>history</TT>
<DD>
Same as <TT>fc -l</TT>.

<A NAME="IDX717"></A>
<DT><TT>integer</TT> [ {<TT>+</TT>|<TT>-</TT>}<TT>ghilrtux</TT> ] [ <VAR>name</VAR>[<TT>=</TT><VAR>value</VAR>] ... ]
<DD>
Equivalent to <TT>typeset -i</TT>, except that options irrelevant to
integers are not permitted.

<A NAME="IDX718"></A>
<DT><TT>jobs</TT> [ <TT>-dlprs</TT> ] [ <VAR>job</VAR> ... ]
<DD>
<DT><TT>jobs -Z</TT> <VAR>string</VAR>
<DD>
Lists information about each given job, or all jobs
if <VAR>job</VAR> is omitted.  The <TT>-l</TT> flag lists process
IDs, and the <TT>-p</TT> flag lists process groups.
If the <TT>-r</TT> flag is specified only running jobs will be listed
and if the <TT>-s</TT> flag is given only stopped jobs are shown.
If the <TT>-d</TT> flag is given, the directory from which the job was
started (which may not be the current directory of the job) will also
be shown.

The <TT>-Z</TT> option replaces the shell's argument and environment space with
the given string, truncated if necessary to fit.  This will normally be
visible in <TT>ps</TT> (man page ps(1)) listings.  This feature is typically
used by daemons, to indicate their state.

<A NAME="IDX719"></A>
<A NAME="IDX720"></A>
<A NAME="IDX721"></A>
<DT><TT>kill</TT> [ <TT>-s</TT> <VAR>signal_name</VAR> ] <VAR>job</VAR> ...
<DD>
<DT><TT>kill</TT> [ <TT>-</TT><VAR>sig</VAR> ] <VAR>job</VAR> ...
<DD>
<DT><TT>kill</TT> <TT>-l</TT> [ <VAR>sig</VAR> ... ]
<DD>
Sends either <TT>SIGTERM</TT> or the specified signal to the given
jobs or processes.
Signals are given by number or by names, without the `<TT>SIG</TT>' prefix.
If the signal being sent is not `<TT>KILL</TT>' or `<TT>CONT</TT>', then the job
will be sent a `<TT>CONT</TT>' signal if it is stopped.
The argument <VAR>job</VAR> can be the process ID of a job
not in the job list.
In the third form, <TT>kill -l</TT>, if <VAR>sig</VAR> is not
specified the signal names are listed.  Otherwise, for each
<VAR>sig</VAR> that is a name, the corresponding signal number is
listed.  For each <VAR>sig</VAR> that is a signal number or a number
representing the exit status of a process which was terminated or
stopped by a signal the name of the signal is printed.

<A NAME="IDX722"></A>
<DT><TT>let</TT> <VAR>arg</VAR> ...
<DD>
Evaluate each <VAR>arg</VAR> as an arithmetic expression.
See section <A HREF="zsh_10.html#SEC37">Arithmetic Evaluation</A> for a description
of arithmetic expressions.  The exit status is 0 if the
value of the last expression is nonzero, and 1 otherwise.

<A NAME="IDX723"></A>
<A NAME="IDX724"></A>
<A NAME="IDX725"></A>
<DT><TT>limit</TT> [ <TT>-hs</TT> ] [ <VAR>resource</VAR> [ <VAR>limit</VAR> ] ] ...
<DD>
Set or display resource limits.  Unless the <TT>-s</TT> flag is given,
the limit applies only the children of the shell.  If <TT>-s</TT> is
given without other arguments, the resource limits of the current
shell is set to the previously set resource limits of the children.

If <VAR>limit</VAR> is not specified, print the current limit placed
on <VAR>resource</VAR>, otherwise
set the limit to the specified value.  If the <TT>-h</TT> flag
is given, use hard limits instead of soft limits.
If no <VAR>resource</VAR> is given, print all limits.

<VAR>resource</VAR> can be one of:

<DL COMPACT>

<DT><TT>addressspace</TT>
<DD>
Maximum amount of address space used.
<DT><TT>aiomemorylocked</TT>
<DD>
Maximum amount of memory locked in RAM for AIO operations.
<DT><TT>aiooperations</TT>
<DD>
Maximum number of AIO operations.
<DT><TT>cachedthreads</TT>
<DD>
Maximum number of cached threads.
<DT><TT>coredumpsize</TT>
<DD>
Maximum size of a core dump.
<DT><TT>cputime</TT>
<DD>
Maximum CPU seconds per process.
<DT><TT>datasize</TT>
<DD>
Maximum data size (including stack) for each process.
<DT><TT>descriptors</TT>
<DD>
Maximum value for a file descriptor.
<DT><TT>filesize</TT>
<DD>
Largest single file allowed.
<DT><TT>maxproc</TT>
<DD>
Maximum number of processes.
<DT><TT>maxpthreads</TT>
<DD>
Maximum number of threads per process.
<DT><TT>memorylocked</TT>
<DD>
Maximum amount of memory locked in RAM.
<DT><TT>memoryuse</TT>
<DD>
Maximum resident set size.
<DT><TT>resident</TT>
<DD>
Maximum resident set size.
<DT><TT>sockbufsize</TT>
<DD>
Maximum size of all socket buffers.
<DT><TT>stacksize</TT>
<DD>
Maximum stack size for each process.
<DT><TT>vmemorysize</TT>
<DD>
Maximum amount of virtual memory.
</DL>

Which of these resource limits are available depends on the system.
<VAR>resource</VAR> can be abbreviated to any unambiguous prefix.

<VAR>limit</VAR> is a number, with an optional scaling factor, as follows:

<DL COMPACT>

<DT><VAR>n</VAR><TT>h</TT>
<DD>
hours
<DT><VAR>n</VAR><TT>k</TT>
<DD>
kilobytes (default)
<DT><VAR>n</VAR><TT>m</TT>
<DD>
megabytes or minutes
<DT>[<VAR>mm</VAR><TT>:</TT>]<VAR>ss</VAR>
<DD>
minutes and seconds
</DL>

<A NAME="IDX726"></A>
<DT><TT>local</TT> [ {<TT>+</TT>|<TT>-</TT>}<TT>AEFLRUZahilrtux</TT> [<VAR>n</VAR>]] [ <VAR>name</VAR>[<TT>=</TT><VAR>value</VAR>] ] ...
<DD>
Same as <TT>typeset</TT>, except that the options <TT>-g</TT>, and
<TT>-f</TT> are not permitted.  In this case the <TT>-x</TT> option does not force
the use of <TT>-g</TT>, i.e. exported variables will be local to functions.

<A NAME="IDX727"></A>
<A NAME="IDX728"></A>
<A NAME="IDX729"></A>
<A NAME="IDX730"></A>
<DT><TT>log</TT>
<DD>
List all users currently logged in who are affected by
the current setting of the <TT>watch</TT> parameter.

<A NAME="IDX731"></A>
<DT><TT>logout</TT> [ <VAR>n</VAR> ]
<DD>
Same as <TT>exit</TT>, except that it only works in a login shell.

<A NAME="IDX732"></A>
<DT><TT>noglob</TT> <VAR>simple command</VAR>
<DD>
See section <A HREF="zsh_5.html#SEC20">Precommand Modifiers</A>.

<A NAME="IDX733"></A>
<DT><TT>popd</TT> [ {<TT>+</TT>|<TT>-</TT>}<VAR>n</VAR> ]
<DD>
Remove an entry from the directory stack, and perform a <TT>cd</TT> to
the new top directory.  With no argument, the current top entry is
removed.  An argument of the form `<TT>+</TT><VAR>n</VAR>' identifies a stack
entry by counting from the left of the list shown by the <TT>dirs</TT> command,
starting with zero.  An argument of the form <TT>-n</TT> counts from the right.
<A NAME="IDX734"></A>
If the <TT>PUSHD_MINUS</TT> option is set, the meanings of `<TT>+</TT>' and
`<TT>-</TT>' in this context are swapped.

<A NAME="IDX735"></A>
<DT><TT>print</TT> [ <TT>-bnrslzpNDPoOicm</TT> ] [ <TT>-u</TT><VAR>n</VAR> ] [ <TT>-R</TT> [ <TT>-en</TT> ]] [ <VAR>arg</VAR> ... ]
<DD>
With no flags or with flag `<TT>-</TT>', the arguments are printed on
the standard output as described by <TT>echo</TT>, with the following differences:
the escape sequence `<TT>\M-</TT><VAR>x</VAR>' metafies the character
<VAR>x</VAR> (sets the highest bit),
`<TT>\C-</TT><VAR>x</VAR>' produces a control character (`<TT>\C-@</TT>' and `<TT>\C-?</TT>' give the
characters NUL and delete), and `<TT>\E</TT>' is a synonym for `<TT>\e</TT>'.
Finally, if not in an escape
sequence, `<TT>\</TT>' escapes the following character and is not printed.

<DL COMPACT>

<DT><TT>-r</TT>
<DD>
Ignore the escape conventions of <TT>echo</TT>.

<DT><TT>-R</TT>
<DD>
Emulate the BSD <TT>echo</TT> command, which does not process escape sequences
unless the <TT>-e</TT> flag is given.  The <TT>-n</TT> flag suppresses the trailing
newline.  Only the <TT>-e</TT> and <TT>-n</TT> flags are recognized after
<TT>-R</TT>; all other arguments and options are printed.

<DT><TT>-b</TT>
<DD>
Recognize all the escape sequences defined for the <TT>bindkey</TT> command,
see 
section <A HREF="zsh_21.html#SEC157">The zsh/zle Module</A>.

<DT><TT>-m</TT>
<DD>
Take the first argument as a pattern (should be quoted), and remove
it from the argument list together with subsequent arguments that
do not match this pattern.

<DT><TT>-s</TT>
<DD>
Place the results in the history list instead of on the standard output.

<DT><TT>-n</TT>
<DD>
Do not add a newline to the output.

<DT><TT>-l</TT>
<DD>
Print the arguments separated by newlines instead of spaces.

<DT><TT>-N</TT>
<DD>
Print the arguments separated and terminated by nulls.

<DT><TT>-o</TT>
<DD>
Print the arguments sorted in ascending order.

<DT><TT>-O</TT>
<DD>
Print the arguments sorted in descending order.

<DT><TT>-i</TT>
<DD>
If given together with <TT>-o</TT> or <TT>-O</TT>, sorting is performed
case-independently.

<DT><TT>-c</TT>
<DD>
Print the arguments in columns.

<DT><TT>-u</TT><VAR>n</VAR>
<DD>
Print the arguments to file descriptor <VAR>n</VAR>.

<DT><TT>-p</TT>
<DD>
Print the arguments to the input of the coprocess.

<DT><TT>-z</TT>
<DD>
Push the arguments onto the editing buffer stack, separated by spaces;
no escape sequences are recognized.

<DT><TT>-D</TT>
<DD>
Treat the arguments as directory names, replacing prefixes with <TT>~</TT>
expressions, as appropriate.

<DT><TT>-P</TT>
<DD>
Perform prompt expansion (see
section <A HREF="zsh_12.html#SEC39">Prompt Expansion</A>).

</DL>

<A NAME="IDX736"></A>
<A NAME="IDX737"></A>
<A NAME="IDX738"></A>
<A NAME="IDX739"></A>
<A NAME="IDX740"></A>
<DT><TT>pushd</TT> [ <VAR>arg</VAR> ]
<DD>
<DT><TT>pushd</TT> <VAR>old</VAR> <VAR>new</VAR>
<DD>
<DT><TT>pushd</TT> {<TT>+</TT>|<TT>-</TT>}<VAR>n</VAR>
<DD>
Change the current directory, and push the old current directory
onto the directory stack.  In the first form, change the
current directory to <VAR>arg</VAR>.
If <VAR>arg</VAR> is not specified, change to the second directory
on the stack (that is, exchange the top two entries), or
change to <TT>$HOME</TT> if the <TT>PUSHD_TO_HOME</TT>
option is set or if there is only one entry on the stack.
Otherwise, <VAR>arg</VAR> is interpreted as it would be by <TT>cd</TT>.
The meaning of <VAR>old</VAR> and <VAR>new</VAR> in the second form is also
the same as for <TT>cd</TT>.

The third form of <TT>pushd</TT> changes directory by rotating the
directory list.  An argument of the form `<TT>+</TT><VAR>n</VAR>' identifies a stack
entry by counting from the left of the list shown by the <TT>dirs</TT>
command, starting with zero.  An argument of the form `<TT>-</TT><VAR>n</VAR>' counts
from the right.  If the <TT>PUSHD_MINUS</TT> option is set, the meanings
of `<TT>+</TT>' and `<TT>-</TT>' in this context are swapped.

If the option <TT>PUSHD_SILENT</TT> is not set, the directory
stack will be printed after a <TT>pushd</TT> is performed.

<A NAME="IDX741"></A>
<DT><TT>pushln</TT> [ <VAR>arg</VAR> ... ]
<DD>
Equivalent to <TT>print -nz</TT>.

<A NAME="IDX742"></A>
<A NAME="IDX743"></A>
<DT><TT>pwd</TT> [ <TT>-rLP</TT> ]
<DD>
Print the absolute pathname of the current working directory.
If the <TT>-r</TT> or the <TT>-P</TT> flag is specified, or the <TT>CHASE_LINKS</TT>
option is set and the <TT>-L</TT> flag is not given, the printed path will not
contain symbolic links.

<A NAME="IDX744"></A>
<DT><TT>r</TT>
<DD>
Same as <TT>fc -e -</TT>.

<A NAME="IDX745"></A>
<A NAME="IDX746"></A>

<DT><TT>read</TT> [ <TT>-rzpqAclneEt</TT> ] [ <TT>-k</TT> [ <VAR>num</VAR> ] ] [ <TT>-u</TT><VAR>n</VAR> ] [ <VAR>name</VAR>[<TT>?</TT><VAR>prompt</VAR>] ] [ <VAR>name</VAR> ...  ]
<DD>
<A NAME="IDX747"></A>
<A NAME="IDX748"></A>
Read one line and break it into fields using the characters
in <TT>$IFS</TT> as separators, except as noted below.
The first field is assigned to the first <VAR>name</VAR>, the second field
to the second <VAR>name</VAR>, etc., with leftover
fields assigned to the last <VAR>name</VAR>.
If <VAR>name</VAR> is omitted then
<TT>REPLY</TT> is used for scalars and <TT>reply</TT> for arrays.

<DL COMPACT>

<DT><TT>-r</TT>
<DD>
Raw mode: a `<TT>\</TT>' at the end of a line does not signify line
continuation and backslashes in the line don't quote the following
character and are not removed.

<DT><TT>-q</TT>
<DD>
Read only one character from the terminal and set <VAR>name</VAR> to
`<TT>y</TT>' if this character was `<TT>y</TT>' or `<TT>Y</TT>' and to `<TT>n</TT>' otherwise.
With this flag set the return value is zero only if the character was
`<TT>y</TT>' or `<TT>Y</TT>'.  Note that this always reads from the terminal, even
if used with the <TT>-p</TT> or <TT>-u</TT> or <TT>-z</TT> flags or with redirected input.
This option may also be used within zle widgets.

<DT><TT>-k</TT> [ <VAR>num</VAR> ]
<DD>
Read only one (or <VAR>num</VAR>) characters.  All are assigned to the first
<VAR>name</VAR>, without word splitting.  This flag is ignored when <TT>-q</TT> is
present.  Input is read from the terminal unless one of <TT>-u</TT> or <TT>-p</TT>
is present.  This option may also be used within zle widgets.

Note that <VAR>num</VAR> must be in the argument word that follows <TT>-k</TT>, not
in the same word.  See <TT>-u</TT>.

<DT><TT>-z</TT>
<DD>
Read one entry from the editor buffer stack and assign it to the first
<VAR>name</VAR>, without word splitting.  Text is pushed onto the stack with
`<TT>print -z</TT>' or with <TT>push-line</TT> from the line editor (see
section <A HREF="zsh_17.html#SEC84">Zsh Line Editor</A>).  This flag is ignored when the <TT>-k</TT> or <TT>-q</TT> flags are present.

<DT><TT>-e</TT>
<DD>
<DT><TT>-E</TT>
<DD>
The input read is printed (echoed) to the standard output.  If the <TT>-e</TT>
flag is used, no input is assigned to the parameters.

<DT><TT>-A</TT>
<DD>
The first <VAR>name</VAR> is taken as the name of an array and all words are
assigned to it.

<DT><TT>-c</TT>
<DD>
<DT><TT>-l</TT>
<DD>
These flags are allowed only if called inside a
function used for completion (specified with the <TT>-K</TT> flag to
<TT>compctl</TT>).  If the <TT>-c</TT> flag is given, the words of the
current command are read. If the <TT>-l</TT> flag is given, the whole
line is assigned as a scalar.  If both flags are present, <TT>-l</TT>
is used and <TT>-c</TT> is ignored.

<DT><TT>-n</TT>
<DD>
Together with <TT>-c</TT>, the number of the word the cursor is on is
read.  With <TT>-l</TT>, the index of the character the cursor is on is
read.  Note that the command name is word number 1, not word 0,
and that when the cursor is at the end of the line, its character
index is the length of the line plus one.

<DT><TT>-u</TT><VAR>n</VAR>
<DD>
Input is read from file descriptor <VAR>n</VAR>, where <VAR>n</VAR> is a single
digit and must <EM>not</EM> be separated from <TT>-u</TT> by any whitespace.

<DT><TT>-p</TT>
<DD>
Input is read from the coprocess.

<DT><TT>-t</TT>
<DD>
Test if input is available before attempting to read; if none is, return
status 1 and do not set any variables.  This is not available when reading
from the editor buffer with <TT>-z</TT>, when called from within completion
with <TT>-c</TT> or <TT>-l</TT>, with <TT>-q</TT> which clears the input queue before
reading, or within zle where other mechanisms should be used to test for
input.

Note that read does not attempt to alter the input processing mode.  The
default mode is canonical input, in which an entire line is read at a time,
so usually `<TT>read -t</TT>' will not read anything until an entire line has
been typed.  However, when reading from the terminal with <TT>-k</TT>
this is automatically handled; note that only availability of the first
character is tested, so that e.g. `<TT>read -t -k 2</TT>' can still block on the
second character.

</DL>
If the first argument contains a `<TT>?</TT>', the remainder of this
word is used as a <VAR>prompt</VAR> on standard error when the shell
is interactive.

The value (exit status) of <TT>read</TT> is 1 when an end-of-file is
encountered, or when <TT>-c</TT> or <TT>-l</TT> is present and the command is
not called from a <TT>compctl</TT> function, or as described for <TT>-q</TT>.
Otherwise the value is 0.

The behavior of some combinations of the <TT>-k</TT>, <TT>-p</TT>, <TT>-q</TT>, <TT>-u</TT>
and <TT>-z</TT> flags is undefined.  Presently <TT>-q</TT> cancels all the others,
<TT>-p</TT> cancels <TT>-u</TT>, <TT>-k</TT> cancels <TT>-z</TT>, and otherwise <TT>-z</TT>
cancels both <TT>-p</TT> and <TT>-u</TT>.

The <TT>-c</TT> or <TT>-l</TT> flags cancel any and all of <TT>-kpquz</TT>.

<A NAME="IDX749"></A>
<A NAME="IDX750"></A>
<DT><TT>readonly</TT>
<DD>
Same as <TT>typeset -r</TT>.

<A NAME="IDX751"></A>
<DT><TT>rehash</TT>
<DD>
Same as <TT>hash -r</TT>.

<A NAME="IDX752"></A>
<A NAME="IDX753"></A>
<DT><TT>return</TT> [ <VAR>n</VAR> ]
<DD>
Causes a shell function or <TT>.</TT> script to return to
the invoking script with the return status specified by <VAR>n</VAR>.  If <VAR>n</VAR>
is omitted, the return status is that of the last command
executed.

If <TT>return</TT> was executed from a trap in a <TT>TRAP</TT><VAR>NAL</VAR> function,
the effect is different for zero and non-zero return status.  With zero
status (or after an implicit return at the end of the trap), the shell
will return to whatever it was previously processing; with a non-zero
status, the shell will behave as interrupted except that the return
status of the trap is retained.  Note that the numeric value of the signal
which caused the trap is passed as the first argument, so the statement
`<TT>return $((128+$1))</TT>' will return the same status as if the signal
had not been trapped.

<DT><TT>sched</TT>
<DD>
See section <A HREF="zsh_21.html#SEC148">The zsh/sched Module</A>.

<A NAME="IDX754"></A>
<A NAME="IDX755"></A>
<A NAME="IDX756"></A>
<A NAME="IDX757"></A>
<A NAME="IDX758"></A>
<DT><TT>set</TT> [ {<TT>+</TT>|<TT>-</TT>}<VAR>options</VAR> | {<TT>+</TT>|<TT>-</TT>}<TT>o</TT> <VAR>option_name</VAR> ] ... [ {<TT>+</TT>|<TT>-</TT>}<TT>A</TT> [ <VAR>name</VAR> ] ] [ <VAR>arg</VAR> ... ]
<DD>
Set the options for the shell and/or set the positional parameters, or
declare and set an array.  If the <TT>-s</TT> option is given, it causes the
specified arguments to be sorted before assigning them to the positional
parameters (or to the array <VAR>name</VAR> if <TT>-A</TT> is used).  With <TT>+s</TT>
sort arguments in descending order.  For the meaning of the other flags, see
section <A HREF="zsh_15.html#SEC75">Options</A>.  Flags may be specified by name using the <TT>-o</TT> option.

If the <TT>-A</TT> flag is specified, <VAR>name</VAR> is
set to an array containing the given <VAR>arg</VAR>s. if <TT>+A</TT> is used and
<VAR>name</VAR> is an array, the given arguments will replace the initial
elements of that array; if no <VAR>name</VAR> is specified, all arrays are
printed.  Otherwise the positional parameters are set.  If no arguments are
given, then the names and values of all parameters are printed on the
standard output.  If the only argument is `<TT>+</TT>',
the names of all parameters are printed.

<DT><TT>setcap</TT>
<DD>
See section <A HREF="zsh_21.html#SEC132">The zsh/cap Module</A>.

<A NAME="IDX759"></A>
<A NAME="IDX760"></A>
<DT><TT>setopt</TT> [ {<TT>+</TT>|<TT>-</TT>}<VAR>options</VAR> | {<TT>+</TT>|<TT>-</TT>}<TT>o</TT> <VAR>option_name</VAR> ] [ <VAR>name</VAR> ... ]
<DD>
Set the options for the shell.  All options specified either
with flags or by name are set.  If no arguments are supplied,
the names of all options currently set are printed.
If the <TT>-m</TT> flag is given the arguments are taken as patterns
(which should be quoted to protect them from filename expansion), and all
options with names matching these patterns are set.

<A NAME="IDX761"></A>
<A NAME="IDX762"></A>
<DT><TT>shift</TT> [ <VAR>n</VAR> ] [ <VAR>name</VAR> ... ]
<DD>
The positional parameters <TT>${</TT><VAR>n</VAR>+1<TT>}</TT> ... are renamed
to <TT>$1</TT> ..., where <VAR>n</VAR> is an arithmetic expression that
defaults to 1.
If any <VAR>name</VAR>s are given then the arrays with these names are
shifted instead of the positional parameters.

<A NAME="IDX763"></A>
<DT><TT>source</TT> <VAR>file</VAR> [ <VAR>arg</VAR> ... ]
<DD>
Same as <TT>.</TT>, except that the current directory is always searched and
is always searched first, before directories in <TT>$path</TT>.

<DT><TT>stat</TT>
<DD>
See section <A HREF="zsh_21.html#SEC149">The zsh/stat Module</A>.

<A NAME="IDX764"></A>
<A NAME="IDX765"></A>
<A NAME="IDX766"></A>
<DT><TT>suspend</TT> [ <TT>-f</TT> ]
<DD>
Suspend the execution of the shell (send it a <TT>SIGTSTP</TT>)
until it receives a <TT>SIGCONT</TT>.
Unless the <TT>-f</TT> option is given, this will refuse to suspend a login shell.

<A NAME="IDX767"></A>
<DT><TT>test</TT> [ <VAR>arg</VAR> ... ]
<DD>
<DT><TT>[</TT> [ <VAR>arg</VAR> ... ] <TT>]</TT>
<DD>
Like the system version of <TT>test</TT>.  Added for compatibility;
use conditional expressions instead (see section <A HREF="zsh_11.html#SEC38">Conditional Expressions</A>).

<A NAME="IDX768"></A>
<A NAME="IDX769"></A>
<A NAME="IDX770"></A>
<DT><TT>times</TT>
<DD>
Print the accumulated user and system times for the shell
and for processes run from the shell.

<A NAME="IDX771"></A>
<A NAME="IDX772"></A>
<A NAME="IDX773"></A>
<DT><TT>trap</TT> [ <VAR>arg</VAR> [ <VAR>sig</VAR> ... ] ]
<DD>
<VAR>arg</VAR> is a series of commands (usually quoted to protect it from
immediate evaluation by the shell) to be read and executed when the shell
receives <VAR>sig</VAR>.  Each <VAR>sig</VAR> can be given as a number
or as the name of a signal.
If <VAR>arg</VAR> is `<TT>-</TT>', then all traps <VAR>sig</VAR> are reset to their
default values.  If <VAR>arg</VAR> is the empty string, then this signal
is ignored by the shell and by the commands it invokes.

If <VAR>sig</VAR> is <TT>ZERR</TT> then <VAR>arg</VAR> will be executed
after each command with a nonzero exit status.
If <VAR>sig</VAR> is <TT>DEBUG</TT> then <VAR>arg</VAR> will be executed
after each command.
If <VAR>sig</VAR> is <TT>0</TT> or <TT>EXIT</TT>
and the <TT>trap</TT> statement is executed inside the body of a function,
then the command <VAR>arg</VAR> is executed after the function completes.
If <VAR>sig</VAR> is <TT>0</TT> or <TT>EXIT</TT>
and the <TT>trap</TT> statement is not executed inside the body of a function,
then the command <VAR>arg</VAR> is executed when the shell terminates.

The <TT>trap</TT> command with no arguments prints a list of commands
associated with each signal.

Note that traps defined with the <TT>trap</TT> builtin are slightly different
from those defined as `<TT>TRAP</TT><VAR>NAL</VAR> () { ... }', as the latter have
their own function environment (line numbers, local variables, etc.) while
the former use the environment of the command in which they were called.
For example,


<PRE>
trap 'print $LINENO' DEBUG
</PRE>

will print the line number of a command executed after it has run, while


<PRE>
TRAPDEBUG() { print $LINENO; }
</PRE>

will always print the number zero.

<A NAME="IDX774"></A>
<A NAME="IDX775"></A>
<DT><TT>true</TT> [ <VAR>arg</VAR> ... ]
<DD>
Do nothing and return an exit code of 0.

<A NAME="IDX776"></A>
<A NAME="IDX777"></A>
<DT><TT>ttyctl</TT> <TT>-fu</TT>
<DD>
The <TT>-f</TT> option freezes the tty, and <TT>-u</TT> unfreezes it.
When the tty is frozen, no changes made to the tty settings by
external programs will be honored by the shell, except for changes in the
size of the screen; the shell will
simply reset the settings to their previous values as soon as each
command exits or is suspended.  Thus, <TT>stty</TT> and similar programs have
no effect when the tty is frozen.  Without options it reports whether the
terminal is frozen or not.

<A NAME="IDX778"></A>
<DT><TT>type</TT> [ <TT>-wfpams</TT> ] <VAR>name</VAR> ...
<DD>
Equivalent to <TT>whence -v</TT>.

<A NAME="IDX779"></A>
<A NAME="IDX780"></A>
<A NAME="IDX781"></A>
<DT><TT>typeset</TT> [ {<TT>+</TT>|<TT>-</TT>}<TT>AEFLRUZafghilrtuxm</TT> [<VAR>n</VAR>]] [ <VAR>name</VAR>[<TT>=</TT><VAR>value</VAR>] ... ]
<DD>
<DT><TT>typeset</TT> -T [ {<TT>+|<TT>-</TT></TT>}<TT>LRUZrux</TT> ] <VAR>SCALAR</VAR>[<TT>=</TT><VAR>value</VAR>] <VAR>array</VAR>
<DD>
Set or display attributes and values for shell parameters.

A parameter is created for each <VAR>name</VAR> that does not already refer
to one.  When inside a function, a new parameter is created for every
<VAR>name</VAR> (even those that already exist), and is unset again when the
function completes.  See
section <A HREF="zsh_14.html#SEC72">Local Parameters</A>.  The same rules apply to special shell parameters, which
retain their special attributes when made local.

For each <VAR>name</VAR><TT>=</TT><VAR>value</VAR> assignment, the parameter
<VAR>name</VAR> is set to <VAR>value</VAR>.  Note that arrays currently cannot be
assigned in <TT>typeset</TT> expressions, only scalars and integers.

For each remaining <VAR>name</VAR> that refers to a parameter that is set, the
name and value of the parameter are printed in the form of an assignment.
Nothing is printed for newly-created parameters, or when any attribute
flags listed below are given along with the <VAR>name</VAR>.  Using `<TT>+</TT>'
instead of minus to introduce an attribute turns it off.

If the <TT>-T</TT> option is given, exactly two (or zero) <VAR>name</VAR>
arguments must be present.  They represent a scalar and an array (in
that order) that will be tied together in the manner of <TT>$PATH</TT> and
<TT>$path</TT>.  In other words, an array present in the latter variable
appears as a scalar with the elements of the array joined by colons in
the former.  Only the scalar may have an initial value.  Both the
scalar and the array may otherwise be manipulated as normal.  If one
is unset, the other will automatically be unset too.  There is no way
of untying the variables without unsetting them, or converting the
type of one of them with another <TT>typeset</TT> command; <TT>+T</TT> does not
work, assigning an array to <VAR>SCALAR</VAR> is an error, and assigning a
scalar to <VAR>array</VAR> sets it to be a single-element array.  Note that
both `<TT>typeset -xT ...</TT>' and `<TT>export -T ...</TT>' work, but only the
scalar will be marked for export.

The <TT>-g</TT> (global) flag is treated specially: it means that any
resulting parameter will not be restricted to local scope.  Note that this
does not necessarily mean that the parameter will be global, as the flag
will apply to any existing parameter (even if unset) from an enclosing
function.  This flag does not affect the parameter after creation, hence it
has no effect when listing existing parameters, nor does the flag <TT>+g</TT>
have any effect except in combination with <TT>-m</TT> (see below).

If no <VAR>name</VAR> is present, the names and values of all parameters are
printed.  In this case the attribute flags restrict the display to only
those parameters that have the specified attributes, and using `<TT>+</TT>'
rather than `<TT>-</TT>' to introduce the flag suppresses printing of the values
of parameters when there is no parameter name.  Also, if the last option
is the word `<TT>+</TT>', then names are printed but values are not.

If the <TT>-m</TT> flag is given the <VAR>name</VAR> arguments are taken as patterns
(which should be quoted).  With no attribute flags, all parameters (or
functions with the <TT>-f</TT> flag) with matching names are printed.  Note that
<TT>-m</TT> is ignored if no patterns are given.  If the <TT>+g</TT> flag is combined
with <TT>-m</TT>, a new local parameter is created for every matching parameter
that is not already local.  Otherwise <TT>-m</TT> applies all other flags or
assignments to the existing parameters.  Except when assignments are made
with <VAR>name</VAR><TT>=</TT><VAR>value</VAR>, using <TT>+m</TT> forces the matching parameters
to be printed, even inside a function.

If no attribute flags are given and either no <TT>-m</TT> flag is present or
the <TT>+m</TT> form was used, each parameter name printed is preceded by a
list of the attributes of that parameter (<TT>array</TT>, <TT>association</TT>,
<TT>exported</TT>, <TT>integer</TT>, <TT>readonly</TT>).  If <TT>+m</TT> is used with attribute
flags, and all those flags are introduced with <TT>+</TT>, the matching
parameter names are printed but their values are not.

The following attribute flags may be specified:

<DL COMPACT>

<DT><TT>-A</TT>
<DD>
The names refer to associative array parameters; see
section <A HREF="zsh_14.html#SEC66">Array Parameters</A>.

<DT><TT>-L</TT>
<DD>
Left justify and remove leading blanks from <VAR>value</VAR>.
If <VAR>n</VAR> is nonzero, it defines the width of the field;
otherwise it is determined by the width of the value of the first
assignment.
When the parameter is expanded, it is filled on the right with
blanks or truncated if necessary to fit the field.
Leading zeros are removed if the <TT>-Z</TT> flag is also set.

<DT><TT>-R</TT>
<DD>
Right justify and fill with leading blanks.  If <VAR>n</VAR> is nonzero
if defines the width of the field;
otherwise it is determined by the width of the value of the first
assignment.
When the parameter is expanded, the field is left filled with
blanks or truncated from the end.

<DT><TT>-U</TT>
<DD>
For arrays (but not for associative arrays), keep only the first
occurrence of each duplicated value.  This may also be set for
colon-separated special parameters like <TT>PATH</TT> or <TT>FIGNORE</TT>, etc.
This flag has a different meaning when used with <TT>-f</TT>; see below.

<DT><TT>-Z</TT>
<DD>
Right justify and fill with leading zeros if the first non-blank
character is a digit and the <TT>-L</TT> flag has not been set.
If <VAR>n</VAR> is nonzero it defines the width of the field;
otherwise it is determined by the width of the value of the
first assignment.

<DT><TT>-a</TT>
<DD>
The names refer to array parameters.  An array parameter may be
created this way, but it may not be assigned to in the <TT>typeset</TT>
statement.  When displaying, both normal and associative arrays are
shown.

<DT><TT>-f</TT>
<DD>
The names refer to functions rather than parameters.  No assignments
can be made, and the only other valid flags are <TT>-t</TT>, <TT>-u</TT> and
<TT>-U</TT>.  The flag <TT>-t</TT> turns on execution tracing for this
function.  The <TT>-u</TT> and <TT>-U</TT> flags cause the function to be
marked for autoloading; <TT>-U</TT> also causes alias expansion to be
suppressed when the function is loaded.  The <TT>fpath</TT> parameter
will be searched to find the function definition when the function
is first referenced; see section <A HREF="zsh_8.html#SEC31">Functions</A>.

<DT><TT>-h</TT>
<DD>
Hide: only useful for special parameters (those marked `&#60;S&#62;' in the table in
section <A HREF="zsh_14.html#SEC73">Parameters Set By The Shell</A>), and for local parameters with the same name as a special parameter,
though harmless for others.  A special parameter with this attribute will
not retain its special effect when made local.  Thus after `<TT>typeset -h
PATH</TT>', a function containing `<TT>typeset PATH</TT>' will create an ordinary
local parameter without the usual behaviour of <TT>PATH</TT>.  Alternatively,
the local parameter may itself be given this attribute; hence inside a
function `<TT>typeset -h PATH</TT>' creates an ordinary local parameter and the
special <TT>PATH</TT> parameter is not altered in any way.  It is also possible
to create a local parameter using `<TT>typeset +h </TT><VAR>special</VAR>', where the
local copy of <VAR>special</VAR> will retain its special properties regardless of
having the <TT>-h</TT> attribute.  Global special parameters loaded from shell
modules (currently those in <TT>zsh/mapfile</TT> and <TT>zsh/parameter</TT>) are
automatically given the <TT>-h</TT> attribute to avoid name clashes.

<DT><TT>-H</TT>
<DD>
Hide value: specifies that <TT>typeset</TT> will not display the value of the
parameter when listing parameters; the display for such parameters is
always as if the `<TT>+</TT>' flag had been given.  Use of the parameter is
in other respects normal, and the option does not apply if the parameter is
specified by name, or by pattern with the <TT>-m</TT> option.  This is on by
default for the parameters in the <TT>zsh/parameter</TT> and <TT>zsh/mapfile</TT>
modules.  Note, however, that unlike the <TT>-h</TT> flag this is also useful
for non-special parameters.

<DT><TT>-i</TT>
<DD>
Use an internal integer representation.  If <VAR>n</VAR> is nonzero it
defines the output arithmetic base, otherwise it is determined by the
first assignment.

<DT><TT>-E</TT>
<DD>
Use an internal double-precision floating point representation.  On output
the variable will be converted to scientific notation.  If <VAR>n</VAR> is
nonzero it defines the number of significant figures to display; the
default is ten.

<DT><TT>-F</TT>
<DD>
Use an internal double-precision floating point representation.  On output
the variable will be converted to fixed-point decimal notation.  If <VAR>n</VAR>
is nonzero it defines the number of digits to display after the decimal
point; the default is ten.

<DT><TT>-l</TT>
<DD>
Convert the result to lower case whenever the parameter is expanded.
The value is <EM>not</EM> converted when assigned.

<DT><TT>-r</TT>
<DD>
The given <VAR>name</VAR>s are marked readonly.

<DT><TT>-t</TT>
<DD>
Tags the named parameters.  Tags have no special meaning to the shell.
This flag has a different meaning when used with <TT>-f</TT>; see above.

<DT><TT>-u</TT>
<DD>
Convert the result to upper case whenever the parameter is expanded.
The value is <EM>not</EM> converted when assigned.
This flag has a different meaning when used with <TT>-f</TT>; see above.

<DT><TT>-x</TT>
<DD>
Mark for automatic export to the environment of subsequently
executed commands.  If the option <TT>GLOBAL_EXPORT</TT> is set, this implies
the option <TT>-g</TT>, unless <TT>+g</TT> is also explicitly given; in other words
the parameter is not made local to the enclosing function.  This is for
compatibility with previous versions of zsh.

</DL>

<A NAME="IDX782"></A>
<A NAME="IDX783"></A>
<A NAME="IDX784"></A>
<DT><TT>ulimit</TT> [ <TT>-SHacdflmnpstv</TT> [ <VAR>limit</VAR> ] ... ]
<DD>
Set or display resource limits of the shell and the processes started by
the shell.  The value of <VAR>limit</VAR> can be a number in the unit specified
below or the value `<TT>unlimited</TT>'.  If the <TT>-H</TT> flag is given use
hard limits instead of soft limits.  If the <TT>-S</TT> flag is given
together with the <TT>-H</TT> flag set both hard and soft limits.  If no
options are used, the file size limit (<TT>-f</TT>) is assumed.  If
<VAR>limit</VAR> is omitted the current value of the specified resources are
printed.  When more than one resource values are printed the limit name and
unit is printed before each value.

<DL COMPACT>

<DT><TT>-a</TT>
<DD>
Lists all of the current resource limits.
<DT><TT>-c</TT>
<DD>
512-byte blocks on the size of core dumps.
<DT><TT>-d</TT>
<DD>
K-bytes on the size of the data segment.
<DT><TT>-f</TT>
<DD>
512-byte blocks on the size of files written.
<DT><TT>-l</TT>
<DD>
K-bytes on the size of locked-in memory.
<DT><TT>-m</TT>
<DD>
K-bytes on the size of physical memory.
<DT><TT>-n</TT>
<DD>
open file descriptors.
<DT><TT>-s</TT>
<DD>
K-bytes on the size of the stack.
<DT><TT>-t</TT>
<DD>
CPU seconds to be used.
<DT><TT>-u</TT>
<DD>
processes available to the user.
<DT><TT>-v</TT>
<DD>
K-bytes on the size of virtual memory.
</DL>

<A NAME="IDX785"></A>
<A NAME="IDX786"></A>
<DT><TT>umask</TT> [ <TT>-S</TT> ] [ <VAR>mask</VAR> ]
<DD>
The umask is set to <VAR>mask</VAR>.  <VAR>mask</VAR> can be either
an octal number or a symbolic value as described in man page chmod(1).
If <VAR>mask</VAR> is omitted, the current value is printed.  The <TT>-S</TT>
option causes the mask to be printed as a symbolic value.  Otherwise,
the mask is printed as an octal number.  Note that in
the symbolic form the permissions you specify are those which are to be
allowed (not denied) to the users specified.

<A NAME="IDX787"></A>
<A NAME="IDX788"></A>
<DT><TT>unalias</TT>
<DD>
Same as <TT>unhash -a</TT>.

<A NAME="IDX789"></A>
<A NAME="IDX790"></A>
<DT><TT>unfunction</TT>
<DD>
Same as <TT>unhash -f</TT>.

<A NAME="IDX791"></A>
<DT><TT>unhash</TT> [ <TT>-adfm</TT> ] <VAR>name</VAR> ...
<DD>
Remove the element named <VAR>name</VAR> from an internal hash table.  The
default is remove elements from the command hash table.  The <TT>-a</TT>
option causes <TT>unhash</TT> to remove aliases.  The <TT>-f</TT> option causes
<TT>unhash</TT> to remove shell functions.  The <TT>-d</TT> options causes
<TT>unhash</TT> to remove named directories.  If the <TT>-m</TT> flag is given
the arguments are taken as patterns (should be quoted) and all elements
of the corresponding hash table with matching names will be removed.

<A NAME="IDX792"></A>
<A NAME="IDX793"></A>
<A NAME="IDX794"></A>
<DT><TT>unlimit</TT> [ <TT>-hs</TT> ] <VAR>resource</VAR> ...
<DD>
The resource limit for each <VAR>resource</VAR> is set to the hard limit.
If the <TT>-h</TT> flag is given and the shell has appropriate privileges,
the hard resource limit for each <VAR>resource</VAR> is removed.
The resources of the shell process are only changed if the <TT>-s</TT>
flag is given.

<A NAME="IDX795"></A>
<A NAME="IDX796"></A>
<DT><TT>unset</TT> [ <TT>-fm</TT> ] <VAR>name</VAR> ...
<DD>
Each named parameter is unset.
Local parameters remain local even if unset; they appear unset within scope,
but the previous value will still reappear when the scope ends.

Individual elements of associative array parameters may be unset by using
subscript syntax on <VAR>name</VAR>, which should be quoted (or the entire command
prefixed with <TT>noglob</TT>) to protect the subscript from filename generation.

If the <TT>-m</TT> flag is specified the arguments are taken as patterns (should
be quoted) and all parameters with matching names are unset.  Note that this
cannot be used when unsetting associative array elements, as the subscript
will be treated as part of the pattern.

<TT>unset -f</TT> is equivalent to <TT>unfunction</TT>.

<A NAME="IDX797"></A>
<A NAME="IDX798"></A>
<DT><TT>unsetopt</TT> [ {<TT>+</TT>|<TT>-</TT>}<VAR>options</VAR> | {<TT>+</TT>|<TT>-</TT>}<TT>o</TT> <VAR>option_name</VAR> ] [ <VAR>name</VAR> ... ]
<DD>
Unset the options for the shell.  All options specified either
with flags or by name are unset.  If no arguments are supplied,
the names of all options currently unset are printed.
If the <TT>-m</TT> flag is given the arguments are taken as patterns
(which should be quoted to preserve them from being interpreted as glob
patterns), and all options with names matching these patterns are unset.

<DT><TT>vared</TT>
<DD>
See section <A HREF="zsh_21.html#SEC157">The zsh/zle Module</A>.

<A NAME="IDX799"></A>
<A NAME="IDX800"></A>
<A NAME="IDX801"></A>
<DT><TT>wait</TT> [ <VAR>job</VAR> ... ]
<DD>
Wait for the specified jobs or processes.  If <VAR>job</VAR> is not given
then all currently active child processes are waited for.
Each <VAR>job</VAR> can be either a job specification or the process ID
of a job in the job table.
The exit status from this command is that of the job waited for.

<A NAME="IDX802"></A>
<DT><TT>whence</TT> [ <TT>-vcwfpams</TT> ] <VAR>name</VAR> ...
<DD>
For each name, indicate how it would be interpreted if used as a
command name.

<DL COMPACT>

<DT><TT>-v</TT>
<DD>
Produce a more verbose report.

<DT><TT>-c</TT>
<DD>
Print the results in a <CITE>csh</CITE>-like format.
This takes precedence over <TT>-v</TT>.

<DT><TT>-w</TT>
<DD>
For each <VAR>name</VAR>, print `<VAR>name</VAR><TT>:</TT> <VAR>word</VAR>' where <VAR>word</VAR>
is one of <TT>alias</TT>, <TT>builtin</TT>, <TT>command</TT>, <TT>function</TT>,
<TT>hashed</TT>, <TT>reserved</TT> or <TT>none</TT>, according as <VAR>name</VAR>
corresponds to an alias, a built-in command, an external command, a
shell function, a command defined with the <TT>hash</TT> builtin, a
reserved word, or is not recognised.  This takes precedence over
<TT>-v</TT> and <TT>-c</TT>.

<DT><TT>-f</TT>
<DD>
Causes the contents of a shell function to be
displayed, which would otherwise not happen unless the <TT>-c</TT>
flag were used.

<DT><TT>-p</TT>
<DD>
Do a path search for <VAR>name</VAR>
even if it is an alias, reserved word, shell function or builtin.

<DT><TT>-a</TT>
<DD>
Do a search for all occurrences of <VAR>name</VAR>
throughout the command path.
Normally only the first occurrence is printed.

<DT><TT>-m</TT>
<DD>
The arguments are taken as patterns (should be
quoted), and the information is displayed for each command matching one
of these patterns.

<DT><TT>-s</TT>
<DD>
If a pathname contains symlinks, print the symlink-free pathname as well.

</DL>

<A NAME="IDX803"></A>
<DT><TT>where</TT> [ <TT>-wpms</TT> ] <VAR>name</VAR> ...
<DD>
Equivalent to <TT>whence -ca</TT>.

<A NAME="IDX804"></A>
<DT><TT>which</TT> [ <TT>-wpams</TT> ] <VAR>name</VAR> ...
<DD>
Equivalent to <TT>whence -c</TT>.

<A NAME="IDX805"></A>
<A NAME="IDX806"></A>
<A NAME="IDX807"></A>
<DT><TT>zcompile</TT> [ <TT>-U</TT> ] [ <TT>-z</TT> | <TT>-k</TT> ] [ <TT>-R</TT> | <TT>-M</TT> ] <VAR>file</VAR> [ <VAR>name</VAR> ... ]
<DD>
<DT><TT>zcompile</TT> <TT>-ca</TT> [ <TT>-m</TT> ] [ <TT>-R</TT> | <TT>-M</TT> ] <VAR>file</VAR> [ <VAR>name</VAR> ... ]
<DD>
<DT><TT>zcompile -t</TT> <VAR>file</VAR> [ <VAR>name</VAR> ... ]
<DD>
This builtin command can be used to compile functions or scripts,
storing the compiled form in a file, and to examine files containing
the compiled form.  This allows faster autoloading of functions and
execution of scripts by avoiding parsing of the text when the files
are read.

The first form (without the <TT>-c</TT>, <TT>-a</TT> or <TT>-t</TT> options) creates a
compiled file.  If only the <VAR>file</VAR> argument is given, the
output file has the name `<VAR>file</VAR><TT>.zwc</TT>' and will be placed in
the same directory as the <VAR>file</VAR>.  The shell will load the compiled
file instead of the normal function file when the function
is autoloaded; see
section <A HREF="zsh_8.html#SEC31">Functions</A>
for a description of how autoloaded functions are searched.  The
extension <TT>.zwc</TT> stands for `zsh word code'.

If there is at least one <VAR>name</VAR> argument, all the named files
are compiled into the output <VAR>file</VAR> given as the first argument.  If
<VAR>file</VAR> does not end in <TT>.zwc</TT>, this extension is automatically
appended.  Files containing multiple compiled functions are called `digest'
files, and are intended to be used as elements of the <TT>FPATH</TT>/<TT>fpath</TT>
special array.

The second form, with the <TT>-c</TT> or <TT>-a</TT> options, writes the compiled
definitions for all the named functions into <VAR>file</VAR>.  For <TT>-c</TT>, the
names must be functions currently defined in the shell, not those marked
for autoloading.  Undefined functions that are marked for autoloading
may be written by using the <TT>-a</TT> option, in which case the <TT>fpath</TT>
is searched and the contents of the definition files for those
functions, if found, are compiled into <VAR>file</VAR>.  If both <TT>-c</TT> and
<TT>-a</TT> are given, names of both defined functions and functions marked
for autoloading may be given.  In either case, the functions in files
written with the <TT>-c</TT> or <TT>-a</TT> option will be autoloaded as if the
<TT>KSH_AUTOLOAD</TT> option were unset.

The reason for handling loaded and not-yet-loaded functions with
different options is that some definition files for autoloading define
multiple functions, including the function with the same name as the
file, and, at the end, call that function.  In such cases the output of
`<TT>zcompile -c</TT>' does not include the additional functions defined in
the file, and any other initialization code in the file is lost.  Using
`<TT>zcompile -a</TT>' captures all this extra information.

If the <TT>-m</TT> option is combined with <TT>-c</TT> or <TT>-a</TT>,
the <VAR>name</VAR>s are used as patterns and all functions whose names
match one of these patterns will be written. If no <VAR>name</VAR> is given,
the definitions of all functions currently defined or marked as
autoloaded will be written.

The third form, with the <TT>-t</TT> option, examines an existing
compiled file.  Without further arguments, the names of the original
files compiled into it are listed.  The first line of output shows
the version of the shell which compiled the file and how the file
will be used (i.e. by reading it directly or by mapping it into memory).
With arguments, nothing is output and the return value is set to zero if
definitions for <EM>all</EM> <VAR>name</VAR>s were found in the compiled
file, and non-zero if the definition for at least one <VAR>name</VAR> was not
found.

Other options:

<DL COMPACT>

<DT><TT>-U</TT>
<DD>
Aliases are not expanded when compiling the <VAR>name</VAR>d files.

<DT><TT>-R</TT>
<DD>
When the compiled file is read, its contents are copied into the
shell's memory, rather than memory-mapped (see <TT>-M</TT>).  This
happens automatically on systems that do not support memory mapping.

When compiling scripts instead of autoloadable functions, it is
often desirable to use this option; otherwise the whole file, including the
code to define functions which have already been defined, will
remain mapped, consequently wasting memory.

<DT><TT>-M</TT>
<DD>
The compiled file is mapped into the shell's memory when read. This
is done in such a way that multiple instances of the shell running
on the same host will share this mapped file.  If neither <TT>-R</TT> nor
<TT>-M</TT> is given, the <TT>zcompile</TT> builtin decides what to do based
on the size of the compiled file.

<DT><TT>-k</TT>
<DD>
<DT><TT>-z</TT>
<DD>
These options are used when the compiled file contains functions which
are to be autoloaded. If <TT>-z</TT> is given, the
function will be autoloaded as if the <TT>KSH_AUTOLOAD</TT> option is
<EM>not</EM> set, even if it is set at the time the compiled file is
read, while if the <TT>-k</TT> is given, the function will be loaded as if
<TT>KSH_AUTOLOAD</TT> <EM>is</EM> set.  If neither of these options is given, the
function will be loaded as determined by the setting of the
<TT>KSH_AUTOLOAD</TT> option at the time the compiled file is read.

These options may also appear as many times as necessary between the listed
<VAR>name</VAR>s to specify the loading style of all following functions, up to
the next <TT>-k</TT> or <TT>-z</TT>.

</DL>

The created file always contains two versions of the compiled
format, one for big-endian machines and one for small-endian
machines.  The upshot of this is that the compiled file is machine
independent and if it is read or mapped, only one half of the file
is actually used (and mapped).

<DT><TT>zformat</TT>
<DD>
See section <A HREF="zsh_21.html#SEC161">The zsh/zutil Module</A>.

<DT><TT>zftp</TT>
<DD>
See section <A HREF="zsh_21.html#SEC152">The zsh/zftp Module</A>.

<DT><TT>zle</TT>
<DD>
See section <A HREF="zsh_21.html#SEC157">The zsh/zle Module</A>.

<A NAME="IDX808"></A>
<A NAME="IDX809"></A>
<A NAME="IDX810"></A>
<DT><TT>zmodload</TT> [ <TT>-dL</TT> ] [ ... ]
<DD>
<DT><TT>zmodload -e</TT> [ <TT>-A</TT> ] [ ... ]
<DD>
<DT><TT>zmodload</TT> [ <TT>-a</TT> [ <TT>-bcpf</TT> [ <TT>-I</TT> ] ] ] [ <TT>-iL</TT> ] ...
<DD>
<DT><TT>zmodload</TT> <TT>-u</TT> [ <TT>-abcdpf</TT> [ <TT>-I</TT> ] ] [ <TT>-iL</TT> ] ...
<DD>
<DT><TT>zmodload</TT> <TT>-A</TT> [ <TT>-L</TT> ] [ <VAR>modalias</VAR>[<TT>=</TT><VAR>module</VAR>] ... ]
<DD>
<DT><TT>zmodload</TT> <TT>-R</TT> <VAR>modalias</VAR> ...
<DD>
Performs operations relating to zsh's loadable modules.
Loading of modules while the shell is running (`dynamical loading') is not
available on all operating systems, or on all installations on a particular
operating system, although the <TT>zmodload</TT> command itself is always
available and can be used to manipulate modules built into versions of the
shell executable without dynamical loading.

Without arguments the names of all currently loaded binary modules are
printed.  The <TT>-L</TT> option causes this list to be in the form of a
series of <TT>zmodload</TT> commands.  Forms with arguments are:

<DL COMPACT>

<DT><TT>zmodload</TT> [ <TT>-i</TT> ] <VAR>name</VAR> ...
<DD>
<DT><TT>zmodload</TT> <TT>-u</TT> [ <TT>-i</TT> ] <VAR>name</VAR> ...
<DD>
In the simplest case, <TT>zmodload</TT> loads a binary module.  The module must
be in a file with a name consisting of the specified <VAR>name</VAR> followed by
a standard suffix, usually `<TT>.so</TT>' (`<TT>.sl</TT>' on HPUX).
If the module to be loaded is
already loaded and the <TT>-i</TT> option is given, the duplicate module is
ignored.  Otherwise <TT>zmodload</TT> prints an error message.

The <VAR>name</VAR>d module is searched for in the same way a command is, using
<TT>$module_path</TT> instead of <TT>$path</TT>.  However, the path search is
performed even when the module name contains a `<TT>/</TT>', which it usually does.
There is no way to prevent the path search.

With <TT>-u</TT>, <TT>zmodload</TT> unloads modules.  The same <VAR>name</VAR>
must be given that was given when the module was loaded, but it is not
necessary for the module to exist in the filesystem.
The <TT>-i</TT> option suppresses the error if the module is already
unloaded (or was never loaded).

Each module has a boot and a cleanup function.  The module
will not be loaded if its boot function fails.  Similarly a module
can only be unloaded if its cleanup function runs successfully.

<DT><TT>zmodload</TT> <TT>-d</TT> [ <TT>-L</TT> ] [ <VAR>name</VAR> ]
<DD>
<DT><TT>zmodload</TT> <TT>-d</TT> <VAR>name</VAR> <VAR>dep</VAR> ...
<DD>
<DT><TT>zmodload</TT> <TT>-ud</TT> <VAR>name</VAR> [ <VAR>dep</VAR> ... ]
<DD>
The <TT>-d</TT> option can be used to specify module dependencies.  The modules
named in the second and subsequent arguments will be loaded before the
module named in the first argument.

With <TT>-d</TT> and one argument, all dependencies for that module are listed.
With <TT>-d</TT> and no arguments, all module dependencies are listed.  This
listing is by default in a Makefile-like format.  The <TT>-L</TT> option
changes this format to a list of <TT>zmodload -d</TT> commands.

If <TT>-d</TT> and <TT>-u</TT> are both used, dependencies are removed.  If only one
argument is given, all dependencies for that module are removed.

<DT><TT>zmodload</TT> <TT>-ab</TT> [ <TT>-L</TT> ]
<DD>
<DT><TT>zmodload</TT> <TT>-ab</TT> [ <TT>-i</TT> ] <VAR>name</VAR> [ <VAR>builtin</VAR> ... ]
<DD>
<DT><TT>zmodload</TT> <TT>-ub</TT> [ <TT>-i</TT> ] <VAR>builtin</VAR> ...
<DD>
The <TT>-ab</TT> option defines autoloaded builtins.  It defines the specified
<VAR>builtin</VAR>s.  When any of those builtins is called, the module specified
in the first argument is loaded.  If only the <VAR>name</VAR> is given, one
builtin is defined, with the same name as the module.  <TT>-i</TT> suppresses
the error if the builtin is already defined or autoloaded, regardless of
which module it came from.

With <TT>-ab</TT> and no arguments, all autoloaded builtins are listed, with the
module name (if different) shown in parentheses after the builtin name.
The <TT>-L</TT> option changes this format to a list of <TT>zmodload -a</TT>
commands.

If <TT>-b</TT> is used together with the <TT>-u</TT> option, it removes builtins
previously defined with <TT>-ab</TT>.  This is only possible if the builtin is
not yet loaded.  <TT>-i</TT> suppresses the error if the builtin is already
removed (or never existed).

<DT><TT>zmodload</TT> <TT>-ac</TT> [ <TT>-IL</TT> ]
<DD>
<DT><TT>zmodload</TT> <TT>-ac</TT> [ <TT>-iI</TT> ] <VAR>name</VAR> [ <VAR>cond</VAR> ... ]
<DD>
<DT><TT>zmodload</TT> <TT>-uc</TT> [ <TT>-iI</TT> ] <VAR>cond</VAR> ...
<DD>
The <TT>-ac</TT> option is used to define autoloaded condition codes. The
<VAR>cond</VAR> strings give the names of the conditions defined by the
module. The optional <TT>-I</TT> option is used to define infix condition
names. Without this option prefix condition names are defined.

If given no condition names, all defined names are listed (as a series of
<TT>zmodload</TT> commands if the <TT>-L</TT> option is given).

The <TT>-uc</TT> option removes definitions for autoloaded conditions.

<DT><TT>zmodload</TT> <TT>-ap</TT> [ <TT>-L</TT> ]
<DD>
<DT><TT>zmodload</TT> <TT>-ap</TT> [ <TT>-i</TT> ] <VAR>name</VAR> [ <VAR>parameter</VAR> ... ]
<DD>
<DT><TT>zmodload</TT> <TT>-up</TT> [ <TT>-i</TT> ] <VAR>parameter</VAR> ...
<DD>
The <TT>-p</TT> option is like the <TT>-b</TT> and <TT>-c</TT> options, but makes
<TT>zmodload</TT> work on autoloaded parameters instead.

<DT><TT>zmodload</TT> <TT>-af</TT> [ <TT>-L</TT> ]
<DD>
<DT><TT>zmodload</TT> <TT>-af</TT> [ <TT>-i</TT> ] <VAR>name</VAR> [ <VAR>function</VAR> ... ]
<DD>
<DT><TT>zmodload</TT> <TT>-uf</TT> [ <TT>-i</TT> ] <VAR>function</VAR> ...
<DD>
The <TT>-f</TT> option is like the <TT>-b</TT>, <TT>-p</TT>, and <TT>-c</TT> options, but
makes <TT>zmodload</TT> work on autoloaded math functions instead. 

<DT><TT>zmodload</TT> <TT>-a</TT> [ <TT>-L</TT> ]
<DD>
<DT><TT>zmodload</TT> <TT>-a</TT> [ <TT>-i</TT> ] <VAR>name</VAR> [ <VAR>builtin</VAR> ... ]
<DD>
<DT><TT>zmodload</TT> <TT>-ua</TT> [ <TT>-i</TT> ] <VAR>builtin</VAR> ...
<DD>
Equivalent to <TT>-ab</TT> and <TT>-ub</TT>.

<DT><TT>zmodload -e</TT> [ <TT>-A</TT> ] [ <VAR>string</VAR> ... ]
<DD>
The <TT>-e</TT> option without arguments lists all loaded modules; if the <TT>-A</TT>
option is also given, module aliases corresponding to loaded modules are
also shown.  With arguments only the return status is set to zero
if all <VAR>string</VAR>s given as arguments are names of loaded modules
and to one if at least on <VAR>string</VAR> is not the name of a
loaded module.  This can be used to test for the availability 
of things implemented by modules.  In this case, any aliases are
automatically resolved and the <TT>-A</TT> flag is not used.

<DT><TT>zmodload</TT> <TT>-A</TT> [ <TT>-L</TT> ] [ <VAR>modalias</VAR>[<TT>=</TT><VAR>module</VAR>] ... ]
<DD>
For each argument, if both <VAR>modalias</VAR> and <VAR>module</VAR> are given,
define <VAR>modalias</VAR> to be an alias for the module <VAR>module</VAR>.
If the module <VAR>modalias</VAR> is ever subsequently requested, either via a
call to <TT>zmodload</TT> or implicitly, the shell will attempt to load
<VAR>module</VAR> instead.  If <VAR>module</VAR> is not given, show the definition of
<VAR>modalias</VAR>.  If no arguments are given, list all defined module aliases.
When listing, if the <TT>-L</TT> flag was also given, list the definition as a
<TT>zmodload</TT> command to recreate the alias.

The existence of aliases for modules is completely independent of whether
the name resolved is actually loaded as a module: while the alias exists,
loading and unloading the module under any alias has exactly the same
effect as using the resolved name, and does not affect the connection
between the alias and the resolved name which can be removed either by
<TT>zmodload -R</TT> or by redefining the alias.  Chains of aliases (i.e. where
the first resolved name is itself an alias) are valid so long as these are
not circular.  As the aliases take the same format as module names, they
may include path separators:  in this case, there is no requirement for any
part of the path named to exist as the alias will be resolved first.  For
example, `<TT>any/old/alias</TT>' is always a valid alias.

Dependencies added to aliased modules are actually added to the resolved
module; these remain if the alias is removed.  It is valid to create an
alias whose name is one of the standard shell modules and which resolves to
a different module.  However, if a module has dependencies, it
will not be possible to use the module name as an alias as the module will
already be marked as a loadable module in its own right.

Apart from the above, aliases can be used in the <TT>zmodload</TT> command
anywhere module names are required.  However, aliases will not be
shown in lists of loaded modules with a bare `<TT>zmodload</TT>'.

<DT><TT>zmodload</TT> <TT>-R</TT> <VAR>modalias</VAR> ...
<DD>
For each <VAR>modalias</VAR> argument that was previously defined as a module
alias via <TT>zmodload -A</TT>, delete the alias.  If any was not defined, an
error is caused and the remainder of the line is ignored.

</DL>

Note that <TT>zsh</TT> makes no distinction between modules that were linked 
into the shell and modules that are loaded dynamically. In both cases
this builtin command has to be used to make available the builtins and
other things defined by modules (unless the module is autoloaded on
these definitions). This is true even for systems that don't support
dynamic loading of modules.

<DT><TT>zparseopts</TT>
<DD>
See section <A HREF="zsh_21.html#SEC161">The zsh/zutil Module</A>.

<DT><TT>zprof</TT>
<DD>
See section <A HREF="zsh_21.html#SEC159">The zsh/zprof Module</A>.

<DT><TT>zpty</TT>
<DD>
See section <A HREF="zsh_21.html#SEC160">The zsh/zpty Module</A>.

<DT><TT>zregexparse</TT>
<DD>
See section <A HREF="zsh_21.html#SEC161">The zsh/zutil Module</A>.

<DT><TT>zstyle</TT>
<DD>
See section <A HREF="zsh_21.html#SEC161">The zsh/zutil Module</A>.

</DL>

<P><HR><P>
Go to the <A HREF="zsh_1.html">first</A>, <A HREF="zsh_15.html">previous</A>, <A HREF="zsh_17.html">next</A>, <A HREF="zsh_29.html">last</A> section, <A HREF="zsh_toc.html">table of contents</A>.
</BODY>
</HTML>