ZSHBUILTINS(1)ZSHBUILTINS(1)NAMEzshbuiltins - zsh built-in functions
DESCRIPTIONS
- simple command
See the secion PRECOMMAND MODIFIERS in zshmisc(1).
. file [ arg ... ]
Read commands from file and execute them in the
current shell environment. If file does not con
tain a slash, or if PATH_DIRS is set, the shell
looks in the components of path to find the direc
tory containing file. Files in the current direc
tory 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 exe
cuting. 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 [ -gmrL ] [ name[=value] ] ...
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 sub
stitution. If the -g flag is present, 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. With no arguments, print all currently
defined aliases. If the -m flag is given the argu
ments 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 -g or
-r flags are present, then restrict the printing to
global or regular aliases, respectively. If the -L
flag is present, then print each alias in a manner
suitable for putting in a startup script. 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 func
tions), create a function marked undefined. The
fpath variable will be searched to find the actual
function definition when the function is first ref
erenced. The definition is contained in a file of
the same name as the function. If the file found
contains a standard definition for the function,
that is stored as the function; otherwise, the
zsh version 3.0 June 26, 1996 1
ZSHBUILTINS(1)ZSHBUILTINS(1)
contents of the entire file are stored as the func
tion. The latter format allows functions to be
used directly as scripts.
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
or vi mode respectively; they cannot be used simul
taneously. 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 exist and
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 preceding options,
or the current mode if used alone. Any previous
bindings 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 com_
mand 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. This pro
cess is recursive but, to avoid infinite loops, the
shell will report an error if more than 20 consecu
tive replacements happen. If the -a option is spec
ified, bind the in-strings in the alternative
keymap instead of the standard one. The alterna
tive keymap is used in vi command mode.
It's possible for an in-string to be bound to some
thing 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 and if not
it will execute the binding. This timeout is
defined by the KEYTIMEOUT parameter; its default is
0.4 sec. No timeout is done if the prefix string is
not bound.
For either in-string or out-string, control charac
ters may be specified in the form ^X, and the back
slash may be used to introduce one of the following
escape sequences:
zsh version 3.0 June 26, 1996 2
ZSHBUILTINS(1)ZSHBUILTINS(1)
\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 `C' is optional.
In all other cases, \ escapes the following charac
ter. 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 bind
key 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 direc
tory.
zsh version 3.0 June 26, 1996 3
ZSHBUILTINS(1)ZSHBUILTINS(1)
The third form of cd extracts an entry from the
directory stack, and changes to that directory. An
argument of the form +n identifies a stack entry by
counting from the left of the list shown by the
dirs command, starting with zero. An argument of
the form -n counts from the right. If the
PUSHD_MINUS option is set, the meanings of + and -
in this context are swapped.
chdir Same as cd.
command simple command
See the secion PRECOMMAND MODIFIERS in zshmisc(1).
compctl
Compctl has it's own man page. Check zshcom_
pctl(1).
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 nth enclosing loop.
declare [ arg ... ]
Same as typeset.
dirs [ -v ] [ arg ... ]
With no arguments, print the contents of the direc
tory stack. If the -v option is given, number the
directories in the stack when printing. Directo
ries are added to this stack with the pushd com
mand, and removed with the cd or popd commands. If
arguments are specified, load them onto the direc
tory stack, replacing anything that was there, and
push the current directory onto the stack.
disable [ -afmr ] arg ...
Disable the hash table element named arg temporar
ily. The default is to disable builtin commands.
This allows you to use an external command with the
same name as a builtin command. The -a option
causes disable to act on aliases. The -f option
causes disable to act on shell functions. The -r
options causes disable to act on reserved words.
Without arguments all disabled hash table elements
from the corresponding hash table are printed.
With the -m flag the arguments are taken as pat
terns (should be quoted to preserve them from being
taken as glob patterns) and all hash table elements
from the corresponding hash table matching these
patterns are disabled. Disabled objects can be
enabled with the enable command.
zsh version 3.0 June 26, 1996 4
ZSHBUILTINS(1)ZSHBUILTINS(1)
disown [ job ... ]
job ... &|
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. If no job is
specified, use the current job.
echo [ -neE ] [ arg ... ]
Write each arg on the standard output, with a space
separating each one. If the -n flag is not pre
sent, print a newline at the end. echo recognizes
the following escape sequences:
\a bell character
\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 maxi
mum of two digits after the `x'; a non-hex
adecimal digit terminates the number.
The -E falg or the BSD_ECHO option can be used to
disable these escape sequences. In the later case
-e flag can be used to enable them.
echotc cap [ arg ... ]
Output the termcap string corresponding to the
capability cap, with optional arguments.
emulate [ -LR ] [ zsh | sh | ksh | csh ]
Set up zsh options to emulate the specified shell
as much as possible. csh will never be fully emu
lated. If the argument is not one of the shells
listed above, zsh will be used as a default. If
the -R option is given, all options are reset to
their default value corresponding to the specified
emulation mode, except for certain options describ
ing the interactive environment; otherwise, only
those options likely to cause portability problems
in scripts and functions are altered. If the -L
option is given, the option LOCAL_OPTIONS will be
set as well, causing the effect of the emulate com
mand to be local to the immediately surrounding
shell function, if any; normally this is turned off
zsh version 3.0 June 26, 1996 5
ZSHBUILTINS(1)ZSHBUILTINS(1)
in all emulation modes except ksh.
enable [ -afmr ] arg ...
Enable the hash table element named arg, presumably
disabled earlier with disable. The default is to
enable builtin commands. The -a option causes
enable to act on aliases. The -f option causes
enable to act on shell functions. The -r option
causes enable to act on reserved words. Without
arguments all enable hash table elememts from the
corresponding hash table are printed. With the -m
flag the arguments are taken as patterns (should be
quoted) and all hash table elements from the corre
sponding hash table matching these patterns are
enabled. Enabled objects can be disabled with the
disable builtin command.
eval [ arg ... ]
Read the arguments as input to the shell and exe
cute the resulting command(s) in the current shell
process.
exec simple command
See the secion PRECOMMAND MODIFIERS in zshmisc(1).
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 IGNOREEOF
option is set.
export [ name[=value] ... ]
The specified names are marked for automatic export
to the environment of subsequently executed com
mands. export is equivalent to typeset -x.
false Do nothing and return an exit code of 1.
fc [ -e ename ] [ -nlrdDfEim ] [ 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 nega
tive 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 (should be quoted) and only the
history events matching this pattern will be shown.
zsh version 3.0 June 26, 1996 6
ZSHBUILTINS(1)ZSHBUILTINS(1)
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 exe
cuted. 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 list
ing. Also when listing, -d prints timestamps for
each command, and -f prints full time-date stamps.
Adding the -E flag causes the dates to be printed
as `dd.mm.yyyy', instead of the default
`mm/dd/yyyy'. Adding the -i flag causes the dates
to be printed as `yyyy-mm-dd', in a fixed format.
With the -D flag, fc prints elapsed times.
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 out to the given file. fc -AI
(-WI) appends (writes) only those events that are
new since 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 sup
ported, too.
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,
zsh version 3.0 June 26, 1996 7
ZSHBUILTINS(1)ZSHBUILTINS(1)
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 [ -dfmr ] [ name[=value] ] ...
With no arguments or options, hash will list the
entire command hash table.
The -m option causes the arguments to be taken as
patterns (they should be quoted) and the elements
of the command hash table matching these patterns
are printed.
The -r option causes the command hash table to be
thrown out and restarted. The -f option causes the
entire path to be searched, and all the commands
found are added to the hash table. These options
cannot be used with any arguments.
For each name with a corresponding value, put name
in the command hash table, associating it with the
pathname value. Whenever name is used as a command
argument, the shell will try to execute the file
given by value. For each name with no correspond
ing value, search for name in the path, and add it
to the command hash table, and associating it with
the discovered path, if it is found.
Adding the -d option causes hash to act on the
named directory table instead of the command hash
table. The remaing discussion of hash will assume
that the -d is given.
If invoked without any arguments, and without any
other options, hash -d lists the entire named
directory table.
The -m option causes the arguments to be taken as
patterns (they should be quoted) and the elements
of the named directory table matching these pat
terns are printed.
The -r option causes the named directory table to
be thrown out and restarted so that it only con
tains `~'. The -f option causes all usernames to
be added to the named directory table. There
options cannot be used with any arguments.
zsh version 3.0 June 26, 1996 8
ZSHBUILTINS(1)ZSHBUILTINS(1)
For each name with a corresponding value, put name
in the named directory table. The directory name
name is then associated with the specified path
value, so that value may be referred to as `~name'.
For each name with no corresponding value, search
for as a username and as a parameter. If it is
found, it is added to the named directory hash
table.
history [ -nrdDfEim ] [ 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 specified only running jobs will be listed
and if the -s flag is given only stopped jobs are
shown.
kill [ -s signal_name ] job ...
kill [ -sig ] job ...
kill -l [ sig ... ]
Sends either SIGTERM or the specified signal to the
given jobs or processes. Signals are given by num
ber or by names, without the SIG prefix. 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 third form, kill -l, if sig
is not specified the signal names are listed. Oth
erwise, for each sig that is a name, the corre
sponding signal number is listed. For each sig
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.
let arg ...
Evaluate each arg as an arithmetic expression. See
ARITHMETIC EVALUATION in zshmisc(1) for a descrip
tion of arithmetic expressions. The exit status is
0 if the value of the last expression is nonzero,
and 1 otherwise.
limit [ -hs ] [ resource [ limit ] ] ...
Set or display resource limits. Unless the -s flag
is given the limit applies only the children of the
shell. If -s is given without other arguments, the
resource limits of the current shell is set to the
zsh version 3.0 June 26, 1996 9
ZSHBUILTINS(1)ZSHBUILTINS(1)
previously set resource limits of the children. 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.
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
Maximum resident set size.
memoryuse
The same as resident.
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.
noglob simple command
See the secion PRECOMMAND MODIFIERS in zshmisc(1).
zsh version 3.0 June 26, 1996 10
ZSHBUILTINS(1)ZSHBUILTINS(1)
popd [ n ]
Removes a entry from the directory stack, and per
form a cd to the new top directory. With no argu
ment, the current top entry is removed. An argu
ment of the form +n identifies a stack entry by
counting from the left of the list shown by the
dirs command, starting with zero. An argument of
the form -n counts from the right. If the
PUSHD_MINUS option is set, the meanings of + and -
in this context are swapped.
print [ -nrslzpNDPoOicm ] [ -un ] [ -R [ -en ]] [ 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 ignore the escape conventions of echo.
-R emulate the BSD echo command which does not
process escape sequences unless the -e flag
is given. The -n flag suppresses the trail
ing newline. Only the -e and -n flags are
recognized after -R, all other arguments and
options are printed.
-m Take the fist argument as a pattern (should
be quoted) and remove it from the argument
list together with subsequent arguments that
do not match this pattern.
-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 them
work case independently
-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,
zsh version 3.0 June 26, 1996 11
ZSHBUILTINS(1)ZSHBUILTINS(1)
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 cur
rent 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 direc
tory.
The third form of pushd changes directory by rotat
ing the directory list. An argument of the form +n
identifies a stack entry by counting from the left
of the list shown by the dirs command, starting
with zero. An argument of the form -n counts from
the right. If the PUSHD_MINUS option is set, the
meanings of + and - in this context are swapped.
pushln Equivalent to print -nz.
pwd [ -r ]
Print the absolute pathname of the current working
directory. If the -r flag is specified or the
CHASE_LINKS option is set, the printed path will
not contain symbolic links.
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.
zsh version 3.0 June 26, 1996 12
ZSHBUILTINS(1)ZSHBUILTINS(1)-r Raw mode: a \ at the end of a line does not
signify line continuation.
-q Read only one character from the terminal
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'.
-k [ num ]
Read only one (or num) characters from the
terminal.
-z 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.
-e
-E The words read are printed after the whole
line is read. If the -e flag is set, the
words are not assigned to the parameters.
-A The first name is taken as the name of an
array and all words are assigned to it.
-c
-l These flags are allowed only if called
inside a function used for completion (spec
ified 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. If
name is omitted then REPLY is used for
scalars and reply for arrays.
-n Together with either of the previous flags,
this option gives the number of the word the
cursor is on or the index of the character
the cursor is on respectively.
-un Input is read from file descriptor n.
-p 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 [ -df ]
Throw out the command hash table and start over.
If the -f option is set, rescan the command path
immediately, instead of rebuilding the hash table
incrementally.
The -d option causes rehash to act on the named
directory table instead of the command hash table.
zsh version 3.0 June 26, 1996 13
ZSHBUILTINS(1)ZSHBUILTINS(1)
This reduces the named directory table to only the
`~' entry. If the -f option is also used, the
named directory table is rebuilt immediately.
rehash is equivalent to hash -r.
return [ n ]
Causes a shell function or . script to return to
the invoking script with the return status speci
fied by n. If n is omitted then the return status
is that of the last command executed.
If return was executed from a trap in 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 process
ing; 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 abso
lute 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 posi
tional parameters, or declare and set an array. If
the -s option is given it causes the specified
arguments to be sorted before assigning them to the
positional parameters (or to the array name if -A
is used). With +s sort arguments in descending
order. For the meaning of the other flags, see the
zshoptions man page. Flags may be specified by
name using the -o option. If the -A flag is speci
fied, name is set to an array containing the given
args; if +A is used and name is an array, the gien
arguments will replace the initial elements of that
array; 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 stan
dard output. If the only argument is +, the names
of all parameters are printed.
zsh version 3.0 June 26, 1996 14
ZSHBUILTINS(1)ZSHBUILTINS(1)
setopt [ options ] [ name ... ]
Set the options for the shell. All options speci
fied 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 (should be quoted to preserve
them from being interpreted as glob patterns) and
all options with names matching these patterns 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 SIGT
STP) 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 compat
ibility; 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 series of commands (usually quoted to pro
tect it from immediate evaluation by the shell) 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. 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 exe
cuted 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
zsh version 3.0 June 26, 1996 15
ZSHBUILTINS(1)ZSHBUILTINS(1)
command with no arguments prints a list of commands
associated with each signal. Note that traps
defined with the trap builtin are slightly differ
ent from those defined as `TRAPNAL () { ... }', 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.
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
or is suspended. 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 [ -fpam ] name ...
Same as whence -v.
typeset [ LRUZfilrtuxm [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 com
pletes. The new parameter will not be exported
unless ALLEXPORT is set, in which case the parame
ter 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 deter
mined 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 set.
-R Right justify and fill with leading blanks.
If n 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 printed, the field is
left filled with blanks or truncated from
the end.
-U For arrays keep only the first element of
each duplications. It can also be set for
colon separated special parameters like PATH
zsh version 3.0 June 26, 1996 16
ZSHBUILTINS(1)ZSHBUILTINS(1)
or FIGNORE, etc.
-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; see autoload.
-i Use an internal integer representation. If
n is nonzero it defines the output arith
metic 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 only the -m flag is
given the arguments are taken as patterns (should
be quoted) and all parameters or functions (with
the -f flag) with matching names are printed.
ulimit [ -SHacdflmnpstv ] [ limit ] ...
Set or display resource limits of the shell and the
processes started by the shell. 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. If the -S flag is
given together with the -H flag set both hard and
soft limits. If no options are used, the file size
limit (-f) is assumed. If limit 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.
-a Lists all of the current resource limits.
zsh version 3.0 June 26, 1996 17
ZSHBUILTINS(1)ZSHBUILTINS(1)-c The number of 512-byte blocks on the size of
core dumps.
-d The number of K-bytes on the size of the
data segment.
-f The number of 512-byte blocks on the size of
files written.
-l The number of K-bytes on the size of locked-
in memory.
-m The number of K-bytes on the size of physi
cal memory.
-n The number of open file descriptors.
-s The number of K-bytes on the size of the
stack.
-t The number of CPU seconds to be used.
-u The number of processes available to the
user.
-v The number of K-bytes on the size of virtual
memory.
umask [ -S ] [ 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. The -S 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.
unalias [ -m ] name ...
The alias definition, if any, for each name is
removed. With the -m flag the arguments are taken
as patterns (should be quoted) and all aliases with
names matching the patterns are removed. unalias
is equivalent to unhash -a.
unfunction [ -m ] name ...
The function definition, if any, for each name is
removed. If the -m flag is specified the arguments
are taken as patterns (should be quoted) and all
functions with names matching the patterns are
removed. unfunction is equivalent to unhash -f.
unhash [ -adfm ] name ...
Remove the element named name from an internal hash
table. The default is remove elements from the
command hash table. The -a option causes unhash to
remove aliases. The -f option causes unhash to
remove shell functions. The -d options causes
unhash to remove named directories. If the -m flag
is given the arguments are taken as patterns
(should be quoted) and all elements of the corre
sponding hash table with matching names will be
zsh version 3.0 June 26, 1996 18
ZSHBUILTINS(1)ZSHBUILTINS(1)
removed.
unlimit [ -hs ] 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. The resources of the
shell process are only changed if the -s flag is
given.
unset [ -fm ] name ...
Each named parameter is unset. If the -m flag is
specified the arguments are taken as patterns
(should be quoted) and all parameters with matching
names are unset. Unset -f is equivalent to unfunc
tion.
unsetopt [ options ] [ name ... ]
Unset the options for the shell. All options spec
ified either with flags or by name are unset. If
the -m flag is given the arguments are considered
to be patterns (don't forget to quote them) and all
options with names matching these patterns are
unset.
vared [ -c ] [ -h ] [ -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 the following
string will be taken as the prompt to display at
the left and if the -r flag is given the following
string gives the prompt to display at the right.
If the -h flag is specified, the history can be
accessed from zle.
wait [ job ... ]
Wait for the specified jobs or processes. If job
is not given then all currently active child pro
cesses 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 [ -vcfpam ] 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 -c flag prints the
results in a csh-like format, and takes precedence
over -v. The -f flag causes the contents of a
shell function to be displayed, which would other
wise not happen unless the -c flag were used. The
zsh version 3.0 June 26, 1996 19
ZSHBUILTINS(1)ZSHBUILTINS(1)-p flag does a path search for name even if it is
an alias, reserved word, shell function or builtin.
The -a flag does a search for all occurrences of
name throughout the command path. With the -m flag
the arguments are taken as patterns (should be
quoted) and the information is displayed for each
command matching one of these patterns.
where Same as whence -ca.
which [ -pam ] name ...
Same as whence -c.
zsh version 3.0 June 26, 1996 20