Sophie

Sophie

distrib > Mageia > 2 > x86_64 > media > core-release > by-pkgid > b4c2f86181a386a57835220d04d25ac6 > files > 150

zsh-doc-4.3.11-1.mga2.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Created on December 20, 2010 by texi2html 1.82
texi2html was written by: 
            Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>zsh: 15. Parameters</title>

<meta name="description" content="zsh: 15. Parameters">
<meta name="keywords" content="zsh: 15. Parameters">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.82">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.roman {font-family:serif; font-weight:normal;}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<a name="Parameters"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="Expansion.html#Glob-Qualifiers" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Description" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="Expansion.html#Expansion" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="zsh.html#Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="Options.html#Options" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="zsh.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="zsh_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concept-Index.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="zsh_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>

<a name="Parameters-4"></a>
<h1 class="chapter">15. Parameters</h1>
<a name="index-parameters"></a>

<hr size="6">
<a name="Description"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Parameters" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Array-Parameters" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Parameters" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Parameters" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="Options.html#Options" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="zsh.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="zsh_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concept-Index.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="zsh_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section">15.1 Description</h2>
<p>A parameter has a name, a value, and a number of attributes.
A name may be any sequence of alphanumeric
characters and underscores, or the single characters
&lsquo;<tt>*</tt>&rsquo;, &lsquo;<tt>@</tt>&rsquo;, &lsquo;<tt>#</tt>&rsquo;, &lsquo;<tt>?</tt>&rsquo;, &lsquo;<tt>-</tt>&rsquo;, &lsquo;<tt>$</tt>&rsquo;, or &lsquo;<tt>!</tt>&rsquo;.
The value may be a <em>scalar</em> (a string),
an integer, an array (indexed numerically), or an <em>associative</em>
array (an unordered set of name-value pairs, indexed by name).  To declare
the type of a parameter, or to assign a scalar or integer value to a
parameter, use the <tt>typeset</tt> builtin.
<a name="index-typeset_002c-use-of"></a>
</p>
<p>The value of a scalar or integer parameter may also be assigned by
writing:
<a name="index-assignment"></a>
</p>
<blockquote><p><var>name</var><tt>=</tt><var>value</var>
</p></blockquote>

<p>If the integer attribute, <tt>-i</tt>, is set for <var>name</var>, the <var>value</var>
is subject to arithmetic evaluation.  Furthermore, by replacing &lsquo;<tt>=</tt>&rsquo;
with &lsquo;<tt>+=</tt>&rsquo;, a parameter can be added or appended to.  See
<a href="#Array-Parameters">Array Parameters</a> for additional forms of assignment.
</p>
<p>To refer to the value of a parameter, write &lsquo;<tt>$</tt><var>name</var>&rsquo; or
&lsquo;<tt>${</tt><var>name</var><tt>}</tt>&rsquo;.  See
<a href="Expansion.html#Parameter-Expansion">Parameter Expansion</a>
for complete details.
</p>
<p>In the parameter lists that follow, the mark &lsquo;&lt;S&gt;&rsquo; indicates that the
parameter is special.
Special parameters cannot have their type changed or their
readonly attribute turned off, and if a special parameter is unset, then
later recreated, the special properties will be retained.  &lsquo;&lt;Z&gt;&rsquo; indicates
that the parameter does not exist when the shell initializes in <tt>sh</tt> or
<tt>ksh</tt> emulation mode.
</p><table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Array-Parameters">15.2 Array Parameters</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Positional-Parameters">15.3 Positional Parameters</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Local-Parameters">15.4 Local Parameters</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Parameters-Set-By-The-Shell">15.5 Parameters Set By The Shell</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Parameters-Used-By-The-Shell">15.6 Parameters Used By The Shell</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>
<hr size="6">
<a name="Array-Parameters"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Description" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Array-Subscripts" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Parameters" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Parameters" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="Options.html#Options" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="zsh.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="zsh_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concept-Index.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="zsh_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>

<a name="Array-Parameters-1"></a>
<h2 class="section">15.2 Array Parameters</h2>
<p>To assign an array value, write one of:
<a name="index-set_002c-use-of"></a>
<a name="index-array-assignment"></a>
</p>
<blockquote><p><tt>set -A</tt> <var>name</var> <var>value</var> ...
</p></blockquote>
<blockquote><p><var>name</var><tt>=(</tt><var>value</var> ...<tt>)</tt>
</p></blockquote>

<p>If no parameter <var>name</var> exists, an ordinary array parameter is created.
If the parameter <var>name</var> exists and is a scalar, it is replaced by a new
array.  Ordinary array parameters may also be explicitly declared with:
<a name="index-typeset_002c-use-of-1"></a>
</p>
<blockquote><p><tt>typeset -a</tt> <var>name</var>
</p></blockquote>

<p>Associative arrays <em>must</em> be declared before assignment, by using:
</p>
<blockquote><p><tt>typeset -A</tt> <var>name</var>
</p></blockquote>

<p>When <var>name</var> refers to an associative array, the list in an assignment
is interpreted as alternating keys and values:
</p>
<blockquote><p>set -A <var>name</var> <var>key</var> <var>value</var> ...
</p></blockquote>
<blockquote><p><var>name</var><tt>=(</tt><var>key</var> <var>value</var> ...<tt>)</tt>
</p></blockquote>

<p>Every <var>key</var> must have a <var>value</var> in this case.  Note that this
assigns to the entire array, deleting any elements that do not appear
in the list.
</p>
<p>To create an empty array (including associative arrays), use one of:
</p>
<blockquote><p><tt>set -A</tt> <var>name</var>
</p></blockquote>
<blockquote><p><var>name</var><tt>=()</tt>
</p></blockquote>


<hr size="6">
<a name="Array-Subscripts"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Array-Parameters" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Array-Element-Assignment" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Parameters" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Array-Parameters" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="Options.html#Options" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="zsh.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="zsh_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concept-Index.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="zsh_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">15.2.1 Array Subscripts</h3>
<a name="index-subscripts"></a>

<p>Individual elements of an array may be selected using a subscript.  A
subscript of the form &lsquo;<tt>[</tt><var>exp</var><tt>]</tt>&rsquo; selects the single element
<var>exp</var>, where <var>exp</var> is an arithmetic expression which will be subject
to arithmetic expansion as if it were surrounded by
&lsquo;<tt>$((</tt>...<tt>))</tt>&rsquo;.  The elements are numbered
beginning with 1, unless the <tt>KSH_ARRAYS</tt> option is set in which case
they are numbered from zero.
<a name="index-KSH_005fARRAYS_002c-use-of"></a>
</p>
<p>Subscripts may be used inside braces used to delimit a parameter name, thus
&lsquo;<tt>${foo[2]}</tt>&rsquo; is equivalent to &lsquo;<tt>$foo[2]</tt>&rsquo;.  If the <tt>KSH_ARRAYS</tt>
option is set, the braced form is the only one that works, as bracketed
expressions otherwise are not treated as subscripts.
</p>
<p>If the <tt>KSH_ARRAYS</tt> option is not set, then by default accesses to
an array element with a subscript that evaluates to zero return an
empty string, while an attempt to write such an element is treated as
an error.  For backward compatibility the <tt>KSH_ZERO_SUBSCRIPT</tt>
option can be set to cause subscript values 0 and 1 to be equivalent; see
the description of the option in <a href="Options.html#Description-of-Options">Description of Options</a>.
</p>
<p>The same subscripting syntax is used for associative arrays, except that
no arithmetic expansion is applied to <var>exp</var>.  However, the parsing
rules for arithmetic expressions still apply, which affects the way that
certain special characters must be protected from interpretation.  See
<em>Subscript Parsing</em> below for details.
</p>
<p>A subscript of the form &lsquo;<tt>[*]</tt>&rsquo; or &lsquo;<tt>[@]</tt>&rsquo; evaluates to all elements
of an array; there is no difference between the two except when they
appear within double quotes.
&lsquo;<tt>&quot;$foo[*]&quot;</tt>&rsquo; evaluates to &lsquo;<tt>&quot;$foo[1] $foo[2] </tt>...<tt>&quot;</tt>&rsquo;, whereas
&lsquo;<tt>&quot;$foo[@]&quot;</tt>&rsquo; evaluates to &lsquo;<tt>&quot;$foo[1]&quot; &quot;$foo[2]&quot; </tt>...&rsquo;.  For
associative arrays, &lsquo;<tt>[*]</tt>&rsquo; or &lsquo;<tt>[@]</tt>&rsquo; evaluate to all the values,
in no particular order.  Note that this does not substitute
the keys; see the documentation for the &lsquo;<tt>k</tt>&rsquo; flag under
<a href="Expansion.html#Parameter-Expansion">Parameter Expansion</a>
for complete details.
When an array parameter is referenced as &lsquo;<tt>$</tt><var>name</var>&rsquo; (with no
subscript) it evaluates to &lsquo;<tt>$</tt><var>name</var><tt>[*]</tt>&rsquo;, unless the <tt>KSH_ARRAYS</tt>
option is set in which case it evaluates to &lsquo;<tt>${</tt><var>name</var><tt>[0]}</tt>&rsquo; (for
an associative array, this means the value of the key &lsquo;<tt>0</tt>&rsquo;, which may
not exist even if there are values for other keys).
</p>
<p>A subscript of the form &lsquo;<tt>[</tt><var>exp1</var><tt>,</tt><var>exp2</var><tt>]</tt>&rsquo;
selects all elements in the range <var>exp1</var> to <var>exp2</var>,
inclusive. (Associative arrays are unordered, and so do not support
ranges.) If one of the subscripts evaluates to a negative number,
say <tt>-</tt><var>n</var>, then the <var>n</var>th element from the end
of the array is used.  Thus &lsquo;<tt>$foo[-3]</tt>&rsquo; is the third element
from the end of the array <tt>foo</tt>, and
&lsquo;<tt>$foo[1,-1]</tt>&rsquo; is the same as &lsquo;<tt>$foo[*]</tt>&rsquo;.
</p>
<p>Subscripting may also be performed on non-array values, in which
case the subscripts specify a substring to be extracted.
For example, if <tt>FOO</tt> is set to &lsquo;<tt>foobar</tt>&rsquo;, then
&lsquo;<tt>echo $FOO[2,5]</tt>&rsquo; prints &lsquo;<tt>ooba</tt>&rsquo;.
</p>

<hr size="6">
<a name="Array-Element-Assignment"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Array-Subscripts" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Subscript-Flags" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Parameters" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Array-Parameters" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="Options.html#Options" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="zsh.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="zsh_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concept-Index.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="zsh_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">15.2.2 Array Element Assignment</h3>

<p>A subscript may be used on the left side of an assignment like so:
</p>
<blockquote><p><var>name</var><tt>[</tt><var>exp</var><tt>]=</tt><var>value</var>
</p></blockquote>

