This is Info file zsh.info, produced by Makeinfo-1.55 from the input
file zsh.texi.

   This is a texinfo version of the man page for the Z Shell,
originally by Paul Falstad.  It was converted from the `zsh.1' file
distributed with zsh v2.5.0.  The conversion was done by Jonathan
Hardwick, `jch@cs.cmu.edu', who would love to hear of any errors he
introduced or texinfo rules he broke.  The text remains the work of
Paul Falstad.


File: zsh.info,  Node: Shell Builtin Commands,  Next: Invocation,  Prev: Options,  Up: Top

Shell Builtin Commands
**********************

`. FILE [ ARG ... ]'
     Read and execute commands from FILE in the current shell
     environment.  If FILE does not contain a slash, or if `PATH_DIRS'
     is set, the shell looks in the components of `path' to find the
     directory containing FILE.  Files in the current directory are not
     read unless `.' appears somewhere in `path'.  If any arguments ARG
     are given, they become the positional parameters; the old
     positional parameters are restored when the FILE is done
     executing.  The exit status is the exit status of the last command
     executed.

`: [ ARG ... ]'
     This command only expands parameters.  A zero exit code is
     returned.

`alias [ -grm ] [ NAME[=VALUE] ] ...'
     With no arguments, print the list of aliases in the form
     `NAME=VALUE' on the standard output.  For each NAME with a
     corresponding VALUE, define an alias with that value.  A trailing
     space in VALUE causes the next word to be checked for alias
     substitution.  If the `-g' flag is given, define a global alias;
     global aliases are expanded even if they do not occur in command
     position.  For each NAME with no VALUE, print the value of NAME,
     if any.  If only the `-g' or the `-r' flag is given only global or
     regular aliases are listed.  If the `-m' 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.  The exit status is nonzero
     if a NAME (with no VALUE) is given for which no alias has been
     defined.

`autoload [ NAME ... ]'
     For each of the NAMEs (which are names of functions), create a
     function marked undefined.  The `fpath' variable will be searched
     to find the actual function definition when the function is first
     referenced.

`bg [ JOB ... ]'
`JOB ... &'
     Put each specified JOB in the background, or the current job if
     none is specified.

`bindkey -mevd'
`bindkey -r IN-STRING ...'
`bindkey [ -a ] IN-STRING [ COMMAND ] ...'
`bindkey -s [ -a ] IN-STRING OUT-STRING ...'
     The `-e' and `-v' options put the keymaps in emacs mode and vi
     mode respectively; they cannot be used simultaneously.  The `-d'
     option resets all bindings to the compiled-in settings.  If not
     used with options `-e' or `-v', the maps will be left in emacs
     mode, or in vi mode if the `VISUAL' or `EDITOR' variables contain
     the string `vi'.  Metafied characters are bound to self-insert by
     default.  The `-m' option loads the compiled-in bindings of these
     characters for the mode determined by the previous options, or the
     current mode if used alone.  Any previous binding done by the user
     will be preserved.  If the `-r' option is given, remove any
     binding for each IN-STRING.  If the `-s' option is not specified,
     bind each IN-STRING to a specified COMMAND.  If no COMMAND is
     specified, print the binding of IN-STRING if it is bound, or
     return a nonzero exit code if it is not bound.  If the `-s' option
     is specified, bind each IN-STRING to each specified OUT-STRING.
     When IN-STRING is typed, OUT-STRING will be pushed back and
     treated as input to the line editor.  The process is recursive,
     but to avoid infinite loops the shell will report an error if more
     than 20 consecutive replacements happen.  If the `-a' option is
     specified, bind the IN-STRINGs in the alternative keymap instead
     of the standard one.  The alternative keymap is used in vi command
     mode.

     It's possible for an IN-STRING to be bound to something and also
     be the beginning of a longer bound string.  In this case the shell
     will wait a certain time to see if more characters are typed,
     otherwise it will execute the shorter binding.  This timeout is
     defined by the `KEYTIMEOUT' parameter; the default is 0.4 seconds.
     No timeout is done if the prefix string is not bound.

     For either IN-STRING or OUT-STRING, control characters may be
     specified in the form `^X', and the backslash may be used to
     introduce one of the following escape sequences:

    `\a'
          Bell character

    `\n'
          Linefeed (newline)

    `\b'
          Backspace

    `\t'
          Horizontal tab

    `\v'
          Vertical tab

    `\f'
          Form feed

    `\r'
          Carriage return

    `\e'
    `\E'
          Escape

    `\NNN'
          Character code in octal

    `\xNN'
          Character code in hexadecimal

    `\M-XXX'
          Character or escape sequence with meta bit set.  The `-'
          after the `M' is optional.

    `\C-X'
          Control character.  The `-' after the `M' is optional.

     In all other cases, `\' escapes the following character.  Delete is
     written as `^?'.  Note that `\M^?' and `^\M?' are not the same.

     Multi-character IN-STRINGS cannot contain the null character (`^@'
     or `^ ').  If they appear in a bindkey command, they will be
     silently translated to `\M-^@'.  This restriction does not apply
     to OUT-STRINGS, single-character IN-STRINGS and the first
     character of a multi-char IN-STRING.

