(zsh.info.gz) The zsh/parameter Module
Info Catalog
(zsh.info.gz) The zsh/newuser Module
(zsh.info.gz) Zsh Modules
(zsh.info.gz) The zsh/pcre Module
22.18 The zsh/parameter Module
==============================
The zsh/parameter module gives access to some of the internal hash
tables used by the shell by defining some special parameters.
options
The keys for this associative array are the names of the options
that can be set and unset using the setopt and unsetopt builtins.
The value of each key is either the string on if the option is
currently set, or the string off if the option is unset. Setting a
key to one of these strings is like setting or unsetting the
option, respectively. Unsetting a key in this array is like
setting it to the value off.
commands
This array gives access to the command hash table. The keys are
the names of external commands, the values are the pathnames of the
files that would be executed when the command would be invoked.
Setting a key in this array defines a new entry in this table in
the same way as with the hash builtin. Unsetting a key as in
'unset "commands[foo]"' removes the entry for the given key from
the command hash table.
functions
This associative array maps names of enabled functions to their
definitions. Setting a key in it is like defining a function with
the name given by the key and the body given by the value.
Unsetting a key removes the definition for the function named by
the key.
dis_functions
Like functions but for disabled functions.
builtins
This associative array gives information about the builtin commands
currently enabled. The keys are the names of the builtin commands
and the values are either 'undefined' for builtin commands that
will automatically be loaded from a module if invoked or 'defined'
for builtin commands that are already loaded.
dis_builtins
Like builtins but for disabled builtin commands.
reswords
This array contains the enabled reserved words.
dis_reswords
Like reswords but for disabled reserved words.
aliases
This maps the names of the regular aliases currently enabled to
their expansions.
dis_aliases
Like aliases but for disabled regular aliases.
galiases
Like aliases, but for global aliases.
dis_galiases
Like galiases but for disabled global aliases.
saliases
Like raliases, but for suffix aliases.
dis_saliases
Like saliases but for disabled suffix aliases.
parameters
The keys in this associative array are the names of the parameters
currently defined. The values are strings describing the type of
the parameter, in the same format used by the t parameter flag, see
Parameter Expansion . Setting or unsetting keys in this
array is not possible.
modules
An associative array giving information about modules. The keys
are the names of the modules loaded, registered to be autoloaded,
or aliased. The value says which state the named module is in and
is one of the strings 'loaded', 'autoloaded', or 'alias:NAME',
where NAME is the name the module is aliased to.
Setting or unsetting keys in this array is not possible.
dirstack
A normal array holding the elements of the directory stack. Note
that the output of the dirs builtin command includes one more
directory, the current working directory.
history
This associative array maps history event numbers to the full
history lines.
historywords
A special array containing the words stored in the history.
jobdirs
This associative array maps job numbers to the directories from
which the job was started (which may not be the current directory
of the job).
The keys of the associative arrays are usually valid job numbers,
and these are the values output with, for example, ${(k)jobdirs}.
Non-numeric job references may be used when looking up a value; for
example, ${jobdirs[%+]} refers to the current job.
jobtexts
This associative array maps job numbers to the texts of the command
lines that were used to start the jobs.
Handling of the keys of the associative array is as described for
jobdirs above.
jobstates
This associative array gives information about the states of the
jobs currently known. The keys are the job numbers and the values
are strings of the form 'JOB-STATE:MARK:PID=STATE...'. The
JOB-STATE gives the state the whole job is currently in, one of
'running', 'suspended', or 'done'. The MARK is '+' for the current
job, '-' for the previous job and empty otherwise. This is
followed by one 'PID=STATE' for every process in the job. The PIDs
are, of course, the process IDs and the STATE describes the state
of that process.
Handling of the keys of the associative array is as described for
jobdirs above.
nameddirs
This associative array maps the names of named directories to the
pathnames they stand for.
userdirs
This associative array maps user names to the pathnames of their
home directories.
usergroups
This associative array maps names of system groups of which the
current user is a member to the corresponding group identifiers.
The contents are the same as the groups output by the id command.
funcfiletrace
This array contains the absolute line numbers and corresponding
file names for the point where the current function, sourced file,
or (if EVAL_LINENO is set) eval command was called. The array is
of the same length as funcsourcetrace and functrace, but differs
from funcsourcetrace in that the line and file are the point of
call, not the point of definition, and differs from functrace in
that all values are absolute line numbers in files, rather than
relative to the start of a function, if any.
funcsourcetrace
This array contains the file names and line numbers of the points
where the functions, sourced files, and (if EVAL_LINENO is set)
eval commands currently being executed were defined. The line
number is the line where the 'function NAME' or 'NAME ()' started.
In the case of an autoloaded function the line number is reported
as zero. The format of each element is FILENAME:LINENO. For
functions autoloaded from a file in native zsh format, where only
the body of the function occurs in the file, or for files that have
been executed by the source or '.' builtins, the trace information
is shown as FILENAME:0, since the entire file is the definition.
Most users will be interested in the information in the
funcfiletrace array instead.
funcstack
This array contains the names of the functions, sourced files, and
(if EVAL_LINENO is set) eval commands. currently being executed.
The first element is the name of the function using the parameter.
functrace
This array contains the names and line numbers of the callers
corresponding to the functions currently being executed. The
format of each element is NAME:LINENO. Callers are also shown for
sourced files; the caller is the point where the source or '.'
command was executed.
Info Catalog
(zsh.info.gz) The zsh/newuser Module
(zsh.info.gz) Zsh Modules
(zsh.info.gz) The zsh/pcre Module
automatically generated by
info2html