<p>In this form of assignment the element or range specified by <var>exp</var>
is replaced by the expression on the right side.  An array (but not an
associative array) may be created by assignment to a range or element.
Arrays do not nest, so assigning a parenthesized list of values to an
element or range changes the number of elements in the array, shifting the
other elements to accommodate the new values.  (This is not supported for
associative arrays.)
</p>
<p>This syntax also works as an argument to the <tt>typeset</tt> command:
</p>
<blockquote><p><tt>typeset</tt> <tt>&quot;</tt><var>name</var><tt>[</tt><var>exp</var><tt>]&quot;=</tt><var>value</var>
</p></blockquote>

<p>The <var>value</var> may <em>not</em> be a parenthesized list in this case; only
single-element assignments may be made with <tt>typeset</tt>.  Note that quotes
are necessary in this case to prevent the brackets from being interpreted
as filename generation operators.  The <tt>noglob</tt> precommand modifier
could be used instead.
</p>
<p>To delete an element of an ordinary array, assign &lsquo;<tt>()</tt>&rsquo; to
that element.  To delete an element of an associative array, use the
<tt>unset</tt> command:
</p>
<blockquote><p><tt>unset</tt> <tt>&quot;</tt><var>name</var><tt>[</tt><var>exp</var><tt>]&quot;</tt>
</p></blockquote>


<hr size="6">
<a name="Subscript-Flags"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Array-Element-Assignment" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Subscript-Parsing" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Parameters" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Array-Parameters" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="Options.html#Options" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="zsh.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="zsh_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concept-Index.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="zsh_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">15.2.3 Subscript Flags</h3>
<a name="index-subscript-flags"></a>

<p>If the opening bracket, or the comma in a range, in any subscript
expression is directly followed by an opening parenthesis, the string up
to the matching closing one is considered to be a list of flags, as in
&lsquo;<var>name</var><tt>[(</tt><var>flags</var><tt>)</tt><var>exp</var><tt>]</tt>&rsquo;.
</p>
<p>The flags <tt>s</tt>, <tt>n</tt> and <tt>b</tt> take an argument; the delimiter
is shown below as &lsquo;<tt>:</tt>&rsquo;, but any character, or the matching pairs
&lsquo;<tt>(</tt>...<tt>)</tt>&rsquo;, &lsquo;<tt>{</tt>...<tt>}</tt>&rsquo;, &lsquo;<tt>[</tt>...<tt>]</tt>&rsquo;, or
&lsquo;<tt>&lt;</tt>...<tt>&gt;</tt>&rsquo;, may be used.
</p>
<p>The flags currently understood are:
</p>
<dl compact="compact">
<dt> <tt>w</tt></dt>
<dd><p>If the parameter subscripted is a scalar then this flag makes
subscripting work on words instead of characters.  The default word
separator is whitespace.  This flag may not be used with the <tt>i</tt> or
<tt>I</tt> flag.
</p>
</dd>
<dt> <tt>s:</tt><var>string</var><tt>:</tt></dt>
<dd><p>This gives the <var>string</var> that separates words (for use with the
<tt>w</tt> flag).  The delimiter character <tt>:</tt> is arbitrary; see above.
</p>
</dd>
<dt> <tt>p</tt></dt>
<dd><p>Recognize the same escape sequences as the <tt>print</tt> builtin in
the string argument of a subsequent &lsquo;<tt>s</tt>&rsquo; flag.
</p>
</dd>
<dt> <tt>f</tt></dt>
<dd><p>If the parameter subscripted is a scalar then this flag makes
subscripting work on lines instead of characters, i.e. with elements
separated by newlines.  This is a shorthand for &lsquo;<tt>pws:\n:</tt>&rsquo;.
</p>
</dd>
<dt> <tt>r</tt></dt>
<dd><p>Reverse subscripting: if this flag is given, the <var>exp</var> is taken as a
pattern and the result is the first matching array element, substring or
word (if the parameter is an array, if it is a scalar, or if it is a
scalar and the &lsquo;<tt>w</tt>&rsquo; flag is given, respectively).  The subscript used
is the number of the matching element, so that pairs of subscripts such as
&lsquo;<tt>$foo[(r)</tt><var>??</var><tt>,3]</tt>&rsquo; and &lsquo;<tt>$foo[(r)</tt><var>??</var><tt>,(r)f*]</tt>&rsquo; are
possible if the parameter is not an associative array.  If the
parameter is an associative array, only the value part of each pair is
compared to the pattern, and the result is that value.
</p>
<p>If a search through an ordinary array failed, the search sets the
subscript to one past the end of the array, and hence
<tt>${array[(r)pattern]}</tt> will substitute the empty string.  Thus the
success of a search can be tested by using the <tt>(i)</tt> flag, for
example (assuming the option <tt>KSH_ARRAYS</tt> is not in effect):
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">[[ ${array[(i)pattern]} -le ${#array} ]]
</pre></td></tr></table>

<p>If <tt>KSH_ARRAYS</tt> is in effect, the <tt>-le</tt> should be replaced by <tt>-lt</tt>.
</p></dd>
<dt> <tt>R</tt></dt>
<dd><p>Like &lsquo;<tt>r</tt>&rsquo;, but gives the last match.  For associative arrays, gives
all possible matches. May be used for assigning to ordinary array
elements, but not for assigning to associative arrays.  On failure, for
normal arrays this has the effect of returning the element corresponding to
subscript 0; this is empty unless one of the options <tt>KSH_ARRAYS</tt> or
<tt>KSH_ZERO_SUBSCRIPT</tt> is in effect.
</p>
<p>Note that in subscripts with both &lsquo;<tt>r</tt>&rsquo; and &lsquo;<tt>R</tt>&rsquo; pattern characters
are active even if they were substituted for a parameter (regardless of the
setting of <tt>GLOB_SUBST</tt> which controls this feature in normal pattern
matching).  The flag &lsquo;<tt>e</tt>&rsquo; can be added to inhibit pattern matching.  As
this flag does not inhibit other forms of substitution, care is still
required; using a parameter to hold the key has the desired effect:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">key2='original key'
print ${array[(Re)$key2]}
</pre></td></tr></table>


</dd>
<dt> <tt>i</tt></dt>
<dd><p>Like &lsquo;<tt>r</tt>&rsquo;, but gives the index of the match instead; this may not be
combined with a second argument.  On the left side of an assignment,
behaves like &lsquo;<tt>r</tt>&rsquo;.  For associative arrays, the key part of each pair
is compared to the pattern, and the first matching key found is the
result.  On failure substitutes the length of the array plus one, as
discussed under the description of &lsquo;<tt>r</tt>&rsquo;, or the empty string for an
associative array.
</p>
</dd>
<dt> <tt>I</tt></dt>
<dd><p>Like &lsquo;<tt>i</tt>&rsquo;, but gives the index of the last match, or all possible
matching keys in an associative array.  On failure substitutes 0, or
the empty string for an associative array.  This flag is best when
testing for values or keys that do not exist.
</p>
</dd>
<dt> <tt>k</tt></dt>
<dd><p>If used in a subscript on an associative array, this flag causes the keys
to be interpreted as patterns, and returns the value for the first key
found where <var>exp</var> is matched by the key.  Note this could be any
such key as no ordering of associative arrays is defined.
This flag does not work on the left side of an assignment to an associative
array element.  If used on another type of parameter, this behaves like &lsquo;<tt>r</tt>&rsquo;.
</p>
</dd>
<dt> <tt>K</tt></dt>
<dd><p>On an associative array this is like &lsquo;<tt>k</tt>&rsquo; but returns all values where
<var>exp</var> is matched by the keys.  On other types of parameters this has
the same effect as &lsquo;<tt>R</tt>&rsquo;.
</p>
</dd>
<dt> <tt>n:</tt><var>expr</var><tt>:</tt></dt>
<dd><p>If combined with &lsquo;<tt>r</tt>&rsquo;, &lsquo;<tt>R</tt>&rsquo;, &lsquo;<tt>i</tt>&rsquo; or &lsquo;<tt>I</tt>&rsquo;, makes them give
the <var>n</var>th or <var>n</var>th last match (if <var>expr</var> evaluates to
<var>n</var>).  This flag is ignored when the array is associative.
The delimiter character <tt>:</tt> is arbitrary; see above.
</p>
</dd>
<dt> <tt>b:</tt><var>expr</var><tt>:</tt></dt>
<dd><p>If combined with &lsquo;<tt>r</tt>&rsquo;, &lsquo;<tt>R</tt>&rsquo;, &lsquo;<tt>i</tt>&rsquo; or &lsquo;<tt>I</tt>&rsquo;, makes them begin
at the <var>n</var>th or <var>n</var>th last element, word, or character (if <var>expr</var>
evaluates to <var>n</var>).  This flag is ignored when the array is associative.
The delimiter character <tt>:</tt> is arbitrary; see above.
</p>
</dd>
<dt> <tt>e</tt></dt>
<dd><p>This flag causes any pattern matching that would be performed on the
subscript to use plain string matching instead.  Hence
&lsquo;<tt>${array[(re)*]}</tt>&rsquo; matches only the array element whose value is <tt>*</tt>.
Note that other forms of substitution such as parameter substitution are
not inhibited.
</p>
<p>This flag can also be used to force <tt>*</tt> or <tt>@</tt> to be interpreted as
a single key rather than as a reference to all values.  It may be used
for either purpose on the left side of an assignment.
</p>
</dd>
</dl>

<p>See <em>Parameter Expansion Flags</em> (<a href="Expansion.html#Parameter-Expansion">Parameter Expansion</a>) for additional ways to manipulate the results of array subscripting.
</p>

<hr size="6">
<a name="Subscript-Parsing"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Subscript-Flags" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Positional-Parameters" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Parameters" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Array-Parameters" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="Options.html#Options" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="zsh.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="zsh_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concept-Index.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="zsh_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">15.2.4 Subscript Parsing</h3>

<p>This discussion applies mainly to associative array key strings and to
patterns used for reverse subscripting (the &lsquo;<tt>r</tt>&rsquo;, &lsquo;<tt>R</tt>&rsquo;, &lsquo;<tt>i</tt>&rsquo;,
etc. flags), but it may also affect parameter substitutions that appear
as part of an arithmetic expression in an ordinary subscript.
</p>
<p>It is possible to avoid the use of subscripts in assignments to associative
array elements by using the syntax:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">
   aa+=('key with &quot;*strange*&quot; characters' 'value string')

</pre></td></tr></table>