`break [ N ]'
     Exit from an enclosing `for', `while', `until', `select', or
     `repeat' loop.  If N is specified, then break N levels instead of
     just one.

`builtin NAME [ ARGS ] ...'
     Executes the builtin NAME, with the given ARGS.

`bye'
     Same as `exit'.

`cd [ ARG ]'
`cd OLD NEW'
`cd [+-]n'
     Change the current directory.  In the first form, change the
     current directory to ARG, or to the value of `HOME' if ARG is not
     specified.  If ARG is `-', change to the value of `OLDPWD', the
     previous directory.  If a directory named ARG is not found in the
     current directory and ARG does not begin with a slash, search each
     component of the shell parameter `cdpath'.  If the option
     `CDABLEVARS' is set, and a parameter named ARG exists whose value
     begins with a slash, treat its value as the directory.

     The second form of `cd' substitutes the string NEW for the string
     OLD in the name of the current directory, and tries to change to
     this new directory.

     The third form of `cd' is equivalent to `popd'.

`chdir'
     Same as `cd'.

`compctl [ -cfqovbCDAIFpEjBaRGuderzNOZn ] [ -k NAME ] [ -X EXPLANATION ]'
`[ -K FUNCTION ] [ -P PREFIX ] [ -S SUFFIX ] [ -g GLOBSTRING ]'
`[ -s SUBSTRING ] [ -H NUM PATTERN ] [ -l CMD ] [ ARG ... ]'
`compctl FLAGS + FLAGS + ...'
`compctl FLAGS -x PATTERN FLAGS - ... -- ARG ...'
     Control the editor's completion behavior when one of ARG is the
     current command.  (Note that aliases are expanded before this is
     determined, unless the `COMPLETE_ALIASES' option is set.)  With the
     `-D' flag, control default completion behavior for commands not
     assigned any special behavior; with `-C', control completion when
     there is no current command.  The remaining options specify the
     type of command arguments to look for during completion.  If
     completion is attempted for a command with a pathname containing
     slashes and no completion is found the search is retried with the
     last pathname component.

    `-c'
          Expect command names.

    `-f'
          Expect filenames and filesystem paths.

    `-o'
          Expect option names.

    `-v'
          Expect variable names.

    `-b'
          Expect key binding names.

    `-A'
          Expect array names.

    `-I'
          Expect integer variable names.

    `-F'
          Expect function names.

    `-p'
          Expect parameter names.

    `-E'
          Expect environment variable names.

    `-j'
          Expect job names (the first word of the job leader's command
          line, useful with the `kill' builtin).

    `-r'
          Expect names of running jobs.

    `-z'
          Expect names of suspended jobs.

    `-B'
          Expect names of builtin commands.

    `-a'
          Expect alias names.

    `-R'
          Expect names of regular aliases.

    `-G'
          Expect names of global aliases.

    `-u'
          Expect user names.

    `-d'
          Expect names of disabled commands.

    `-e'
          Expect names of executable (and enabled) commands.

    `-N'
          Expect names of scalar parameters.

    `-n'
          Expect named directories.

    `-O'
          Expect names of readonly variables.

    `-Z'
          Expect names of shell special parameters.

    `-q'
          If given together with a suffix (see the `-S' flag below) it
          makes this suffix be removed if the next character typed is a
          blank or does not insert anything (this is the same rule as
          used for the `AUTO_REMOVE_SLASH' option).

    `-k NAME'
          Expect names taken from the elements of `$name' (which should
          be an array).  Alternatively, the argument NAME itself may be
          a set of space- or comma-separated values in parentheses, in
          which any delimiter may be escaped with a backslash.
          Example: `compctl -k "(cputime filesize datasize stacksize
          coredumpsize resident descriptors)" limit'.

    `-K FUNCTION'
          Call the given function to get the completions.  The function
          gets two arguments: the prefix and the suffix of the word on
          which completion is tried.  The function should set the
          variable `reply' to an array containing the completions (one
          completion per element); note that `reply' should not be made
          local.  From such a function the command line can be accessed
          with the `-c' and `-l' flags to the `read' builtin.  Example:
          `function whoson { reply=(`users`); }; compctl -K whoson
          talk' completes only logged-on users after `talk'.  Note that
          `whoson' must return an array so that just `reply=`users`' is
          incorrect.

    `-X EXPLANATION'
          Print the explanation string before the list of completions.
          A `%n' in this string is replaced by the number of matches.

    `-P PREFIX'
          The PREFIX is inserted just before the completed string; any
          initial part already typed will be completed and the whole
          PREFIX ignored for completion purposes.  Example: `compctl -j
          -P "%" kill'.

    `-S SUFFIX'
          After a unique completion is found the SUFFIX is inserted
          after the completed string.

    `-g GLOBSTRING'
          The 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 `*(/)' instead of `*/' for directories.  The `fignore'
          special parameter is not used.  More than one of these
          pattern may be given separated by blanks.  Note that brace
          expansion is *not* part of globbing.

    `-s SUBSTRING'
          The SUBSTRING is split into words and these words are than
          expanded using all shell expansion mechanisms.  The resulting
          words are taken as possible completions.  The `fignore'
          special parameter is *not* used.  Note that `-g' is faster
          for filenames.

    `-H NUM PATTERN'
          The possible completions are taken from the last NUM history
          lines.  Only words matching PATTERN are taken.  If NUM is
          zero or negative the whole history is searched and if PATTERN
          is the empty string (or `*', of course) all words are taken.

    `-l CMD'
          This option cannot be combined with any other option.  If it
          is given it restricts the range of command line words that
          are considered to be arguments.  By default this range
          contains all arguments without the command string.  If
          combined with extended completion (see below) and one of
          `p[...]', `r[...]', or `R[...]' the range is restricted to
          the arguments between the ones that are specified in the
          brackets.  After the range of arguments is determined
          completion is done in it as if they were arguments to the CMD
          given with this option.  If this string is empty the first
          word in the range is taken as the command name for which to
          complete.  In this case, if the cursor is in the first word,
          command names are completed.  Example: `compctl -x
          'r[-exec,;]' -l '' -- find' completes the arguments between
          `-exec' and the following `;' (or the end of the command line
          if there is no such string) as if they were specifying a
          command on their own.

    `-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 (`-K' option), which can examine the word via the
          `read' builtin's `-c' and `-l' flags and use its own
          criterion to decide what matches.

     The second form specifies alternative options.  First completion is
     tried with the options before the first `+'.  If this produces no
     matches completion is tried with the flags after the `+' and so on.
     If there are no flags after the last `+' this means that default
     completion is tried if no matches were found.

     The third form specifies extended completion for the commands
     given as ARG.  Each PATTERN is examined in turn; when a match is
     found, the corresponding FLAGS, as described above for the
     ordinary case, are used to generate possible completions.  If no
     PATTERN matches, the FLAGS given before the `-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 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 space which match if all of the
     sub-patterns match (they are and'ed).  An element of the
     sub-patterns is of the form `c[...][...]', where the pairs of
     brackets may be repeated as often as necessary, and matches if any
     of the sets of brackets match (an or).  These elements may be any
     of the following:

    `s[STRING] ...'
          The pattern matches if the current word on the command line
          starts with one of the strings given in brackets.  The STRING
          is not removed and is not part of the completion.

    `S[STRING] ...'
          Like `s[STRING]' but the STRING is part of the completion.

    `p[FROM,TO] ...'
          The pattern matches if the number of the current word is
          between one of the FROM and TO pairs.  The comma and TO are
          optional; TO defaults to the same value as FROM.  The numbers
          may be negative: -N refers to the N'th last word on the line.

    `c[OFFSET,STRING] ...'
          The pattern matches if one of the STRINGs matches the word
          offset by OFFSET from the current word position.

    `C[OFFSET,PATTERN] ...'
          Like `c' but uses pattern matching instead.

    `w[INDEX,STRING] ...'
          The pattern matches if the word in position INDEX is equal to
          the corresponding STRING.  Note that the word count is made
          after alias expansion.

    `W[INDEX,PATTERN] ...'
          Like `w' but uses pattern matching instead.

    `n[INDEX,STRING] ...'
          Matches if the current word contains STRING.  Anything up to
          the INDEX'th ocurrence of this string will not be considered
          part of the completion, but the rest will.

    `N[INDEX,STRING] ...'
          Like `n[INDEX,STRING]' but the string will be taken as a
          character class (anything up to the INDEX'th ocurrence of any
          of the characters in STRING will not be considered part of the
          completion).

    `m[MIN,MAX] ...'
          Matches if the total number of words lies between MIN and MAX
          (inclusive).

    `r[STR1,STR2]...'
          Matches if the cursor is after a word with prefix STR1.  If
          there is also a word with prefix STR2 on the command line it
          matches only if the cursor is before this word.

    `R[STR1,STR2]...'
          Like `r' but uses pattern matching instead.

     Example:

     `compctl -u -x 's[+] c[-1,-f],s[-f+]' -g '~/Mail/*(:t)' -
     's[-f],c[-1,-f]' -f -- mail'

     Complete users by default.  After a `-f' with an optional space,
     complete file names; if a `+' follows the `-f', whether or not
     there is a space in between, complete with the non-directory part
     of files in the directory `~/Mail'.

`continue [ NUM ]'
     Resume the next iteration of the enclosing `for', `while',
     `until', `select', or `repeat' loop.  If N is specified, break out
     of N-1 loops and resume at the N'th enclosing loop.

`declare [ ARG ... ]'
     Same as `typeset'.

`dirs [ -v ] [ ARG ... ]'
     With no arguments, print the contents of the directory stack.  If
     the `-v' option is given, number the directories in the stack when
     printing.  Directories are added to this stack with the `pushd'
     command, and removed with the `cd' or `popd' commands.  If
     arguments are specified, load them onto the directory stack,
     replacing anything that was there, and push the current directory
     onto the stack.

`disable [ -m ] ARG ...'
     Disable the builtin ARG temporarily.  This allows you to use an
     external command with the same name as a shell builtin.  Without
     arguments all disabled builtins are printed; with the `-m' flag the
     arguments are taken as patterns (which should be quoted to
     preserve them from being taken as glob patterns) and all builtins
     matching these patterns are disabled.  Actually the same as
     `unhash'.  Builtins can be enabled with the `enable' command.

`disown JOB ...'
     Remove the specified jobs 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.

`echo [ -n ] [ ARG ... ]'
     Write each ARG on the standard output, with a space separating
     each one.  If the `-n' flag is not present, print a newline at the
     end.  `echo' recognizes the following escape sequences:

    `\a'
          Bell

    `\b'
          Backspace

    `\c'
          Don't print an ending newline

    `\e'
          Escape

    `\f'
          Form feed

    `\n'
          Newline

    `\r'
          Carriage return

    `\t'
          Horizontal tab

    `\v'
          Vertical tab

    `\\'
          Backslash

    `\0NNN'
          Character code in octal, with a maximum of three digits after
          the zero.  A non-octal digit terminates the number.

    `\xNN'
          Character code in hexadecimal, with a maximum of two digits
          after the `x'.  A non-hexadecimal digit terminates the number.

`echotc CAP [ ARG ... ]'
     Output the termcap string corresponding to the capability CAP,
     with optional arguments.

`enable [ -m ] ARG ...'
     Enable the specified builtin commands, presumably disabled earlier
     with `disable'.  Without arguments the enabled builtins are
     printed; with the `-m' flag the arguments are taken as patterns
     (and hence should be quoted), and all builtins matching these
     patterns are enabled.

`eval [ ARG ... ]'
     Read the arguments as input to the shell and execute the resulting
     command(s) in the current shell process.

`exit [ N ]'
     Exit the shell with the exit code specified by N; if none is
     specified, use the exit code from the last command executed.  An
     `EOF' condition will also cause the shell to exit, unless the
     `IGNORE_EOF' option is set.

`export [ NAME[=VALUE] ... ]'
     The specified NAMEs are marked for automatic export to the
     environment of subsequently executed commands.

`false'
     Do nothing and return an exit code of 1.

`fc [ -e ENAME ] [ -nlrdDfEm ] [ OLD=NEW ... ] [ FIRST [ LAST ]]'
`fc -ARWI [ FILENAME ]'
     Select a range of commands from FIRST to LAST from the history
     list.  The arguments FIRST and LAST 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 OLD=NEW,
     if any, are then performed on the commands.  If the `-l' flag is
     given, the resulting commands are listed on standard output.  If
     the `-m' flag is also given the first argument is taken as a
     pattern (which should be quoted), and only the history events
     matching this pattern will be shown.  Otherwise the editor program
     ENAME is invoked on a file containing these history events.  If
     ENAME is not given, the value of the parameter `FCEDIT' is used.
     If ENAME is `-', no editor is invoked.  When editing is complete,
     the edited command(s) is executed.  If FIRST is not specified, it
     will be set to -1 (the most recent event), or to -16 if the `-l'
     flag is given.  If LAST is not specified, it will be set to FIRST,
     or to -1 if the `-l' flag is given.  The flag `-r' reverses the
     order of the commands and the flag `-n' suppresses command numbers
     when listing.  Also when listing, `-d' prints timestamps for each
     command, `-f' prints full time and date stamps, and `-D' prints
     elapsed times.  Adding the `-E' flag causes the dates to be
     printed in the European format (DD.MM.YYYY).

     `fc -R' reads the history from the given file, `fc -W' writes the
     history out to the given file, and `fc -A' appends the history to
     the given file.  `fc -AI' (`-WI') appends (writes) only those
     events that are new since the last incremental append (write) to
     the history file.  In any case the file will have no more than
     `SAVEHIST' entries.

`fg [ JOB ... ]'
`JOB ...'
     Bring the specified JOBs to the foreground.  If no JOB is
     specified, use the current job.

`functions [ +-tum ] [ NAME ... ]'
     Equivalent to `typeset -f'.

`getln NAME ...'
     Read the top value from the buffer stack and put it in the shell
     parameter NAME.  Equivalent to `read -zr'.  The flags `-c', `-l',
     `-A', `-e', `-E', and `-n' are also supported.

`getopts OPTSTRING NAME [ ARG ... ]'
     Checks ARG for legal options.  If ARG is omitted, use the
     positional parameters.  A valid option argument begins with a `+'
     or a `-'.  An argument not beginning with a `+' or a `-', or the
     argument `--', ends the options.  OPTSTRING contains the letters
     that `getopts' recognizes.  If a letter is followed by a `:', that
     option is expected to have an argument.  The options can be
     separated from the argument by blanks.

     Each time it is invoked, `getopts' places the option letter it
     finds in the shell parameter NAME, prepended with a `+' when ARG
     begins with a `+'.  The index of the next ARG is stored in
     `OPTIND'.  The option argument, if any, is stored in `OPTARG'.

     A leading `:' in OPTSTRING causes `getopts' to store the letter of
     the invalid option in `OPTARG', and to set NAME to `?' for an
     unknown option and to `:' when a required option is missing.
     Otherwise, `getopts' prints an error message.  The exit status is
     nonzero when there are no more options.

`hash NAME PATH'
     Puts NAME in the command hash table, associating it with the
     pathname PATH.  Whenever NAME is used as a command argument, the
     shell will try to execute the file given by PATH.

`history [ -nrdDfEm ] [ FIRST [ LAST ]]'
     Same as `fc -l'.

`integer [ +-lrtux ] [ NAME[=VALUE] ]'
     Same as `typeset -i', except that options irrelevant to integers
     are not permitted.

`jobs [ -lprs ] [ JOB ... ]'
     Lists information about each given job, or all jobs if JOB is
     omitted.  The `-l' flag lists process ids, and the `-p' flag lists
     process groups.  If the `-r' flag is given only running jobs will
     be listed; if the `-s' flag is given only stopped jobs are shown.

`kill [ -SIG ] JOB ...'
`kill -l'
     Sends either `SIGTERM' or the specified signal to the given jobs or
     processes.  Signals are given by number or by names (with the
     prefix `SIG' removed).  If the signal being sent is not `KILL' or
     `CONT', then the job will be sent a `CONT' signal if it is
     stopped.  The argument JOB can be the process id of a job not in
     the job list.  In the second form, `kill -l', the signal names are
     listed.

`let ARG ...'
     Evaluate each ARG as an arithmetic expression.  *Note Arithmetic
     Evaluation::, for a description of arithmetic expressions.  The
     exit status is 0 if the value of the last expression is nonzero,
     and 1 otherwise.

`limit [ -h ] [ RESOURCE [ LIMIT ]] ...'
`limit -s'
     Limit the resource consumption of children of the current shell.
     If LIMIT is not specified, print the current limit placed on
     RESOURCE; otherwise set the limit to the specified value.  If the
     `-h' flag is given, use hard limits instead of soft limits.  If no
     RESOURCE is given, print all limits.  See also `ulimit'.  RESOURCE
     is one of:

    `cputime'
          Maximum CPU seconds per process.

    `filesize'
          Largest single file allowed.

    `datasize'
          Maximum data size (including stack) for each process.

    `stacksize'
          Maximum stack size for each process.

    `coredumpsize'
          Maximum size of a core dump.

    `resident'
    `memoryuse'
          Maximum resident set size.

    `memorylocked'
          Maximum amount of memory locked in RAM.

    `descriptors'
          Maximum value for a file descriptor.

    `openfiles'
          Maximum number of open files.

    `vmemorysize'
          Maximum amount of virtual memory.

     Which of these resource limits are available depends on the system.
     lIMIT is a number, with an optional scaling factor, as follows:

    `Nh'
          Hours.

    `Nk'
          Kilobytes.  This is the default for all but cputime.

    `Nm'
          Megabytes or minutes.

    `MM:SS'
          Minutes and seconds.

`local [ +-LRZilrtu [N]] [ NAME[=VALUE] ]'
     Same as `typeset', except that the options `-x' and `-f' are not
     permitted.

`log'
     List all users currently logged in who are affected by the current
     setting of the `watch' parameter.

`logout'
     Exit the shell, if this is a login shell.

`popd [ +-N ]'
     Removes entries from the directory stack.  With no arguments,
     removes the top directory from the stack, and performs a `cd' to
     the new top directory.  With an argument of the form `+N', remove
     the N'th entry counting from the left of the list shown by the
     `dirs' command, starting with zero, and change to that directory.
     With an argument of the form `-N', remove the N'th entry counting
     from the right.  If the `PUSHD_MINUS' option is set, the meanings
     of `+' and `-' in this context are swapped.

`print [ -RnrslzpNDPoOic ] [ -uN ] [ ARG ... ]'
     With no flags or with flag `-', the arguments are printed on the
     standard output as described by `echo', with the following
     differences: the escape sequence `\M-x' metafies the character `x'
     (sets the highest bit), `\C-x' produces a control character
     (`\C-@' and `\C-?' give the characters NULL and delete) and `\E'
     is a synonym for `\e'.  Finally, if not in an escape sequence, `\'
     escapes the following character and is not printed.

    `-R'
    `-r'
          Ignore the escape conventions of `echo'.  The `-R' option
          will print all subsequent arguments and options.

    `-s'
          Place the results in the history list instead of on the
          standard output.

    `-n'
          Do not add a newline to the output.

    `-l'
          Print the arguments separated by newlines instead of spaces.

    `-N'
          Print the arguments separated and terminated by nulls.

    `-o'
          Print the arguments sorted in ascending order.

    `-O'
          Print the arguments sorted in descending order.

    `-i'
          If given together with `-o' or `-O', makes the sort be
          case-insensitive.

    `-c'
          Print the arguments in columns.

    `-uN'
          Print the arguments to file descriptor N.

    `-p'
          Print the arguments to the input of the coprocess.

    `-z'
          Push the arguments onto the editing buffer stack, separated
          by spaces; no escape sequences are recognized.

    `-D'
          Treat the arguments as directory names, replacing prefixes
          with `~' expressions, as appropriate.

    `-P'
          Recognize the same escape sequences as in the `PROMPT'
          parameter.