<p>This adds a new key/value pair if the key is not already present, and
replaces the value for the existing key if it is.
</p>
<p>The basic rule to remember when writing a subscript expression is that all
text between the opening &lsquo;<tt>[</tt>&rsquo; and the closing &lsquo;<tt>]</tt>&rsquo; is interpreted
<em>as if</em> it were in double quotes (<a href="Shell-Grammar.html#Quoting">Quoting</a>).  However, unlike double quotes which normally cannot nest, subscript
expressions may appear inside double-quoted strings or inside other
subscript expressions (or both!), so the rules have two important
differences.
</p>
<p>The first difference is that brackets (&lsquo;<tt>[</tt>&rsquo; and &lsquo;<tt>]</tt>&rsquo;) must appear as
balanced pairs in a subscript expression unless they are preceded by a
backslash (&lsquo;<tt>\</tt>&rsquo;).  Therefore, within a subscript expression (and unlike
true double-quoting) the sequence &lsquo;<tt>\[</tt>&rsquo; becomes &lsquo;<tt>[</tt>&rsquo;, and similarly
&lsquo;<tt>\]</tt>&rsquo; becomes &lsquo;<tt>]</tt>&rsquo;.  This applies even in cases where a backslash is
not normally required; for example, the pattern &lsquo;<tt>[^[]</tt>&rsquo; (to match any
character other than an open bracket) should be written &lsquo;<tt>[^\[]</tt>&rsquo; in a
reverse-subscript pattern.  However, note that &lsquo;<tt>\[^\[\]</tt>&rsquo; and even
&lsquo;<tt>\[^[]</tt>&rsquo; mean the <em>same</em> thing, because backslashes are always
stripped when they appear before brackets!
</p>
<p>The same rule applies to parentheses (&lsquo;<tt>(</tt>&rsquo; and &lsquo;<tt>)</tt>&rsquo;) and
braces (&lsquo;<tt>{</tt>&rsquo; and &lsquo;<tt>}</tt>&rsquo;): they must appear either in balanced pairs or
preceded by a backslash, and backslashes that protect parentheses or
braces are removed during parsing.  This is because parameter expansions
may be surrounded by balanced braces, and subscript flags are introduced by
balanced parentheses.
</p>
<p>The second difference is that a double-quote (&lsquo;<tt>&quot;</tt>&rsquo;) may appear as part
of a subscript expression without being preceded by a backslash, and
therefore that the two characters &lsquo;<tt>\&quot;</tt>&rsquo; remain as two characters in the
subscript (in true double-quoting, &lsquo;<tt>\&quot;</tt>&rsquo; becomes &lsquo;<tt>&quot;</tt>&rsquo;).  However,
because of the standard shell quoting rules, any double-quotes that appear
must occur in balanced pairs unless preceded by a backslash.  This makes
it more difficult to write a subscript expression that contains an odd
number of double-quote characters, but the reason for this difference is
so that when a subscript expression appears inside true double-quotes, one
can still write &lsquo;<tt>\&quot;</tt>&rsquo; (rather than &lsquo;<tt>\\\&quot;</tt>&rsquo;) for &lsquo;<tt>&quot;</tt>&rsquo;.
</p>
<p>To use an odd number of double quotes as a key in an assignment, use the
<tt>typeset</tt> builtin and an enclosing pair of double quotes; to refer to
the value of that key, again use double quotes:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">typeset -A aa
typeset &quot;aa[one\&quot;two\&quot;three\&quot;quotes]&quot;=QQQ
print &quot;$aa[one\&quot;two\&quot;three\&quot;quotes]&quot;
</pre></td></tr></table>

<p>It is important to note that the quoting rules do not change when a
parameter expansion with a subscript is nested inside another subscript
expression.  That is, it is not necessary to use additional backslashes
within the inner subscript expression; they are removed only once, from
the innermost subscript outwards.  Parameters are also expanded from the
innermost subscript first, as each expansion is encountered left to right
in the outer expression.
</p>
<p>A further complication arises from a way in which subscript parsing is
<em>not</em> different from double quote parsing.  As in true double-quoting,
the sequences &lsquo;<tt>\*</tt>&rsquo;, and &lsquo;<tt>\@</tt>&rsquo; remain as two characters when they
appear in a subscript expression.  To use a literal &lsquo;<tt>*</tt>&rsquo; or &lsquo;<tt>@</tt>&rsquo; as
an associative array key, the &lsquo;<tt>e</tt>&rsquo; flag must be used:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">typeset -A aa
aa[(e)*]=star
print $aa[(e)*]
</pre></td></tr></table>

<p>A last detail must be considered when reverse subscripting is performed.
Parameters appearing in the subscript expression are first expanded and
then the complete expression is interpreted as a pattern.  This has two
effects: first, parameters behave as if <tt>GLOB_SUBST</tt> were on (and it
cannot be turned off); second, backslashes are interpreted twice, once
when parsing the array subscript and again when parsing the pattern.  In a
reverse subscript, it&rsquo;s necessary to use <em>four</em> backslashes to cause a
single backslash to match literally in the pattern.  For complex patterns,
it is often easiest to assign the desired pattern to a parameter and then
refer to that parameter in the subscript, because then the backslashes,
brackets, parentheses, etc., are seen only when the complete expression is
converted to a pattern.  To match the value of a parameter literally in a
reverse subscript, rather than as a pattern,
use &lsquo;<tt>${(q</tt><tt>)</tt><var>name</var><tt>}</tt>&rsquo; (<a href="Expansion.html#Parameter-Expansion">Parameter Expansion</a>) to quote the expanded value.
</p>
<p>Note that the &lsquo;<tt>k</tt>&rsquo; and &lsquo;<tt>K</tt>&rsquo; flags are reverse subscripting for an
ordinary array, but are <em>not</em> reverse subscripting for an associative
array!  (For an associative array, the keys in the array itself are
interpreted as patterns by those flags; the subscript is a plain string
in that case.)
</p>
<p>One final note, not directly related to subscripting: the numeric names
of positional parameters (<a href="#Positional-Parameters">Positional Parameters</a>) are parsed specially, so for example &lsquo;<tt>$2foo</tt>&rsquo; is equivalent to
&lsquo;<tt>${2}foo</tt>&rsquo;.  Therefore, to use subscript syntax to extract a substring
from a positional parameter, the expansion must be surrounded by braces;
for example, &lsquo;<tt>${2[3,5]}</tt>&rsquo; evaluates to the third through fifth
characters of the second positional parameter, but &lsquo;<tt>$2[3,5]</tt>&rsquo; is the
entire second parameter concatenated with the filename generation pattern
&lsquo;<tt>[3,5]</tt>&rsquo;.
</p>
<hr size="6">
<a name="Positional-Parameters"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Subscript-Parsing" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Local-Parameters" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Parameters" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Parameters" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="Options.html#Options" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="zsh.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="zsh_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concept-Index.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="zsh_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>

<a name="Positional-Parameters-1"></a>
<h2 class="section">15.3 Positional Parameters</h2>
<p>The positional parameters provide access to the command-line arguments
of a shell function, shell script, or the shell itself; see
<a href="Invocation.html#Invocation">Invocation</a>, and also <a href="Functions.html#Functions">Functions</a>.
The parameter <var>n</var>, where <var>n</var> is a number,
is the <var>n</var>th positional parameter.
The parameters <tt>*</tt>, <tt>@</tt> and <tt>argv</tt> are
arrays containing all the positional parameters;
thus &lsquo;<tt>$argv[</tt><var>n</var><tt>]</tt>&rsquo;, etc., is equivalent to simply &lsquo;<tt>$</tt><var>n</var>&rsquo;.
</p>
<p>Positional parameters may be changed after the shell or function starts by
using the <tt>set</tt> builtin, by assigning to the <tt>argv</tt> array, or by direct
assignment of the form &lsquo;<var>n</var><tt>=</tt><var>value</var>&rsquo; where <var>n</var> is the number of
the positional parameter to be changed.  This also creates (with empty
values) any of the positions from 1 to <var>n</var> that do not already have
values.  Note that, because the positional parameters form an array, an
array assignment of the form &lsquo;<var>n</var><tt>=(</tt><var>value</var> ...<tt>)</tt>&rsquo; is
allowed, and has the effect of shifting all the values at positions greater
than <var>n</var> by as many positions as necessary to accommodate the new values.
</p>
<hr size="6">
<a name="Local-Parameters"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Positional-Parameters" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Parameters-Set-By-The-Shell" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Parameters" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Parameters" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="Options.html#Options" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="zsh.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="zsh_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concept-Index.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="zsh_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>

<a name="Local-Parameters-1"></a>
<h2 class="section">15.4 Local Parameters</h2>
<p>Shell function executions delimit scopes for shell parameters.
(Parameters are dynamically scoped.)  The <tt>typeset</tt> builtin, and its
alternative forms <tt>declare</tt>, <tt>integer</tt>, <tt>local</tt> and <tt>readonly</tt>
(but not <tt>export</tt>), can be used to declare a parameter as being local
to the innermost scope.
</p>
<p>When a parameter is read or assigned to, the
innermost existing parameter of that name is used.  (That is, the
local parameter hides any less-local parameter.)  However, assigning
to a non-existent parameter, or declaring a new parameter with <tt>export</tt>,
causes it to be created in the <em>outer</em>most scope.
</p>
<p>Local parameters disappear when their scope ends.
<tt>unset</tt> can be used to delete a parameter while it is still in scope;
any outer parameter of the same name remains hidden.
</p>
<p>Special parameters may also be made local; they retain their special
attributes unless either the existing or the newly-created parameter
has the <tt>-h</tt> (hide) attribute.  This may have unexpected effects:
there is no default value, so if there is no assignment at the
point the variable is made local, it will be set to an empty value (or zero
in the case of integers).  
The following:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">typeset PATH=/new/directory:$PATH
</pre></td></tr></table>

<p>is valid for temporarily allowing the shell or programmes called from it to
find the programs in <tt>/new/directory</tt> inside a function.
</p>
<p>Note that the restriction in older versions of zsh that local parameters
were never exported has been removed.
</p>
<hr size="6">
<a name="Parameters-Set-By-The-Shell"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Local-Parameters" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Parameters-Used-By-The-Shell" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Parameters" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Parameters" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="Options.html#Options" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="zsh.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="zsh_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concept-Index.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="zsh_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>

<a name="Parameters-Set-By-The-Shell-1"></a>
<h2 class="section">15.5 Parameters Set By The Shell</h2>
<p>The following parameters are automatically set by the shell:
</p>
<dl compact="compact">
<dd><a name="index-_0021"></a>
</dd>
<dt> <tt>!</tt> &lt;S&gt;</dt>
<dd><p>The process ID of the last command started in the background with <tt>&amp;</tt>,
or put into the background with the <tt>bg</tt> builtin.
</p>
<a name="index-_0023"></a>
</dd>
<dt> <tt>#</tt> &lt;S&gt;</dt>
<dd><p>The number of positional parameters in decimal.  Note that some confusion
may occur with the syntax <tt>$#</tt><var>param</var> which substitutes the length of
<var>param</var>.  Use <tt>${#}</tt> to resolve ambiguities.  In particular, the
sequence &lsquo;<tt>$#-</tt><var>...</var>&rsquo; in an arithmetic expression is interpreted as
the length of the parameter <tt>-</tt>, q.v.
</p>
<a name="index-ARGC"></a>
</dd>
<dt> <tt>ARGC</tt> &lt;S&gt; &lt;Z&gt;</dt>
<dd><p>Same as <tt>#</tt>.
</p>
<a name="index-_0024"></a>
</dd>
<dt> <tt>$</tt> &lt;S&gt;</dt>
<dd><p>The process ID of this shell.  Note that this indicates the original
shell started by invoking <tt>zsh</tt>; all processes forked from the shells
without executing a new program, such as subshells started by
<tt>(</tt><var>...</var><tt>)</tt>, substitute the same value.
</p>
<a name="index-_002d-1"></a>
</dd>
<dt> <tt>-</tt> &lt;S&gt;</dt>
<dd><p>Flags supplied to the shell on invocation or by the <tt>set</tt>
or <tt>setopt</tt> commands.
</p>
<a name="index-_002a"></a>
</dd>
<dt> <tt>*</tt> &lt;S&gt;</dt>
<dd><p>An array containing the positional parameters.
</p>
<a name="index-argv"></a>
</dd>
<dt> <tt>argv</tt> &lt;S&gt; &lt;Z&gt;</dt>
<dd><p>Same as <tt>*</tt>.  Assigning to <tt>argv</tt> changes the local positional
parameters, but <tt>argv</tt> is <em>not</em> itself a local parameter.
Deleting <tt>argv</tt> with <tt>unset</tt> in any function deletes it everywhere,
although only the innermost positional parameter array is deleted (so
<tt>*</tt> and <tt>@</tt> in other scopes are not affected).
</p>
<a name="index-_0040"></a>
</dd>
<dt> <tt>@</tt> &lt;S&gt;</dt>
<dd><p>Same as <tt>argv[@]</tt>, even when <tt>argv</tt> is not set.
</p>
<a name="index-_003f"></a>
</dd>
<dt> <tt>?</tt> &lt;S&gt;</dt>
<dd><p>The exit status returned by the last command.
</p>
<a name="index-0"></a>
</dd>
<dt> <tt>0</tt> &lt;S&gt;</dt>
<dd><p>The name used to invoke the current shell.  If the <tt>FUNCTION_ARGZERO</tt> option
is set, this is set temporarily within a shell function to the name of the
function, and within a sourced script to the name of the script.
</p>
<a name="index-status"></a>
</dd>
<dt> <tt>status</tt> &lt;S&gt; &lt;Z&gt;</dt>
<dd><p>Same as <tt>?</tt>.
</p>
<a name="index-pipestatus"></a>
</dd>
<dt> <tt>pipestatus</tt> &lt;S&gt; &lt;Z&gt;</dt>
<dd><p>An array containing the exit statuses returned by all commands in the
last pipeline.
</p>
<a name="index-_005f"></a>
</dd>
<dt> <tt>_</tt> &lt;S&gt;</dt>
<dd><p>The last argument of the previous command.
Also, this parameter is set in the environment of every command
executed to the full pathname of the command.
</p>
<a name="index-CPUTYPE"></a>
</dd>
<dt> <tt>CPUTYPE</tt></dt>
<dd><p>The machine type (microprocessor class or machine model),
as determined at run time.
</p>
<a name="index-EGID"></a>
</dd>
<dt> <tt>EGID</tt> &lt;S&gt;</dt>
<dd><p>The effective group ID of the shell process.  If you have sufficient
privileges, you may change the effective group ID of the shell
process by assigning to this parameter.  Also (assuming sufficient
privileges), you may start a single command with a different
effective group ID by &lsquo;<tt>(EGID=</tt><var>gid</var><tt>; command)</tt>&rsquo;
</p>
<a name="index-EUID"></a>
</dd>
<dt> <tt>EUID</tt> &lt;S&gt;</dt>
<dd><p>The effective user ID of the shell process.  If you have sufficient
privileges, you may change the effective user ID of the shell process
by assigning to this parameter.  Also (assuming sufficient privileges),
you may start a single command with a different
effective user ID by &lsquo;<tt>(EUID=</tt><var>uid</var><tt>; command)</tt>&rsquo;
</p>
<a name="index-ERRNO"></a>
</dd>
<dt> <tt>ERRNO</tt> &lt;S&gt;</dt>
<dd><p>The value of errno (see man page errno(3))
as set by the most recently failed system call.
This value is system dependent and is intended for debugging
purposes.  It is also useful with the <tt>zsh/system</tt> module which
allows the number to be turned into a name or message.
</p>
<a name="index-GID"></a>
</dd>
<dt> <tt>GID</tt> &lt;S&gt;</dt>
<dd><p>The real group ID of the shell process.  If you have sufficient privileges,
you may change the group ID of the shell process by assigning to this
parameter.  Also (assuming sufficient privileges), you may start a single
command under a different
group ID by &lsquo;<tt>(GID=</tt><var>gid</var><tt>; command)</tt>&rsquo;
</p>
<a name="index-HISTCMD"></a>
</dd>
<dt> <tt>HISTCMD</tt></dt>
<dd><p>The current history line number in an interactive shell, in other
words the line number for the command that caused <tt>$HISTCMD</tt>
to be read.
</p>
<a name="index-HOST"></a>
</dd>
<dt> <tt>HOST</tt></dt>
<dd><p>The current hostname.
</p>
<a name="index-LINENO"></a>
</dd>
<dt> <tt>LINENO</tt> &lt;S&gt;</dt>
<dd><p>The line number of the current line within the current script, sourced
file, or shell function being executed, whichever was started most
recently.  Note that in the case of shell functions the line
number refers to the function as it appeared in the original definition,
not necessarily as displayed by the <tt>functions</tt> builtin.
</p>
<a name="index-LOGNAME"></a>
</dd>
<dt> <tt>LOGNAME</tt></dt>
<dd><p>If the corresponding variable is not set in the environment of the
shell, it is initialized to the login name corresponding to the
current login session. This parameter is exported by default but
this can be disabled using the <tt>typeset</tt> builtin.
</p>
<a name="index-MACHTYPE"></a>
</dd>
<dt> <tt>MACHTYPE</tt></dt>
<dd><p>The machine type (microprocessor class or machine model),
as determined at compile time.
</p>
<a name="index-OLDPWD"></a>
</dd>
<dt> <tt>OLDPWD</tt></dt>
<dd><p>The previous working directory.  This is set when the shell initializes
and whenever the directory changes.
</p>
<a name="index-OPTARG"></a>
</dd>
<dt> <tt>OPTARG</tt> &lt;S&gt;</dt>
<dd><p>The value of the last option argument processed by the <tt>getopts</tt>
command.
</p>
<a name="index-OPTIND"></a>
</dd>
<dt> <tt>OPTIND</tt> &lt;S&gt;</dt>
<dd><p>The index of the last option argument processed by the <tt>getopts</tt>
command.
</p>
<a name="index-OSTYPE"></a>
</dd>
<dt> <tt>OSTYPE</tt></dt>
<dd><p>The operating system, as determined at compile time.
</p>
<a name="index-PPID"></a>
</dd>
<dt> <tt>PPID</tt> &lt;S&gt;</dt>
<dd><p>The process ID of the parent of the shell.  As for <tt>$$</tt>, the
value indicates the parent of the original shell and does not
change in subshells.
</p>
<a name="index-PWD"></a>
</dd>
<dt> <tt>PWD</tt></dt>
<dd><p>The present working directory.  This is set when the shell initializes
and whenever the directory changes.
</p>
<a name="index-RANDOM"></a>
</dd>
<dt> <tt>RANDOM</tt> &lt;S&gt;</dt>
<dd><p>A pseudo-random integer from 0 to 32767, newly generated each time
this parameter is referenced.  The random number generator
can be seeded by assigning a numeric value to <tt>RANDOM</tt>.
</p>
<p>The values of <tt>RANDOM</tt> form an intentionally-repeatable pseudo-random
sequence; subshells that reference <tt>RANDOM</tt> will result
in identical pseudo-random values unless the value of <tt>RANDOM</tt> is
referenced or seeded in the parent shell in between subshell invocations.
</p>
<a name="index-SECONDS"></a>
</dd>
<dt> <tt>SECONDS</tt> &lt;S&gt;</dt>
<dd><p>The number of seconds since shell invocation.  If this parameter
is assigned a value, then the value returned upon reference
will be the value that was assigned plus the number of seconds
since the assignment.
</p>
<p>Unlike other special parameters, the type of the <tt>SECONDS</tt> parameter can
be changed using the <tt>typeset</tt> command.  Only integer and one of the
floating point types are allowed.  For example, &lsquo;<tt>typeset -F SECONDS</tt>&rsquo;
causes the value to be reported as a floating point number.  The
value is available to microsecond accuracy, although the shell may
show more or fewer digits depending on the use of <tt>typeset</tt>.  See
the documentation for the builtin <tt>typeset</tt> in
<a href="Shell-Builtin-Commands.html#Shell-Builtin-Commands">Shell Builtin Commands</a> for more details.
</p>
<a name="index-SHLVL"></a>
</dd>
<dt> <tt>SHLVL</tt> &lt;S&gt;</dt>
<dd><p>Incremented by one each time a new shell is started.
</p>
<a name="index-signals"></a>
</dd>
<dt> <tt>signals</tt></dt>
<dd><p>An array containing the names of the signals.
</p>
<a name="index-TRY_005fBLOCK_005fERROR"></a>
</dd>
<dt> <tt>TRY_BLOCK_ERROR</tt> &lt;S&gt;</dt>
<dd><p>In an <tt>always</tt> block, indicates whether the preceding list of code
caused an error.  The value is 1 to indicate an error, 0 otherwise.
It may be reset, clearing the error condition.  See
<a href="Shell-Grammar.html#Complex-Commands">Complex Commands</a>
</p>
<a name="index-TTY"></a>
</dd>
<dt> <tt>TTY</tt></dt>
<dd><p>The name of the tty associated with the shell, if any.
</p>
<a name="index-TTYIDLE"></a>
</dd>
<dt> <tt>TTYIDLE</tt> &lt;S&gt;</dt>
<dd><p>The idle time of the tty associated with the shell in seconds or -1 if there
is no such tty.
</p>
<a name="index-UID"></a>
</dd>
<dt> <tt>UID</tt> &lt;S&gt;</dt>
<dd><p>The real user ID of the shell process.  If you have sufficient privileges,
you may change the user ID of the shell by assigning to this parameter.
Also (assuming sufficient privileges), you may start a single command
under a different
user ID by &lsquo;<tt>(UID=</tt><var>uid</var><tt>; command)</tt>&rsquo;
</p>
<a name="index-USERNAME"></a>
</dd>
<dt> <tt>USERNAME</tt> &lt;S&gt;</dt>
<dd><p>The username corresponding to the real user ID of the shell process.  If you
have sufficient privileges, you may change the username (and also the
user ID and group ID) of the shell by assigning to this parameter.
Also (assuming sufficient privileges), you may start a single command
under a different username (and user ID and group ID)
by &lsquo;<tt>(USERNAME=</tt><var>username</var><tt>; command)</tt>&rsquo;
</p>
<a name="index-VENDOR"></a>
</dd>
<dt> <tt>VENDOR</tt></dt>
<dd><p>The vendor, as determined at compile time.
</p>
<a name="index-zsh_005feval_005fcontext"></a>
<a name="index-ZSH_005fEVAL_005fCONTEXT"></a>
</dd>
<dt> <tt>zsh_eval_context</tt> &lt;S&gt; &lt;Z&gt; (<tt>ZSH_EVAL_CONTEXT</tt> &lt;S&gt;)</dt>
<dd><p>An array (colon-separated list) indicating the context of shell
code that is being run.  Each time a piece of shell code that
is stored within the shell is executed a string is temporarily appended to
the array to indicate the type of operation that is being performed.
Read in order the array gives an indication of the stack of
operations being performed with the most immediate context last.
</p>
<p>Note that the variable does not give information on syntactic context such
as pipelines or subshells.  Use <tt>$ZSH_SUBSHELL</tt> to detect subshells.
</p>
<p>The context is one of the following:
</p><dl compact="compact">
<dt> <tt>cmdarg</tt></dt>
<dd><p>Code specified by the <tt>-c</tt> option to the command line that invoked
the shell.
</p>
</dd>
<dt> <tt>cmdsubst</tt></dt>
<dd><p>Command substitution using the <tt>&lsquo;</tt><var>...</var><tt>&lsquo;</tt> or
<tt>$(</tt><var>...</var><tt>)</tt> construct.
</p>
</dd>
<dt> <tt>equalsubst</tt></dt>
<dd><p>File substitution using the <tt>=(</tt><var>...</var><tt>)</tt> construct.
</p>
</dd>
<dt> <tt>eval</tt></dt>
<dd><p>Code executed by the <tt>eval</tt> builtin.
</p>
</dd>
<dt> <tt>evalautofunc</tt></dt>
<dd><p>Code executed with the <tt>KSH_AUTOLOAD</tt> mechanism in order to define
an autoloaded function.
</p>
</dd>
<dt> <tt>fc</tt></dt>
<dd><p>Code from the shell history executed by the <tt>-e</tt> option to the <tt>fc</tt>
builtin.
</p>
</dd>
<dt> <tt>file</tt></dt>
<dd><p>Lines of code being read directly from a file, for example by
the <tt>source</tt> builtin.
</p>
</dd>
<dt> <tt>filecode</tt></dt>
<dd><p>Lines of code being read from a <tt>.zwc</tt> file instead of directly
from the source file.
</p>
</dd>
<dt> <tt>globqual</tt></dt>
<dd><p>Code executed by the <tt>e</tt> or <tt>+</tt> glob qualifier.
</p>
</dd>
<dt> <tt>globsort</tt></dt>
<dd><p>Code executed to order files by the <tt>o</tt> glob qualifier.
</p>
</dd>
<dt> <tt>insubst</tt></dt>
<dd><p>File substitution using the <tt>&lt;(</tt><var>...</var><tt>)</tt> construct.
</p>
</dd>
<dt> <tt>loadautofunc</tt></dt>
<dd><p>Code read directly from a file to define an autoloaded function.
</p>
</dd>
<dt> <tt>outsubst</tt></dt>
<dd><p>File substitution using the <tt>&gt;(</tt><var>...</var><tt>)</tt> construct.
</p>
</dd>
<dt> <tt>sched</tt></dt>
<dd><p>Code executed by the <tt>sched</tt> builtin.
</p>
</dd>
<dt> <tt>shfunc</tt></dt>
<dd><p>A shell function.
</p>
</dd>
<dt> <tt>stty</tt></dt>
<dd><p>Code passed to <tt>stty</tt> by the <tt>STTY</tt> environment variable.
Normally this is passed directly to the system&rsquo;s <tt>stty</tt> command,
so this value is unlikely to be seen in practice.
</p>
</dd>
<dt> <tt>style</tt></dt>
<dd><p>Code executed as part of a style retrieved by the <tt>zstyle</tt> builtin
from the <tt>zsh/zutil</tt> module.
</p>
</dd>
<dt> <tt>toplevel</tt></dt>
<dd><p>The highest execution level of a script or interactive shell.
</p>
</dd>
<dt> <tt>trap</tt></dt>
<dd><p>Code executed as a trap defined by the <tt>trap</tt> builtin.  Traps
defined as functions have the context <tt>shfunc</tt>.  As traps are
asynchronous they may have a different hierarchy from other
code.
</p>
</dd>
<dt> <tt>zpty</tt></dt>
<dd><p>Code executed by the <tt>zpty</tt> builtin from the <tt>zsh/zpty</tt> module.
</p>
</dd>
<dt> <tt>zregexparse-guard</tt></dt>
<dd><p>Code executed as a guard by the <tt>zregexparse</tt> command from the
<tt>zsh/zutil</tt> module.
</p>
</dd>
<dt> <tt>zregexparse-action</tt></dt>
<dd><p>Code executed as an action by the <tt>zregexparse</tt> command from the
<tt>zsh/zutil</tt> module.
</p>
</dd>
</dl>

<a name="index-ZSH_005fNAME"></a>
</dd>
<dt> <tt>ZSH_NAME</tt></dt>
<dd><p>Expands to the basename of the command used to invoke this instance
of zsh.
</p>
<a name="index-ZSH_005fPATCHLEVEL"></a>
</dd>
<dt> <tt>ZSH_PATCHLEVEL</tt></dt>
<dd><p>The revision string for the version number of the ChangeLog file
in the zsh distribution.  This is most useful in order to keep
track of versions of the shell during development between releases;
hence most users should not use it and should instead rely on
<tt>$ZSH_VERSION</tt>.
</p>
</dd>
<dt> <tt>zsh_scheduled_events</tt></dt>
<dd><p>See <a href="Zsh-Modules.html#The-zsh_002fsched-Module">The zsh/sched Module</a>.
</p>
<a name="index-ZSH_005fSUBSHELL-_003cS_003e"></a>
</dd>
<dt> <tt>ZSH_SUBSHELL</tt></dt>
<dd><p>Readonly integer.  Initially zero, incremented each time the shell forks
to create a subshell for executing code.  Hence &lsquo;<tt>(print $ZSH_SUBSHELL)</tt>&rsquo;
and &lsquo;<tt>print $(print $ZSH_SUBSHELL)</tt>&rsquo; output 1, while
&lsquo;<tt>( (print $ZSH_SUBSHELL) )</tt>&rsquo; outputs 2.
</p>
<a name="index-ZSH_005fVERSION"></a>
</dd>
<dt> <tt>ZSH_VERSION</tt></dt>
<dd><p>The version number of the release of zsh.
</p>
</dd>
</dl>
<hr size="6">
<a name="Parameters-Used-By-The-Shell"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Parameters-Set-By-The-Shell" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="Options.html#Options" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#Parameters" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Parameters" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="Options.html#Options" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="zsh.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="zsh_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concept-Index.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="zsh_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>

<a name="Parameters-Used-By-The-Shell-1"></a>
<h2 class="section">15.6 Parameters Used By The Shell</h2>
<p>The following parameters are used by the shell.
</p>
<p>In cases where there are two parameters with an upper- and lowercase
form of the same name, such as <tt>path</tt> and <tt>PATH</tt>, the lowercase form
is an array and the uppercase form is a scalar with the elements of the
array joined together by colons.  These are similar to tied parameters
created via &lsquo;<tt>typeset -T</tt>&rsquo;.  The normal use for the colon-separated
form is for exporting to the environment, while the array form is easier
to manipulate within the shell.  Note that unsetting either of the pair
will unset the other; they retain their special properties when
recreated, and recreating one of the pair will recreate the other.
</p>
<dl compact="compact">
<dd><a name="index-ARGV0"></a>
</dd>
<dt> <tt>ARGV0</tt></dt>
<dd><p>If exported, its value is used as the <tt>argv[0]</tt> of external commands.
Usually used in constructs like &lsquo;<tt>ARGV0=emacs nethack</tt>&rsquo;.
</p>
<a name="index-editing-over-slow-connection"></a>
<a name="index-slow-connection_002c-editing-over"></a>
<a name="index-BAUD"></a>
</dd>
<dt> <tt>BAUD</tt></dt>
<dd><p>The rate in bits per second at which data reaches the terminal.
The line editor will use this value in order to compensate for a slow
terminal by delaying updates to the display until necessary.  If the
parameter is unset or the value is zero the compensation mechanism is
turned off.  The parameter is not set by default.
</p>
<p>This parameter may be profitably set in some circumstances, e.g.
for slow modems dialing into a communications server, or on a slow wide
area network.  It should be set to the baud
rate of the slowest part of the link for best performance.
</p>
<a name="index-cdpath"></a>
<a name="index-CDPATH"></a>
</dd>
<dt> <tt>cdpath</tt> &lt;S&gt; &lt;Z&gt; (<tt>CDPATH</tt> &lt;S&gt;)</dt>
<dd><p>An array (colon-separated list)
of directories specifying the search path for the <tt>cd</tt> command.
</p>
<a name="index-COLUMNS"></a>
</dd>
<dt> <tt>COLUMNS</tt> &lt;S&gt;</dt>
<dd><p>The number of columns for this terminal session.
Used for printing select lists and for the line editor.
</p>
<a name="index-CORRECT_005fIGNORE"></a>
</dd>
<dt> <tt>CORRECT_IGNORE</tt></dt>
<dd><p>If set, is treated as a pattern during spelling correction.  Any
potential correction that matches the pattern is ignored.  For example,
if the value is &lsquo;<tt>_*</tt>&rsquo; then completion functions (which, by
convention, have names beginning with &lsquo;<tt>_</tt>&rsquo;) will never be offered
as spelling corrections.  The pattern does not apply to the correction
of file names, as applied by the <tt>CORRECT_ALL</tt> option (so with the
example just given files beginning with &lsquo;<tt>_</tt>&rsquo; in the current
directory would still be completed).
</p>
<a name="index-DIRSTACKSIZE"></a>
</dd>
<dt> <tt>DIRSTACKSIZE</tt></dt>
<dd><p>The maximum size of the directory stack.  If the
stack gets larger than this, it will be truncated automatically.
This is useful with the <tt>AUTO_PUSHD</tt> option.
<a name="index-AUTO_005fPUSHD_002c-use-of"></a>
</p>
<a name="index-ENV"></a>
</dd>
<dt> <tt>ENV</tt></dt>
<dd><p>If the <tt>ENV</tt> environment variable is set when zsh is invoked as <tt>sh</tt>
or <tt>ksh</tt>, <tt>$ENV</tt> is sourced after the profile scripts.  The value of
<tt>ENV</tt> is subjected to parameter expansion, command substitution, and
arithmetic expansion before being interpreted as a pathname.  Note that
<tt>ENV</tt> is <em>not</em> used unless zsh is emulating <cite>sh</cite> or <cite>ksh</cite>.
</p>
<a name="index-FCEDIT"></a>
</dd>
<dt> <tt>FCEDIT</tt></dt>
<dd><p>The default editor for the <tt>fc</tt> builtin.  If <tt>FCEDIT</tt> is not set,
the parameter <tt>EDITOR</tt> is used; if that is not set either, a builtin
default, usually <tt>vi</tt>, is used.
</p>
<a name="index-fignore"></a>
<a name="index-FIGNORE"></a>
</dd>
<dt> <tt>fignore</tt> &lt;S&gt; &lt;Z&gt; (<tt>FIGNORE</tt> &lt;S&gt;)</dt>
<dd><p>An array (colon separated list)
containing the suffixes of files to be ignored
during filename completion.  However, if completion only generates files
with suffixes in this list, then these files are completed anyway.
</p>
<a name="index-fpath"></a>
<a name="index-FPATH"></a>
</dd>
<dt> <tt>fpath</tt> &lt;S&gt; &lt;Z&gt; (<tt>FPATH</tt> &lt;S&gt;)</dt>
<dd><p>An array (colon separated list)
of directories specifying the search path for
function definitions.  This path is searched when a function
with the <tt>-u</tt> attribute is referenced.  If an executable
file is found, then it is read and executed in the current environment.
</p>
<a name="index-histchars"></a>
</dd>
<dt> <tt>histchars</tt> &lt;S&gt;</dt>
<dd><p>Three characters used by the shell&rsquo;s history and lexical analysis
mechanism.  The first character signals the start of a history
expansion (default &lsquo;<tt>!</tt>&rsquo;).  The second character signals the
start of a quick history substitution (default &lsquo;<tt>^</tt>&rsquo;).  The third
character is the comment character (default &lsquo;<tt>#</tt>&rsquo;).
</p>
<p>The characters must be in the ASCII character set; any attempt to set
<tt>histchars</tt> to characters with a locale-dependent meaning will be
rejected with an error message.
</p>
<a name="index-HISTCHARS"></a>
</dd>
<dt> <tt>HISTCHARS</tt> &lt;S&gt; &lt;Z&gt;</dt>
<dd><p>Same as <tt>histchars</tt>.  (Deprecated.)
</p>
<a name="index-HISTFILE"></a>
</dd>
<dt> <tt>HISTFILE</tt></dt>
<dd><p>The file to save the history in when an interactive shell exits.
If unset, the history is not saved.
</p>
<a name="index-HISTSIZE"></a>
</dd>
<dt> <tt>HISTSIZE</tt> &lt;S&gt;</dt>
<dd><p>The maximum number of events stored in the internal history list.
If you use the <tt>HIST_EXPIRE_DUPS_FIRST</tt> option, setting this value
larger than the <tt>SAVEHIST</tt> size will give you the difference as a
cushion for saving duplicated history events.
</p>
<a name="index-HOME"></a>
</dd>
<dt> <tt>HOME</tt> &lt;S&gt;</dt>
<dd><p>The default argument for the <tt>cd</tt> command.  This is not set automatically
by the shell in <tt>sh</tt>, <tt>ksh</tt> or <tt>csh</tt> emulation, but it is typically
present in the environment anyway, and if it becomes set it has its usual
special behaviour.
</p>
<a name="index-IFS"></a>
</dd>
<dt> <tt>IFS</tt> &lt;S&gt;</dt>
<dd><p>Internal field separators (by default space, tab, newline and NUL), that
are used to separate words which result from
command or parameter expansion and words read by
the <tt>read</tt> builtin.  Any characters from the set space, tab and
newline that appear in the IFS are called <em>IFS white space</em>.
One or more IFS white space characters or one non-IFS white space
character together with any adjacent IFS white space character delimit
a field.  If an IFS white space character appears twice consecutively
in the IFS, this character is treated as if it were not an IFS white
space character.
</p>
<p>If the parameter is unset, the default is used.  Note this has
a different effect from setting the parameter to an empty string.
</p>
<a name="index-KEYBOARD_005fHACK"></a>
</dd>
<dt> <tt>KEYBOARD_HACK</tt></dt>
<dd><p>This variable defines a character to be removed from the end of the
command line before interpreting it (interactive shells only). It is
intended to fix the problem with keys placed annoyingly close to return
and replaces the <tt>SUNKEYBOARDHACK</tt> option which did this for
backquotes only.  Should the chosen character be one of singlequote,
doublequote or backquote, there must also be an odd number of them
on the command line for the last one to be removed.
</p>
<a name="index-KEYTIMEOUT"></a>
</dd>
<dt> <tt>KEYTIMEOUT</tt></dt>
<dd><p>The time the shell waits, in hundredths of seconds, for another key to
be pressed when reading bound multi-character sequences.
</p>
<a name="index-LANG"></a>
</dd>
<dt> <tt>LANG</tt> &lt;S&gt;</dt>
<dd><p>This variable determines the locale category for any category not
specifically selected via a variable starting with &lsquo;<tt>LC_</tt>&rsquo;.
</p>
<a name="index-LC_005fALL"></a>
</dd>
<dt> <tt>LC_ALL</tt> &lt;S&gt;</dt>
<dd><p>This variable overrides the value of the &lsquo;<tt>LANG</tt>&rsquo; variable and the value
of any of the other variables starting with &lsquo;<tt>LC_</tt>&rsquo;.
</p>
<a name="index-LC_005fCOLLATE"></a>
</dd>
<dt> <tt>LC_COLLATE</tt> &lt;S&gt;</dt>
<dd><p>This variable determines the locale category for character collation
information within ranges in glob brackets and for sorting.
</p>
<a name="index-LC_005fCTYPE"></a>
</dd>
<dt> <tt>LC_CTYPE</tt> &lt;S&gt;</dt>
<dd><p>This variable determines the locale category for character handling
functions.  If the <tt>MULTIBYTE</tt> option is in effect this variable or
<tt>LANG</tt> should contain a value that reflects the character set in
use, even if it is a single-byte character set, unless only the
7-bit subset (ASCII) is used.  For example, if the character set
is ISO-8859-1, a suitable value might be <tt>en_US.iso88591</tt> (certain
Linux distributions) or <tt>en_US.ISO8859-1</tt> (MacOS).
</p>
<a name="index-LC_005fMESSAGES"></a>
</dd>
<dt> <tt>LC_MESSAGES</tt> &lt;S&gt;</dt>
<dd><p>This variable determines the language in which messages should be
written.  Note that zsh does not use message catalogs.
</p>
<a name="index-LC_005fNUMERIC"></a>
</dd>
<dt> <tt>LC_NUMERIC</tt> &lt;S&gt;</dt>
<dd><p>This variable affects the decimal point character and thousands
separator character for the formatted input/output functions
and string conversion functions.  Note that zsh ignores this
setting when parsing floating point mathematical expressions.
</p>
<a name="index-LC_005fTIME"></a>
</dd>
<dt> <tt>LC_TIME</tt> &lt;S&gt;</dt>
<dd><p>This variable determines the locale category for date and time
formatting in prompt escape sequences.
</p>
<a name="index-LINES"></a>
</dd>
<dt> <tt>LINES</tt> &lt;S&gt;</dt>
<dd><p>The number of lines for this terminal session.
Used for printing select lists and for the line editor.
</p>
<a name="index-LISTMAX"></a>
</dd>
<dt> <tt>LISTMAX</tt></dt>
<dd><p>In the line editor, the number of matches to list without asking
first. If the value is negative, the list will be shown if it spans at 
most as many lines as given by the absolute value.
If set to zero, the shell asks only if the top of the listing would scroll
off the screen.
</p>
<a name="index-LOGCHECK"></a>
</dd>
<dt> <tt>LOGCHECK</tt></dt>
<dd><p>The interval in seconds between checks for login/logout activity
using the <tt>watch</tt> parameter.
</p>
<a name="index-MAIL"></a>
</dd>
<dt> <tt>MAIL</tt></dt>
<dd><p>If this parameter is set and <tt>mailpath</tt> is not set,
the shell looks for mail in the specified file.
</p>
<a name="index-MAILCHECK"></a>
</dd>
<dt> <tt>MAILCHECK</tt></dt>
<dd><p>The interval in seconds between checks for new mail.
</p>
<a name="index-mailpath"></a>
<a name="index-MAILPATH"></a>
</dd>
<dt> <tt>mailpath</tt> &lt;S&gt; &lt;Z&gt; (<tt>MAILPATH</tt> &lt;S&gt;)</dt>
<dd><p>An array (colon-separated list) of filenames to check for
new mail.  Each filename can be followed by a &lsquo;<tt>?</tt>&rsquo; and a
message that will be printed.  The message will undergo
parameter expansion, command substitution and arithmetic
expansion with the variable <tt>$_</tt> defined as the name
of the file that has changed.  The default message is
&lsquo;<tt>You have new mail</tt>&rsquo;.  If an element is a directory
instead of a file the shell will recursively check every
file in every subdirectory of the element.
</p>
<a name="index-manpath"></a>
<a name="index-MANPATH"></a>
</dd>
<dt> <tt>manpath</tt> &lt;S&gt; &lt;Z&gt; (<tt>MANPATH</tt> &lt;S&gt; &lt;Z&gt;)</dt>
<dd><p>An array (colon-separated list)
whose value is not used by the shell.  The <tt>manpath</tt>
array can be useful, however, since setting it also sets
<tt>MANPATH</tt>, and vice versa.
</p>
<a name="index-module_005fpath"></a>
<a name="index-MODULE_005fPATH"></a>
</dd>
<dt> <tt>module_path</tt> &lt;S&gt; &lt;Z&gt; (<tt>MODULE_PATH</tt> &lt;S&gt;)</dt>
<dd><p>An array (colon-separated list)
of directories that <tt>zmodload</tt>
searches for dynamically loadable modules.
This is initialized to a standard pathname,
usually &lsquo;<tt>/usr/local/lib/zsh/$ZSH_VERSION</tt>&rsquo;.
(The &lsquo;<tt>/usr/local/lib</tt>&rsquo; part varies from installation to installation.)
For security reasons, any value set in the environment when the shell
is started will be ignored.
</p>
<p>These parameters only exist if the installation supports dynamic
module loading.
</p>
<a name="index-NULLCMD"></a>
<a name="index-null-command-style"></a>
<a name="index-csh_002c-null-command-style"></a>
<a name="index-ksh_002c-null-command-style"></a>
</dd>
<dt> <tt>NULLCMD</tt> &lt;S&gt;</dt>
<dd><p>The command name to assume if a redirection is specified
with no command.  Defaults to <tt>cat</tt>.  For <cite>sh</cite>/<cite>ksh</cite>
behavior, change this to <tt>:</tt>.  For <cite>csh</cite>-like
behavior, unset this parameter; the shell will print an
error message if null commands are entered.
</p>
<a name="index-path"></a>
<a name="index-PATH"></a>
</dd>
<dt> <tt>path</tt> &lt;S&gt; &lt;Z&gt; (<tt>PATH</tt> &lt;S&gt;)</dt>
<dd><p>An array (colon-separated list)
of directories to search for commands.
When this parameter is set, each directory is scanned
and all files found are put in a hash table.
</p>
<a name="index-POSTEDIT"></a>
</dd>
<dt> <tt>POSTEDIT</tt> &lt;S&gt;</dt>
<dd><p>This string is output whenever the line editor exits.
It usually contains termcap strings to reset the terminal.
</p>
<a name="index-PROMPT"></a>
</dd>
<dt> <tt>PROMPT</tt> &lt;S&gt; &lt;Z&gt;</dt>
<dd><a name="index-PROMPT2"></a>
</dd>
<dt> <tt>PROMPT2</tt> &lt;S&gt; &lt;Z&gt;</dt>
<dd><a name="index-PROMPT3"></a>
</dd>
<dt> <tt>PROMPT3</tt> &lt;S&gt; &lt;Z&gt;</dt>
<dd><a name="index-PROMPT4"></a>
</dd>
<dt> <tt>PROMPT4</tt> &lt;S&gt; &lt;Z&gt;</dt>
<dd><p>Same as <tt>PS1</tt>, <tt>PS2</tt>, <tt>PS3</tt> and <tt>PS4</tt>,
respectively.
</p>
<a name="index-prompt"></a>
</dd>
<dt> <tt>prompt</tt> &lt;S&gt; &lt;Z&gt;</dt>
<dd><p>Same as <tt>PS1</tt>.
</p>
<a name="index-PROMPT_005fEOL_005fMARK"></a>
</dd>
<dt> <tt>PROMPT_EOL_MARK</tt></dt>
<dd><p>When the <tt>PROMPT_CR</tt> and <tt>PROMPT_SP</tt> options are set, the
<tt>PROMPT_EOL_MARK</tt> parameter can be used to customize how the end of
partial lines are shown.  This parameter undergoes prompt expansion, with
the <tt>PROMPT_PERCENT</tt> option set.  If not set or empty, the default
behavior is equivalent to the value &lsquo;<tt>%B%S%#%s%b</tt>&rsquo;.
</p>
<a name="index-PS1"></a>
</dd>
<dt> <tt>PS1</tt> &lt;S&gt;</dt>
<dd><p>The primary prompt string, printed before a command is read.
It undergoes a special form of expansion
before being displayed; see
<a href="Prompt-Expansion.html#Prompt-Expansion">Prompt Expansion</a>.  The default is &lsquo;<tt>%m%# </tt>&rsquo;.
</p>
<a name="index-PS2"></a>
</dd>
<dt> <tt>PS2</tt> &lt;S&gt;</dt>
<dd><p>The secondary prompt, printed when the shell needs more information
to complete a command.
It is expanded in the same way as <tt>PS1</tt>.
The default is &lsquo;<tt>%_&gt; </tt>&rsquo;, which displays any shell constructs or quotation
marks which are currently being processed.
</p>
<a name="index-PS3"></a>
</dd>
<dt> <tt>PS3</tt> &lt;S&gt;</dt>
<dd><p>Selection prompt used within a <tt>select</tt> loop.
It is expanded in the same way as <tt>PS1</tt>.
The default is &lsquo;<tt>?# </tt>&rsquo;.
</p>
<a name="index-PS4"></a>
</dd>
<dt> <tt>PS4</tt> &lt;S&gt;</dt>
<dd><p>The execution trace prompt.  Default is &lsquo;<tt>+%N:%i&gt; </tt>&rsquo;, which displays
the name of the current shell structure and the line number within it.
In sh or ksh emulation, the default is &lsquo;<tt>+ </tt>&rsquo;.
</p>
<a name="index-psvar"></a>
<a name="index-PSVAR"></a>
</dd>
<dt> <tt>psvar</tt> &lt;S&gt; &lt;Z&gt; (<tt>PSVAR</tt> &lt;S&gt;)</dt>
<dd><p>An array (colon-separated list) whose first nine values can be used in
<tt>PROMPT</tt> strings.  Setting <tt>psvar</tt> also sets <tt>PSVAR</tt>, and
vice versa.
</p>
<a name="index-READNULLCMD"></a>
</dd>
<dt> <tt>READNULLCMD</tt> &lt;S&gt;</dt>
<dd><p>The command name to assume if a single input redirection
is specified with no command.  Defaults to <tt>more</tt>.
</p>
<a name="index-REPORTTIME"></a>
</dd>
<dt> <tt>REPORTTIME</tt></dt>
<dd><p>If nonnegative, commands whose combined user and system execution times
(measured in seconds) are greater than this value have timing
statistics printed for them.
</p>
<a name="index-REPLY"></a>
</dd>
<dt> <tt>REPLY</tt></dt>
<dd><p>This parameter is reserved by convention to pass string values between
shell scripts and shell builtins in situations where a function call or
redirection are impossible or undesirable.  The <tt>read</tt> builtin and the
<tt>select</tt> complex command may set <tt>REPLY</tt>, and filename generation both
sets and examines its value when evaluating certain expressions.  Some
modules also employ <tt>REPLY</tt> for similar purposes.
</p>
<a name="index-reply"></a>
</dd>
<dt> <tt>reply</tt></dt>
<dd><p>As <tt>REPLY</tt>, but for array values rather than strings.
</p>
<a name="index-RPROMPT"></a>
</dd>
<dt> <tt>RPROMPT</tt> &lt;S&gt;</dt>
<dd><a name="index-RPS1"></a>
</dd>
<dt> <tt>RPS1</tt> &lt;S&gt;</dt>
<dd><p>This prompt is displayed on the right-hand side of the screen
when the primary prompt is being displayed on the left.
This does not work if the <tt>SINGLELINEZLE</tt> option is set.
It is expanded in the same way as <tt>PS1</tt>.
</p>
<a name="index-RPROMPT2"></a>
</dd>
<dt> <tt>RPROMPT2</tt> &lt;S&gt;</dt>
<dd><a name="index-RPS2"></a>
</dd>
<dt> <tt>RPS2</tt> &lt;S&gt;</dt>
<dd><p>This prompt is displayed on the right-hand side of the screen
when the secondary prompt is being displayed on the left.
This does not work if the <tt>SINGLELINEZLE</tt> option is set.
It is expanded in the same way as <tt>PS2</tt>.
</p>
<a name="index-SAVEHIST"></a>
</dd>
<dt> <tt>SAVEHIST</tt></dt>
<dd><p>The maximum number of history events to save in the history file.
</p>
<a name="index-SPROMPT"></a>
</dd>
<dt> <tt>SPROMPT</tt> &lt;S&gt;</dt>
<dd><p>The prompt used for spelling correction.  The sequence
&lsquo;<tt>%R</tt>&rsquo; expands to the string which presumably needs spelling
correction, and &lsquo;<tt>%r</tt>&rsquo; expands to the proposed correction.
All other prompt escapes are also allowed.
</p>
<a name="index-STTY"></a>
</dd>
<dt> <tt>STTY</tt></dt>
<dd><p>If this parameter is set in a command&rsquo;s environment, the shell runs the
<tt>stty</tt> command with the value of this parameter as arguments in order to
set up the terminal before executing the command. The modes apply only to the
command, and are reset when it finishes or is suspended. If the command is
suspended and continued later with the <tt>fg</tt> or <tt>wait</tt> builtins it will
see the modes specified by <tt>STTY</tt>, as if it were not suspended.  This
(intentionally) does not apply if the command is continued via &lsquo;<tt>kill
-CONT</tt>&rsquo;.  <tt>STTY</tt> is ignored if the command is run in the background, or
if it is in the environment of the shell but not explicitly assigned to in
the input line. This avoids running stty at every external command by
accidentally exporting it. Also note that <tt>STTY</tt> should not be used for
window size specifications; these will not be local to the command.
</p>
<a name="index-TERM"></a>
</dd>
<dt> <tt>TERM</tt> &lt;S&gt;</dt>
<dd><p>The type of terminal in use.  This is used when looking up termcap
sequences.  An assignment to <tt>TERM</tt> causes zsh to re-initialize the
terminal, even if the value does not change (e.g., &lsquo;<tt>TERM=$TERM</tt>&rsquo;).  It
is necessary to make such an assignment upon any change to the terminal
definition database or terminal type in order for the new settings to
take effect.
</p>
<a name="index-TIMEFMT"></a>
</dd>
<dt> <tt>TIMEFMT</tt></dt>
<dd><p>The format of process time reports with the <tt>time</tt> keyword.
The default is &lsquo;<tt>%E real  %U user  %S system  %P %J</tt>&rsquo;.
Recognizes the following escape sequences, although not all
may be available on all systems, and some that are available
may not be useful:
</p>
<dl compact="compact">
<dt> <tt>%%</tt></dt>
<dd><p>A &lsquo;<tt>%</tt>&rsquo;.
</p></dd>
<dt> <tt>%U</tt></dt>
<dd><p>CPU seconds spent in user mode.
</p></dd>
<dt> <tt>%S</tt></dt>
<dd><p>CPU seconds spent in kernel mode.
</p></dd>
<dt> <tt>%E</tt></dt>
<dd><p>Elapsed time in seconds.
</p></dd>
<dt> <tt>%P</tt></dt>
<dd><p>The CPU percentage, computed as
(100*<tt>%U</tt>+<tt>%S</tt>)/<tt>%E</tt>.
</p></dd>
<dt> <tt>%W</tt></dt>
<dd><p>Number of times the process was swapped.
</p></dd>
<dt> <tt>%X</tt></dt>
<dd><p>The average amount in (shared) text space used in Kbytes.
</p></dd>
<dt> <tt>%D</tt></dt>
<dd><p>The average amount in (unshared) data/stack space used in
Kbytes.
</p></dd>
<dt> <tt>%K</tt></dt>
<dd><p>The total space used (%X+%D) in Kbytes.
</p></dd>
<dt> <tt>%M</tt></dt>
<dd><p>The  maximum memory the process had in use at any time in
Kbytes.
</p></dd>
<dt> <tt>%F</tt></dt>
<dd><p>The number of major page faults (page needed to be brought
from disk).
</p></dd>
<dt> <tt>%R</tt></dt>
<dd><p>The number of minor page faults.
</p></dd>
<dt> <tt>%I</tt></dt>
<dd><p>The number of input operations.
</p></dd>
<dt> <tt>%O</tt></dt>
<dd><p>The number of output operations.
</p></dd>
<dt> <tt>%r</tt></dt>
<dd><p>The number of socket messages received.
</p></dd>
<dt> <tt>%s</tt></dt>
<dd><p>The number of socket messages sent.
</p></dd>
<dt> <tt>%k</tt></dt>
<dd><p>The number of signals received.
</p></dd>
<dt> <tt>%w</tt></dt>
<dd><p>Number of voluntary context switches (waits).
</p></dd>
<dt> <tt>%c</tt></dt>
<dd><p>Number of involuntary context switches.
</p></dd>
<dt> <tt>%J</tt></dt>
<dd><p>The name of this job.
</p></dd>
</dl>

<p>A star may be inserted between the percent sign and flags printing time.
This cause the time to be printed in
&lsquo;<var>hh</var><tt>:</tt><var>mm</var><tt>:</tt><var>ss</var><tt>.</tt><var>ttt</var>&rsquo;
format (hours and minutes are only printed if they are not zero).
</p>
<a name="index-TMOUT"></a>
</dd>
<dt> <tt>TMOUT</tt></dt>
<dd><p>If this parameter is nonzero, the shell will receive an <tt>ALRM</tt>
signal if a command is not entered within the specified number of
seconds after issuing a prompt. If there is a trap on <tt>SIGALRM</tt>, it
will be executed and a new alarm is scheduled using the value of the
<tt>TMOUT</tt> parameter after executing the trap.  If no trap is set, and
the idle time of the terminal is not less than the value of the
<tt>TMOUT</tt> parameter, zsh terminates.  Otherwise a new alarm is
scheduled to <tt>TMOUT</tt> seconds after the last keypress.
</p>
<a name="index-TMPPREFIX"></a>
</dd>
<dt> <tt>TMPPREFIX</tt></dt>
<dd><p>A pathname prefix which the shell will use for all temporary files.
Note that this should include an initial part for the file name as
well as any directory names.  The default is &lsquo;<tt>/tmp/zsh</tt>&rsquo;.
</p>
<a name="index-watch"></a>
<a name="index-WATCH"></a>
</dd>
<dt> <tt>watch</tt> &lt;S&gt; &lt;Z&gt; (<tt>WATCH</tt> &lt;S&gt;)</dt>
<dd><p>An array (colon-separated list) of login/logout events to report.
If it contains the single word &lsquo;<tt>all</tt>&rsquo;, then all login/logout events
are reported.  If it contains the single word &lsquo;<tt>notme</tt>&rsquo;, then all
events are reported as with &lsquo;<tt>all</tt>&rsquo; except <tt>$USERNAME</tt>.
An entry in this list may consist of a username,
an &lsquo;<tt>@</tt>&rsquo; followed by a remote hostname,
and a &lsquo;<tt>%</tt>&rsquo; followed by a line (tty).
Any or all of these components may be present in an entry;
if a login/logout event matches all of them,
it is reported.
</p>
<a name="index-WATCHFMT"></a>
</dd>
<dt> <tt>WATCHFMT</tt></dt>
<dd><p>The format of login/logout reports if the <tt>watch</tt> parameter is set.
Default is &lsquo;<tt>%n has %a %l from %m</tt>&rsquo;.
Recognizes the following escape sequences:
</p>
<dl compact="compact">
<dt> <tt>%n</tt></dt>
<dd><p>The name of the user that logged in/out.
</p>
</dd>
<dt> <tt>%a</tt></dt>
<dd><p>The observed action, i.e. &quot;logged on&quot; or &quot;logged off&quot;.
</p>
</dd>
<dt> <tt>%l</tt></dt>
<dd><p>The line (tty) the user is logged in on.
</p>
</dd>
<dt> <tt>%M</tt></dt>
<dd><p>The full hostname of the remote host.
</p>
</dd>
<dt> <tt>%m</tt></dt>
<dd><p>The hostname up to the first &lsquo;<tt>.</tt>&rsquo;.  If only the
IP address is available or the utmp field contains
the name of an X-windows display, the whole name is printed.
</p>
<p><em>NOTE:</em>
The &lsquo;<tt>%m</tt>&rsquo; and &lsquo;<tt>%M</tt>&rsquo; escapes will work only if there is a host name
field in the utmp on your machine.  Otherwise they are
treated as ordinary strings.
</p>
</dd>
<dt> <tt>%S</tt> (<tt>%s</tt>)</dt>
<dd><p>Start (stop) standout mode.
</p>
</dd>
<dt> <tt>%U</tt> (<tt>%u</tt>)</dt>
<dd><p>Start (stop) underline mode.
</p>
</dd>
<dt> <tt>%B</tt> (<tt>%b</tt>)</dt>
<dd><p>Start (stop) boldface mode.
</p>
</dd>
<dt> <tt>%t</tt></dt>
<dt> <tt>%@</tt></dt>
<dd><p>The time, in 12-hour, am/pm format.
</p>
</dd>
<dt> <tt>%T</tt></dt>
<dd><p>The time, in 24-hour format.
</p>
</dd>
<dt> <tt>%w</tt></dt>
<dd><p>The date in &lsquo;<var>day</var><tt>-</tt><var>dd</var>&rsquo; format.
</p>
</dd>
<dt> <tt>%W</tt></dt>
<dd><p>The date in &lsquo;<var>mm</var><tt>/</tt><var>dd</var><tt>/</tt><var>yy</var>&rsquo; format.
</p>
</dd>
<dt> <tt>%D</tt></dt>
<dd><p>The date in &lsquo;<var>yy</var><tt>-</tt><var>mm</var><tt>-</tt><var>dd</var>&rsquo; format.
</p>
</dd>
<dt> <tt>%(</tt><var>x</var><tt>:</tt><var>true-text</var><tt>:</tt><var>false-text</var><tt>)</tt></dt>
<dd><p>Specifies a ternary expression.
The character following the <var>x</var> is
arbitrary; the same character is used to separate the text
for the &quot;true&quot; result from that for the &quot;false&quot; result.
Both the separator and the right parenthesis may be escaped
with a backslash.
Ternary expressions may be nested.
</p>
<p>The test character <var>x</var> may be any one of &lsquo;<tt>l</tt>&rsquo;, &lsquo;<tt>n</tt>&rsquo;, &lsquo;<tt>m</tt>&rsquo;
or &lsquo;<tt>M</tt>&rsquo;, which indicate a &lsquo;true&rsquo; result if the corresponding
escape sequence would return a non-empty value; or it may be &lsquo;<tt>a</tt>&rsquo;,
which indicates a &lsquo;true&rsquo; result if the watched user has logged in,
or &lsquo;false&rsquo; if he has logged out.
Other characters evaluate to neither true nor false; the entire
expression is omitted in this case.
</p>
<p>If the result is &lsquo;true&rsquo;, then the <var>true-text</var>
is formatted according to the rules above and printed,
and the <var>false-text</var> is skipped.
If &lsquo;false&rsquo;, the <var>true-text</var> is skipped and the <var>false-text</var>
is formatted and printed.
Either or both of the branches may be empty, but
both separators must be present in any case.
</p>
</dd>
</dl>

<a name="index-WORDCHARS"></a>
</dd>
<dt> <tt>WORDCHARS</tt> &lt;S&gt;</dt>
<dd><p>A list of non-alphanumeric characters considered part of a word
by the line editor.
</p>
<a name="index-ZBEEP"></a>
</dd>
<dt> <tt>ZBEEP</tt></dt>
<dd><p>If set, this gives a string of characters, which can use all the same codes
as the <tt>bindkey</tt> command as described in
<a href="Zsh-Modules.html#The-zsh_002fzle-Module">The zsh/zle Module</a>, that will be output to the terminal
instead of beeping.  This may have a visible instead of an audible effect;
for example, the string &lsquo;<tt>\e[?5h\e[?5l</tt>&rsquo; on a vt100 or xterm will have
the effect of flashing reverse video on and off (if you usually use reverse
video, you should use the string &lsquo;<tt>\e[?5l\e[?5h</tt>&rsquo; instead).  This takes
precedence over the <tt>NOBEEP</tt> option.
</p>
<a name="index-ZDOTDIR"></a>
</dd>
<dt> <tt>ZDOTDIR</tt></dt>
<dd><p>The directory to search for shell startup files (.zshrc, etc),
if not <tt>$HOME</tt>.
</p>
<a name="index-ZLE_005fLINE_005fABORTED"></a>
</dd>
<dt> <tt>ZLE_LINE_ABORTED</tt></dt>
<dd><p>This parameter is set by the line editor when an error occurs.  It
contains the line that was being edited at the point of the error.
&lsquo;<tt>print -zr &ndash; $ZLE_LINE_ABORTED</tt>&rsquo; can be used to recover the line.
Only the most recent line of this kind is remembered.
</p>
<a name="index-ZLE_005fREMOVE_005fSUFFIX_005fCHARS"></a>
<a name="index-ZLE_005fSPACE_005fSUFFIX_005fCHARS"></a>
</dd>
<dt> <tt>ZLE_REMOVE_SUFFIX_CHARS</tt></dt>
<dt> <tt>ZLE_SPACE_SUFFIX_CHARS</tt></dt>
<dd><p>These parameters are used by the line editor.  In certain circumstances
suffixes (typically space or slash) added by the completion system
will be removed automatically, either because the next editing command
was not an insertable character, or because the character was marked
as requiring the suffix to be removed.
</p>
<p>These variables can contain the sets of characters that will cause the
suffix to be removed.  If <tt>ZLE_REMOVE_SUFFIX_CHARS</tt> is set, those
characters will cause the suffix to be removed; if
<tt>ZLE_SPACE_SUFFIX_CHARS</tt> is set, those characters will cause the
suffix to be removed and replaced by a space.
</p>
<p>If <tt>ZLE_REMOVE_SUFFIX_CHARS</tt> is not set, the default behaviour is
equivalent to:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">ZLE_REMOVE_SUFFIX_CHARS=$' \t\n;&amp;|'
</pre></td></tr></table>

<p>If <tt>ZLE_REMOVE_SUFFIX_CHARS</tt> is set but is empty, no characters have this
behaviour.  <tt>ZLE_SPACE_SUFFIX_CHARS</tt> takes precedence, so that the
following:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">ZLE_SPACE_SUFFIX_CHARS=$'&amp;|'
</pre></td></tr></table>

<p>causes the characters &lsquo;<tt>&amp;</tt>&rsquo; and &lsquo;<tt>|</tt>&rsquo; to remove the suffix but to
replace it with a space.
</p>
<p>To illustrate the difference, suppose that the option <tt>AUTO_REMOVE_SLASH</tt>
is in effect and the directory <tt>DIR</tt> has just been completed, with an
appended <tt>/</tt>, following which the user types &lsquo;<tt>&amp;</tt>&rsquo;.  The default result
is &lsquo;<tt>DIR&amp;</tt>&rsquo;.  With <tt>ZLE_REMOVE_SUFFIX_CHARS</tt> set but without including
&lsquo;<tt>&amp;</tt>&rsquo; the result is &lsquo;<tt>DIR/&amp;</tt>&rsquo;.  With <tt>ZLE_SPACE_SUFFIX_CHARS</tt> set to
include &lsquo;<tt>&amp;</tt>&rsquo; the result is &lsquo;<tt>DIR &amp;</tt>&rsquo;.
</p>
<p>Note that certain completions may provide their own suffix removal
or replacement behaviour which overrides the values described here.
See the completion system documentation in
<a href="Completion-System.html#Completion-System">Completion System</a>.
</p>
</dd>
</dl>
<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Parameters" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="Options.html#Options" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="zsh.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="zsh_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concept-Index.html#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="zsh_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
 <font size="-1">
  This document was generated by <em>Peter Stephenson</em> on <em>December 20, 2010</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
 </font>
 <br>

</p>
</body>
</html>