`pushd [ ARG ]'
`pushd OLD NEW'
`pushd +-N'
     Change the current directory, and push the old current directory
     onto the directory stack.  In the first form, change the current
     directory to ARG.  If ARG is not specified, change to the second
     directory on the stack (that is, exchange the top two entries), or
     change to the value of `HOME' if the `PUSHD_TO_HOME' option is set
     or if there is only one entry on the stack.  If ARG is `-', change
     to the value of `OLDPWD', the previous directory.  If a directory
     named ARG is not found in the current directory and ARG does not
     contain a slash, search each component of the shell parameter
     `cdpath'.  If the option `CDABLEVARS' is set, and a parameter
     named ARG exists whose value begins with a slash, treat its value
     as the directory.  If the option `PUSHD_SILENT' is not set, the
     directory stack will be printed after a `pushd' is performed.

     The second form of `pushd' substitutes the string NEW for the
     string OLD in the name of the current directory, and tries to
     change to this new directory.

     The third form of `pushd' is equivalent to `popd'.

`pushln'
     Equivalent to `print -nZ'.

`pwd'
     Equivalent to `print -R $PWD'.

`r'
     Equivalent to `fc -e -'.

`read [ -rzpqAclneE ] [ -k [NUM] ] [ -uN ] [ NAME?PROMPT ] [ NAME ... ]'
     Read one line and break it into fields using the characters in
     `IFS' as separators.  In raw mode, `-r', a `\' at the end of a
     line does not signify line continuation.  With the `-q' flag read
     only one character and set NAME to `y' if this character was `y'
     or `Y', and to `n' otherwise.  With this flag set the return value
     is zero only if the character was `y' or `Y'.  If the `-k' flag is
     given read only one (or NUM) characters.  If the `-z' flag is
     given, read from the editor buffer stack.  The first field is
     assigned to the first NAME, the second field to the second NAME,
     etc, with leftover fields assigned to the last NAME.  If the `-e'
     or the `-E' flag is given, the words read are printed after the
     whole line is read.  If the `-e' flag is given, the words are not
     assigned to the parameters.  If the `-A' flag is given, the first
     NAME is taken as the name of an array and all words are assigned
     to it.  If NAME is omitted then `REPLY' is used for scalars and
     `reply' for arrays.  The `-c' and `-l' flags are allowed only if
     called inside a function used for completion (specified with the
     `-K' flag to `compctl').  If the `-c' flag is given, the words of
     the current command are read.  If the `-l' flag is given, the
     whole line is assigned as a scalar.  Together with the `-n' flag
     these options give the number of the word the cursor is on and the
     index of the character the cursor is on respectively.  If `-uN' is
     specified, then input is read from file descriptor N; if `-p' is
     specified, then input is read from the coprocess.  If the first
     argument contains a `?', the remainder of this word is used as a
     PROMPT on standard error when the shell is interactive.  The exit
     status is 0 unless an end-of-file is encountered.

`readonly [ NAME[=VALUE]] ...'
     The given NAMES are marked readonly; these names cannot be changed
     by subsequent assignment.

`rehash [ -f ]'
     Throw out the command hash table and start over.  If the `-f'
     option is given, rescan the command path immediately, instead of
     rebuilding the hash table incrementally.

`return [ N ]'
     Causes a shell function or `.' script to return to the invoking
     script with the return status specified by N.  If N is omitted
     then the return status is that of the last command executed.

     If `return' was executed from a trap, whether set by the `trap'
     builtin or by defining a `TRAPXXX' 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 signal
     which caused the trap is passed as the first argument, so the
     statement `return $[128+$1]' will return the same status as if the
     signal had not been trapped.

`sched [+]HH:MM COMMAND ...'
`sched [ -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 `-ITEM', removes the given item from the list.

`set [ +-OPTIONS ] [ +-o OPTION NAME ] ... [ -A [NAME] ] [ ARG ] ...'
     Set the options for the shell and/or set the positional
     parameters, or declare an array.  *Note Options::, for the meaning
     of the flags.  Flags may be specified by name using the `-o'
     option.  If the `-A' flag is given, NAME is set to an array
     containing the given ARGs; if no NAME 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 `+',
     the names of all parameters are printed.

`setopt [ -m ] [ +-OPTIONS ] [ NAME ... ]'
     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.  In option names, case is
     insignificant, and all underscore characters are ignored.  If the
     `-m' 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 matching names are set.

`shift [ N ] [ NAME ... ]'
     The positional parameters from `$N+1' ... are renamed `$1', where
     N is an arithmetic expression that defaults to 1.  If any NAMEs
     are given then the arrays with these names are shifted, instead of
     the positional parameters.

`source'
     Same as `.', except that the current directory is always searched
     and is always searched first, before directories in `path'.

`suspend [ -f ]'
     Suspend the execution of the shell (send it a `SIGTSTP') until it
     receives a `SIGCONT'.  If the `-f' option is not given, complain
     if this is a login shell.

`test ARG ...'
`[ ARG ... ]'
     Like the system version of `test'.  Added for compatibility; use
     conditional expressions instead.

`times'
     Print the accumulated user and system times for the shell and for
     processes run from the shell.

`trap [ ARG ] [ SIG ] ...'
     ARG is a command to be read and executed when the shell receives
     SIG.  Each SIG can be given as a number or as the name of a
     signal.  Inside the command, `$1' refers to the number of the
     signal that caused the trap.  If ARG is `-', then all traps SIG
     are reset to their default values.  If ARG is the null string,
     then this signal is ignored by the shell and by the commands it
     invokes.  If SIG is `ZERR' then ARG will be executed after each
     command with a nonzero exit status.  If SIG is `DEBUG' then ARG
     will be executed after each command. If SIG is `0' or `EXIT' and
     the `trap' statement is executed inside the body of a function,
     then the command ARG is executed after the function completes.  If
     SIG is `0' or `EXIT' and the `trap' statement is not executed
     inside the body of a function, then the command ARG is executed
     when the shell terminates.  The `trap' command with no arguments
     prints a list of commands associated with each signal.

`true'
     Do nothing and return an exit code of 0.

`ttyctl [ -fu ]'
     The `-f' option freezes the tty, and `-u' 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.  Thus, `stty'
     and similar programs have no effect when the tty is frozen.
     Without options it reports whether the terminal is frozen or not.

`type'
     Same as `whence -v'.

`typeset [ +-LRZfilrtuxm [N]] [ NAME[=VALUE]] ...'
     Set attributes and values for shell parameters.  When invoked
     inside a function, a new parameter is created which will be unset
     when the function completes.  The new parameter will not be
     exported unless `ALL_EXPORT' is set, in which case the parameter
     will be exported provided no parameter of that name already
     exists.  The following attributes are valid:

    `-L'
          Left justify and remove leading blanks from VALUE.  If N 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 printed, it is filled on the right
          with blanks or truncated if necessary to fit the field.
          Leading zeros are removed if the `-Z' flag is also given.

    `-R'
          Right justify and fill with leading blanks.  If N 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 printed, the field is left filled with blanks or
          truncated from the end.

    `-Z'
          Right justify and fill with leading zeros if the first
          non-blank character is a digit and the `-L' flag has not been
          set.  If N is nonzero it defines the width of the field;
          otherwise it is determined by the width of the value of the
          first assignment.

    `-f'
          The names refer to functions rather than parameters.  No
          assignments can be made, and the only other valid flags are
          `-t' and `-u'.  The flag `-t' turns on execution tracing for
          this function.  The flag `-u' causes this function to be
          marked for autoloading.  The `fpath' parameter will be
          searched to find the function definition when the function is
          first referenced.

    `-i'
          Use an internal integer representation.  If N is nonzero it
          defines the output arithmetic base, otherwise it is
          determined by the first assignment.

    `-l'
          Convert to lower case.

    `-r'
          The given NAMEs are marked readonly.

    `-t'
          Tags the named parameters.  Tags have no special meaning to
          the shell.

    `-u'
          Convert to upper case.

    `-x'
          Mark for automatic export to the environment of subsequently
          executed commands.

     Using `+' rather than `-' causes these flags to be turned off.  If
     no arguments are given but flags are specified, a list of named
     parameters which have these flags set is printed.  Using `+'
     instead of `-' keeps their values from being printed.  If no
     arguments or options are given, the names and attributes of all
     parameters are printed.  If just the `-m' flag is given the
     arguments are taken as patterns (which should be quoted), and all
     parameters or functions (with the `-f' flag) with matching names
     are printed.

`ulimit [ -Hacdflmnopstv ] [ LIMIT ]'
     Set or display a resource limit.  When setting a limit it will
     apply to the children of the shell but not to the shell itself.
     The value of limit can be a number in the unit specified below or
     the value `unlimited'.  If the `-H' flag is given use hard limits
     instead of soft limits.  See also `limit'.

    `-a'
          Lists all of the current resource limits.

    `-c'
          Maximum size of core dumps, in 512-byte blocks.

    `-d'
          Maximum size of the data segment, in Kbytes.

    `-f'
          Maximum size of individual files written, in 512-byte blocks.

    `-l'
          Maximum size of locked-in memory, in Kbytes.

    `-m'
          Maximum size of physical memory, in Kbytes.

    `-n'
          Maximum number of file descriptors.

    `-o'
          Maximum number of open files.

    `-p'
          Maximum number of processes.

    `-s'
          Maximum size of stack, in Kbytes.

    `-t'
          Maximum number of CPU seconds.

    `-v'
          Maximum size of virtual memory, in Kbytes.

`umask [ MASK ]'
     The umask is set to MASK.  MASK can be either an octal number or a
     symbolic value as described in `chmod(1)'.  If MASK is omitted,
     the current value is printed.  Note that in the symbolic form the
     permissions you specify are those which are to be allowed (not
     denied) to the users specified).

`unalias [ -m ] NAME ...'
     The alias definition, if any, for each NAME is removed.  With the
     `-m' flag, the arguments are taken as patterns (which should be
     quoted), and all aliases with matching names are removed.

`unfunction [ -m ] NAME ...'
     The function definition, if any, for each NAME is removed.  With
     the `-m' flag, the arguments are taken as patterns (which should be
     quoted), and all function with matching names are removed.

`unhash [ -m ] NAME ...'
     The entry in the command hash table, if any, for each NAME is
     removed.  With the `-m' flag, the arguments are taken as patterns
     (which should be quoted), and all entries for commands with
     matching names are removed.

`unlimit [ -h ] RESOURCE ...'
     The resource limit for each RESOURCE is set to the hard limit.  If
     the `-h' flag is given and the shell is running as root, the hard
     resource limit for each RESOURCE is removed.

`unset [ -m ] NAME ...'
     Each named parameter is unset.  With the `-m' flag, the arguments
     are taken as patterns (which should be quoted), and all parameters
     with matching names are unset.

`unsetopt [ -m ]  [ +-OPTIONS ] [ NAME ... ]'
     Unset the options for the shell.  All options specified either with
     flags or by name are unset.  With the `-m' flag, the arguments are
     taken as patterns (which should be quoted), and all options with
     matching names are unset.

`vared [ -c ] [ -p PROMPT] [ -r RPROMPT ] NAME'
     The value of the parameter NAME is loaded into the edit buffer,
     and the line editor is invoked.  When the editor exits, NAME is
     set to the string value returned by the editor.  If the `-c' flag
     is given, the parameter is created if it doesn't already exist.
     If the `-p' flag is given, PROMPT will be taken as the prompt to
     display at the left.  If the `-r' flag is given, RPROMPT will be
     taken as the prompt to display at the right.

`wait [ JOB ... ]'
     Wait for the specified jobs or processes.  If JOB is not given
     then all currently active child processes are waited for.  Each
     JOB 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.

`whence [ -acpvm ] NAME ...'
     For each name, indicate how it would be interpreted if used as a
     command name.  The `-v' flag produces a more verbose report.  The
     `-p' flag does a path search for NAME even if it is a shell
     function, alias, or reserved word.  The `-c' flag prints the
     results in a csh-like format.  The `-a' flag does a search for all
     occurences of NAME throughout the command path.  With the `-m'
     flag, the arguments are taken as patterns (which should be
     quoted), and the information is displayed for each command
     matching one of these patterns.

`which'
     Same as `whence -c'.


File: zsh.info,  Node: Invocation,  Next: Wrapping Up,  Prev: Shell Builtin Commands,  Up: Top

Invocation
**********

`zsh [ +-OPTIONS ] [ +-o OPTION ] ...  [ -c STRING ] [ ARG ... ]'

Commands are first read from `/etc/zshenv'.  If the `-f' flag is given
or if the `NO_RCS' option is set within `/etc/zshenv', all other
initialization files are skipped.  Otherwise, commands are read from
`$ZDOTDIR/.zshenv' (if `ZDOTDIR' is unset, `HOME' is used instead).  If
the first character of argument zero passed to the shell is `-', or if
the `-l' flag is present, then the shell is assumed to be a login
shell, and commands are read from `/etc/zprofile' and then
`$ZDOTDIR/.zprofile'.  Then, if the shell is interactive and the
`NO_RCS' option is unset, commands are read from `/etc/zshrc' and then
`$ZDOTDIR/.zshrc'.  Finally, if the shell is a login shell,
`/etc/zlogin' and `$ZDOTDIR/.zlogin' are read.

If the `-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:

`-c STRING'
     Read commands from STRING.

`-s'
     Read command from the standard input.

`-i'
     If this flag is present or the shell input and output are attached
     to a terminal, this shell is interactive.


File: zsh.info,  Node: Wrapping Up,  Next: Concept Index,  Prev: Invocation,  Up: Top

Wrapping Up
***********

See Also
========

sh(1), csh(1), tcsh(1), itcsh(1), rc(1), bash(1), ash(1), ksh(1),
clam(1), strftime(3).

Files
=====

$ZDOTDIR/.zshenv
$ZDOTDIR/.zprofile
$ZDOTDIR/.zshrc
$ZDOTDIR/.zlogin
$ZDOTDIR/.zlogout
/tmp/zsh*
/etc/zshenv
/etc/zprofile
/etc/zshrc
/etc/zlogin

Author
======

Paul Falstad (pf@z-code.com).  Programmable completion was implemented
by Sven Wischnowsky (oberon@cs.tu-berlin.de) and Peter Stephenson
(pws@s-a.amtp.liv.ac.uk).

Availability
============

The latest official release of zsh is available via anonymous ftp from
`ftp.sterling.com', in the directory `/zsh' and from
`carlo.phys.uva.nl', in the directory `/pub/bas/zsh'.

Undocumented Features
=====================

Known only to the recipients of the zsh mailing list,
`zsh-list@sterling.com'.  If you run into problems, please send your
questions and patches to the mailing list.  To subscribe to zsh-list,
send an email message with the body `subscribe zsh-list' to
`Majordomo@sterling.com'.

