2820 lines
146 KiB
HTML
2820 lines
146 KiB
HTML
|
<!DOCTYPE HTML>
|
|||
|
<html lang="en" class="sidebar-visible no-js light">
|
|||
|
<head>
|
|||
|
<!-- Book generated using mdBook -->
|
|||
|
<meta charset="UTF-8">
|
|||
|
<title>Options - Zsh Manual</title>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<!-- Custom HTML head -->
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|||
|
<meta name="description" content="">
|
|||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|||
|
<meta name="theme-color" content="#ffffff" />
|
|||
|
|
|||
|
|
|||
|
<link rel="icon" href="favicon.svg">
|
|||
|
|
|||
|
|
|||
|
<link rel="shortcut icon" href="favicon.png">
|
|||
|
|
|||
|
<link rel="stylesheet" href="css/variables.css">
|
|||
|
<link rel="stylesheet" href="css/general.css">
|
|||
|
<link rel="stylesheet" href="css/chrome.css">
|
|||
|
|
|||
|
<link rel="stylesheet" href="css/print.css" media="print">
|
|||
|
|
|||
|
|
|||
|
<!-- Fonts -->
|
|||
|
<link rel="stylesheet" href="FontAwesome/css/font-awesome.css">
|
|||
|
|
|||
|
<link rel="stylesheet" href="fonts/fonts.css">
|
|||
|
|
|||
|
|
|||
|
<!-- Highlight.js Stylesheets -->
|
|||
|
<link rel="stylesheet" href="highlight.css">
|
|||
|
<link rel="stylesheet" href="tomorrow-night.css">
|
|||
|
<link rel="stylesheet" href="ayu-highlight.css">
|
|||
|
|
|||
|
<!-- Custom theme stylesheets -->
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</head>
|
|||
|
<body>
|
|||
|
<!-- Provide site root to javascript -->
|
|||
|
<script type="text/javascript">
|
|||
|
var path_to_root = "";
|
|||
|
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
|
|||
|
</script>
|
|||
|
|
|||
|
<!-- Work around some values being stored in localStorage wrapped in quotes -->
|
|||
|
<script type="text/javascript">
|
|||
|
try {
|
|||
|
var theme = localStorage.getItem('mdbook-theme');
|
|||
|
var sidebar = localStorage.getItem('mdbook-sidebar');
|
|||
|
|
|||
|
if (theme.startsWith('"') && theme.endsWith('"')) {
|
|||
|
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
|
|||
|
}
|
|||
|
|
|||
|
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
|
|||
|
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
|
|||
|
}
|
|||
|
} catch (e) { }
|
|||
|
</script>
|
|||
|
|
|||
|
<!-- Set the theme before any content is loaded, prevents flash -->
|
|||
|
<script type="text/javascript">
|
|||
|
var theme;
|
|||
|
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
|
|||
|
if (theme === null || theme === undefined) { theme = default_theme; }
|
|||
|
var html = document.querySelector('html');
|
|||
|
html.classList.remove('no-js')
|
|||
|
html.classList.remove('light')
|
|||
|
html.classList.add(theme);
|
|||
|
html.classList.add('js');
|
|||
|
</script>
|
|||
|
|
|||
|
<!-- Hide / unhide sidebar before it is displayed -->
|
|||
|
<script type="text/javascript">
|
|||
|
var html = document.querySelector('html');
|
|||
|
var sidebar = 'hidden';
|
|||
|
if (document.body.clientWidth >= 1080) {
|
|||
|
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
|
|||
|
sidebar = sidebar || 'visible';
|
|||
|
}
|
|||
|
html.classList.remove('sidebar-visible');
|
|||
|
html.classList.add("sidebar-" + sidebar);
|
|||
|
</script>
|
|||
|
|
|||
|
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
|
|||
|
<div class="sidebar-scrollbox">
|
|||
|
<ol class="chapter"><li class="chapter-item expanded "><a href="The-Z-Shell-Manual.html"><strong aria-hidden="true">1.</strong> The Z Shell Manual</a></li><li class="chapter-item expanded "><a href="Introduction.html"><strong aria-hidden="true">2.</strong> Introduction</a></li><li class="chapter-item expanded "><a href="Roadmap.html"><strong aria-hidden="true">3.</strong> Roadmap</a></li><li class="chapter-item expanded "><a href="Invocation.html"><strong aria-hidden="true">4.</strong> Invocation</a></li><li class="chapter-item expanded "><a href="Files.html"><strong aria-hidden="true">5.</strong> Files</a></li><li class="chapter-item expanded "><a href="Shell-Grammar.html"><strong aria-hidden="true">6.</strong> Shell Grammar</a></li><li class="chapter-item expanded "><a href="Redirection.html"><strong aria-hidden="true">7.</strong> Redirection</a></li><li class="chapter-item expanded "><a href="Command-Execution.html"><strong aria-hidden="true">8.</strong> Command Execution</a></li><li class="chapter-item expanded "><a href="Functions.html"><strong aria-hidden="true">9.</strong> Functions</a></li><li class="chapter-item expanded "><a href="Jobs-_0026-Signals.html"><strong aria-hidden="true">10.</strong> Jobs & Signals</a></li><li class="chapter-item expanded "><a href="Arithmetic-Evaluation.html"><strong aria-hidden="true">11.</strong> Arithmetic Evaluation</a></li><li class="chapter-item expanded "><a href="Conditional-Expressions.html"><strong aria-hidden="true">12.</strong> Conditional Expressions</a></li><li class="chapter-item expanded "><a href="Prompt-Expansion.html"><strong aria-hidden="true">13.</strong> Prompt Expansion</a></li><li class="chapter-item expanded "><a href="Expansion.html"><strong aria-hidden="true">14.</strong> Expansion</a></li><li class="chapter-item expanded "><a href="Parameters.html"><strong aria-hidden="true">15.</strong> Parameters</a></li><li class="chapter-item expanded "><a href="Options.html" class="active"><strong aria-hidden="true">16.</strong> Options</a></li><li class="chapter-item expanded "><a href="Shell-Builtin-Commands.html"><strong aria-hidden="true">17.</strong> Shell Builtin Commands</a></li><li class="chapter-item expanded "><a href="Zsh-Line-Editor.html"><strong aria-hidden="true">18.</strong> Zsh Line Editor</a></li><li class="chapter-item expanded "><a href="Completion-Widgets.html"><strong aria-hidden="true">19.</strong> Completion Widgets</a></li><li class="chapter-item expanded "><a href="Completion-System.html"><strong aria-hidden="true">20.</strong> Completion System</a></li><li class="chapter-item expanded "><a href="Completion-Using-compctl.html"><strong aria-hidden="true">21.</strong> Completion Using compctl</a></li><li class="chapter-item expanded "><a href="Zsh-Modules.html"><strong aria-hidden="true">22.</strong> Zsh Modules</a></li><li class="chapter-item expanded "><a href="Calendar-Function-System.html"><strong aria-hidden="true">23.</strong> Calendar Function System</a></li><li class="chapter-item expanded "><a href="TCP-Function-System.html"><strong aria-hidden="true">24.</strong> TCP Function System</a></li><li class="chapter-item expanded "><a href="Zftp-Function-System.html"><strong aria-hidden="true">25.</strong> Zftp Function System</a></li><li class="chapter-item expanded "><a href="User-Contributions.html"><strong aria-hidden="true">26.</strong> User Contributions</a></li></ol>
|
|||
|
</div>
|
|||
|
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
|
|||
|
</nav>
|
|||
|
|
|||
|
<div id="page-wrapper" class="page-wrapper">
|
|||
|
|
|||
|
<div class="page">
|
|||
|
|
|||
|
<div id="menu-bar-hover-placeholder"></div>
|
|||
|
<div id="menu-bar" class="menu-bar sticky bordered">
|
|||
|
<div class="left-buttons">
|
|||
|
<button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
|
|||
|
<i class="fa fa-bars"></i>
|
|||
|
</button>
|
|||
|
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
|
|||
|
<i class="fa fa-paint-brush"></i>
|
|||
|
</button>
|
|||
|
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
|
|||
|
<li role="none"><button role="menuitem" class="theme" id="light">Light (default)</button></li>
|
|||
|
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
|
|||
|
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
|
|||
|
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
|
|||
|
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
|
|||
|
<i class="fa fa-search"></i>
|
|||
|
</button>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
<h1 class="menu-title">Zsh Manual</h1>
|
|||
|
|
|||
|
<div class="right-buttons">
|
|||
|
|
|||
|
<a href="print.html" title="Print this book" aria-label="Print this book">
|
|||
|
<i id="print-button" class="fa fa-print"></i>
|
|||
|
</a>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<div id="search-wrapper" class="hidden">
|
|||
|
<form id="searchbar-outer" class="searchbar-outer">
|
|||
|
<input type="search" name="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
|
|||
|
</form>
|
|||
|
<div id="searchresults-outer" class="searchresults-outer hidden">
|
|||
|
<div id="searchresults-header" class="searchresults-header"></div>
|
|||
|
<ul id="searchresults">
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
|
|||
|
<script type="text/javascript">
|
|||
|
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
|
|||
|
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
|
|||
|
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
|
|||
|
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
|
|||
|
});
|
|||
|
</script>
|
|||
|
|
|||
|
<div id="content" class="content">
|
|||
|
<main>
|
|||
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|||
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|||
|
<p><strong>Table of Contents</strong> <em>generated with <a href="https://github.com/thlorenz/doctoc">DocToc</a></em></p>
|
|||
|
<ul>
|
|||
|
<li><a href="#16-options">16 Options</a>
|
|||
|
<ul>
|
|||
|
<li><a href="#161-specifying-options">16.1 Specifying Options</a></li>
|
|||
|
<li><a href="#162-description-of-options">16.2 Description of Options</a>
|
|||
|
<ul>
|
|||
|
<li><a href="#1621-changing-directories">16.2.1 Changing Directories</a></li>
|
|||
|
<li><a href="#1622-completion">16.2.2 Completion</a></li>
|
|||
|
<li><a href="#1623-expansion-and-globbing">16.2.3 Expansion and Globbing</a></li>
|
|||
|
<li><a href="#1624-history">16.2.4 History</a></li>
|
|||
|
<li><a href="#1625-initialisation">16.2.5 Initialisation</a></li>
|
|||
|
<li><a href="#1626-inputoutput">16.2.6 Input/Output</a></li>
|
|||
|
<li><a href="#1627-job-control">16.2.7 Job Control</a></li>
|
|||
|
<li><a href="#1628-prompting">16.2.8 Prompting</a></li>
|
|||
|
<li><a href="#1629-scripts-and-functions">16.2.9 Scripts and Functions</a></li>
|
|||
|
<li><a href="#16210-shell-emulation">16.2.10 Shell Emulation</a></li>
|
|||
|
<li><a href="#16211-shell-state">16.2.11 Shell State</a></li>
|
|||
|
<li><a href="#16212-zle">16.2.12 Zle</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><a href="#163-option-aliases">16.3 Option Aliases</a></li>
|
|||
|
<li><a href="#164-single-letter-options">16.4 Single Letter Options</a>
|
|||
|
<ul>
|
|||
|
<li><a href="#1641-default-set">16.4.1 Default set</a></li>
|
|||
|
<li><a href="#1642-shksh-emulation-set">16.4.2 sh/ksh emulation set</a></li>
|
|||
|
<li><a href="#1643-also-note">16.4.3 Also note</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|||
|
<p><span id="Options"></span> <span id="Options-1"></span></p>
|
|||
|
<h1 id="16-options"><a class="header" href="#16-options">16 Options</a></h1>
|
|||
|
<p><span id="index-options"></span></p>
|
|||
|
<hr />
|
|||
|
<p><span id="Specifying-Options"></span>
|
|||
|
<span id="Specifying-Options-1"></span></p>
|
|||
|
<h2 id="161-specifying-options"><a class="header" href="#161-specifying-options">16.1 Specifying Options</a></h2>
|
|||
|
<p><span id="index-options_002c-specifying"></span></p>
|
|||
|
<p>Options are primarily referred to by name. These names are case
|
|||
|
insensitive and underscores are ignored. For example, ‘<code>allexport</code>’ is
|
|||
|
equivalent to ‘<code>A__lleXP_ort</code>’.</p>
|
|||
|
<p>The sense of an option name may be inverted by preceding it with ‘<code>no</code>’,
|
|||
|
so ‘<code>setopt No_Beep</code>’ is equivalent to ‘<code>unsetopt beep</code>’. This inversion
|
|||
|
can only be done once, so ‘<code>nonobeep</code>’ is <em>not</em> a synonym for ‘<code>beep</code>’.
|
|||
|
Similarly, ‘<code>tify</code>’ is not a synonym for ‘<code>nonotify</code>’ (the inversion of
|
|||
|
‘<code>notify</code>’).</p>
|
|||
|
<p>Some options also have one or more single letter names. There are two
|
|||
|
sets of single letter options: one used by default, and another used to
|
|||
|
emulate sh/ksh (used when the <code>SH_OPTION_LETTERS</code> option is set). The
|
|||
|
single letter options can be used on the shell command line, or with the
|
|||
|
<code>set</code>, <code>setopt</code> and <code>unsetopt</code> builtins, as normal Unix options preceded
|
|||
|
by ‘<code>-</code>’.</p>
|
|||
|
<p>The sense of the single letter options may be inverted by using ‘<code>+</code>’
|
|||
|
instead of ‘<code>-</code>’. Some of the single letter option names refer to an
|
|||
|
option being off, in which case the inversion of that name refers to the
|
|||
|
option being on. For example, ‘<code>+n</code>’ is the short name of ‘<code>exec</code>’, and
|
|||
|
‘<code>-n</code>’ is the short name of its inversion, ‘<code>noexec</code>’.</p>
|
|||
|
<p>In strings of single letter options supplied to the shell at startup,
|
|||
|
trailing whitespace will be ignored; for example the string ‘<code>-f </code>’
|
|||
|
will be treated just as ‘<code>-f</code>’, but the string ‘<code>-f i</code>’ is an error.
|
|||
|
This is because many systems which implement the ‘<code>#!</code>’ mechanism for
|
|||
|
calling scripts do not strip trailing whitespace.</p>
|
|||
|
<hr />
|
|||
|
<p><span id="Description-of-Options"></span>
|
|||
|
<span id="Description-of-Options-1"></span></p>
|
|||
|
<h2 id="162-description-of-options"><a class="header" href="#162-description-of-options">16.2 Description of Options</a></h2>
|
|||
|
<p><span id="index-options_002c-description"></span></p>
|
|||
|
<p>In the following list, options set by default in all emulations are
|
|||
|
marked <D>; those set by default only in csh, ksh, sh, or zsh
|
|||
|
emulations are marked <C>, <K>, <S>, <Z> as appropriate. When
|
|||
|
listing options (by ‘<code>setopt</code>’, ‘<code>unsetopt</code>’, ‘<code>set -o</code>’ or ‘<code>set +o</code>’),
|
|||
|
those turned on by default appear in the list prefixed with ‘<code>no</code>’.
|
|||
|
Hence (unless <code>KSH_OPTION_PRINT</code> is set), ‘<code>setopt</code>’ shows all options
|
|||
|
whose settings are changed from the default.</p>
|
|||
|
<hr />
|
|||
|
<p><span id="Changing-Directories"></span></p>
|
|||
|
<h3 id="1621-changing-directories"><a class="header" href="#1621-changing-directories">16.2.1 Changing Directories</a></h3>
|
|||
|
<p><span id="index-AUTO_005fCD"></span>
|
|||
|
<span id="index-NO_005fAUTO_005fCD"></span>
|
|||
|
<span id="index-AUTOCD"></span> <span id="index-NOAUTOCD"></span>
|
|||
|
<span id="index-cd_002c-automatic"></span></p>
|
|||
|
<p><code>AUTO_CD</code> (<code>-J</code>)</p>
|
|||
|
<p>If a command is issued that can’t be executed as a normal command, and
|
|||
|
the command is the name of a directory, perform the <code>cd</code> command to that
|
|||
|
directory. This option is only applicable if the option <code>SHIN_STDIN</code> is
|
|||
|
set, i.e. if commands are being read from standard input. The option is
|
|||
|
designed for interactive use; it is recommended that <code>cd</code> be used
|
|||
|
explicitly in scripts to avoid ambiguity.</p>
|
|||
|
<p><span id="index-AUTO_005fPUSHD"></span>
|
|||
|
<span id="index-NO_005fAUTO_005fPUSHD"></span>
|
|||
|
<span id="index-AUTOPUSHD"></span> <span id="index-NOAUTOPUSHD"></span>
|
|||
|
<span id="index-cd_002c-behaving-like-pushd"></span>
|
|||
|
<span id="index-pushd_002c-making-cd-behave-like"></span></p>
|
|||
|
<p><code>AUTO_PUSHD</code> (<code>-N</code>)</p>
|
|||
|
<p>Make <code>cd</code> push the old directory onto the directory stack.</p>
|
|||
|
<p><span id="index-CDABLE_005fVARS"></span>
|
|||
|
<span id="index-NO_005fCDABLE_005fVARS"></span>
|
|||
|
<span id="index-CDABLEVARS"></span>
|
|||
|
<span id="index-NOCDABLEVARS"></span>
|
|||
|
<span id="index-cd_002c-to-parameter"></span></p>
|
|||
|
<p><code>CDABLE_VARS</code> (<code>-T</code>)</p>
|
|||
|
<p>If the argument to a <code>cd</code> command (or an implied <code>cd</code> with the <code>AUTO_CD</code>
|
|||
|
option set) is not a directory, and does not begin with a slash, try to
|
|||
|
expand the expression as if it were preceded by a ‘<code>~</code>’ (see <a href="Expansion.html#Filename-Expansion">Filename
|
|||
|
Expansion</a>).</p>
|
|||
|
<p><span id="index-CD_005fSILENT"></span>
|
|||
|
<span id="index-NO_005fCD_005fSILENT"></span>
|
|||
|
<span id="index-CDSILENT"></span> <span id="index-NOCDSILENT"></span>
|
|||
|
<span id="index-cd_002c-silencing"></span>
|
|||
|
<span id="index-autocd_002c-silencing"></span></p>
|
|||
|
<p><code>CD_SILENT</code></p>
|
|||
|
<p>Never print the working directory after a <code>cd</code> (whether explicit or
|
|||
|
implied with the <code>AUTO_CD</code> option set). <code>cd</code> normally prints the working
|
|||
|
directory when the argument given to it was <code>-</code>, a stack entry, or the
|
|||
|
name of a directory found under <code>CDPATH</code>. Note that this is distinct
|
|||
|
from <code>pushd</code>’s stack-printing behaviour, which is controlled by
|
|||
|
<code>PUSHD_SILENT</code>. This option overrides the printing-related effects of
|
|||
|
<code>POSIX_CD</code>.</p>
|
|||
|
<p><span id="index-CHASE_005fDOTS"></span>
|
|||
|
<span id="index-NO_005fCHASE_005fDOTS"></span>
|
|||
|
<span id="index-CHASEDOTS"></span> <span id="index-NOCHASEDOTS"></span>
|
|||
|
<span id="index-cd_002c-with-_002e_002e-in-argument"></span></p>
|
|||
|
<p><code>CHASE_DOTS</code></p>
|
|||
|
<p>When changing to a directory containing a path segment ‘<code>..</code>’ which
|
|||
|
would otherwise be treated as canceling the previous segment in the path
|
|||
|
(in other words, ‘<code>foo/..</code>’ would be removed from the path, or if ‘<code>..</code>’
|
|||
|
is the first part of the path, the last part of the current working
|
|||
|
directory would be removed), instead resolve the path to the physical
|
|||
|
directory. This option is overridden by <code>CHASE_LINKS</code>.</p>
|
|||
|
<p>For example, suppose <code>/foo/bar</code> is a link to the directory <code>/alt/rod</code>.
|
|||
|
Without this option set, ‘<code>cd /foo/bar/..</code>’ changes to <code>/foo</code>; with it
|
|||
|
set, it changes to <code>/alt</code>. The same applies if the current directory is
|
|||
|
<code>/foo/bar</code> and ‘<code>cd ..</code>’ is used. Note that all other symbolic links in
|
|||
|
the path will also be resolved.</p>
|
|||
|
<p><span id="index-CHASE_005fLINKS"></span>
|
|||
|
<span id="index-NO_005fCHASE_005fLINKS"></span>
|
|||
|
<span id="index-CHASELINKS"></span>
|
|||
|
<span id="index-NOCHASELINKS"></span>
|
|||
|
<span id="index-links_002c-symbolic"></span>
|
|||
|
<span id="index-symbolic-links"></span></p>
|
|||
|
<p><code>CHASE_LINKS</code> (<code>-w</code>)</p>
|
|||
|
<p>Resolve symbolic links to their true values when changing directory.
|
|||
|
This also has the effect of <code>CHASE_DOTS</code>, i.e. a ‘<code>..</code>’ path segment
|
|||
|
will be treated as referring to the physical parent, even if the
|
|||
|
preceding path segment is a symbolic link.</p>
|
|||
|
<p><span id="index-POSIX_005fCD"></span> <span id="index-POSIXCD"></span>
|
|||
|
<span id="index-NO_005fPOSIX_005fCD"></span>
|
|||
|
<span id="index-NOPOSIXCD"></span>
|
|||
|
<span id="index-CDPATH_002c-order-of-checking"></span></p>
|
|||
|
<p><code>POSIX_CD</code> <K> <S></p>
|
|||
|
<p>Modifies the behaviour of <code>cd</code>, <code>chdir</code> and <code>pushd</code> commands to make
|
|||
|
them more compatible with the POSIX standard. The behaviour with the
|
|||
|
option unset is described in the documentation for the <code>cd</code> builtin in
|
|||
|
<a href="Shell-Builtin-Commands.html#Shell-Builtin-Commands">Shell Builtin
|
|||
|
Commands</a>. If the
|
|||
|
option is set, the shell does not test for directories beneath the local
|
|||
|
directory (‘<code>.</code>’) until after all directories in <code>cdpath</code> have been
|
|||
|
tested, and the <code>cd</code> and <code>chdir</code> commands do not recognise arguments of
|
|||
|
the form ‘{<code>+</code>|<code>-</code>}<code>n</code>’ as directory stack entries.</p>
|
|||
|
<p>Also, if the option is set, the conditions under which the shell prints
|
|||
|
the new directory after changing to it are modified. It is no longer
|
|||
|
restricted to interactive shells (although printing of the directory
|
|||
|
stack with <code>pushd</code> is still limited to interactive shells); and any use
|
|||
|
of a component of <code>CDPATH</code>, including a ‘<code>.</code>’ but excluding an empty
|
|||
|
component that is otherwise treated as ‘<code>.</code>’, causes the directory to be
|
|||
|
printed.</p>
|
|||
|
<p><span id="index-PUSHD_005fIGNORE_005fDUPS"></span>
|
|||
|
<span id="index-NO_005fPUSHD_005fIGNORE_005fDUPS"></span>
|
|||
|
<span id="index-PUSHDIGNOREDUPS"></span>
|
|||
|
<span id="index-NOPUSHDIGNOREDUPS"></span>
|
|||
|
<span id="index-directory-stack_002c-ignoring-duplicates"></span></p>
|
|||
|
<p><code>PUSHD_IGNORE_DUPS</code></p>
|
|||
|
<p>Don’t push multiple copies of the same directory onto the directory
|
|||
|
stack.</p>
|
|||
|
<p><span id="index-PUSHD_005fMINUS"></span>
|
|||
|
<span id="index-NO_005fPUSHD_005fMINUS"></span>
|
|||
|
<span id="index-PUSHDMINUS"></span>
|
|||
|
<span id="index-NOPUSHDMINUS"></span>
|
|||
|
<span id="index-directory-stack_002c-controlling-syntax"></span></p>
|
|||
|
<p><code>PUSHD_MINUS</code></p>
|
|||
|
<p>Exchanges the meanings of ‘<code>+</code>’ and ‘<code>-</code>’ when used with a number to
|
|||
|
specify a directory in the stack.</p>
|
|||
|
<p><span id="index-PUSHD_005fSILENT"></span>
|
|||
|
<span id="index-NO_005fPUSHD_005fSILENT"></span>
|
|||
|
<span id="index-PUSHDSILENT"></span>
|
|||
|
<span id="index-NOPUSHDSILENT"></span>
|
|||
|
<span id="index-directory-stack_002c-silencing"></span></p>
|
|||
|
<p><code>PUSHD_SILENT</code> (<code>-E</code>)</p>
|
|||
|
<p>Do not print the directory stack after <code>pushd</code> or <code>popd</code>.</p>
|
|||
|
<p><span id="index-PUSHD_005fTO_005fHOME"></span>
|
|||
|
<span id="index-NO_005fPUSHD_005fTO_005fHOME"></span>
|
|||
|
<span id="index-PUSHDTOHOME"></span>
|
|||
|
<span id="index-NOPUSHDTOHOME"></span>
|
|||
|
<span id="index-pushd_002c-to-home"></span></p>
|
|||
|
<p><code>PUSHD_TO_HOME</code> (<code>-D</code>)</p>
|
|||
|
<p>Have <code>pushd</code> with no arguments act like ‘<code>pushd $HOME</code>’.</p>
|
|||
|
<hr />
|
|||
|
<p><span id="Completion-4"></span></p>
|
|||
|
<h3 id="1622-completion"><a class="header" href="#1622-completion">16.2.2 Completion</a></h3>
|
|||
|
<p><span id="index-ALWAYS_005fLAST_005fPROMPT"></span>
|
|||
|
<span id="index-NO_005fALWAYS_005fLAST_005fPROMPT"></span>
|
|||
|
<span id="index-ALWAYSLASTPROMPT"></span>
|
|||
|
<span id="index-NOALWAYSLASTPROMPT"></span></p>
|
|||
|
<p><code>ALWAYS_LAST_PROMPT</code> <D></p>
|
|||
|
<p>If unset, key functions that list completions try to return to the last
|
|||
|
prompt if given a numeric argument. If set these functions try to return
|
|||
|
to the last prompt if given <em>no</em> numeric argument.</p>
|
|||
|
<p><span id="index-ALWAYS_005fTO_005fEND"></span>
|
|||
|
<span id="index-NO_005fALWAYS_005fTO_005fEND"></span>
|
|||
|
<span id="index-ALWAYSTOEND"></span>
|
|||
|
<span id="index-NOALWAYSTOEND"></span></p>
|
|||
|
<p><code>ALWAYS_TO_END</code></p>
|
|||
|
<p>If a completion is performed with the cursor within a word, and a full
|
|||
|
completion is inserted, the cursor is moved to the end of the word. That
|
|||
|
is, the cursor is moved to the end of the word if either a single match
|
|||
|
is inserted or menu completion is performed.</p>
|
|||
|
<p><span id="index-AUTO_005fLIST"></span>
|
|||
|
<span id="index-NO_005fAUTO_005fLIST"></span>
|
|||
|
<span id="index-AUTOLIST"></span> <span id="index-NOAUTOLIST"></span>
|
|||
|
<span id="index-completion_002c-listing-choices"></span></p>
|
|||
|
<p><code>AUTO_LIST</code> (<code>-9</code>) <D></p>
|
|||
|
<p>Automatically list choices on an ambiguous completion.</p>
|
|||
|
<p><span id="index-AUTO_005fMENU"></span>
|
|||
|
<span id="index-NO_005fAUTO_005fMENU"></span>
|
|||
|
<span id="index-AUTOMENU"></span> <span id="index-NOAUTOMENU"></span>
|
|||
|
<span id="index-completion_002c-menu"></span></p>
|
|||
|
<p><code>AUTO_MENU</code> <D></p>
|
|||
|
<p>Automatically use menu completion after the second consecutive request
|
|||
|
for completion, for example by pressing the tab key repeatedly. This
|
|||
|
option is overridden by <code>MENU_COMPLETE</code>.</p>
|
|||
|
<p><span id="index-AUTO_005fNAME_005fDIRS"></span>
|
|||
|
<span id="index-NO_005fAUTO_005fNAME_005fDIRS"></span>
|
|||
|
<span id="index-AUTONAMEDIRS"></span>
|
|||
|
<span id="index-NOAUTONAMEDIRS"></span>
|
|||
|
<span id="index-directories_002c-named"></span></p>
|
|||
|
<p><code>AUTO_NAME_DIRS</code></p>
|
|||
|
<p>Any parameter that is set to the absolute name of a directory
|
|||
|
immediately becomes a name for that directory, that will be used by the
|
|||
|
‘<code>%~</code>’ and related prompt sequences, and will be available when
|
|||
|
completion is performed on a word starting with ‘<code>~</code>’. (Otherwise, the
|
|||
|
parameter must be used in the form ‘<code>~``param</code>’ first.)</p>
|
|||
|
<p><span id="index-AUTO_005fPARAM_005fKEYS"></span>
|
|||
|
<span id="index-NO_005fAUTO_005fPARAM_005fKEYS"></span>
|
|||
|
<span id="index-AUTOPARAMKEYS"></span>
|
|||
|
<span id="index-NOAUTOPARAMKEYS"></span></p>
|
|||
|
<p><code>AUTO_PARAM_KEYS</code> <D></p>
|
|||
|
<p>If a parameter name was completed and a following character (normally a
|
|||
|
space) automatically inserted, and the next character typed is one of
|
|||
|
those that have to come directly after the name (like ‘<code>}</code>’, ‘<code>:</code>’,
|
|||
|
etc.), the automatically added character is deleted, so that the
|
|||
|
character typed comes immediately after the parameter name. Completion
|
|||
|
in a brace expansion is affected similarly: the added character is a
|
|||
|
‘<code>,</code>’, which will be removed if ‘<code>}</code>’ is typed next.</p>
|
|||
|
<p><span id="index-AUTO_005fPARAM_005fSLASH"></span>
|
|||
|
<span id="index-NO_005fAUTO_005fPARAM_005fSLASH"></span>
|
|||
|
<span id="index-AUTOPARAMSLASH"></span>
|
|||
|
<span id="index-NOAUTOPARAMSLASH"></span></p>
|
|||
|
<p><code>AUTO_PARAM_SLASH</code> <D></p>
|
|||
|
<p>If a parameter is completed whose content is the name of a directory,
|
|||
|
then add a trailing slash instead of a space.</p>
|
|||
|
<p><span id="index-AUTO_005fREMOVE_005fSLASH"></span>
|
|||
|
<span id="index-NO_005fAUTO_005fREMOVE_005fSLASH"></span>
|
|||
|
<span id="index-AUTOREMOVESLASH"></span>
|
|||
|
<span id="index-NOAUTOREMOVESLASH"></span>
|
|||
|
<span id="index-slash_002c-removing-trailing"></span></p>
|
|||
|
<p><code>AUTO_REMOVE_SLASH</code> <D></p>
|
|||
|
<p>When the last character resulting from a completion is a slash and the
|
|||
|
next character typed is a word delimiter, a slash, or a character that
|
|||
|
ends a command (such as a semicolon or an ampersand), remove the slash.</p>
|
|||
|
<p><span id="index-BASH_005fAUTO_005fLIST"></span>
|
|||
|
<span id="index-NO_005fBASH_005fAUTO_005fLIST"></span>
|
|||
|
<span id="index-BASHAUTOLIST"></span>
|
|||
|
<span id="index-NOBASHAUTOLIST"></span>
|
|||
|
<span id="index-completion_002c-listing-choices_002c-bash-style"></span></p>
|
|||
|
<p><code>BASH_AUTO_LIST</code></p>
|
|||
|
<p>On an ambiguous completion, automatically list choices when the
|
|||
|
completion function is called twice in succession. This takes precedence
|
|||
|
over <code>AUTO_LIST</code>. The setting of <code>LIST_AMBIGUOUS</code> is respected. If
|
|||
|
<code>AUTO_MENU</code> is set, the menu behaviour will then start with the third
|
|||
|
press. Note that this will not work with <code>MENU_COMPLETE</code>, since repeated
|
|||
|
completion calls immediately cycle through the list in that case.</p>
|
|||
|
<p><span id="index-COMPLETE_005fALIASES"></span>
|
|||
|
<span id="index-NO_005fCOMPLETE_005fALIASES"></span>
|
|||
|
<span id="index-COMPLETEALIASES"></span>
|
|||
|
<span id="index-NOCOMPLETEALIASES"></span>
|
|||
|
<span id="index-aliases_002c-completion-of"></span></p>
|
|||
|
<p><code>COMPLETE_ALIASES</code></p>
|
|||
|
<p>Prevents aliases on the command line from being internally substituted
|
|||
|
before completion is attempted. The effect is to make the alias a
|
|||
|
distinct command for completion purposes.</p>
|
|||
|
<p><span id="index-COMPLETE_005fIN_005fWORD"></span>
|
|||
|
<span id="index-NO_005fCOMPLETE_005fIN_005fWORD"></span>
|
|||
|
<span id="index-COMPLETEINWORD"></span>
|
|||
|
<span id="index-NOCOMPLETEINWORD"></span></p>
|
|||
|
<p><code>COMPLETE_IN_WORD</code></p>
|
|||
|
<p>If unset, the cursor is set to the end of the word if completion is
|
|||
|
started. Otherwise it stays there and completion is done from both ends.</p>
|
|||
|
<p><span id="index-GLOB_005fCOMPLETE"></span>
|
|||
|
<span id="index-NO_005fGLOB_005fCOMPLETE"></span>
|
|||
|
<span id="index-GLOBCOMPLETE"></span>
|
|||
|
<span id="index-NOGLOBCOMPLETE"></span></p>
|
|||
|
<p><code>GLOB_COMPLETE</code></p>
|
|||
|
<p>When the current word has a glob pattern, do not insert all the words
|
|||
|
resulting from the expansion but generate matches as for completion and
|
|||
|
cycle through them like <code>MENU_COMPLETE</code>. The matches are generated as if
|
|||
|
a ‘<code>*</code>’ was added to the end of the word, or inserted at the cursor when
|
|||
|
<code>COMPLETE_IN_WORD</code> is set. This actually uses pattern matching, not
|
|||
|
globbing, so it works not only for files but for any completion, such as
|
|||
|
options, user names, etc.</p>
|
|||
|
<p>Note that when the pattern matcher is used, matching control (for
|
|||
|
example, case-insensitive or anchored matching) cannot be used. This
|
|||
|
limitation only applies when the current word contains a pattern; simply
|
|||
|
turning on the <code>GLOB_COMPLETE</code> option does not have this effect.</p>
|
|||
|
<p><span id="index-HASH_005fLIST_005fALL"></span>
|
|||
|
<span id="index-NO_005fHASH_005fLIST_005fALL"></span>
|
|||
|
<span id="index-HASHLISTALL"></span>
|
|||
|
<span id="index-NOHASHLISTALL"></span></p>
|
|||
|
<p><code>HASH_LIST_ALL</code> <D></p>
|
|||
|
<p>Whenever a command completion or spelling correction is attempted, make
|
|||
|
sure the entire command path is hashed first. This makes the first
|
|||
|
completion slower but avoids false reports of spelling errors.</p>
|
|||
|
<p><span id="index-LIST_005fAMBIGUOUS"></span>
|
|||
|
<span id="index-NO_005fLIST_005fAMBIGUOUS"></span>
|
|||
|
<span id="index-LISTAMBIGUOUS"></span>
|
|||
|
<span id="index-NOLISTAMBIGUOUS"></span>
|
|||
|
<span id="index-ambiguous-completion"></span>
|
|||
|
<span id="index-completion_002c-ambiguous"></span></p>
|
|||
|
<p><code>LIST_AMBIGUOUS</code> <D></p>
|
|||
|
<p>This option works when <code>AUTO_LIST</code> or <code>BASH_AUTO_LIST</code> is also set. If
|
|||
|
there is an unambiguous prefix to insert on the command line, that is
|
|||
|
done without a completion list being displayed; in other words,
|
|||
|
auto-listing behaviour only takes place when nothing would be inserted.
|
|||
|
In the case of <code>BASH_AUTO_LIST</code>, this means that the list will be
|
|||
|
delayed to the third call of the function.</p>
|
|||
|
<p><span id="index-LIST_005fBEEP"></span>
|
|||
|
<span id="index-NO_005fLIST_005fBEEP"></span>
|
|||
|
<span id="index-LISTBEEP"></span> <span id="index-NOLISTBEEP"></span>
|
|||
|
<span id="index-beep_002c-ambiguous-completion"></span>
|
|||
|
<span id="index-completion_002c-beep-on-ambiguous"></span></p>
|
|||
|
<p><code>LIST_BEEP</code> <D></p>
|
|||
|
<p>Beep on an ambiguous completion. More accurately, this forces the
|
|||
|
completion widgets to return status 1 on an ambiguous completion, which
|
|||
|
causes the shell to beep if the option <code>BEEP</code> is also set; this may be
|
|||
|
modified if completion is called from a user-defined widget.</p>
|
|||
|
<p><span id="index-LIST_005fPACKED"></span>
|
|||
|
<span id="index-NO_005fLIST_005fPACKED"></span>
|
|||
|
<span id="index-LISTPACKED"></span>
|
|||
|
<span id="index-NOLISTPACKED"></span>
|
|||
|
<span id="index-completion_002c-listing"></span></p>
|
|||
|
<p><code>LIST_PACKED</code></p>
|
|||
|
<p>Try to make the completion list smaller (occupying less lines) by
|
|||
|
printing the matches in columns with different widths.</p>
|
|||
|
<p><span id="index-LIST_005fROWS_005fFIRST"></span>
|
|||
|
<span id="index-NO_005fLIST_005fROWS_005fFIRST"></span>
|
|||
|
<span id="index-LISTROWSFIRST"></span>
|
|||
|
<span id="index-NOLISTROWSFIRST"></span>
|
|||
|
<span id="index-completion_002c-listing-order"></span></p>
|
|||
|
<p><code>LIST_ROWS_FIRST</code></p>
|
|||
|
<p>Lay out the matches in completion lists sorted horizontally, that is,
|
|||
|
the second match is to the right of the first one, not under it as
|
|||
|
usual.</p>
|
|||
|
<p><span id="index-LIST_005fTYPES"></span>
|
|||
|
<span id="index-NO_005fLIST_005fTYPES"></span>
|
|||
|
<span id="index-LISTTYPES"></span> <span id="index-NOLISTTYPES"></span>
|
|||
|
<span id="index-marking-file-types"></span>
|
|||
|
<span id="index-files_002c-marking-type-of"></span></p>
|
|||
|
<p><code>LIST_TYPES</code> (<code>-X</code>) <D></p>
|
|||
|
<p>When listing files that are possible completions, show the type of each
|
|||
|
file with a trailing identifying mark.</p>
|
|||
|
<p><span id="index-MENU_005fCOMPLETE"></span>
|
|||
|
<span id="index-NO_005fMENU_005fCOMPLETE"></span>
|
|||
|
<span id="index-MENUCOMPLETE"></span>
|
|||
|
<span id="index-NOMENUCOMPLETE"></span>
|
|||
|
<span id="index-completion_002c-menu-1"></span></p>
|
|||
|
<p><code>MENU_COMPLETE</code> (<code>-Y</code>)</p>
|
|||
|
<p>On an ambiguous completion, instead of listing possibilities or beeping,
|
|||
|
insert the first match immediately. Then when completion is requested
|
|||
|
again, remove the first match and insert the second match, etc. When
|
|||
|
there are no more matches, go back to the first one again.
|
|||
|
<code>reverse-menu-complete</code> may be used to loop through the list in the
|
|||
|
other direction. This option overrides <code>AUTO_MENU</code>.</p>
|
|||
|
<p><span id="index-REC_005fEXACT"></span>
|
|||
|
<span id="index-NO_005fREC_005fEXACT"></span>
|
|||
|
<span id="index-RECEXACT"></span> <span id="index-NORECEXACT"></span>
|
|||
|
<span id="index-completion_002c-exact-matches"></span></p>
|
|||
|
<p><code>REC_EXACT</code> (<code>-S</code>)</p>
|
|||
|
<p>If the string on the command line exactly matches one of the possible
|
|||
|
completions, it is accepted, even if there is another completion (i.e.
|
|||
|
that string with something else added) that also matches.</p>
|
|||
|
<hr />
|
|||
|
<p><span id="Expansion-and-Globbing"></span></p>
|
|||
|
<h3 id="1623-expansion-and-globbing"><a class="header" href="#1623-expansion-and-globbing">16.2.3 Expansion and Globbing</a></h3>
|
|||
|
<p><span id="index-BAD_005fPATTERN"></span>
|
|||
|
<span id="index-NO_005fBAD_005fPATTERN"></span>
|
|||
|
<span id="index-BADPATTERN"></span>
|
|||
|
<span id="index-NOBADPATTERN"></span>
|
|||
|
<span id="index-globbing_002c-bad-pattern"></span>
|
|||
|
<span id="index-filename-generation_002c-bad-pattern"></span></p>
|
|||
|
<p><code>BAD_PATTERN</code> (<code>+2</code>) <C> <Z></p>
|
|||
|
<p>If a pattern for filename generation is badly formed, print an error
|
|||
|
message. (If this option is unset, the pattern will be left unchanged.)</p>
|
|||
|
<p><span id="index-BARE_005fGLOB_005fQUAL"></span>
|
|||
|
<span id="index-NO_005fBARE_005fGLOB_005fQUAL"></span>
|
|||
|
<span id="index-BAREGLOBQUAL"></span>
|
|||
|
<span id="index-NOBAREGLOBQUAL"></span>
|
|||
|
<span id="index-globbing-qualifiers_002c-enable"></span>
|
|||
|
<span id="index-enable-globbing-qualifiers"></span></p>
|
|||
|
<p><code>BARE_GLOB_QUAL</code> <Z></p>
|
|||
|
<p>In a glob pattern, treat a trailing set of parentheses as a qualifier
|
|||
|
list, if it contains no ‘<code>|</code>’, ‘<code>(</code>’ or (if special) ‘<code>~</code>’ characters.
|
|||
|
See <a href="Expansion.html#Filename-Generation">Filename Generation</a>.</p>
|
|||
|
<p><span id="index-BRACE_005fCCL"></span>
|
|||
|
<span id="index-NO_005fBRACE_005fCCL"></span>
|
|||
|
<span id="index-BRACECCL"></span> <span id="index-NOBRACECCL"></span>
|
|||
|
<span id="index-brace-expansion_002c-extending"></span>
|
|||
|
<span id="index-expansion_002c-brace_002c-extending"></span></p>
|
|||
|
<p><code>BRACE_CCL</code></p>
|
|||
|
<p>Expand expressions in braces which would not otherwise undergo brace
|
|||
|
expansion to a lexically ordered list of all the characters. See <a href="Expansion.html#Brace-Expansion">Brace
|
|||
|
Expansion</a>.</p>
|
|||
|
<p><span id="index-CASE_005fGLOB"></span>
|
|||
|
<span id="index-NO_005fCASE_005fGLOB"></span>
|
|||
|
<span id="index-CASEGLOB"></span> <span id="index-NOCASEGLOB"></span>
|
|||
|
<span id="index-case_002dinsensitive-globbing_002c-option"></span></p>
|
|||
|
<p><code>CASE_GLOB</code> <D></p>
|
|||
|
<p>Make globbing (filename generation) sensitive to case. Note that other
|
|||
|
uses of patterns are always sensitive to case. If the option is unset,
|
|||
|
the presence of any character which is special to filename generation
|
|||
|
will cause case-insensitive matching. For example, <code>cvs(/)</code> can match
|
|||
|
the directory <code>CVS</code> owing to the presence of the globbing flag (unless
|
|||
|
the option <code>BARE_GLOB_QUAL</code> is unset).</p>
|
|||
|
<p><span id="index-CASE_005fMATCH"></span>
|
|||
|
<span id="index-NO_005fCASE_005fMATCH"></span>
|
|||
|
<span id="index-CASEMATCH"></span> <span id="index-NOCASEMATCH"></span>
|
|||
|
<span id="index-case_002dinsensitive-regular-expression-matches_002c-option"></span>
|
|||
|
<span id="index-regular-expressions_002c-case_002dinsensitive-matching_002c-option"></span></p>
|
|||
|
<p><code>CASE_MATCH</code> <D></p>
|
|||
|
<p>Make regular expressions using the <code>zsh/regex</code> module (including matches
|
|||
|
with <code>=~</code>) sensitive to case.</p>
|
|||
|
<p><span id="index-CSH_005fNULL_005fGLOB"></span>
|
|||
|
<span id="index-NO_005fCSH_005fNULL_005fGLOB"></span>
|
|||
|
<span id="index-CSHNULLGLOB"></span>
|
|||
|
<span id="index-NOCSHNULLGLOB"></span>
|
|||
|
<span id="index-csh_002c-null-globbing-style"></span>
|
|||
|
<span id="index-null-globbing-style_002c-csh"></span>
|
|||
|
<span id="index-globbing_002c-null_002c-style_002c-csh"></span></p>
|
|||
|
<p><code>CSH_NULL_GLOB</code> <C></p>
|
|||
|
<p>If a pattern for filename generation has no matches, delete the pattern
|
|||
|
from the argument list; do not report an error unless all the patterns
|
|||
|
in a command have no matches. Overrides <code>NOMATCH</code>.</p>
|
|||
|
<p><span id="index-EQUALS"></span> <span id="index-NO_005fEQUALS"></span>
|
|||
|
<span id="index-NOEQUALS"></span>
|
|||
|
<span id="index-filename-expansion_002c-_003d"></span></p>
|
|||
|
<p><code>EQUALS</code> <Z></p>
|
|||
|
<p>Perform <code>=</code> filename expansion. (See <a href="Expansion.html#Filename-Expansion">Filename
|
|||
|
Expansion</a>.)</p>
|
|||
|
<p><span id="index-EXTENDED_005fGLOB"></span>
|
|||
|
<span id="index-NO_005fEXTENDED_005fGLOB"></span>
|
|||
|
<span id="index-EXTENDEDGLOB"></span>
|
|||
|
<span id="index-NOEXTENDEDGLOB"></span>
|
|||
|
<span id="index-globbing_002c-extended"></span></p>
|
|||
|
<p><code>EXTENDED_GLOB</code></p>
|
|||
|
<p>Treat the ‘<code>#</code>’, ‘<code>~</code>’ and ‘<code>^</code>’ characters as part of patterns for
|
|||
|
filename generation, etc. (An initial unquoted ‘<code>~</code>’ always produces
|
|||
|
named directory expansion.)</p>
|
|||
|
<p><span id="index-FORCE_005fFLOAT"></span>
|
|||
|
<span id="index-NO_005fFORCE_005fFLOAT"></span>
|
|||
|
<span id="index-FORCEFLOAT"></span>
|
|||
|
<span id="index-NOFORCEFLOAT"></span>
|
|||
|
<span id="index-floating-point_002c-forcing-use-of"></span>
|
|||
|
<span id="index-forcing-use-of-floating-point"></span></p>
|
|||
|
<p><code>FORCE_FLOAT</code></p>
|
|||
|
<p>Constants in arithmetic evaluation will be treated as floating point
|
|||
|
even without the use of a decimal point; the values of integer variables
|
|||
|
will be converted to floating point when used in arithmetic expressions.
|
|||
|
Integers in any base will be converted.</p>
|
|||
|
<p><span id="index-GLOB"></span> <span id="index-NO_005fGLOB"></span>
|
|||
|
<span id="index-NOGLOB"></span>
|
|||
|
<span id="index-globbing_002c-enabling"></span>
|
|||
|
<span id="index-enabling-globbing"></span></p>
|
|||
|
<p><code>GLOB</code> (<code>+F</code>, ksh: <code>+f</code>) <D></p>
|
|||
|
<p>Perform filename generation (globbing). (See <a href="Expansion.html#Filename-Generation">Filename
|
|||
|
Generation</a>.)</p>
|
|||
|
<p><span id="index-GLOB_005fASSIGN"></span>
|
|||
|
<span id="index-NO_005fGLOB_005fASSIGN"></span>
|
|||
|
<span id="index-GLOBASSIGN"></span>
|
|||
|
<span id="index-NOGLOBASSIGN"></span></p>
|
|||
|
<p><code>GLOB_ASSIGN</code> <C></p>
|
|||
|
<p>If this option is set, filename generation (globbing) is performed on
|
|||
|
the right hand side of scalar parameter assignments of the form
|
|||
|
‘<code>name``=``pattern</code> (e.g. ‘<code>foo=*</code>’). If the result has more than one
|
|||
|
word the parameter will become an array with those words as arguments.
|
|||
|
This option is provided for backwards compatibility only: globbing is
|
|||
|
always performed on the right hand side of array assignments of the form
|
|||
|
‘<code>name``=(``value``)</code>’ (e.g. ‘<code>foo=(*)</code>’) and this form is recommended
|
|||
|
for clarity; with this option set, it is not possible to predict whether
|
|||
|
the result will be an array or a scalar.</p>
|
|||
|
<p><span id="index-GLOB_005fDOTS"></span>
|
|||
|
<span id="index-NO_005fGLOB_005fDOTS"></span>
|
|||
|
<span id="index-GLOBDOTS"></span> <span id="index-NOGLOBDOTS"></span>
|
|||
|
<span id="index-globbing_002c-of-_002e-files"></span></p>
|
|||
|
<p><code>GLOB_DOTS</code> (<code>-4</code>)</p>
|
|||
|
<p>Do not require a leading ‘<code>.</code>’ in a filename to be matched explicitly.</p>
|
|||
|
<p><span id="index-GLOB_005fSTAR_005fSHORT"></span>
|
|||
|
<span id="index-NO_005fGLOB_005fSTAR_005fSHORT"></span>
|
|||
|
<span id="index-GLOBSTARSHORT"></span>
|
|||
|
<span id="index-NOGLOBSTARSHORT"></span>
|
|||
|
<span id="index-globbing_002c-short-forms"></span>
|
|||
|
<span id="index-globbing_002c-_002a_002a-special"></span></p>
|
|||
|
<p><code>GLOB_STAR_SHORT</code></p>
|
|||
|
<p>When this option is set and the default zsh-style globbing is in effect,
|
|||
|
the pattern ‘<code>**/*</code>’ can be abbreviated to ‘<code>**</code>’ and the pattern
|
|||
|
‘<code>***/*</code>’ can be abbreviated to <code>***</code>. Hence ‘<code>**.c</code>’ finds a file
|
|||
|
ending in <code>.c</code> in any subdirectory, and ‘<code>***.c</code>’ does the same while
|
|||
|
also following symbolic links. A <code>/</code> immediately after the ‘<code>**</code>’ or
|
|||
|
‘<code>***</code>’ forces the pattern to be treated as the unabbreviated form.</p>
|
|||
|
<p><span id="index-GLOB_005fSUBST"></span>
|
|||
|
<span id="index-NO_005fGLOB_005fSUBST"></span>
|
|||
|
<span id="index-GLOBSUBST"></span> <span id="index-NOGLOBSUBST"></span></p>
|
|||
|
<p><code>GLOB_SUBST</code> <C> <K> <S></p>
|
|||
|
<p>Treat any characters resulting from parameter expansion as being
|
|||
|
eligible for filename expansion and filename generation, and any
|
|||
|
characters resulting from command substitution as being eligible for
|
|||
|
filename generation. Braces (and commas in between) do not become
|
|||
|
eligible for expansion.</p>
|
|||
|
<p><span id="index-HIST_005fSUBST_005fPATTERN"></span>
|
|||
|
<span id="index-NO_005fHIST_005fSUBST_005fPATTERN"></span>
|
|||
|
<span id="index-HISTSUBSTPATTERN"></span>
|
|||
|
<span id="index-NOHISTSUBSTPATTERN"></span></p>
|
|||
|
<p><code>HIST_SUBST_PATTERN</code></p>
|
|||
|
<p>Substitutions using the <code>:s</code> and <code>:&</code> history modifiers are performed
|
|||
|
with pattern matching instead of string matching. This occurs wherever
|
|||
|
history modifiers are valid, including glob qualifiers and parameters.
|
|||
|
See <a href="Expansion.html#Modifiers">Modifiers</a>.</p>
|
|||
|
<p><span id="index-IGNORE_005fBRACES"></span>
|
|||
|
<span id="index-NO_005fIGNORE_005fBRACES"></span>
|
|||
|
<span id="index-IGNOREBRACES"></span>
|
|||
|
<span id="index-NOIGNOREBRACES"></span>
|
|||
|
<span id="index-disabling-brace-expansion"></span>
|
|||
|
<span id="index-brace-expansion_002c-disabling"></span>
|
|||
|
<span id="index-expansion_002c-brace_002c-disabling"></span></p>
|
|||
|
<p><code>IGNORE_BRACES</code> (<code>-I</code>) <S></p>
|
|||
|
<p>Do not perform brace expansion. For historical reasons this also
|
|||
|
includes the effect of the <code>IGNORE_CLOSE_BRACES</code> option.</p>
|
|||
|
<p><span id="index-IGNORE_005fCLOSE_005fBRACES"></span>
|
|||
|
<span id="index-NO_005fIGNORE_005fCLOSE_005fBRACES"></span>
|
|||
|
<span id="index-IGNORECLOSEBRACES"></span>
|
|||
|
<span id="index-NOIGNORECLOSEBRACES"></span></p>
|
|||
|
<p><code>IGNORE_CLOSE_BRACES</code></p>
|
|||
|
<p>When neither this option nor <code>IGNORE_BRACES</code> is set, a sole close brace
|
|||
|
character ‘<code>}</code>’ is syntactically significant at any point on a command
|
|||
|
line. This has the effect that no semicolon or newline is necessary
|
|||
|
before the brace terminating a function or current shell construct. When
|
|||
|
either option is set, a closing brace is syntactically significant only
|
|||
|
in command position. Unlike <code>IGNORE_BRACES</code>, this option does not
|
|||
|
disable brace expansion.</p>
|
|||
|
<p>For example, with both options unset a function may be defined in the
|
|||
|
following fashion:</p>
|
|||
|
<div class="example">
|
|||
|
<pre><code class="language-example">args() { echo $# }
|
|||
|
</code></pre>
|
|||
|
</div>
|
|||
|
<p>while if either option is set, this does not work and something
|
|||
|
equivalent to the following is required:</p>
|
|||
|
<div class="example">
|
|||
|
<pre><code class="language-example">args() { echo $#; }
|
|||
|
</code></pre>
|
|||
|
</div>
|
|||
|
<p><span id="index-KSH_005fGLOB"></span>
|
|||
|
<span id="index-NO_005fKSH_005fGLOB"></span>
|
|||
|
<span id="index-KSHGLOB"></span> <span id="index-NOKSHGLOB"></span></p>
|
|||
|
<p><code>KSH_GLOB</code> <K></p>
|
|||
|
<p>In pattern matching, the interpretation of parentheses is affected by a
|
|||
|
preceding ‘<code>@</code>’, ‘<code>*</code>’, ‘<code>+</code>’, ‘<code>?</code>’ or ‘<code>!</code>’. See <a href="Expansion.html#Filename-Generation">Filename
|
|||
|
Generation</a>.</p>
|
|||
|
<p><span id="index-MAGIC_005fEQUAL_005fSUBST"></span>
|
|||
|
<span id="index-NO_005fMAGIC_005fEQUAL_005fSUBST"></span>
|
|||
|
<span id="index-MAGICEQUALSUBST"></span>
|
|||
|
<span id="index-NOMAGICEQUALSUBST"></span></p>
|
|||
|
<p><code>MAGIC_EQUAL_SUBST</code></p>
|
|||
|
<p>All unquoted arguments of the form ‘<code>anything``=``expression</code>’ appearing
|
|||
|
after the command name have filename expansion (that is, where
|
|||
|
<code>expression</code> has a leading ‘<code>~</code>’ or ‘<code>=</code>’) performed on <code>expression</code> as
|
|||
|
if it were a parameter assignment. The argument is not otherwise treated
|
|||
|
specially; it is passed to the command as a single argument, and not
|
|||
|
used as an actual parameter assignment. For example, in <code>echo foo=~/bar:~/rod</code>, both occurrences of <code>~</code> would be replaced. Note that
|
|||
|
this happens anyway with <code>typeset</code> and similar statements.</p>
|
|||
|
<p>This option respects the setting of the <code>KSH_TYPESET</code> option. In other
|
|||
|
words, if both options are in effect, arguments looking like assignments
|
|||
|
will not undergo word splitting.</p>
|
|||
|
<p><span id="index-MARK_005fDIRS"></span>
|
|||
|
<span id="index-NO_005fMARK_005fDIRS"></span>
|
|||
|
<span id="index-MARKDIRS"></span> <span id="index-NOMARKDIRS"></span>
|
|||
|
<span id="index-directories_002c-marking"></span>
|
|||
|
<span id="index-marking-directories"></span></p>
|
|||
|
<p><code>MARK_DIRS</code> (<code>-8</code>, ksh: <code>-X</code>)</p>
|
|||
|
<p>Append a trailing ‘<code>/</code>’ to all directory names resulting from filename
|
|||
|
generation (globbing).</p>
|
|||
|
<p><span id="index-MULTIBYTE"></span>
|
|||
|
<span id="index-NO_005fMULTIBYTE"></span>
|
|||
|
<span id="index-NOMULTIBYTE"></span>
|
|||
|
<span id="index-characters_002c-multibyte_002c-in-expansion-and-globbing"></span>
|
|||
|
<span id="index-multibyte-characters_002c-in-expansion-and-globbing"></span></p>
|
|||
|
<p><code>MULTIBYTE</code> <D></p>
|
|||
|
<p>Respect multibyte characters when found in strings. When this option is
|
|||
|
set, strings are examined using the system library to determine how many
|
|||
|
bytes form a character, depending on the current locale. This affects
|
|||
|
the way characters are counted in pattern matching, parameter values and
|
|||
|
various delimiters.</p>
|
|||
|
<p>The option is on by default if the shell was compiled with
|
|||
|
<code>MULTIBYTE_SUPPORT</code>; otherwise it is off by default and has no effect if
|
|||
|
turned on.</p>
|
|||
|
<p>If the option is off a single byte is always treated as a single
|
|||
|
character. This setting is designed purely for examining strings known
|
|||
|
to contain raw bytes or other values that may not be characters in the
|
|||
|
current locale. It is not necessary to unset the option merely because
|
|||
|
the character set for the current locale does not contain multibyte
|
|||
|
characters.</p>
|
|||
|
<p>The option does not affect the shell’s editor, which always uses the
|
|||
|
locale to determine multibyte characters. This is because the character
|
|||
|
set displayed by the terminal emulator is independent of shell settings.</p>
|
|||
|
<p><span id="index-NOMATCH"></span> <span id="index-NO_005fNOMATCH"></span>
|
|||
|
<span id="index-NONOMATCH"></span>
|
|||
|
<span id="index-globbing_002c-no-matches"></span></p>
|
|||
|
<p><code>NOMATCH</code> (<code>+3</code>) <C> <Z></p>
|
|||
|
<p>If a pattern for filename generation has no matches, print an error,
|
|||
|
instead of leaving it unchanged in the argument list. This also applies
|
|||
|
to file expansion of an initial ‘<code>~</code>’ or ‘<code>=</code>’.</p>
|
|||
|
<p><span id="index-NULL_005fGLOB"></span>
|
|||
|
<span id="index-NO_005fNULL_005fGLOB"></span>
|
|||
|
<span id="index-NULLGLOB"></span> <span id="index-NONULLGLOB"></span>
|
|||
|
<span id="index-globbing_002c-no-matches-1"></span></p>
|
|||
|
<p><code>NULL_GLOB</code> (<code>-G</code>)</p>
|
|||
|
<p>If a pattern for filename generation has no matches, delete the pattern
|
|||
|
from the argument list instead of reporting an error. Overrides
|
|||
|
<code>NOMATCH</code>.</p>
|
|||
|
<p><span id="index-NUMERIC_005fGLOB_005fSORT"></span>
|
|||
|
<span id="index-NO_005fNUMERIC_005fGLOB_005fSORT"></span>
|
|||
|
<span id="index-NUMERICGLOBSORT"></span>
|
|||
|
<span id="index-NONUMERICGLOBSORT"></span>
|
|||
|
<span id="index-globbing_002c-sorting-numerically"></span></p>
|
|||
|
<p><code>NUMERIC_GLOB_SORT</code></p>
|
|||
|
<p>If numeric filenames are matched by a filename generation pattern, sort
|
|||
|
the filenames numerically rather than lexicographically.</p>
|
|||
|
<p><span id="index-RC_005fEXPAND_005fPARAM"></span>
|
|||
|
<span id="index-NO_005fRC_005fEXPAND_005fPARAM"></span>
|
|||
|
<span id="index-RCEXPANDPARAM"></span>
|
|||
|
<span id="index-NORCEXPANDPARAM"></span>
|
|||
|
<span id="index-rc_002c-parameter-expansion-style"></span>
|
|||
|
<span id="index-parameter-expansion-style_002c-rc"></span></p>
|
|||
|
<p><code>RC_EXPAND_PARAM</code> (<code>-P</code>)</p>
|
|||
|
<p>Array expansions of the form ‘<code>foo``${``xx``}``bar</code>’, where the
|
|||
|
parameter <code>xx</code> is set to <code>(``a b c``)</code>, are substituted with ‘<code>fooabar foobbar foocbar</code>’ instead of the default ‘<code>fooa b cbar</code>’. Note that an
|
|||
|
empty array will therefore cause all arguments to be removed.</p>
|
|||
|
<p><span id="index-REMATCH_005fPCRE"></span>
|
|||
|
<span id="index-NO_005fREMATCH_005fPCRE"></span>
|
|||
|
<span id="index-REMATCHPCRE"></span>
|
|||
|
<span id="index-NOREMATCHPCRE"></span>
|
|||
|
<span id="index-regexp_002c-PCRE"></span>
|
|||
|
<span id="index-PCRE_002c-regexp"></span></p>
|
|||
|
<p><code>REMATCH_PCRE</code></p>
|
|||
|
<p>If set, regular expression matching with the <code>=~</code> operator will use
|
|||
|
Perl-Compatible Regular Expressions from the PCRE library. (The
|
|||
|
<code>zsh/pcre</code> module must be available.) If not set, regular expressions
|
|||
|
will use the extended regexp syntax provided by the system libraries.</p>
|
|||
|
<p><span id="index-SH_005fGLOB"></span>
|
|||
|
<span id="index-NO_005fSH_005fGLOB"></span>
|
|||
|
<span id="index-SHGLOB"></span> <span id="index-NOSHGLOB"></span>
|
|||
|
<span id="index-sh_002c-globbing-style"></span>
|
|||
|
<span id="index-globbing-style_002c-sh"></span></p>
|
|||
|
<p><code>SH_GLOB</code> <K> <S></p>
|
|||
|
<p>Disables the special meaning of ‘<code>(</code>’, ‘<code>|</code>’, ‘<code>)</code>’ and ’<code><</code>’ for
|
|||
|
globbing the result of parameter and command substitutions, and in some
|
|||
|
other places where the shell accepts patterns. If <code>SH_GLOB</code> is set but
|
|||
|
<code>KSH_GLOB</code> is not, the shell allows the interpretation of subshell
|
|||
|
expressions enclosed in parentheses in some cases where there is no
|
|||
|
space before the opening parenthesis, e.g. <code>!(true)</code> is interpreted as
|
|||
|
if there were a space after the <code>!</code>. This option is set by default if
|
|||
|
zsh is invoked as <code>sh</code> or <code>ksh</code>.</p>
|
|||
|
<p><span id="index-UNSET"></span> <span id="index-NO_005fUNSET"></span>
|
|||
|
<span id="index-NOUNSET"></span>
|
|||
|
<span id="index-parameters_002c-substituting-unset"></span>
|
|||
|
<span id="index-unset-parameters_002c-substituting"></span></p>
|
|||
|
<p><code>UNSET</code> (<code>+u</code>, ksh: <code>+u</code>) <K> <S> <Z></p>
|
|||
|
<p>Treat unset parameters as if they were empty when substituting, and as
|
|||
|
if they were zero when reading their values in arithmetic expansion and
|
|||
|
arithmetic commands. Otherwise they are treated as an error.</p>
|
|||
|
<p><span id="index-WARN_005fCREATE_005fGLOBAL"></span>
|
|||
|
<span id="index-NO_005fWARN_005fCREATE_005fGLOBAL"></span>
|
|||
|
<span id="index-WARNCREATEGLOBAL"></span>
|
|||
|
<span id="index-NOWARNCREATEGLOBAL"></span>
|
|||
|
<span id="index-parameters_002c-warning-when-created-globally"></span></p>
|
|||
|
<p><code>WARN_CREATE_GLOBAL</code></p>
|
|||
|
<p>Print a warning message when a global parameter is created in a function
|
|||
|
by an assignment or in math context. This often indicates that a
|
|||
|
parameter has not been declared local when it should have been.
|
|||
|
Parameters explicitly declared global from within a function using
|
|||
|
<code>typeset -g</code> do not cause a warning. Note that there is no warning when
|
|||
|
a local parameter is assigned to in a nested function, which may also
|
|||
|
indicate an error.</p>
|
|||
|
<p><span id="index-WARN_005fNESTED_005fVAR"></span>
|
|||
|
<span id="index-NO_005fWARN_005fNESTED_005fVAR"></span>
|
|||
|
<span id="index-WARNNESTEDVAR"></span>
|
|||
|
<span id="index-NO_005fWARNNESTEDVAR"></span>
|
|||
|
<span id="index-parameters_002c-warning-when-setting-in-enclosing-scope"></span></p>
|
|||
|
<p><code>WARN_NESTED_VAR</code></p>
|
|||
|
<p>Print a warning message when an existing parameter from an enclosing
|
|||
|
function scope, or global, is set in a function by an assignment or in
|
|||
|
math context. Assignment to shell special parameters does not cause a
|
|||
|
warning. This is the companion to <code>WARN_CREATE_GLOBAL</code> as in this case
|
|||
|
the warning is only printed when a parameter is <em>not</em> created. Where
|
|||
|
possible, use of <code>typeset -g</code> to set the parameter suppresses the error,
|
|||
|
but note that this needs to be used every time the parameter is set. To
|
|||
|
restrict the effect of this option to a single function scope, use
|
|||
|
‘<code>functions -W</code>’.</p>
|
|||
|
<p>For example, the following code produces a warning for the assignment
|
|||
|
inside the function <code>nested</code> as that overrides the value within
|
|||
|
<code>toplevel</code></p>
|
|||
|
<div class="example">
|
|||
|
<pre><code class="language-example">toplevel() {
|
|||
|
local foo="in fn"
|
|||
|
nested
|
|||
|
}
|
|||
|
nested() {
|
|||
|
foo="in nested"
|
|||
|
}
|
|||
|
setopt warn_nested_var
|
|||
|
toplevel
|
|||
|
</code></pre>
|
|||
|
</div>
|
|||
|
<hr />
|
|||
|
<p><span id="History"></span></p>
|
|||
|
<h3 id="1624-history"><a class="header" href="#1624-history">16.2.4 History</a></h3>
|
|||
|
<p><span id="index-APPEND_005fHISTORY"></span>
|
|||
|
<span id="index-NO_005fAPPEND_005fHISTORY"></span>
|
|||
|
<span id="index-APPENDHISTORY"></span>
|
|||
|
<span id="index-NOAPPENDHISTORY"></span>
|
|||
|
<span id="index-history_002c-appending-to-a-file"></span></p>
|
|||
|
<p><code>APPEND_HISTORY</code> <D></p>
|
|||
|
<p>If this is set, zsh sessions will append their history list to the
|
|||
|
history file, rather than replace it. Thus, multiple parallel zsh
|
|||
|
sessions will all have the new entries from their history lists added to
|
|||
|
the history file, in the order that they exit. The file will still be
|
|||
|
periodically re-written to trim it when the number of lines grows 20%
|
|||
|
beyond the value specified by <code>$SAVEHIST</code> (see also the
|
|||
|
<code>HIST_SAVE_BY_COPY</code> option).</p>
|
|||
|
<p><span id="index-BANG_005fHIST"></span>
|
|||
|
<span id="index-NO_005fBANG_005fHIST"></span>
|
|||
|
<span id="index-BANGHIST"></span> <span id="index-NOBANGHIST"></span>
|
|||
|
<span id="index-history_002c-enable-substitution"></span>
|
|||
|
<span id="index-enable-history-substitution"></span></p>
|
|||
|
<p><code>BANG_HIST</code> (<code>+K</code>) <C> <Z></p>
|
|||
|
<p>Perform textual history expansion, csh-style, treating the character
|
|||
|
‘<code>!</code>’ specially.</p>
|
|||
|
<p><span id="index-EXTENDED_005fHISTORY"></span>
|
|||
|
<span id="index-NO_005fEXTENDED_005fHISTORY"></span>
|
|||
|
<span id="index-EXTENDEDHISTORY"></span>
|
|||
|
<span id="index-NOEXTENDEDHISTORY"></span>
|
|||
|
<span id="index-history_002c-timestamping"></span></p>
|
|||
|
<p><code>EXTENDED_HISTORY</code> <C></p>
|
|||
|
<p>Save each command’s beginning timestamp (in seconds since the epoch) and
|
|||
|
the duration (in seconds) to the history file. The format of this
|
|||
|
prefixed data is:</p>
|
|||
|
<p>‘<code> : ``<beginning time>``:``<elapsed seconds>``;``<command></code>’.</p>
|
|||
|
<p><span id="index-HIST_005fALLOW_005fCLOBBER"></span>
|
|||
|
<span id="index-NO_005fHIST_005fALLOW_005fCLOBBER"></span>
|
|||
|
<span id="index-HISTALLOWCLOBBER"></span>
|
|||
|
<span id="index-NOHISTALLOWCLOBBER"></span></p>
|
|||
|
<p><code>HIST_ALLOW_CLOBBER</code></p>
|
|||
|
<p>Add ‘<code>|</code>’ to output redirections in the history. This allows history
|
|||
|
references to clobber files even when <code>CLOBBER</code> is unset.</p>
|
|||
|
<p><span id="index-HIST_005fBEEP"></span>
|
|||
|
<span id="index-NO_005fHIST_005fBEEP"></span>
|
|||
|
<span id="index-HISTBEEP"></span> <span id="index-NOHISTBEEP"></span>
|
|||
|
<span id="index-history-beeping"></span>
|
|||
|
<span id="index-beep_002c-history"></span></p>
|
|||
|
<p><code>HIST_BEEP</code> <D></p>
|
|||
|
<p>Beep in ZLE when a widget attempts to access a history entry which isn’t
|
|||
|
there.</p>
|
|||
|
<p><span id="index-HIST_005fEXPIRE_005fDUPS_005fFIRST"></span>
|
|||
|
<span id="index-NO_005fHIST_005fEXPIRE_005fDUPS_005fFIRST"></span>
|
|||
|
<span id="index-HISTEXPIREDUPSFIRST"></span>
|
|||
|
<span id="index-NOHISTEXPIREDUPSFIRST"></span>
|
|||
|
<span id="index-history_002c-expiring-duplicates"></span></p>
|
|||
|
<p><code>HIST_EXPIRE_DUPS_FIRST</code></p>
|
|||
|
<p>If the internal history needs to be trimmed to add the current command
|
|||
|
line, setting this option will cause the oldest history event that has a
|
|||
|
duplicate to be lost before losing a unique event from the list. You
|
|||
|
should be sure to set the value of <code>HISTSIZE</code> to a larger number than
|
|||
|
<code>SAVEHIST</code> in order to give you some room for the duplicated events,
|
|||
|
otherwise this option will behave just like <code>HIST_IGNORE_ALL_DUPS</code> once
|
|||
|
the history fills up with unique events.</p>
|
|||
|
<p><span id="index-HIST_005fFCNTL_005fLOCK"></span>
|
|||
|
<span id="index-NO_005fHIST_005fFCNTL_005fLOCK"></span>
|
|||
|
<span id="index-HISTFCNTLLOCK"></span>
|
|||
|
<span id="index-NOHISTFCNTLLOCK"></span></p>
|
|||
|
<p><code>HIST_FCNTL_LOCK</code></p>
|
|||
|
<p>When writing out the history file, by default zsh uses ad-hoc file
|
|||
|
locking to avoid known problems with locking on some operating systems.
|
|||
|
With this option locking is done by means of the system’s <code>fcntl</code> call,
|
|||
|
where this method is available. On recent operating systems this may
|
|||
|
provide better performance, in particular avoiding history corruption
|
|||
|
when files are stored on NFS.</p>
|
|||
|
<p><span id="index-HIST_005fFIND_005fNO_005fDUPS"></span>
|
|||
|
<span id="index-NO_005fHIST_005fFIND_005fNO_005fDUPS"></span>
|
|||
|
<span id="index-HISTFINDNODUPS"></span>
|
|||
|
<span id="index-NOHISTFINDNODUPS"></span>
|
|||
|
<span id="index-history_002c-ignoring-duplicates-in-search"></span></p>
|
|||
|
<p><code>HIST_FIND_NO_DUPS</code></p>
|
|||
|
<p>When searching for history entries in the line editor, do not display
|
|||
|
duplicates of a line previously found, even if the duplicates are not
|
|||
|
contiguous.</p>
|
|||
|
<p><span id="index-HIST_005fIGNORE_005fALL_005fDUPS"></span>
|
|||
|
<span id="index-NO_005fHIST_005fIGNORE_005fALL_005fDUPS"></span>
|
|||
|
<span id="index-HISTIGNOREALLDUPS"></span>
|
|||
|
<span id="index-NOHISTIGNOREALLDUPS"></span>
|
|||
|
<span id="index-history_002c-ignoring-all-duplicates"></span></p>
|
|||
|
<p><code>HIST_IGNORE_ALL_DUPS</code></p>
|
|||
|
<p>If a new command line being added to the history list duplicates an
|
|||
|
older one, the older command is removed from the list (even if it is not
|
|||
|
the previous event).</p>
|
|||
|
<p><span id="index-HIST_005fIGNORE_005fDUPS"></span>
|
|||
|
<span id="index-NO_005fHIST_005fIGNORE_005fDUPS"></span>
|
|||
|
<span id="index-HISTIGNOREDUPS"></span>
|
|||
|
<span id="index-NOHISTIGNOREDUPS"></span>
|
|||
|
<span id="index-history_002c-ignoring-duplicates"></span></p>
|
|||
|
<p><code>HIST_IGNORE_DUPS</code> (<code>-h</code>)</p>
|
|||
|
<p>Do not enter command lines into the history list if they are duplicates
|
|||
|
of the previous event.</p>
|
|||
|
<p><span id="index-HIST_005fIGNORE_005fSPACE"></span>
|
|||
|
<span id="index-NO_005fHIST_005fIGNORE_005fSPACE"></span>
|
|||
|
<span id="index-HISTIGNORESPACE"></span>
|
|||
|
<span id="index-NOHISTIGNORESPACE"></span>
|
|||
|
<span id="index-history_002c-ignoring-spaces"></span></p>
|
|||
|
<p><code>HIST_IGNORE_SPACE</code> (<code>-g</code>)</p>
|
|||
|
<p>Remove command lines from the history list when the first character on
|
|||
|
the line is a space, or when one of the expanded aliases contains a
|
|||
|
leading space. Only normal aliases (not global or suffix aliases) have
|
|||
|
this behaviour. Note that the command lingers in the internal history
|
|||
|
until the next command is entered before it vanishes, allowing you to
|
|||
|
briefly reuse or edit the line. If you want to make it vanish right away
|
|||
|
without entering another command, type a space and press return.</p>
|
|||
|
<p><span id="index-HIST_005fLEX_005fWORDS"></span>
|
|||
|
<span id="index-NO_005fHIST_005fLEX_005fWORDS"></span>
|
|||
|
<span id="index-HISTLEXWORDS"></span>
|
|||
|
<span id="index-NOHISTLEXWORDS"></span></p>
|
|||
|
<p><code>HIST_LEX_WORDS</code></p>
|
|||
|
<p>By default, shell history that is read in from files is split into words
|
|||
|
on all white space. This means that arguments with quoted whitespace are
|
|||
|
not correctly handled, with the consequence that references to words in
|
|||
|
history lines that have been read from a file may be inaccurate. When
|
|||
|
this option is set, words read in from a history file are divided up in
|
|||
|
a similar fashion to normal shell command line handling. Although this
|
|||
|
produces more accurately delimited words, if the size of the history
|
|||
|
file is large this can be slow. Trial and error is necessary to decide.</p>
|
|||
|
<p><span id="index-HIST_005fNO_005fFUNCTIONS"></span>
|
|||
|
<span id="index-NO_005fHIST_005fNO_005fFUNCTIONS"></span>
|
|||
|
<span id="index-HISTNOFUNCTIONS"></span>
|
|||
|
<span id="index-NOHISTNOFUNCTIONS"></span></p>
|
|||
|
<p><code>HIST_NO_FUNCTIONS</code></p>
|
|||
|
<p>Remove function definitions from the history list. Note that the
|
|||
|
function lingers in the internal history until the next command is
|
|||
|
entered before it vanishes, allowing you to briefly reuse or edit the
|
|||
|
definition.</p>
|
|||
|
<p><span id="index-HIST_005fNO_005fSTORE"></span>
|
|||
|
<span id="index-NO_005fHIST_005fNO_005fSTORE"></span>
|
|||
|
<span id="index-HISTNOSTORE"></span>
|
|||
|
<span id="index-NOHISTNOSTORE"></span></p>
|
|||
|
<p><code>HIST_NO_STORE</code></p>
|
|||
|
<p>Remove the <code>history</code> (<code>fc -l</code>) command from the history list when
|
|||
|
invoked. Note that the command lingers in the internal history until the
|
|||
|
next command is entered before it vanishes, allowing you to briefly
|
|||
|
reuse or edit the line.</p>
|
|||
|
<p><span id="index-HIST_005fREDUCE_005fBLANKS"></span>
|
|||
|
<span id="index-NO_005fHIST_005fREDUCE_005fBLANKS"></span>
|
|||
|
<span id="index-HISTREDUCEBLANKS"></span>
|
|||
|
<span id="index-NOHISTREDUCEBLANKS"></span></p>
|
|||
|
<p><code>HIST_REDUCE_BLANKS</code></p>
|
|||
|
<p>Remove superfluous blanks from each command line being added to the
|
|||
|
history list.</p>
|
|||
|
<p><span id="index-HIST_005fSAVE_005fBY_005fCOPY"></span>
|
|||
|
<span id="index-NO_005fHIST_005fSAVE_005fBY_005fCOPY"></span>
|
|||
|
<span id="index-HISTSAVEBYCOPY"></span>
|
|||
|
<span id="index-NOHISTSAVEBYCOPY"></span></p>
|
|||
|
<p><code>HIST_SAVE_BY_COPY</code> <D></p>
|
|||
|
<p>When the history file is re-written, we normally write out a copy of the
|
|||
|
file named <code>$HISTFILE.new</code> and then rename it over the old one. However,
|
|||
|
if this option is unset, we instead truncate the old history file and
|
|||
|
write out the new version in-place. If one of the history-appending
|
|||
|
options is enabled, this option only has an effect when the enlarged
|
|||
|
history file needs to be re-written to trim it down to size. Disable
|
|||
|
this only if you have special needs, as doing so makes it possible to
|
|||
|
lose history entries if zsh gets interrupted during the save.</p>
|
|||
|
<p>When writing out a copy of the history file, zsh preserves the old
|
|||
|
file’s permissions and group information, but will refuse to write out
|
|||
|
a new file if it would change the history file’s owner.</p>
|
|||
|
<p><span id="index-HIST_005fSAVE_005fNO_005fDUPS"></span>
|
|||
|
<span id="index-NO_005fHIST_005fSAVE_005fNO_005fDUPS"></span>
|
|||
|
<span id="index-HISTSAVENODUPS"></span>
|
|||
|
<span id="index-NOHISTSAVENODUPS"></span></p>
|
|||
|
<p><code>HIST_SAVE_NO_DUPS</code></p>
|
|||
|
<p>When writing out the history file, older commands that duplicate newer
|
|||
|
ones are omitted.</p>
|
|||
|
<p><span id="index-HIST_005fVERIFY"></span>
|
|||
|
<span id="index-NO_005fHIST_005fVERIFY"></span>
|
|||
|
<span id="index-HISTVERIFY"></span>
|
|||
|
<span id="index-NOHISTVERIFY"></span>
|
|||
|
<span id="index-history_002c-verifying-substitution"></span></p>
|
|||
|
<p><code>HIST_VERIFY</code></p>
|
|||
|
<p>Whenever the user enters a line with history expansion, don’t execute
|
|||
|
the line directly; instead, perform history expansion and reload the
|
|||
|
line into the editing buffer.</p>
|
|||
|
<p><span id="index-INC_005fAPPEND_005fHISTORY"></span>
|
|||
|
<span id="index-NO_005fINC_005fAPPEND_005fHISTORY"></span>
|
|||
|
<span id="index-INCAPPENDHISTORY"></span>
|
|||
|
<span id="index-NOINCAPPENDHISTORY"></span>
|
|||
|
<span id="index-history_002c-incremental-appending-to-a-file"></span></p>
|
|||
|
<p><code>INC_APPEND_HISTORY</code></p>
|
|||
|
<p>This option works like <code>APPEND_HISTORY</code> except that new history lines
|
|||
|
are added to the <code>$HISTFILE</code> incrementally (as soon as they are
|
|||
|
entered), rather than waiting until the shell exits. The file will still
|
|||
|
be periodically re-written to trim it when the number of lines grows 20%
|
|||
|
beyond the value specified by <code>$SAVEHIST</code> (see also the
|
|||
|
<code>HIST_SAVE_BY_COPY</code> option).</p>
|
|||
|
<p><span id="index-INC_005fAPPEND_005fHISTORY_005fTIME"></span>
|
|||
|
<span id="index-NO_005fINC_005fAPPEND_005fHISTORY_005fTIME"></span>
|
|||
|
<span id="index-INCAPPENDHISTORYTIME"></span>
|
|||
|
<span id="index-NOINCAPPENDHISTORYTIME"></span>
|
|||
|
<span id="index-history_002c-incremental-appending-to-a-file-with-time"></span></p>
|
|||
|
<p><code>INC_APPEND_HISTORY_TIME</code></p>
|
|||
|
<p>This option is a variant of <code>INC_APPEND_HISTORY</code> in which, where
|
|||
|
possible, the history entry is written out to the file after the command
|
|||
|
is finished, so that the time taken by the command is recorded correctly
|
|||
|
in the history file in <code>EXTENDED_HISTORY</code> format. This means that the
|
|||
|
history entry will not be available immediately from other instances of
|
|||
|
the shell that are using the same history file.</p>
|
|||
|
<p>This option is only useful if <code>INC_APPEND_HISTORY</code> and <code>SHARE_HISTORY</code>
|
|||
|
are turned off. The three options should be considered mutually
|
|||
|
exclusive.</p>
|
|||
|
<p><span id="index-SHARE_005fHISTORY"></span>
|
|||
|
<span id="index-NO_005fSHARE_005fHISTORY"></span>
|
|||
|
<span id="index-SHAREHISTORY"></span>
|
|||
|
<span id="index-NOSHAREHISTORY"></span>
|
|||
|
<span id="index-share-history"></span>
|
|||
|
<span id="index-history_002c-sharing"></span></p>
|
|||
|
<p><code>SHARE_HISTORY</code> <K></p>
|
|||
|
<p>This option both imports new commands from the history file, and also
|
|||
|
causes your typed commands to be appended to the history file (the
|
|||
|
latter is like specifying <code>INC_APPEND_HISTORY</code>, which should be turned
|
|||
|
off if this option is in effect). The history lines are also output with
|
|||
|
timestamps ala <code>EXTENDED_HISTORY</code> (which makes it easier to find the
|
|||
|
spot where we left off reading the file after it gets re-written).</p>
|
|||
|
<p>By default, history movement commands visit the imported lines as well
|
|||
|
as the local lines, but you can toggle this on and off with the
|
|||
|
set-local-history zle binding. It is also possible to create a zle
|
|||
|
widget that will make some commands ignore imported commands, and some
|
|||
|
include them.</p>
|
|||
|
<p>If you find that you want more control over when commands get imported,
|
|||
|
you may wish to turn <code>SHARE_HISTORY</code> off, <code>INC_APPEND_HISTORY</code> or
|
|||
|
<code>INC_APPEND_HISTORY_TIME</code> (see above) on, and then manually import
|
|||
|
commands whenever you need them using ‘<code>fc -RI</code>’.</p>
|
|||
|
<hr />
|
|||
|
<p><span id="Initialisation"></span></p>
|
|||
|
<h3 id="1625-initialisation"><a class="header" href="#1625-initialisation">16.2.5 Initialisation</a></h3>
|
|||
|
<p><span id="index-ALL_005fEXPORT"></span>
|
|||
|
<span id="index-NO_005fALL_005fEXPORT"></span>
|
|||
|
<span id="index-ALLEXPORT"></span> <span id="index-NOALLEXPORT"></span>
|
|||
|
<span id="index-export_002c-automatic"></span></p>
|
|||
|
<p><code>ALL_EXPORT</code> (<code>-a</code>, ksh: <code>-a</code>)</p>
|
|||
|
<p>All parameters subsequently defined are automatically exported.</p>
|
|||
|
<p><span id="index-GLOBAL_005fEXPORT"></span>
|
|||
|
<span id="index-NO_005fGLOBAL_005fEXPORT"></span>
|
|||
|
<span id="index-GLOBALEXPORT"></span>
|
|||
|
<span id="index-NOGLOBALEXPORT"></span>
|
|||
|
<span id="index-environment_002c-and-local-parameters"></span></p>
|
|||
|
<p><code>GLOBAL_EXPORT</code> <Z></p>
|
|||
|
<p>If this option is set, passing the <code>-x</code> flag to the builtins <code>declare</code>,
|
|||
|
<code>float</code>, <code>integer</code>, <code>readonly</code> and <code>typeset</code> (but not <code>local</code>) will also
|
|||
|
set the <code>-g</code> flag; hence parameters exported to the environment will not
|
|||
|
be made local to the enclosing function, unless they were already or the
|
|||
|
flag <code>+g</code> is given explicitly. If the option is unset, exported
|
|||
|
parameters will be made local in just the same way as any other
|
|||
|
parameter.</p>
|
|||
|
<p>This option is set by default for backward compatibility; it is not
|
|||
|
recommended that its behaviour be relied upon. Note that the builtin
|
|||
|
<code>export</code> always sets both the <code>-x</code> and <code>-g</code> flags, and hence its effect
|
|||
|
extends beyond the scope of the enclosing function; this is the</p>
|
|||
|
<p><span id="index-exporting_002c-and-local-parameters"></span>
|
|||
|
<span id="index-GLOBAL_005fRCS"></span>
|
|||
|
<span id="index-NO_005fGLOBAL_005fRCS"></span>
|
|||
|
<span id="index-GLOBALRCS"></span> <span id="index-NOGLOBALRCS"></span>
|
|||
|
<span id="index-startup-files_002c-global_002c-inhibiting"></span>
|
|||
|
<span id="index-files_002c-global-startup_002c-inhibiting"></span></p>
|
|||
|
<p><code>GLOBAL_RCS</code> (<code>-d</code>) <D></p>
|
|||
|
<p>If this option is unset, the startup files <code>/etc/zprofile</code>,
|
|||
|
<code>/etc/zshrc</code>, <code>/etc/zlogin</code> and <code>/etc/zlogout</code> will not be run. It can
|
|||
|
be disabled and re-enabled at any time, including inside local startup
|
|||
|
files (<code>.zshrc</code>, etc.).</p>
|
|||
|
<p><span id="index-RCS"></span> <span id="index-NO_005fRCS"></span>
|
|||
|
<span id="index-NORCS"></span>
|
|||
|
<span id="index-startup-files_002c-sourcing"></span></p>
|
|||
|
<p><code>RCS</code> (<code>+f</code>) <D></p>
|
|||
|
<p>After <code>/etc/zshenv</code> is sourced on startup, source the <code>.zshenv</code>,
|
|||
|
<code>/etc/zprofile</code>, <code>.zprofile</code>, <code>/etc/zshrc</code>, <code>.zshrc</code>, <code>/etc/zlogin</code>,
|
|||
|
<code>.zlogin</code>, and <code>.zlogout</code> files, as described in
|
|||
|
<a href="Files.html#Files">Files</a>. If this option is unset, the <code>/etc/zshenv</code>
|
|||
|
file is still sourced, but any of the others will not be; it can be set
|
|||
|
at any time to prevent the remaining startup files after the currently
|
|||
|
executing one from being sourced.</p>
|
|||
|
<hr />
|
|||
|
<p><span id="Input_002fOutput"></span></p>
|
|||
|
<h3 id="1626-inputoutput"><a class="header" href="#1626-inputoutput">16.2.6 Input/Output</a></h3>
|
|||
|
<p><span id="index-ALIASES"></span> <span id="index-NO_005fALIASES"></span>
|
|||
|
<span id="index-NOALIASES"></span>
|
|||
|
<span id="index-aliases_002c-expansion"></span></p>
|
|||
|
<p><code>ALIASES</code> <D></p>
|
|||
|
<p>Expand aliases.</p>
|
|||
|
<p><span id="index-CLOBBER"></span> <span id="index-NO_005fCLOBBER"></span>
|
|||
|
<span id="index-NOCLOBBER"></span>
|
|||
|
<span id="index-clobbering_002c-of-files"></span>
|
|||
|
<span id="index-file-clobbering_002c-allowing"></span></p>
|
|||
|
<p><code>CLOBBER</code> (<code>+C</code>, ksh: <code>+C</code>) <D></p>
|
|||
|
<p>Allows ‘<code>></code>’ redirection to truncate existing files. Otherwise ‘<code>>!</code>’ or
|
|||
|
‘<code>>|</code>’ must be used to truncate a file.</p>
|
|||
|
<p>If the option is not set, and the option <code>APPEND_CREATE</code> is also not
|
|||
|
set, ‘<code>>>!</code>’ or ‘<code>>>|</code>’ must be used to create a file. If either option
|
|||
|
is set, ‘<code>>></code>’ may be used.</p>
|
|||
|
<p><span id="index-CORRECT"></span> <span id="index-NO_005fCORRECT"></span>
|
|||
|
<span id="index-NOCORRECT"></span>
|
|||
|
<span id="index-correction_002c-spelling"></span>
|
|||
|
<span id="index-spelling-correction"></span></p>
|
|||
|
<p><code>CORRECT</code> (<code>-0</code>)</p>
|
|||
|
<p>Try to correct the spelling of commands. Note that, when the
|
|||
|
<code>HASH_LIST_ALL</code> option is not set or when some directories in the path
|
|||
|
are not readable, this may falsely report spelling errors the first time
|
|||
|
some commands are used.</p>
|
|||
|
<p>The shell variable <code>CORRECT_IGNORE</code> may be set to a pattern to match
|
|||
|
words that will never be offered as corrections.</p>
|
|||
|
<p><span id="index-CORRECT_005fALL"></span>
|
|||
|
<span id="index-NO_005fCORRECT_005fALL"></span>
|
|||
|
<span id="index-CORRECTALL"></span>
|
|||
|
<span id="index-NOCORRECTALL"></span></p>
|
|||
|
<p><code>CORRECT_ALL</code> (<code>-O</code>)</p>
|
|||
|
<p>Try to correct the spelling of all arguments in a line.</p>
|
|||
|
<p>The shell variable <code>CORRECT_IGNORE_FILE</code> may be set to a pattern to
|
|||
|
match file names that will never be offered as corrections.</p>
|
|||
|
<p><span id="index-DVORAK"></span> <span id="index-NO_005fDVORAK"></span>
|
|||
|
<span id="index-NODVORAK"></span></p>
|
|||
|
<p><code>DVORAK</code></p>
|
|||
|
<p>Use the Dvorak keyboard instead of the standard qwerty keyboard as a
|
|||
|
basis for examining spelling mistakes for the <code>CORRECT</code> and
|
|||
|
<code>CORRECT_ALL</code> options and the <code>spell-word</code> editor command.</p>
|
|||
|
<p><span id="index-FLOW_005fCONTROL"></span>
|
|||
|
<span id="index-NO_005fFLOW_005fCONTROL"></span>
|
|||
|
<span id="index-FLOWCONTROL"></span>
|
|||
|
<span id="index-NOFLOWCONTROL"></span>
|
|||
|
<span id="index-flow-control"></span></p>
|
|||
|
<p><code>FLOW_CONTROL</code> <D></p>
|
|||
|
<p>If this option is unset, output flow control via start/stop characters
|
|||
|
(usually assigned to ^S/^Q) is disabled in the shell’s editor.</p>
|
|||
|
<p><span id="index-IGNORE_005fEOF"></span>
|
|||
|
<span id="index-NO_005fIGNORE_005fEOF"></span>
|
|||
|
<span id="index-IGNOREEOF"></span> <span id="index-NOIGNOREEOF"></span>
|
|||
|
<span id="index-EOF_002c-ignoring"></span></p>
|
|||
|
<p><code>IGNORE_EOF</code> (<code>-7</code>)</p>
|
|||
|
<p>Do not exit on end-of-file. Require the use of <code>exit</code> or <code>logout</code>
|
|||
|
instead. However, ten consecutive EOFs will cause the shell to exit
|
|||
|
anyway, to avoid the shell hanging if its tty goes away.</p>
|
|||
|
<p>Also, if this option is set and the Zsh Line Editor is used, widgets
|
|||
|
implemented by shell functions can be bound to EOF (normally Control-D)
|
|||
|
without printing the normal warning message. This works only for normal
|
|||
|
widgets, not for completion widgets.</p>
|
|||
|
<p><span id="index-INTERACTIVE_005fCOMMENTS"></span>
|
|||
|
<span id="index-NO_005fINTERACTIVE_005fCOMMENTS"></span>
|
|||
|
<span id="index-INTERACTIVECOMMENTS"></span>
|
|||
|
<span id="index-NOINTERACTIVECOMMENTS"></span>
|
|||
|
<span id="index-comments_002c-in-interactive-shells"></span></p>
|
|||
|
<p><code>INTERACTIVE_COMMENTS</code> (<code>-k</code>) <K> <S></p>
|
|||
|
<p>Allow comments even in interactive shells.</p>
|
|||
|
<p><span id="index-HASH_005fCMDS"></span>
|
|||
|
<span id="index-NO_005fHASH_005fCMDS"></span>
|
|||
|
<span id="index-HASHCMDS"></span> <span id="index-NOHASHCMDS"></span>
|
|||
|
<span id="index-hashing_002c-of-commands"></span>
|
|||
|
<span id="index-command-hashing"></span></p>
|
|||
|
<p><code>HASH_CMDS</code> <D></p>
|
|||
|
<p>Note the location of each command the first time it is executed.
|
|||
|
Subsequent invocations of the same command will use the saved location,
|
|||
|
avoiding a path search. If this option is unset, no path hashing is done
|
|||
|
at all. However, when <code>CORRECT</code> is set, commands whose names do not
|
|||
|
appear in reporting them as spelling errors.</p>
|
|||
|
<p><span id="index-HASH_005fDIRS"></span>
|
|||
|
<span id="index-NO_005fHASH_005fDIRS"></span>
|
|||
|
<span id="index-HASHDIRS"></span> <span id="index-NOHASHDIRS"></span>
|
|||
|
<span id="index-hashing_002c-of-directories"></span>
|
|||
|
<span id="index-directories_002c-hashing"></span></p>
|
|||
|
<p><code>HASH_DIRS</code> <D></p>
|
|||
|
<p>Whenever a command name is hashed, hash the directory containing it, as
|
|||
|
well as all directories that occur earlier in the path. Has no effect if
|
|||
|
neither <code>HASH_CMDS</code> nor <code>CORRECT</code> is set.</p>
|
|||
|
<p><span id="index-HASH_005fEXECUTABLES_005fONLY"></span>
|
|||
|
<span id="index-NO_005fHASH_005fEXECUTABLES_005fONLY"></span>
|
|||
|
<span id="index-HASHEXECUTABLESONLY"></span>
|
|||
|
<span id="index-NOHASHEXECUTABLESONLY"></span></p>
|
|||
|
<p><code>HASH_EXECUTABLES_ONLY</code></p>
|
|||
|
<p>When hashing commands because of <code>HASH_CMDS</code>, check that the is unset by
|
|||
|
default as if the path contains a large number of commands, or consists
|
|||
|
of many remote files, the additional tests can take a long time. Trial
|
|||
|
and error is needed to show if this option is beneficial.</p>
|
|||
|
<p><span id="index-MAIL_005fWARNING"></span>
|
|||
|
<span id="index-NO_005fMAIL_005fWARNING"></span>
|
|||
|
<span id="index-MAILWARNING"></span>
|
|||
|
<span id="index-NOMAILWARNING"></span>
|
|||
|
<span id="index-mail_002c-warning-of-reading"></span></p>
|
|||
|
<p><code>MAIL_WARNING</code> (<code>-U</code>)</p>
|
|||
|
<p>Print a warning message if a mail file has been accessed since the shell
|
|||
|
last checked.</p>
|
|||
|
<p><span id="index-PATH_005fDIRS"></span>
|
|||
|
<span id="index-NO_005fPATH_005fDIRS"></span>
|
|||
|
<span id="index-PATHDIRS"></span> <span id="index-NOPATHDIRS"></span>
|
|||
|
<span id="index-path-search_002c-extended"></span></p>
|
|||
|
<p><code>PATH_DIRS</code> (<code>-Q</code>)</p>
|
|||
|
<p>Perform a path search even on command names with slashes in them. Thus
|
|||
|
if ‘<code>/usr/local/bin</code>’ is in the user’s path, and he or she types
|
|||
|
‘<code>X11/xinit</code>’, the command ‘<code>/usr/local/bin/X11/xinit</code>’ will be
|
|||
|
executed (assuming it exists). Commands explicitly beginning with ‘<code>/</code>’,
|
|||
|
‘<code>./</code>’ or ‘<code>../</code>’ are not subject to the path search. This also applies
|
|||
|
to the ‘<code>.</code>’ and <code>source</code> builtins.</p>
|
|||
|
<p>Note that subdirectories of the current directory are always searched
|
|||
|
for indicated by this option, and regardless of whether ‘<code>.</code>’ or the
|
|||
|
current directory appear in the command search path.</p>
|
|||
|
<p><span id="index-PATH_005fSCRIPT"></span>
|
|||
|
<span id="index-NO_005fPATH_005fSCRIPT"></span>
|
|||
|
<span id="index-PATHSCRIPT"></span>
|
|||
|
<span id="index-NOPATHSCRIPT"></span>
|
|||
|
<span id="index-path-search_002c-for-script-argument-to-shell"></span></p>
|
|||
|
<p><code>PATH_SCRIPT</code> <K> <S></p>
|
|||
|
<p>If this option is not set, a script passed as the first non-option
|
|||
|
argument to the shell must contain the name of the file to open. If this
|
|||
|
option is set, and the script does not specify a directory path, the
|
|||
|
script is looked for first in the current directory, then in the command
|
|||
|
path. See <a href="Invocation.html#Invocation">Invocation</a>.</p>
|
|||
|
<p><span id="index-PRINT_005fEIGHT_005fBIT"></span>
|
|||
|
<span id="index-NO_005fPRINT_005fEIGHT_005fBIT"></span>
|
|||
|
<span id="index-PRINTEIGHTBIT"></span>
|
|||
|
<span id="index-NOPRINTEIGHTBIT"></span>
|
|||
|
<span id="index-eight-bit-characters_002c-printing"></span></p>
|
|||
|
<p><code>PRINT_EIGHT_BIT</code></p>
|
|||
|
<p>Print eight bit characters literally in completion lists, etc. This
|
|||
|
option is not necessary if your system correctly returns the
|
|||
|
printability of eight bit characters (see man page ctype(3)).</p>
|
|||
|
<p><span id="index-PRINT_005fEXIT_005fVALUE"></span>
|
|||
|
<span id="index-NO_005fPRINT_005fEXIT_005fVALUE"></span>
|
|||
|
<span id="index-PRINTEXITVALUE"></span>
|
|||
|
<span id="index-NOPRINTEXITVALUE"></span>
|
|||
|
<span id="index-exit-status_002c-printing"></span></p>
|
|||
|
<p><code>PRINT_EXIT_VALUE</code> (<code>-1</code>)</p>
|
|||
|
<p>Print the exit value of programs with non-zero exit status. This is only
|
|||
|
available at the command line in interactive shells.</p>
|
|||
|
<p><span id="index-RC_005fQUOTES"></span>
|
|||
|
<span id="index-NO_005fRC_005fQUOTES"></span>
|
|||
|
<span id="index-RCQUOTES"></span> <span id="index-NORCQUOTES"></span>
|
|||
|
<span id="index-rc_002c-quoting-style"></span>
|
|||
|
<span id="index-quoting-style_002c-rc"></span></p>
|
|||
|
<p><code>RC_QUOTES</code></p>
|
|||
|
<p>Allow the character sequence ‘<code>’’</code>’ to signify a single quote within
|
|||
|
singly quoted strings. Note this does not apply in quoted strings using
|
|||
|
the format <code>$’``...``’</code>, where a backslashed single quote can be used.</p>
|
|||
|
<p><span id="index-RM_005fSTAR_005fSILENT"></span>
|
|||
|
<span id="index-NO_005fRM_005fSTAR_005fSILENT"></span>
|
|||
|
<span id="index-RMSTARSILENT"></span>
|
|||
|
<span id="index-NORMSTARSILENT"></span>
|
|||
|
<span id="index-rm-_002a_002c-querying-before"></span>
|
|||
|
<span id="index-querying-before-rm-_002a"></span></p>
|
|||
|
<p><code>RM_STAR_SILENT</code> (<code>-H</code>) <K> <S></p>
|
|||
|
<p>Do not query the user before executing ‘<code>rm *</code>’ or ‘<code>rm path/*</code>’.</p>
|
|||
|
<p><span id="index-RM_005fSTAR_005fWAIT"></span>
|
|||
|
<span id="index-NO_005fRM_005fSTAR_005fWAIT"></span>
|
|||
|
<span id="index-RMSTARWAIT"></span>
|
|||
|
<span id="index-NORMSTARWAIT"></span>
|
|||
|
<span id="index-rm-_002a_002c-waiting-before"></span>
|
|||
|
<span id="index-waiting-before-rm-_002a"></span></p>
|
|||
|
<p><code>RM_STAR_WAIT</code></p>
|
|||
|
<p>If querying the user before executing ‘<code>rm *</code>’ or ‘<code>rm path/*</code>’, first
|
|||
|
wait ten seconds and ignore anything typed in that time. This avoids the
|
|||
|
problem of reflexively answering ‘yes’ to the query when one didn’t
|
|||
|
really mean it. The wait and query can always be avoided by expanding
|
|||
|
the ‘<code>*</code>’ in ZLE (with tab).</p>
|
|||
|
<p><span id="index-SHORT_005fLOOPS"></span>
|
|||
|
<span id="index-NO_005fSHORT_005fLOOPS"></span>
|
|||
|
<span id="index-SHORTLOOPS"></span>
|
|||
|
<span id="index-NOSHORTLOOPS"></span></p>
|
|||
|
<p><code>SHORT_LOOPS</code> <C> <Z></p>
|
|||
|
<p>Allow the short forms of <code>for</code>, <code>repeat</code>, <code>select</code>, <code>if</code>, and <code>function</code>
|
|||
|
constructs.</p>
|
|||
|
<p><span id="index-SUN_005fKEYBOARD_005fHACK"></span>
|
|||
|
<span id="index-NO_005fSUN_005fKEYBOARD_005fHACK"></span>
|
|||
|
<span id="index-SUNKEYBOARDHACK"></span>
|
|||
|
<span id="index-NOSUNKEYBOARDHACK"></span>
|
|||
|
<span id="index-sun-keyboard_002c-annoying"></span>
|
|||
|
<span id="index-annoying-keyboard_002c-sun"></span></p>
|
|||
|
<p><code>SUN_KEYBOARD_HACK</code> (<code>-L</code>)</p>
|
|||
|
<p>If a line ends with a backquote, and there are an odd number of
|
|||
|
backquotes on the line, ignore the trailing backquote. This is useful on
|
|||
|
some keyboards where the return key is too small, and the backquote key
|
|||
|
lies annoyingly close to it. As an alternative the variable
|
|||
|
<code>KEYBOARD_HACK</code> lets you choose the character to be removed.</p>
|
|||
|
<hr />
|
|||
|
<p><span id="Job-Control"></span></p>
|
|||
|
<h3 id="1627-job-control"><a class="header" href="#1627-job-control">16.2.7 Job Control</a></h3>
|
|||
|
<p><span id="index-AUTO_005fCONTINUE"></span>
|
|||
|
<span id="index-NO_005fAUTO_005fCONTINUE"></span>
|
|||
|
<span id="index-AUTOCONTINUE"></span>
|
|||
|
<span id="index-NOAUTOCONTINUE"></span>
|
|||
|
<span id="index-jobs_002c-continuing-automatically"></span>
|
|||
|
<span id="index-continuing-jobs-automatically"></span></p>
|
|||
|
<p><code>AUTO_CONTINUE</code></p>
|
|||
|
<p>with the <code>disown</code> builtin command are automatically sent a <code>CONT</code> signal
|
|||
|
to make them running.</p>
|
|||
|
<p><span id="index-AUTO_005fRESUME"></span>
|
|||
|
<span id="index-NO_005fAUTO_005fRESUME"></span>
|
|||
|
<span id="index-AUTORESUME"></span>
|
|||
|
<span id="index-NOAUTORESUME"></span>
|
|||
|
<span id="index-jobs_002c-resuming-automatically"></span>
|
|||
|
<span id="index-resuming-jobs-automatically"></span></p>
|
|||
|
<p><code>AUTO_RESUME</code> (<code>-W</code>)</p>
|
|||
|
<p>Treat single word simple commands without redirection as candidates for
|
|||
|
resumption of an existing job.</p>
|
|||
|
<p><span id="index-BG_005fNICE"></span>
|
|||
|
<span id="index-NO_005fBG_005fNICE"></span>
|
|||
|
<span id="index-BGNICE"></span> <span id="index-NOBGNICE"></span>
|
|||
|
<span id="index-jobs_002c-background-priority"></span>
|
|||
|
<span id="index-background-jobs_002c-priority-of"></span>
|
|||
|
<span id="index-priority-of-background-jobs"></span></p>
|
|||
|
<p><code>BG_NICE</code> (<code>-6</code>) <C> <Z></p>
|
|||
|
<p>Run all background jobs at a lower priority. This option is set by
|
|||
|
default.</p>
|
|||
|
<p><span id="index-CHECK_005fJOBS"></span>
|
|||
|
<span id="index-NO_005fCHECK_005fJOBS"></span>
|
|||
|
<span id="index-CHECKJOBS"></span> <span id="index-NOCHECKJOBS"></span>
|
|||
|
<span id="index-exiting_002c-checking-jobs-when"></span>
|
|||
|
<span id="index-logging-out_002c-checking-jobs-when"></span></p>
|
|||
|
<p><code>CHECK_JOBS</code> <Z></p>
|
|||
|
<p>Report the status of background and suspended jobs before exiting a
|
|||
|
shell with job control; a second attempt to exit the shell will succeed.
|
|||
|
<code>NO_CHECK_JOBS</code> is best used only in combination with <code>NO_HUP</code>, else
|
|||
|
such jobs will be killed automatically.</p>
|
|||
|
<p>The check is omitted if the commands run from the previous command line
|
|||
|
included a ‘<code>jobs</code>’ command, since it is assumed the user is aware that
|
|||
|
there are background or suspended jobs. A ‘<code>jobs</code>’ command run from one
|
|||
|
of the hook functions defined in the section Special Functions in
|
|||
|
<a href="Functions.html#Functions">Functions</a> is not counted for this purpose.</p>
|
|||
|
<p><span id="index-CHECK_005fRUNNING_005fJOBS"></span>
|
|||
|
<span id="index-NO_005fCHECK_005fRUNNING_005fJOBS"></span>
|
|||
|
<span id="index-CHECKRUNNINGJOBS"></span>
|
|||
|
<span id="index-NOCHECKRUNNINGJOBS"></span>
|
|||
|
<span id="index-exiting_002c-checking-running-jobs-when"></span>
|
|||
|
<span id="index-logging-out_002c-checking-running-jobs-when"></span></p>
|
|||
|
<p><code>CHECK_RUNNING_JOBS</code> <Z></p>
|
|||
|
<p>Check for both running and suspended jobs when <code>CHECK_JOBS</code> is enabled.
|
|||
|
When this option is disabled, zsh checks only for suspended jobs, which
|
|||
|
matches the default behavior of bash.</p>
|
|||
|
<p>This option has no effect unless <code>CHECK_JOBS</code> is set.</p>
|
|||
|
<p><span id="index-HUP"></span> <span id="index-NO_005fHUP"></span>
|
|||
|
<span id="index-NOHUP"></span> <span id="index-jobs_002c-HUP"></span></p>
|
|||
|
<p><code>HUP</code> <Z></p>
|
|||
|
<p>Send the <code>HUP</code> signal to running jobs when the shell exits.</p>
|
|||
|
<p><span id="index-LONG_005fLIST_005fJOBS"></span>
|
|||
|
<span id="index-NO_005fLONG_005fLIST_005fJOBS"></span>
|
|||
|
<span id="index-LONGLISTJOBS"></span>
|
|||
|
<span id="index-NOLONGLISTJOBS"></span>
|
|||
|
<span id="index-jobs_002c-list-format"></span></p>
|
|||
|
<p><code>LONG_LIST_JOBS</code> (<code>-R</code>)</p>
|
|||
|
<p>Print job notifications in the long format by default.</p>
|
|||
|
<p><span id="index-MONITOR"></span> <span id="index-NO_005fMONITOR"></span>
|
|||
|
<span id="index-NOMONITOR"></span>
|
|||
|
<span id="index-job-control_002c-allowing"></span></p>
|
|||
|
<p><code>MONITOR</code> (<code>-m</code>, ksh: <code>-m</code>)</p>
|
|||
|
<p>Allow job control. Set by default in interactive shells.</p>
|
|||
|
<p><span id="index-NOTIFY"></span> <span id="index-NO_005fNOTIFY"></span>
|
|||
|
<span id="index-NONOTIFY"></span>
|
|||
|
<span id="index-background-jobs_002c-notification"></span>
|
|||
|
<span id="index-notification-of-background-jobs"></span></p>
|
|||
|
<p><code>NOTIFY</code> (<code>-5</code>, ksh: <code>-b</code>) <Z></p>
|
|||
|
<p>Report the status of background jobs immediately, rather than waiting
|
|||
|
until just before printing a prompt.</p>
|
|||
|
<p><span id="index-POSIX_005fJOBS"></span>
|
|||
|
<span id="index-POSIXJOBS"></span>
|
|||
|
<span id="index-NO_005fPOSIX_005fJOBS"></span>
|
|||
|
<span id="index-NOPOSIXJOBS"></span>
|
|||
|
<span id="index-bg_002c-output-in-POSIX-format"></span>
|
|||
|
<span id="index-fg_002c-output-in-POSIX-format"></span>
|
|||
|
<span id="index-job-control_002c-in-subshell"></span>
|
|||
|
<span id="index-jobs_002c-output-in-subshell"></span></p>
|
|||
|
<p><code>POSIX_JOBS</code> <K> <S></p>
|
|||
|
<p>This option makes job control more compliant with the POSIX standard.</p>
|
|||
|
<p>When the option is not set, the <code>MONITOR</code> option is unset on entry to
|
|||
|
subshells, so that job control is no longer active. When the option is
|
|||
|
set, the <code>MONITOR</code> option and job control remain active in the subshell,
|
|||
|
but note that the subshell has no access to jobs in the parent shell.</p>
|
|||
|
<p>When the option is not set, jobs put in the background or foreground
|
|||
|
with <code>bg</code> or <code>fg</code> are displayed with the same information that would be
|
|||
|
reported by <code>jobs</code>. When the option is set, only the text is printed.
|
|||
|
The output from <code>jobs</code> itself is not affected by the option.</p>
|
|||
|
<p>When the option is not set, job information from the parent shell is
|
|||
|
saved for output within a subshell (for example, within a pipeline).
|
|||
|
When the option is set, the output of <code>jobs</code> is empty until a job is
|
|||
|
started within the subshell.</p>
|
|||
|
<p>In previous versions of the shell, it was necessary to enable
|
|||
|
<code>POSIX_JOBS</code> in order for the builtin command <code>wait</code> to return the
|
|||
|
status of background jobs that had already exited. This is no longer the
|
|||
|
case.</p>
|
|||
|
<hr />
|
|||
|
<p><span id="Prompting"></span></p>
|
|||
|
<h3 id="1628-prompting"><a class="header" href="#1628-prompting">16.2.8 Prompting</a></h3>
|
|||
|
<p><span id="index-PROMPT_005fBANG"></span>
|
|||
|
<span id="index-NO_005fPROMPT_005fBANG"></span>
|
|||
|
<span id="index-PROMPTBANG"></span>
|
|||
|
<span id="index-NOPROMPTBANG"></span>
|
|||
|
<span id="index-prompt_002c-_0021-expansion"></span></p>
|
|||
|
<p><code>PROMPT_BANG</code> <K></p>
|
|||
|
<p>If set, ‘<code>!</code>’ is treated specially in prompt expansion. See <a href="Prompt-Expansion.html#Prompt-Expansion">Prompt
|
|||
|
Expansion</a>.</p>
|
|||
|
<p><span id="index-PROMPT_005fCR"></span>
|
|||
|
<span id="index-NO_005fPROMPT_005fCR"></span>
|
|||
|
<span id="index-PROMPTCR"></span> <span id="index-NOPROMPTCR"></span>
|
|||
|
<span id="index-prompt_002c-with-CR"></span></p>
|
|||
|
<p><code>PROMPT_CR</code> (<code>+V</code>) <D></p>
|
|||
|
<p>Print a carriage return just before printing a prompt in the line
|
|||
|
editor. This is on by default as multi-line editing is only possible if
|
|||
|
the editor knows where the start of the line appears.</p>
|
|||
|
<p><span id="index-PROMPT_005fSP"></span>
|
|||
|
<span id="index-NO_005fPROMPT_005fSP"></span>
|
|||
|
<span id="index-PROMPTSP"></span> <span id="index-NOPROMPTSP"></span>
|
|||
|
<span id="index-prompt_002c-save-partial-lines"></span></p>
|
|||
|
<p><code>PROMPT_SP</code> <D></p>
|
|||
|
<p>Attempt to preserve a partial line (i.e. a line that did not end with a
|
|||
|
newline) that would otherwise be covered up by the command prompt due to
|
|||
|
the <code>PROMPT_CR</code> option. This works by outputting some cursor-control
|
|||
|
characters, including a series of spaces, that should make the terminal
|
|||
|
wrap to the next line when a partial line is present (note that this is
|
|||
|
only successful if your terminal has automatic margins, which is
|
|||
|
typical).</p>
|
|||
|
<p>When a partial line is preserved, by default you will see an
|
|||
|
inverse+bold character at the end of the partial line: a ‘<code>%</code>’ for a
|
|||
|
normal user or a ‘<code>#</code>’ for root. If set, the shell parameter
|
|||
|
<code>PROMPT_EOL_MARK</code> can be used to customize how the end of partial lines
|
|||
|
are shown.</p>
|
|||
|
<p>NOTE: if the <code>PROMPT_CR</code> option is not set, enabling this option will
|
|||
|
have no effect. This option is on by default.</p>
|
|||
|
<p><span id="index-PROMPT_005fPERCENT"></span>
|
|||
|
<span id="index-NO_005fPROMPT_005fPERCENT"></span>
|
|||
|
<span id="index-PROMPTPERCENT"></span>
|
|||
|
<span id="index-NOPROMPTPERCENT"></span>
|
|||
|
<span id="index-prompt_002c-_0025-expansion"></span></p>
|
|||
|
<p><code>PROMPT_PERCENT</code> <C> <Z></p>
|
|||
|
<p>If set, ‘<code>%</code>’ is treated specially in prompt expansion. See <a href="Prompt-Expansion.html#Prompt-Expansion">Prompt
|
|||
|
Expansion</a>.</p>
|
|||
|
<p><span id="index-PROMPT_005fSUBST"></span>
|
|||
|
<span id="index-NO_005fPROMPT_005fSUBST"></span>
|
|||
|
<span id="index-PROMPTSUBST"></span>
|
|||
|
<span id="index-NOPROMPTSUBST"></span>
|
|||
|
<span id="index-prompt_002c-parameter-expansion"></span></p>
|
|||
|
<p><code>PROMPT_SUBST</code> <K> <S></p>
|
|||
|
<p>If set, <em>parameter expansion</em>, <em>command substitution</em> and <em>arithmetic
|
|||
|
expansion</em> are performed in prompts. Substitutions within prompts do not
|
|||
|
affect the command status.</p>
|
|||
|
<p><span id="index-TRANSIENT_005fRPROMPT"></span>
|
|||
|
<span id="index-NO_005fTRANSIENT_005fRPROMPT"></span>
|
|||
|
<span id="index-TRANSIENTRPROMPT"></span>
|
|||
|
<span id="index-NOTRANSIENTRPROMPT"></span></p>
|
|||
|
<p><code>TRANSIENT_RPROMPT</code></p>
|
|||
|
<p>Remove any right prompt from display when accepting a command line. This
|
|||
|
may be useful with terminals with other cut/paste methods.</p>
|
|||
|
<hr />
|
|||
|
<p><span id="Scripts-and-Functions"></span></p>
|
|||
|
<h3 id="1629-scripts-and-functions"><a class="header" href="#1629-scripts-and-functions">16.2.9 Scripts and Functions</a></h3>
|
|||
|
<p><span id="index-ALIAS_005fFUNC_005fDEF"></span>
|
|||
|
<span id="index-NO_005fALIAS_005fFUNC_005fDEF"></span>
|
|||
|
<span id="index-ALIASFUNCDEF"></span>
|
|||
|
<span id="index-NOALIASFUNCDEF"></span>
|
|||
|
<span id="index-functions_002c-defining-with-expanded-aliases"></span>
|
|||
|
<span id="index-aliases_002c-expanding-in-function-definition"></span></p>
|
|||
|
<p><code>ALIAS_FUNC_DEF</code> <S></p>
|
|||
|
<p>By default, zsh does not allow the definition of functions using the
|
|||
|
‘<code>name</code> <code>()</code>’ syntax if <code>name</code> was expanded as an alias: this causes
|
|||
|
an error. This is usually the desired behaviour, as otherwise the
|
|||
|
combination of an alias and a function based on the same definition can
|
|||
|
easily cause problems.</p>
|
|||
|
<p>When this option is set, aliases can be used for defining functions.</p>
|
|||
|
<p>For example, consider the following definitions as they might occur in a
|
|||
|
startup file.</p>
|
|||
|
<div class="example">
|
|||
|
<pre><code class="language-example">alias foo=bar
|
|||
|
foo() {
|
|||
|
print This probably does not do what you expect.
|
|||
|
}
|
|||
|
</code></pre>
|
|||
|
</div>
|
|||
|
<p>Here, <code>foo</code> is expanded as an alias to <code>bar</code> before the <code>()</code> is
|
|||
|
encountered, so the function defined would be named <code>bar</code>. By default
|
|||
|
this is instead an error in native mode. Note that quoting any part of
|
|||
|
the function name, or using the keyword <code>function</code>, avoids the problem,
|
|||
|
so is recommended when the function name can also be an alias.</p>
|
|||
|
<p><span id="index-C_005fBASES"></span>
|
|||
|
<span id="index-NO_005fC_005fBASES"></span>
|
|||
|
<span id="index-CBASES"></span> <span id="index-NOCBASES"></span>
|
|||
|
<span id="index-bases_002c-output-in-C-format"></span>
|
|||
|
<span id="index-hexadecimal_002c-output-in-C-format"></span>
|
|||
|
<span id="index-octal_002c-output-in-C-format"></span></p>
|
|||
|
<p><code>C_BASES</code></p>
|
|||
|
<p>Output hexadecimal numbers in the standard C format, for example
|
|||
|
‘<code>0xFF</code>’ instead of the usual ‘<code>16#FF</code>’. If the option
|
|||
|
<code>OCTAL_ZEROES</code> is also set (it is not by default), octal numbers will be
|
|||
|
treated similarly and hence appear as ‘<code>077</code>’ instead of ‘<code>8#77</code>’. This
|
|||
|
option has no effect on the choice of the output base, nor on the output
|
|||
|
of bases other than hexadecimal and octal. Note that these formats will
|
|||
|
be understood on input irrespective of the setting of <code>C_BASES</code>.</p>
|
|||
|
<p><span id="index-C_005fPRECEDENCES"></span>
|
|||
|
<span id="index-NO_005fC_005fPRECEDENCES"></span>
|
|||
|
<span id="index-CPRECEDENCES"></span>
|
|||
|
<span id="index-NOCPRECEDENCES"></span>
|
|||
|
<span id="index-precedence_002c-operator"></span>
|
|||
|
<span id="index-operator-precedence"></span></p>
|
|||
|
<p><code>C_PRECEDENCES</code></p>
|
|||
|
<p>This alters the precedence of arithmetic operators to be more like C and
|
|||
|
other programming languages; <a href="Arithmetic-Evaluation.html#Arithmetic-Evaluation">Arithmetic
|
|||
|
Evaluation</a> has an
|
|||
|
explicit list.</p>
|
|||
|
<p><span id="index-DEBUG_005fBEFORE_005fCMD"></span>
|
|||
|
<span id="index-NO_005fDEBUG_005fBEFORE_005fCMD"></span>
|
|||
|
<span id="index-DEBUGBEFORECMD"></span>
|
|||
|
<span id="index-NODEBUGBEFORECMD"></span>
|
|||
|
<span id="index-traps_002c-DEBUG_002c-before-or-after-command"></span>
|
|||
|
<span id="index-DEBUG-trap_002c-before-or-after-command"></span></p>
|
|||
|
<p><code>DEBUG_BEFORE_CMD</code> <D></p>
|
|||
|
<p>Run the <code>DEBUG</code> trap before each command; otherwise it is run after each
|
|||
|
command. Setting this option mimics the behaviour of ksh 93; with the
|
|||
|
option unset the behaviour is that of ksh 88.</p>
|
|||
|
<p><span id="index-ERR_005fEXIT"></span>
|
|||
|
<span id="index-NO_005fERR_005fEXIT"></span>
|
|||
|
<span id="index-ERREXIT"></span> <span id="index-NOERREXIT"></span>
|
|||
|
<span id="index-exit-status_002c-trapping"></span></p>
|
|||
|
<p><code>ERR_EXIT</code> (<code>-e</code>, ksh: <code>-e</code>)</p>
|
|||
|
<p>If a command has a non-zero exit status, execute the <code>ZERR</code> trap, if
|
|||
|
set, and exit. This is disabled while running initialization scripts.</p>
|
|||
|
<p>The behaviour is also disabled inside <code>DEBUG</code> traps. In this case the
|
|||
|
option is handled specially: it is unset on entry to the trap. If the
|
|||
|
option <code>DEBUG_BEFORE_CMD</code> is set, as it is by default, and the option
|
|||
|
<code>ERR_EXIT</code> is found to have been set on exit, then the command for which
|
|||
|
the <code>DEBUG</code> trap is being executed is skipped. The option is restored
|
|||
|
after the trap exits.</p>
|
|||
|
<p>Non-zero status in a command list containing <code>&&</code> or <code>||</code> is ignored for
|
|||
|
commands not at the end of the list. Hence</p>
|
|||
|
<div class="example">
|
|||
|
<pre><code class="language-example">false && true
|
|||
|
</code></pre>
|
|||
|
</div>
|
|||
|
<p>does not trigger exit.</p>
|
|||
|
<p>Exiting due to <code>ERR_EXIT</code> has certain interactions with asynchronous
|
|||
|
jobs noted in <a href="Jobs-_0026-Signals.html#Jobs-_0026-Signals">Jobs &
|
|||
|
Signals</a>.</p>
|
|||
|
<p><span id="index-ERR_005fRETURN"></span>
|
|||
|
<span id="index-NO_005fERR_005fRETURN"></span>
|
|||
|
<span id="index-ERRRETURN"></span> <span id="index-NOERRRETURN"></span>
|
|||
|
<span id="index-function-return_002c-on-error"></span>
|
|||
|
<span id="index-return-from-function_002c-on-error"></span></p>
|
|||
|
<p><code>ERR_RETURN</code></p>
|
|||
|
<p>If a command has a non-zero exit status, return immediately from the
|
|||
|
enclosing function. The logic is similar to that for <code>ERR_EXIT</code>, except
|
|||
|
that an implicit <code>return</code> statement is executed instead of an <code>exit</code>.
|
|||
|
This will trigger an exit at the outermost level of a non-interactive
|
|||
|
script.</p>
|
|||
|
<p>Normally this option inherits the behaviour of <code>ERR_EXIT</code> that code
|
|||
|
followed by ‘<code>&&</code>’ ‘<code>||</code>’ does not trigger a return. Hence in the
|
|||
|
following:</p>
|
|||
|
<div class="example">
|
|||
|
<pre><code class="language-example">summit || true
|
|||
|
</code></pre>
|
|||
|
</div>
|
|||
|
<p>no return is forced as the combined effect always has a zero return
|
|||
|
status.</p>
|
|||
|
<p>Note. however, that if <code>summit</code> in the above example is itself a
|
|||
|
function, code inside it is considered separately: it may force a return
|
|||
|
from <code>summit</code> (assuming the option remains set within <code>summit</code>), but not
|
|||
|
from the enclosing context. This behaviour is different from <code>ERR_EXIT</code>
|
|||
|
which is unaffected by function scope.</p>
|
|||
|
<p><span id="index-EVAL_005fLINENO"></span>
|
|||
|
<span id="index-NO_005fEVAL_005fLINENO"></span>
|
|||
|
<span id="index-EVALLINENO"></span>
|
|||
|
<span id="index-NOEVALLINENO"></span>
|
|||
|
<span id="index-line-number_002c-in-evaluated-expression"></span></p>
|
|||
|
<p><code>EVAL_LINENO</code> <Z></p>
|
|||
|
<p>If set, line numbers of expressions evaluated using the builtin <code>eval</code>
|
|||
|
are tracked separately of the enclosing environment. This applies both
|
|||
|
to the parameter <code>LINENO</code> and the line number output by the prompt
|
|||
|
escape <code>%i</code>. If the option is set, the prompt escape <code>%N</code> will output
|
|||
|
the string ‘<code>(eval)</code>’ instead of the script or function name as an
|
|||
|
indication. (The two prompt escapes are typically used in the parameter
|
|||
|
<code>PS4</code> to be output when the option <code>XTRACE</code> is set.) If <code>EVAL_LINENO</code> is
|
|||
|
unset, the line number of the surrounding script or function is retained
|
|||
|
during the evaluation.</p>
|
|||
|
<p><span id="index-EXEC"></span> <span id="index-NO_005fEXEC"></span>
|
|||
|
<span id="index-NOEXEC"></span>
|
|||
|
<span id="index-command-execution_002c-enabling"></span></p>
|
|||
|
<p><code>EXEC</code> (<code>+n</code>, ksh: <code>+n</code>) <D></p>
|
|||
|
<p>Do execute commands. Without this option, commands are read and checked
|
|||
|
for syntax errors, but not executed. This option cannot be turned off in
|
|||
|
an interactive shell, except when ‘<code>-n</code>’ is supplied to the shell at
|
|||
|
startup.</p>
|
|||
|
<p><span id="index-FUNCTION_005fARGZERO"></span>
|
|||
|
<span id="index-NO_005fFUNCTION_005fARGZERO"></span>
|
|||
|
<span id="index-FUNCTIONARGZERO"></span>
|
|||
|
<span id="index-NOFUNCTIONARGZERO"></span>
|
|||
|
<span id="index-_00240_002c-setting"></span></p>
|
|||
|
<p><code>FUNCTION_ARGZERO</code> <C> <Z></p>
|
|||
|
<p>When executing a shell function or sourcing a script, set <code>$0</code>
|
|||
|
temporarily to the name of the function/script. Note that toggling
|
|||
|
<code>FUNCTION_ARGZERO</code> from on to off (or off to on) does not change the
|
|||
|
current value of <code>$0</code>. Only the state upon entry to the function or
|
|||
|
script has an effect. Compare <code>POSIX_ARGZERO</code>.</p>
|
|||
|
<p><span id="index-LOCAL_005fLOOPS"></span>
|
|||
|
<span id="index-NO_005fLOCAL_005fLOOPS"></span>
|
|||
|
<span id="index-LOCALLOOPS"></span>
|
|||
|
<span id="index-NOLOCALLOOPS"></span>
|
|||
|
<span id="index-break_002c-inside-function"></span>
|
|||
|
<span id="index-continue_002c-inside-function"></span>
|
|||
|
<span id="index-function_002c-scope-of-break-and-continue"></span></p>
|
|||
|
<p><code>LOCAL_LOOPS</code></p>
|
|||
|
<p>When this option is not set, the effect of <code>break</code> and <code>continue</code>
|
|||
|
commands may propagate outside function scope, affecting loops in
|
|||
|
calling functions. When the option is set in a calling function, a
|
|||
|
<code>break</code> or a <code>continue</code> that is not caught within a called function
|
|||
|
(regardless of the setting of the option within that function) produces
|
|||
|
a warning and the effect is cancelled.</p>
|
|||
|
<p><span id="index-LOCAL_005fOPTIONS"></span>
|
|||
|
<span id="index-NO_005fLOCAL_005fOPTIONS"></span>
|
|||
|
<span id="index-LOCALOPTIONS"></span>
|
|||
|
<span id="index-NOLOCALOPTIONS"></span></p>
|
|||
|
<p><code>LOCAL_OPTIONS</code> <K></p>
|
|||
|
<p>If this option is set at the point of return from a shell function, most
|
|||
|
options (including this one) which were in force upon entry to the
|
|||
|
function are restored; options that are not restored are <code>PRIVILEGED</code>
|
|||
|
and <code>RESTRICTED</code>. Otherwise, only this option, and the <code>LOCAL_LOOPS</code>,
|
|||
|
<code>XTRACE</code> and <code>PRINT_EXIT_VALUE</code> options are restored. Hence if this is
|
|||
|
explicitly unset by a shell function the other options in force at the
|
|||
|
point of return will remain so. A shell function can also guarantee
|
|||
|
itself a known shell configuration with a formulation like ‘<code>emulate -L zsh</code>’; the <code>-L</code> activates <code>LOCAL_OPTIONS</code>.</p>
|
|||
|
<p><span id="index-LOCAL_005fPATTERNS"></span>
|
|||
|
<span id="index-NO_005fLOCAL_005fPATTERNS"></span>
|
|||
|
<span id="index-LOCALPATTERNS"></span>
|
|||
|
<span id="index-NOLOCALPATTERNS"></span></p>
|
|||
|
<p><code>LOCAL_PATTERNS</code></p>
|
|||
|
<p>If this option is set at the point of return from a shell function, the
|
|||
|
state of pattern disables, as set with the builtin command ‘<code>disable -p</code>’, is restored to what it was when the function was entered. The
|
|||
|
behaviour of this option is similar to the effect of <code>LOCAL_OPTIONS</code> on
|
|||
|
options; hence ‘<code>emulate -L sh</code>’ (or indeed any other emulation with the
|
|||
|
<code>-L</code> option) activates <code>LOCAL_PATTERNS</code>.</p>
|
|||
|
<p><span id="index-LOCAL_005fTRAPS"></span>
|
|||
|
<span id="index-NO_005fLOCAL_005fTRAPS"></span>
|
|||
|
<span id="index-LOCALTRAPS"></span>
|
|||
|
<span id="index-NOLOCALTRAPS"></span></p>
|
|||
|
<p><code>LOCAL_TRAPS</code> <K></p>
|
|||
|
<p>If this option is set when a signal trap is set inside a function, then
|
|||
|
the previous status of the trap for that signal will be restored when
|
|||
|
the function exits. Note that this option must be set <em>prior</em> to
|
|||
|
altering the trap behaviour in a function; unlike <code>LOCAL_OPTIONS</code>, the
|
|||
|
value on exit from the function is irrelevant. However, it does not need
|
|||
|
to be set before any global trap for that to be correctly restored by a
|
|||
|
function. For example,</p>
|
|||
|
<div class="example">
|
|||
|
<pre><code class="language-example">unsetopt localtraps
|
|||
|
trap - INT
|
|||
|
fn() { setopt localtraps; trap '' INT; sleep 3; }
|
|||
|
</code></pre>
|
|||
|
</div>
|
|||
|
<p>will restore normal handling of <code>SIGINT</code> after the function exits.</p>
|
|||
|
<p><span id="index-MULTI_005fFUNC_005fDEF"></span>
|
|||
|
<span id="index-NO_005fMULTI_005fFUNC_005fDEF"></span>
|
|||
|
<span id="index-MULTIFUNCDEF"></span>
|
|||
|
<span id="index-NOMULTIFUNCDEF"></span></p>
|
|||
|
<p><code>MULTI_FUNC_DEF</code> <Z></p>
|
|||
|
<p>Allow definitions of multiple functions at once in the form ‘<code>fn1 fn2``...``()</code>’; if the option is not set, this causes a parse error.
|
|||
|
Definition of multiple functions with the <code>function</code> keyword is always
|
|||
|
allowed. Multiple function definitions are not often used and can cause
|
|||
|
obscure errors.</p>
|
|||
|
<p><span id="index-MULTIOS"></span> <span id="index-NO_005fMULTIOS"></span>
|
|||
|
<span id="index-NOMULTIOS"></span></p>
|
|||
|
<p><code>MULTIOS</code> <Z></p>
|
|||
|
<p>Perform implicit tees or cats when multiple redirections are attempted
|
|||
|
(see <a href="Redirection.html#Redirection">Redirection</a>).</p>
|
|||
|
<p><span id="index-OCTAL_005fZEROES"></span>
|
|||
|
<span id="index-NO_005fOCTAL_005fZEROES"></span>
|
|||
|
<span id="index-OCTALZEROES"></span>
|
|||
|
<span id="index-NOOCTALZEROES"></span>
|
|||
|
<span id="index-octal_002c-arithmetic-expressions"></span></p>
|
|||
|
<p><code>OCTAL_ZEROES</code> <S></p>
|
|||
|
<p>Interpret any integer constant beginning with a 0 as octal, per IEEE Std
|
|||
|
1003.2-1992 (ISO 9945-2:1993). This is not enabled by default as it
|
|||
|
causes problems with parsing of, for example, date and time strings with
|
|||
|
leading zeroes.</p>
|
|||
|
<p>Sequences of digits indicating a numeric base such as the ‘<code>08</code>’
|
|||
|
component in ‘<code>08#77</code>’ are always interpreted as decimal, regardless of
|
|||
|
leading zeroes.</p>
|
|||
|
<p><span id="index-PIPE_005fFAIL"></span>
|
|||
|
<span id="index-NO_005fPIPE_005fFAIL"></span>
|
|||
|
<span id="index-PIPEFAIL"></span> <span id="index-NOPIPEFAIL"></span>
|
|||
|
<span id="index-exit-status-from-pipeline"></span>
|
|||
|
<span id="index-status_002c-on-exit-from-pipeline"></span>
|
|||
|
<span id="index-pipeline_002c-exit-status-from"></span></p>
|
|||
|
<p><code>PIPE_FAIL</code></p>
|
|||
|
<p>By default, when a pipeline exits the exit status recorded by the shell
|
|||
|
and returned by the shell variable <code>$?</code> reflects that of the rightmost
|
|||
|
element of a pipeline. If this option is set, the exit status instead
|
|||
|
reflects the status of the rightmost element of the pipeline that was
|
|||
|
non-zero, or zero if all elements exited with zero status.</p>
|
|||
|
<p><span id="index-SOURCE_005fTRACE"></span>
|
|||
|
<span id="index-NO_005fSOURCE_005fTRACE"></span>
|
|||
|
<span id="index-SOURCETRACE"></span>
|
|||
|
<span id="index-NOSOURCETRACE"></span></p>
|
|||
|
<p><code>SOURCE_TRACE</code></p>
|
|||
|
<p>If set, zsh will print an informational message announcing the name of
|
|||
|
each file it loads. The format of the output is similar to that for the
|
|||
|
<code>XTRACE</code> option, with the message <code><sourcetrace></code>. A file may be loaded
|
|||
|
by the shell itself when it starts up and shuts down (<code>Startup/Shutdown Files</code>) or by the use of the ‘<code>source</code>’ and ‘<code>dot</code>’ builtin commands.</p>
|
|||
|
<p><span id="index-TYPESET_005fSILENT"></span>
|
|||
|
<span id="index-NO_005fTYPESET_005fSILENT"></span>
|
|||
|
<span id="index-TYPESETSILENT"></span>
|
|||
|
<span id="index-NOTYPESETSILENT"></span></p>
|
|||
|
<p><code>TYPESET_SILENT</code></p>
|
|||
|
<p>If this is unset, executing any of the ‘<code>typeset</code>’ family of commands
|
|||
|
with no options and a list of parameters that have no values to be
|
|||
|
assigned but already exist will display the value of the parameter. If
|
|||
|
the option is set, they will only be shown when parameters are selected
|
|||
|
with the ‘<code>-m</code>’ option. The option ‘<code>-p</code>’ is available whether or not
|
|||
|
the option is set.</p>
|
|||
|
<p><span id="index-VERBOSE"></span> <span id="index-NO_005fVERBOSE"></span>
|
|||
|
<span id="index-NOVERBOSE"></span>
|
|||
|
<span id="index-tracing_002c-of-input-lines"></span>
|
|||
|
<span id="index-input_002c-tracing"></span></p>
|
|||
|
<p><code>VERBOSE</code> (<code>-v</code>, ksh: <code>-v</code>)</p>
|
|||
|
<p>Print shell input lines as they are read.</p>
|
|||
|
<p><span id="index-XTRACE"></span> <span id="index-NO_005fXTRACE"></span>
|
|||
|
<span id="index-NOXTRACE"></span>
|
|||
|
<span id="index-tracing_002c-of-commands"></span>
|
|||
|
<span id="index-commands_002c-tracing"></span></p>
|
|||
|
<p><code>XTRACE</code> (<code>-x</code>, ksh: <code>-x</code>)</p>
|
|||
|
<p>Print commands and their arguments as they are executed. The output is
|
|||
|
preceded by the value of <code>$PS4</code>, formatted as described in <a href="Prompt-Expansion.html#Prompt-Expansion">Prompt
|
|||
|
Expansion</a>.</p>
|
|||
|
<hr />
|
|||
|
<p><span id="Shell-Emulation"></span></p>
|
|||
|
<h3 id="16210-shell-emulation"><a class="header" href="#16210-shell-emulation">16.2.10 Shell Emulation</a></h3>
|
|||
|
<p><span id="index-APPEND_005fCREATE"></span>
|
|||
|
<span id="index-NO_005fAPPEND_005fCREATE"></span>
|
|||
|
<span id="index-APPENDCREATE"></span>
|
|||
|
<span id="index-NOAPPENDCREATE"></span>
|
|||
|
<span id="index-clobbering_002c-POSIX-compatibility"></span>
|
|||
|
<span id="index-file-clobbering_002c-POSIX-compatibility"></span>
|
|||
|
<span id="index-no-clobber_002c-POSIX-compatible"></span></p>
|
|||
|
<p><code>APPEND_CREATE</code> <K> <S></p>
|
|||
|
<p>This option only applies when <code>NO_CLOBBER</code> (-<code>C</code>) is in effect.</p>
|
|||
|
<p>If this option is not set, the shell will report an error when a append
|
|||
|
redirection (<code>>></code>) is used on a file that does not already exists (the
|
|||
|
traditional zsh behaviour of <code>NO_CLOBBER</code>). If the option is set, no
|
|||
|
error is reported (POSIX behaviour).</p>
|
|||
|
<p><span id="index-BASH_005fREMATCH"></span>
|
|||
|
<span id="index-NO_005fBASH_005fREMATCH"></span>
|
|||
|
<span id="index-BASHREMATCH"></span>
|
|||
|
<span id="index-NOBASHREMATCH"></span>
|
|||
|
<span id="index-bash_002c-BASH_005fREMATCH-variable"></span>
|
|||
|
<span id="index-regexp_002c-bash-BASH_005fREMATCH-variable"></span></p>
|
|||
|
<p><code>BASH_REMATCH</code></p>
|
|||
|
<p>When set, matches performed with the <code>=~</code> operator will set the
|
|||
|
<code>BASH_REMATCH</code> array variable, instead of the default <code>MATCH</code> and
|
|||
|
<code>match</code> variables. The first element of the <code>BASH_REMATCH</code> array will
|
|||
|
contain the entire matched text and subsequent elements will contain
|
|||
|
extracted substrings. This option makes more sense when <code>KSH_ARRAYS</code> is
|
|||
|
also set, so that the entire matched portion is stored at index 0 and
|
|||
|
the first substring is at index 1. Without this option, the <code>MATCH</code>
|
|||
|
variable contains the entire matched text and the <code>match</code> array variable
|
|||
|
contains substrings.</p>
|
|||
|
<p><span id="index-BSD_005fECHO"></span>
|
|||
|
<span id="index-NO_005fBSD_005fECHO"></span>
|
|||
|
<span id="index-BSDECHO"></span> <span id="index-NOBSDECHO"></span>
|
|||
|
<span id="index-echo_002c-BSD-compatible"></span></p>
|
|||
|
<p><code>BSD_ECHO</code> <S></p>
|
|||
|
<p>Make the <code>echo</code> builtin compatible with the BSD man page echo(1)
|
|||
|
command. This disables backslashed escape sequences in echo strings
|
|||
|
unless the <code>-e</code> option is specified.</p>
|
|||
|
<p><span id="index-CONTINUE_005fON_005fERROR"></span>
|
|||
|
<span id="index-NO_005fCONTINUE_005fON_005fERROR"></span>
|
|||
|
<span id="index-CONTINUEONERROR"></span>
|
|||
|
<span id="index-NOCONTINUEONERROR"></span>
|
|||
|
<span id="index-error_002c-option-to-continue-script-on"></span></p>
|
|||
|
<p><code>CONTINUE_ON_ERROR</code></p>
|
|||
|
<p>If a fatal error is encountered (see
|
|||
|
<a href="Shell-Grammar.html#Errors">Errors</a>), and the code is running in a
|
|||
|
script, the shell will resume execution at the next statement in the
|
|||
|
script at the top level, in other words outside all functions or shell
|
|||
|
constructs such as loops and conditions. This mimics the behaviour of
|
|||
|
interactive shells, where the shell returns to the line editor to read a
|
|||
|
new command; it was the normal behaviour in versions of zsh before
|
|||
|
5.0.1.</p>
|
|||
|
<p><span id="index-CSH_005fJUNKIE_005fHISTORY"></span>
|
|||
|
<span id="index-NO_005fCSH_005fJUNKIE_005fHISTORY"></span>
|
|||
|
<span id="index-CSHJUNKIEHISTORY"></span>
|
|||
|
<span id="index-NOCSHJUNKIEHISTORY"></span>
|
|||
|
<span id="index-csh_002c-history-style"></span>
|
|||
|
<span id="index-history-style_002c-csh"></span></p>
|
|||
|
<p><code>CSH_JUNKIE_HISTORY</code> <C></p>
|
|||
|
<p>A history reference without an event specifier will always refer to the
|
|||
|
previous command. Without this option, such a history reference refers
|
|||
|
to the same event as the previous history reference on the current
|
|||
|
command line, defaulting to the previous command.</p>
|
|||
|
<p><span id="index-CSH_005fJUNKIE_005fLOOPS"></span>
|
|||
|
<span id="index-NO_005fCSH_005fJUNKIE_005fLOOPS"></span>
|
|||
|
<span id="index-CSHJUNKIELOOPS"></span>
|
|||
|
<span id="index-NOCSHJUNKIELOOPS"></span>
|
|||
|
<span id="index-csh_002c-loop-style"></span>
|
|||
|
<span id="index-loop-style_002c-csh"></span></p>
|
|||
|
<p><code>CSH_JUNKIE_LOOPS</code> <C></p>
|
|||
|
<p>Allow loop bodies to take the form ‘<code>list``; end</code>’ instead of ‘<code> do ``list``; done</code>’.</p>
|
|||
|
<p><span id="index-CSH_005fJUNKIE_005fQUOTES"></span>
|
|||
|
<span id="index-NO_005fCSH_005fJUNKIE_005fQUOTES"></span>
|
|||
|
<span id="index-CSHJUNKIEQUOTES"></span>
|
|||
|
<span id="index-NOCSHJUNKIEQUOTES"></span>
|
|||
|
<span id="index-csh_002c-quoting-style"></span>
|
|||
|
<span id="index-quoting-style_002c-csh"></span></p>
|
|||
|
<p><code>CSH_JUNKIE_QUOTES</code> <C></p>
|
|||
|
<p>Changes the rules for single- and double-quoted text to match that of
|
|||
|
csh. These require that embedded newlines be preceded by a backslash;
|
|||
|
unescaped newlines will cause an error message. In double-quoted
|
|||
|
strings, it is made impossible to escape ‘<code>$</code>’, ‘<code>‘</code>’ or ‘<code>"</code>’ (and
|
|||
|
‘<code>\</code>’ itself no longer needs escaping). Command substitutions are
|
|||
|
only expanded once, and cannot be nested.</p>
|
|||
|
<p><span id="index-CSH_005fNULLCMD"></span>
|
|||
|
<span id="index-NO_005fCSH_005fNULLCMD"></span>
|
|||
|
<span id="index-CSHNULLCMD"></span>
|
|||
|
<span id="index-NOCSHNULLCMD"></span>
|
|||
|
<span id="index-NULLCMD_002c-ignoring"></span>
|
|||
|
<span id="index-READNULLCMD_002c-ignoring"></span>
|
|||
|
<span id="index-redirections-with-no-command_002c-csh"></span>
|
|||
|
<span id="index-csh_002c-redirections-with-no-command"></span></p>
|
|||
|
<p><code>CSH_NULLCMD</code> <C></p>
|
|||
|
<p>Do not use the values of <code>NULLCMD</code> and <code>READNULLCMD</code> when running
|
|||
|
redirections with no command. This make such redirections fail (see
|
|||
|
<a href="Redirection.html#Redirection">Redirection</a>).</p>
|
|||
|
<p><span id="index-KSH_005fARRAYS"></span>
|
|||
|
<span id="index-NO_005fKSH_005fARRAYS"></span>
|
|||
|
<span id="index-KSHARRAYS"></span> <span id="index-NOKSHARRAYS"></span>
|
|||
|
<span id="index-arrays_002c-ksh-style"></span>
|
|||
|
<span id="index-array-style_002c-ksh"></span>
|
|||
|
<span id="index-ksh_002c-array-style"></span></p>
|
|||
|
<p><code>KSH_ARRAYS</code> <K> <S></p>
|
|||
|
<p>Emulate ksh array handling as closely as possible. If this option is
|
|||
|
set, array elements are numbered from zero, an array parameter without
|
|||
|
subscript refers to the first element instead of the whole array, and
|
|||
|
braces are required to delimit a subscript (‘<code>${path[2]}</code>’ rather than
|
|||
|
just ‘<code>$path[2]</code>’) or to apply modifiers to any parameter (‘<code>${PWD:h}</code>’
|
|||
|
rather than ‘<code>$PWD:h</code>’).</p>
|
|||
|
<p><span id="index-KSH_005fAUTOLOAD"></span>
|
|||
|
<span id="index-NO_005fKSH_005fAUTOLOAD"></span>
|
|||
|
<span id="index-KSHAUTOLOAD"></span>
|
|||
|
<span id="index-NOKSHAUTOLOAD"></span></p>
|
|||
|
<p><code>KSH_AUTOLOAD</code> <K> <S></p>
|
|||
|
<p>Emulate ksh function autoloading. This means that when a function is
|
|||
|
autoloaded, the corresponding file is merely executed, and must define
|
|||
|
the function itself. (By default, the function is defined to the
|
|||
|
contents of the file. However, the most common ksh-style case - of the
|
|||
|
file containing only a simple definition of the function - is always
|
|||
|
handled in the ksh-compatible manner.)</p>
|
|||
|
<p><span id="index-KSH_005fOPTION_005fPRINT"></span>
|
|||
|
<span id="index-NO_005fKSH_005fOPTION_005fPRINT"></span>
|
|||
|
<span id="index-KSHOPTIONPRINT"></span>
|
|||
|
<span id="index-NOKSHOPTIONPRINT"></span>
|
|||
|
<span id="index-option-printing_002c-ksh-style"></span>
|
|||
|
<span id="index-option-printing-style_002c-ksh"></span>
|
|||
|
<span id="index-ksh_002c-option-printing-style"></span></p>
|
|||
|
<p><code>KSH_OPTION_PRINT</code> <K></p>
|
|||
|
<p>Alters the way options settings are printed: instead of separate lists
|
|||
|
of set and unset options, all options are shown, marked ‘on’ if they are
|
|||
|
in the non-default state, ‘off’ otherwise.</p>
|
|||
|
<p><span id="index-KSH_005fTYPESET"></span>
|
|||
|
<span id="index-NO_005fKSH_005fTYPESET"></span>
|
|||
|
<span id="index-KSHTYPESET"></span>
|
|||
|
<span id="index-NOKSHTYPESET"></span>
|
|||
|
<span id="index-argument-splitting_002c-in-typeset-etc_002e"></span>
|
|||
|
<span id="index-ksh_002c-argument-splitting-in-typeset"></span></p>
|
|||
|
<p><code>KSH_TYPESET</code></p>
|
|||
|
<p>This option is now obsolete: a better appropximation to the behaviour of
|
|||
|
other shells is obtained with the reserved word interface to <code>declare</code>,
|
|||
|
<code>export</code>, <code>float</code>, <code>integer</code>, <code>local</code>, <code>readonly</code> and <code>typeset</code>. Note
|
|||
|
that the option is only applied when the reserved word interface is
|
|||
|
<em>not</em> in use.</p>
|
|||
|
<p>Alters the way arguments to the <code>typeset</code> family of commands, including
|
|||
|
<code>declare</code>, <code>export</code>, <code>float</code>, <code>integer</code>, <code>local</code> and <code>readonly</code>, are
|
|||
|
processed. Without this option, zsh will perform normal word splitting
|
|||
|
after command and parameter expansion in arguments of an assignment;
|
|||
|
with it, word splitting does not take place in those cases.</p>
|
|||
|
<p><span id="index-KSH_005fZERO_005fSUBSCRIPT"></span>
|
|||
|
<span id="index-NO_005fKSH_005fZERO_005fSUBSCRIPT"></span>
|
|||
|
<span id="index-KSHZEROSUBSCRIPT"></span>
|
|||
|
<span id="index-NOKSHZEROSUBSCRIPT"></span>
|
|||
|
<span id="index-arrays_002c-behaviour-of-index-zero"></span></p>
|
|||
|
<p><code>KSH_ZERO_SUBSCRIPT</code></p>
|
|||
|
<p>Treat use of a subscript of value zero in array or string expressions as
|
|||
|
a reference to the first element, i.e. the element that usually has the
|
|||
|
subscript 1. Ignored if <code>KSH_ARRAYS</code> is also set.</p>
|
|||
|
<p>If neither this option nor <code>KSH_ARRAYS</code> is set, accesses to an element
|
|||
|
of an array or string with subscript zero return an empty element or
|
|||
|
string, while attempts to set element zero of an array or string are
|
|||
|
treated as an error. However, attempts to set an otherwise valid
|
|||
|
subscript range that includes zero will succeed. For example, if
|
|||
|
<code>KSH_ZERO_SUBSCRIPT</code> is not set,</p>
|
|||
|
<div class="example">
|
|||
|
<pre><code class="language-example">array[0]=(element)
|
|||
|
</code></pre>
|
|||
|
</div>
|
|||
|
<p>is an error, while</p>
|
|||
|
<div class="example">
|
|||
|
<pre><code class="language-example">array[0,1]=(element)
|
|||
|
</code></pre>
|
|||
|
</div>
|
|||
|
<p>is not and will replace the first element of the array.</p>
|
|||
|
<p>This option is for compatibility with older versions of the shell and is
|
|||
|
not recommended in new code.</p>
|
|||
|
<p><span id="index-POSIX_005fALIASES"></span>
|
|||
|
<span id="index-NO_005fPOSIX_005fALIASES"></span>
|
|||
|
<span id="index-POSIXALIASES"></span>
|
|||
|
<span id="index-NOPOSIXALIASES"></span></p>
|
|||
|
<p><code>POSIX_ALIASES</code> <K> <S></p>
|
|||
|
<p>When this option is set, reserved words are not candidates for alias
|
|||
|
expansion: it is still possible to declare any of them as an alias, but
|
|||
|
the alias will never be expanded. Reserved words are described in
|
|||
|
<a href="Shell-Grammar.html#Reserved-Words">Reserved Words</a>.</p>
|
|||
|
<p>Alias expansion takes place while text is being read; hence when this
|
|||
|
option is set it does not take effect until the end of any function or
|
|||
|
other piece of shell code parsed as one unit. Note this may cause
|
|||
|
differences from other shells even when the option is in effect. For
|
|||
|
example, when running a command with ‘<code>zsh -c</code>’, or even ‘<code>zsh -o posixaliases -c</code>’, the entire command argument is parsed as one unit, so
|
|||
|
aliases defined within the argument are not available even in later
|
|||
|
lines. If in doubt, avoid use of aliases in non-interactive code.</p>
|
|||
|
<p><span id="index-POSIX_005fARGZERO"></span>
|
|||
|
<span id="index-NO_005fPOSIX_005fARGZERO"></span>
|
|||
|
<span id="index-POSIXARGZERO"></span>
|
|||
|
<span id="index-NOPOSIXARGZERO"></span>
|
|||
|
<span id="index-_00240_002c-using"></span></p>
|
|||
|
<p><code>POSIX_ARGZERO</code></p>
|
|||
|
<p>This option may be used to temporarily disable <code>FUNCTION_ARGZERO</code> and
|
|||
|
thereby restore the value of <code>$0</code> to the name used to invoke the shell
|
|||
|
(or as set by the <code>-c</code> command line option). For compatibility with
|
|||
|
previous versions of the shell, emulations use <code>NO_FUNCTION_ARGZERO</code>
|
|||
|
instead of <code>POSIX_ARGZERO</code>, which may result in unexpected scoping of
|
|||
|
<code>$0</code> if the emulation mode is changed inside a function or script. To
|
|||
|
avoid this, explicitly enable <code>POSIX_ARGZERO</code> in the <code>emulate</code> command:</p>
|
|||
|
<div class="example">
|
|||
|
<pre><code class="language-example">emulate sh -o POSIX_ARGZERO
|
|||
|
</code></pre>
|
|||
|
</div>
|
|||
|
<p>Note that <code>NO_POSIX_ARGZERO</code> has no effect unless <code>FUNCTION_ARGZERO</code> was
|
|||
|
already enabled upon entry to the function or script.</p>
|
|||
|
<p><span id="index-POSIX_005fBUILTINS"></span>
|
|||
|
<span id="index-NO_005fPOSIX_005fBUILTINS"></span>
|
|||
|
<span id="index-POSIXBUILTINS"></span>
|
|||
|
<span id="index-NOPOSIXBUILTINS"></span></p>
|
|||
|
<p><code>POSIX_BUILTINS</code> <K> <S></p>
|
|||
|
<p>When this option is set the <code>command</code> builtin can be used to execute
|
|||
|
shell builtin commands. Parameter assignments specified before shell
|
|||
|
functions and special builtins are kept after the command completes
|
|||
|
unless the special builtin is prefixed with the <code>command</code> builtin.
|
|||
|
Special builtins are <code>.</code>, <code>:</code>, <code>break</code>, <code>continue</code>, <code>declare</code>, <code>eval</code>,
|
|||
|
<code>exit</code>, <code>export</code>, <code>integer</code>, <code>local</code>, <code>readonly</code>, <code>return</code>, <code>set</code>,
|
|||
|
<code>shift</code>, <code>source</code>, <code>times</code>, <code>trap</code> and <code>unset</code>.</p>
|
|||
|
<p>In addition, various error conditions associated with the above builtins
|
|||
|
or <code>exec</code> cause a non-interactive shell to exit and an interactive shell
|
|||
|
to return to its top-level processing.</p>
|
|||
|
<p>Furthermore, functions and shell builtins are not executed after an
|
|||
|
<code>exec</code> prefix; the command to be executed must be an external command
|
|||
|
found in the path.</p>
|
|||
|
<p>Furthermore, the <code>getopts</code> builtin behaves in a POSIX-compatible fashion
|
|||
|
in that the associated variable <code>OPTIND</code> is not made local to functions.</p>
|
|||
|
<p>Moreover, the warning and special exit code from <code>[[ -o ``non_existent_option`` ]]</code> are suppressed.</p>
|
|||
|
<p><span id="index-POSIX_005fIDENTIFIERS"></span>
|
|||
|
<span id="index-NO_005fPOSIX_005fIDENTIFIERS"></span>
|
|||
|
<span id="index-POSIXIDENTIFIERS"></span>
|
|||
|
<span id="index-NOPOSIXIDENTIFIERS"></span></p>
|
|||
|
<p><code>POSIX_IDENTIFIERS</code> <K> <S></p>
|
|||
|
<p>When this option is set, only the ASCII characters <code>a</code> to <code>z</code>, <code>A</code> to
|
|||
|
<code>Z</code>, <code>0</code> to <code>9</code> and <code>_</code> may be used in identifiers (names of shell
|
|||
|
parameters and modules).</p>
|
|||
|
<p>In addition, setting this option limits the effect of parameter
|
|||
|
substitution with no braces, so that the expression <code>$#</code> is treated as
|
|||
|
the parameter <code>$#</code> even if followed by a valid parameter name. When it
|
|||
|
is unset, zsh allows expressions of the form <code>$#``name</code> to refer to the
|
|||
|
length of <code>$``name</code>, even for special variables, for example in
|
|||
|
expressions such as <code>$#-</code> and <code>$#*</code>.</p>
|
|||
|
<p>Another difference is that with the option set assignment to an unset
|
|||
|
variable in arithmetic context causes the variable to be created as a
|
|||
|
scalar rather than a numeric type. So after ‘<code>unset t; (( t = 3 ))</code>’.
|
|||
|
without <code>POSIX_IDENTIFIERS</code> set <code>t</code> has integer type, while with it set
|
|||
|
it has scalar type.</p>
|
|||
|
<p>When the option is unset and multibyte character support is enabled
|
|||
|
(i.e. it is compiled in and the option <code>MULTIBYTE</code> is set), then
|
|||
|
additionally any alphanumeric characters in the local character set may
|
|||
|
be used in identifiers. Note that scripts and functions written with
|
|||
|
this feature are or function is parsed; setting them during execution is
|
|||
|
not sufficient as the syntax <code>variable``=``value</code> has already been
|
|||
|
parsed as a command rather than an assignment.</p>
|
|||
|
<p>If multibyte character support is not compiled into the shell this
|
|||
|
option is ignored; all octets with the top bit set may be used in
|
|||
|
identifiers. This is non-standard but is the traditional zsh behaviour.</p>
|
|||
|
<p><span id="index-POSIX_005fSTRINGS"></span>
|
|||
|
<span id="index-NO_005fPOSIX_005fSTRINGS"></span>
|
|||
|
<span id="index-POSIXSTRINGS"></span>
|
|||
|
<span id="index-NOPOSIXSTRINGS"></span>
|
|||
|
<span id="index-discarding-embedded-nulls-in-_0024_0027_002e_002e_002e_0027"></span>
|
|||
|
<span id="index-embedded-nulls_002c-in-_0024_0027_002e_002e_002e_0027"></span>
|
|||
|
<span id="index-nulls_002c-embedded-in-_0024_0027_002e_002e_002e_0027"></span></p>
|
|||
|
<p><code>POSIX_STRINGS</code> <K> <S></p>
|
|||
|
<p>This option affects processing of quoted strings. Currently it only
|
|||
|
affects the behaviour of null characters, i.e. character 0 in the</p>
|
|||
|
<p>When this option is not set, null characters embedded within strings of
|
|||
|
the form <code>$’``...``’</code> are treated as ordinary characters. The entire
|
|||
|
string is maintained within the shell and output to files where
|
|||
|
necessary, although owing to restrictions of the library interface the
|
|||
|
string is truncated at the null character in file names, environment
|
|||
|
variables, or in arguments to external programs.</p>
|
|||
|
<p>When this option is set, the <code>$’``...``’</code> expression is truncated at the
|
|||
|
null character. Note that remaining parts of the same string beyond the
|
|||
|
termination of the quotes are not truncated.</p>
|
|||
|
<p>For example, the command line argument <code>a$’b\0c’d</code> is treated with the
|
|||
|
option off as the characters <code>a</code>, <code>b</code>, null, <code>c</code>, <code>d</code>, and with the
|
|||
|
option on as the characters <code>a</code>, <code>b</code>, <code>d</code>.</p>
|
|||
|
<p><span id="index-POSIX_005fTRAPS"></span>
|
|||
|
<span id="index-NO_005fPOSIX_005fTRAPS"></span>
|
|||
|
<span id="index-POSIXTRAPS"></span>
|
|||
|
<span id="index-NOPOSIXTRAPS"></span>
|
|||
|
<span id="index-traps_002c-on-function-exit"></span>
|
|||
|
<span id="index-traps_002c-POSIX-compatibility"></span></p>
|
|||
|
<p><code>POSIX_TRAPS</code> <K> <S></p>
|
|||
|
<p>When this option is set, the usual zsh behaviour of executing traps for
|
|||
|
<code>EXIT</code> on exit from shell functions is suppressed. In that case,
|
|||
|
manipulating <code>EXIT</code> traps always alters the global trap for exiting the
|
|||
|
shell; the <code>LOCAL_TRAPS</code> option is ignored for the <code>EXIT</code> trap.
|
|||
|
Furthermore, a <code>return</code> statement executed in a trap with no argument
|
|||
|
passes back from the function the value from the surrounding context,
|
|||
|
not from code executed within the trap.</p>
|
|||
|
<p><span id="index-SH_005fFILE_005fEXPANSION"></span>
|
|||
|
<span id="index-NO_005fSH_005fFILE_005fEXPANSION"></span>
|
|||
|
<span id="index-SHFILEEXPANSION"></span>
|
|||
|
<span id="index-NOSHFILEEXPANSION"></span>
|
|||
|
<span id="index-sh_002c-expansion-style"></span>
|
|||
|
<span id="index-expansion-style_002c-sh"></span></p>
|
|||
|
<p><code>SH_FILE_EXPANSION</code> <K> <S></p>
|
|||
|
<p>Perform filename expansion (e.g., <code>~</code> expansion) <em>before</em> parameter
|
|||
|
expansion, command substitution, arithmetic expansion and brace
|
|||
|
expansion. If this option is unset, it is performed <em>after</em> brace
|
|||
|
expansion, so things like ‘<code>~$USERNAME</code>’ and ‘<code>~{pfalstad,rc}</code>’ will
|
|||
|
work.</p>
|
|||
|
<p><span id="index-SH_005fNULLCMD"></span>
|
|||
|
<span id="index-NO_005fSH_005fNULLCMD"></span>
|
|||
|
<span id="index-SHNULLCMD"></span> <span id="index-NOSHNULLCMD"></span>
|
|||
|
<span id="index-NULLCMD_002c-ignoring-1"></span>
|
|||
|
<span id="index-READNULLCMD_002c-ignoring-1"></span>
|
|||
|
<span id="index-sh_002c-redirections-with-no-command"></span>
|
|||
|
<span id="index-ksh_002c-redirections-with-no-command"></span>
|
|||
|
<span id="index-redirections-with-no-command_002c-sh"></span>
|
|||
|
<span id="index-redirections-with-no-command_002c-ksh"></span></p>
|
|||
|
<p><code>SH_NULLCMD</code> <K> <S></p>
|
|||
|
<p>Do not use the values of <code>NULLCMD</code> and <code>READNULLCMD</code> when doing
|
|||
|
redirections, use ‘<code>:</code>’ instead (see
|
|||
|
<a href="Redirection.html#Redirection">Redirection</a>).</p>
|
|||
|
<p><span id="index-SH_005fOPTION_005fLETTERS"></span>
|
|||
|
<span id="index-NO_005fSH_005fOPTION_005fLETTERS"></span>
|
|||
|
<span id="index-SHOPTIONLETTERS"></span>
|
|||
|
<span id="index-NOSHOPTIONLETTERS"></span>
|
|||
|
<span id="index-sh_002c-single-letter-options-style"></span>
|
|||
|
<span id="index-ksh_002c-single-letter-options-style"></span>
|
|||
|
<span id="index-single-letter-options_002c-ksh-style"></span>
|
|||
|
<span id="index-options_002c-single-letter_002c-ksh-style"></span></p>
|
|||
|
<p><code>SH_OPTION_LETTERS</code> <K> <S></p>
|
|||
|
<p>If this option is set the shell tries to interpret single letter options
|
|||
|
(which are used with <code>set</code> and <code>setopt</code>) like ksh does. This also
|
|||
|
affects the value of the <code>-</code> special parameter.</p>
|
|||
|
<p><span id="index-SH_005fWORD_005fSPLIT"></span>
|
|||
|
<span id="index-NO_005fSH_005fWORD_005fSPLIT"></span>
|
|||
|
<span id="index-SHWORDSPLIT"></span>
|
|||
|
<span id="index-NOSHWORDSPLIT"></span>
|
|||
|
<span id="index-field-splitting_002c-sh-style"></span>
|
|||
|
<span id="index-sh_002c-field-splitting-style"></span></p>
|
|||
|
<p><code>SH_WORD_SPLIT</code> (<code>-y</code>) <K> <S></p>
|
|||
|
<p>Causes field splitting to be performed on unquoted parameter expansions.
|
|||
|
Note that this option has nothing to do with word splitting. (See
|
|||
|
<a href="Expansion.html#Parameter-Expansion">Parameter Expansion</a>.)</p>
|
|||
|
<p><span id="index-TRAPS_005fASYNC"></span>
|
|||
|
<span id="index-NO_005fTRAPS_005fASYNC"></span>
|
|||
|
<span id="index-TRAPSASYNC"></span>
|
|||
|
<span id="index-NOTRAPSASYNC"></span>
|
|||
|
<span id="index-traps_002c-asynchronous"></span></p>
|
|||
|
<p><code>TRAPS_ASYNC</code></p>
|
|||
|
<p>While waiting for a program to exit, handle signals and run traps
|
|||
|
immediately. Otherwise the trap is run after a child process has exited.
|
|||
|
Note this does not affect the point at which traps are run for any case
|
|||
|
other than when the shell is waiting for a child process.</p>
|
|||
|
<hr />
|
|||
|
<p><span id="Shell-State"></span></p>
|
|||
|
<h3 id="16211-shell-state"><a class="header" href="#16211-shell-state">16.2.11 Shell State</a></h3>
|
|||
|
<p><span id="index-INTERACTIVE"></span>
|
|||
|
<span id="index-NO_005fINTERACTIVE"></span>
|
|||
|
<span id="index-NOINTERACTIVE"></span></p>
|
|||
|
<p><code>INTERACTIVE</code> (<code>-i</code>, ksh: <code>-i</code>)</p>
|
|||
|
<p>This is an interactive shell. This option is set upon initialisation if
|
|||
|
the standard input is a tty and commands are being read from standard
|
|||
|
input. (See the discussion of <code>SHIN_STDIN</code>.) This heuristic may be
|
|||
|
overridden by specifying a state for this option on the command line.
|
|||
|
The value of this option can only be changed via flags supplied at
|
|||
|
invocation of the shell. It cannot be changed once zsh is running.</p>
|
|||
|
<p><span id="index-LOGIN"></span> <span id="index-NO_005fLOGIN"></span>
|
|||
|
<span id="index-NOLOGIN"></span></p>
|
|||
|
<p><code>LOGIN</code> (<code>-l</code>, ksh: <code>-l</code>)</p>
|
|||
|
<p>This is a login shell. If this option is not explicitly set, the shell
|
|||
|
becomes a login shell if the first character of the <code>argv[0]</code> passed to
|
|||
|
the shell is a ‘<code>-</code>’.</p>
|
|||
|
<p><span id="index-PRIVILEGED"></span>
|
|||
|
<span id="index-NO_005fPRIVILEGED"></span>
|
|||
|
<span id="index-NOPRIVILEGED"></span>
|
|||
|
<span id="index-privileged-mode"></span>
|
|||
|
<span id="index-mode_002c-privileged"></span></p>
|
|||
|
<p><code>PRIVILEGED</code> (<code>-p</code>, ksh: <code>-p</code>)</p>
|
|||
|
<p>Turn on privileged mode. Typically this is used when script is to be run
|
|||
|
with elevated privileges. This should be done as follows directly with
|
|||
|
the <code>-p</code> option to zsh so that it takes effect during startup.</p>
|
|||
|
<div class="example">
|
|||
|
<pre><code class="language-example">#!/bin/zsh -p
|
|||
|
</code></pre>
|
|||
|
</div>
|
|||
|
<p>The option is enabled automatically on startup if the effective user
|
|||
|
(group) ID is not equal to the real user (group) ID. In this case,
|
|||
|
turning the option off causes the effective user and group IDs to be set
|
|||
|
to the real user and group IDs. Be aware that if that fails the shell
|
|||
|
may be running with different IDs than was intended so a script should
|
|||
|
check for failure and act accordingly, for example:</p>
|
|||
|
<div class="example">
|
|||
|
<pre><code class="language-example">unsetopt privileged || exit
|
|||
|
</code></pre>
|
|||
|
</div>
|
|||
|
<p>The <code>PRIVILEGED</code> option disables sourcing user startup files. If zsh is
|
|||
|
invoked as ‘<code>sh</code>’ or ‘<code>ksh</code>’ with this option set, <code>/etc/suid_profile</code>
|
|||
|
is sourced (after <code>/etc/profile</code> on interactive shells). Sourcing
|
|||
|
<code>~/.profile</code> is disabled and the contents of the <code>ENV</code> variable is
|
|||
|
ignored. This option cannot be changed using the <code>-m</code> option of <code>setopt</code>
|
|||
|
and <code>unsetopt</code>, and changing it inside a function always changes it
|
|||
|
globally regardless of the <code>LOCAL_OPTIONS</code> option.</p>
|
|||
|
<p><span id="index-RESTRICTED-1"></span>
|
|||
|
<span id="index-NO_005fRESTRICTED"></span>
|
|||
|
<span id="index-NORESTRICTED"></span>
|
|||
|
<span id="index-restricted-shell-1"></span></p>
|
|||
|
<p><code>RESTRICTED</code> (<code>-r</code>)</p>
|
|||
|
<p>Enables restricted mode. This option cannot be changed using <code>unsetopt</code>,
|
|||
|
and setting it inside a function always changes it globally regardless
|
|||
|
of the <code>LOCAL_OPTIONS</code> option. See <a href="Invocation.html#Restricted-Shell">Restricted
|
|||
|
Shell</a>.</p>
|
|||
|
<p><span id="index-SHIN_005fSTDIN"></span>
|
|||
|
<span id="index-NO_005fSHIN_005fSTDIN"></span>
|
|||
|
<span id="index-SHINSTDIN"></span> <span id="index-NOSHINSTDIN"></span></p>
|
|||
|
<p><code>SHIN_STDIN</code> (<code>-s</code>, ksh: <code>-s</code>)</p>
|
|||
|
<p>Commands are being read from the standard input. Commands are read from
|
|||
|
standard input if no command is specified with <code>-c</code> and no file of
|
|||
|
commands is specified. If <code>SHIN_STDIN</code> is set explicitly on the command
|
|||
|
line, any argument that would otherwise have been taken as a file to run
|
|||
|
will instead be treated as a normal positional parameter. Note that
|
|||
|
setting or unsetting this option on the command line does not
|
|||
|
necessarily affect the state the option will have while the shell is
|
|||
|
running - that is purely an indicator of whether or not commands are
|
|||
|
<em>actually</em> being read from standard input. The value of this option can
|
|||
|
only be changed via flags supplied at invocation of the shell. It cannot
|
|||
|
be changed once zsh is running.</p>
|
|||
|
<p><span id="index-SINGLE_005fCOMMAND"></span>
|
|||
|
<span id="index-NO_005fSINGLE_005fCOMMAND"></span>
|
|||
|
<span id="index-SINGLECOMMAND"></span>
|
|||
|
<span id="index-NOSINGLECOMMAND"></span>
|
|||
|
<span id="index-single-command"></span>
|
|||
|
<span id="index-INTERACTIVE_002c-use-of"></span></p>
|
|||
|
<p><code>SINGLE_COMMAND</code> (<code>-t</code>, ksh: <code>-t</code>)</p>
|
|||
|
<p>If the shell is reading from standard input, it exits after a single
|
|||
|
command has been executed. This also makes the shell non-interactive,
|
|||
|
unless the <code>INTERACTIVE</code> option is explicitly set on the command line.
|
|||
|
The value of this option can only be changed via flags supplied at
|
|||
|
invocation of the shell. It cannot be changed once zsh is running.</p>
|
|||
|
<hr />
|
|||
|
<p><span id="Zle"></span></p>
|
|||
|
<h3 id="16212-zle"><a class="header" href="#16212-zle">16.2.12 Zle</a></h3>
|
|||
|
<p><span id="index-BEEP"></span> <span id="index-NO_005fBEEP"></span>
|
|||
|
<span id="index-NOBEEP"></span>
|
|||
|
<span id="index-beep_002c-enabling"></span>
|
|||
|
<span id="index-enabling-the-beep"></span></p>
|
|||
|
<p><code>BEEP</code> (<code>+B</code>) <D></p>
|
|||
|
<p>Beep on error in ZLE.</p>
|
|||
|
<p><span id="index-COMBINING_005fCHARS"></span>
|
|||
|
<span id="index-NO_005fCOMBINING_005fCHARS"></span>
|
|||
|
<span id="index-COMBININGCHARS"></span>
|
|||
|
<span id="index-NOCOMBININGCHARS"></span>
|
|||
|
<span id="index-characters_002c-_0028Unicode_0029-combining"></span>
|
|||
|
<span id="index-combining-characters-_0028Unicode_0029"></span>
|
|||
|
<span id="index-Unicode-combining-characters"></span></p>
|
|||
|
<p><code>COMBINING_CHARS</code></p>
|
|||
|
<p>Assume that the terminal displays combining characters correctly.
|
|||
|
Specifically, if a base alphanumeric character is followed by one or
|
|||
|
more zero-width punctuation characters, assume that the zero-width
|
|||
|
characters will be displayed as modifications to the base character
|
|||
|
within the same width. Not all terminals handle this. If this option is
|
|||
|
not set, zero-width characters are displayed separately with special
|
|||
|
mark-up.</p>
|
|||
|
<p>If this option is set, the pattern test <code>[[:WORD:]]</code> matches a
|
|||
|
zero-width punctuation character on the assumption that it will be used
|
|||
|
as part of a word in combination with a word character. Otherwise the
|
|||
|
base shell does not handle combining characters specially.</p>
|
|||
|
<p><span id="index-EMACS"></span> <span id="index-NO_005fEMACS"></span>
|
|||
|
<span id="index-NOEMACS"></span></p>
|
|||
|
<p><code>EMACS</code></p>
|
|||
|
<p>If ZLE is loaded, turning on this option has the equivalent effect of
|
|||
|
‘<code>bindkey -e</code>’. In addition, the VI option is unset. Turning it off
|
|||
|
has no effect. The option setting is not guaranteed to reflect the
|
|||
|
current keymap. This option is provided for compatibility; <code>bindkey</code> is
|
|||
|
the recommended interface.</p>
|
|||
|
<p><span id="index-OVERSTRIKE"></span>
|
|||
|
<span id="index-NO_005fOVERSTRIKE"></span>
|
|||
|
<span id="index-NOOVERSTRIKE"></span>
|
|||
|
<span id="index-editor_002c-overstrike-mode"></span>
|
|||
|
<span id="index-overstrike-mode_002c-of-editor"></span></p>
|
|||
|
<p><code>OVERSTRIKE</code></p>
|
|||
|
<p>Start up the line editor in overstrike mode.</p>
|
|||
|
<p><span id="index-SINGLE_005fLINE_005fZLE"></span>
|
|||
|
<span id="index-NO_005fSINGLE_005fLINE_005fZLE"></span>
|
|||
|
<span id="index-SINGLELINEZLE"></span>
|
|||
|
<span id="index-NOSINGLELINEZLE"></span>
|
|||
|
<span id="index-editor_002c-single-line-mode"></span></p>
|
|||
|
<p><code>SINGLE_LINE_ZLE</code> (<code>-M</code>) <K></p>
|
|||
|
<p>Use single-line command line editing instead of multi-line.</p>
|
|||
|
<p>Note that although this is on by default in ksh emulation it only
|
|||
|
provides superficial compatibility with the ksh line editor and reduces
|
|||
|
the effectiveness of the zsh line editor. As it has no effect on shell
|
|||
|
syntax, many users may wish to disable this option when using ksh
|
|||
|
emulation interactively.</p>
|
|||
|
<p><span id="index-VI"></span> <span id="index-NO_005fVI"></span>
|
|||
|
<span id="index-NOVI"></span></p>
|
|||
|
<p><code>VI</code></p>
|
|||
|
<p>If ZLE is loaded, turning on this option has the equivalent effect of
|
|||
|
‘<code>bindkey -v</code>’. In addition, the EMACS option is unset. Turning it off
|
|||
|
has no effect. The option setting is not guaranteed to reflect the
|
|||
|
current keymap. This option is provided for compatibility; <code>bindkey</code> is
|
|||
|
the recommended interface.</p>
|
|||
|
<p><span id="index-ZLE"></span> <span id="index-NO_005fZLE"></span>
|
|||
|
<span id="index-NOZLE"></span>
|
|||
|
<span id="index-editor_002c-enabling"></span>
|
|||
|
<span id="index-enabling-the-editor"></span></p>
|
|||
|
<p><code>ZLE</code> (<code>-Z</code>)</p>
|
|||
|
<p>Use the zsh line editor. Set by default in interactive shells connected
|
|||
|
to a terminal.</p>
|
|||
|
<hr />
|
|||
|
<p><span id="Option-Aliases"></span> <span id="Option-Aliases-1"></span></p>
|
|||
|
<h2 id="163-option-aliases"><a class="header" href="#163-option-aliases">16.3 Option Aliases</a></h2>
|
|||
|
<p><span id="index-options_002c-aliases"></span></p>
|
|||
|
<p>Some options have alternative names. These aliases are never used for
|
|||
|
output, but can be used just like normal option names when specifying
|
|||
|
options to the shell.</p>
|
|||
|
<p><span id="index-BRACE_005fEXPAND"></span>
|
|||
|
<span id="index-NO_005fBRACE_005fEXPAND"></span>
|
|||
|
<span id="index-BRACEEXPAND"></span>
|
|||
|
<span id="index-NOBRACEEXPAND"></span></p>
|
|||
|
<p><code>BRACE_EXPAND</code></p>
|
|||
|
<p><em>NO_</em><code>IGNORE_BRACES</code> (ksh and bash compatibility)</p>
|
|||
|
<p><span id="index-DOT_005fGLOB"></span>
|
|||
|
<span id="index-NO_005fDOT_005fGLOB"></span>
|
|||
|
<span id="index-DOTGLOB"></span> <span id="index-NODOTGLOB"></span></p>
|
|||
|
<p><code>DOT_GLOB</code></p>
|
|||
|
<p><code>GLOB_DOTS</code> (bash compatibility)</p>
|
|||
|
<p><span id="index-HASH_005fALL"></span>
|
|||
|
<span id="index-NO_005fHASH_005fALL"></span>
|
|||
|
<span id="index-HASHALL"></span> <span id="index-NOHASHALL"></span></p>
|
|||
|
<p><code>HASH_ALL</code></p>
|
|||
|
<p><code>HASH_CMDS</code> (bash compatibility)</p>
|
|||
|
<p><span id="index-HIST_005fAPPEND"></span>
|
|||
|
<span id="index-NO_005fHIST_005fAPPEND"></span>
|
|||
|
<span id="index-HISTAPPEND"></span>
|
|||
|
<span id="index-NOHISTAPPEND"></span></p>
|
|||
|
<p><code>HIST_APPEND</code></p>
|
|||
|
<p><code>APPEND_HISTORY</code> (bash compatibility)</p>
|
|||
|
<p><span id="index-HIST_005fEXPAND"></span>
|
|||
|
<span id="index-NO_005fHIST_005fEXPAND"></span>
|
|||
|
<span id="index-HISTEXPAND"></span>
|
|||
|
<span id="index-NOHISTEXPAND"></span></p>
|
|||
|
<p><code>HIST_EXPAND</code></p>
|
|||
|
<p><code>BANG_HIST</code> (bash compatibility)</p>
|
|||
|
<p><span id="index-LOG"></span> <span id="index-NO_005fLOG"></span>
|
|||
|
<span id="index-NOLOG"></span></p>
|
|||
|
<p><code>LOG</code></p>
|
|||
|
<p><em>NO_</em><code>HIST_NO_FUNCTIONS</code> (ksh compatibility)</p>
|
|||
|
<p><span id="index-MAIL_005fWARN"></span>
|
|||
|
<span id="index-NO_005fMAIL_005fWARN"></span>
|
|||
|
<span id="index-MAILWARN"></span> <span id="index-NOMAILWARN"></span></p>
|
|||
|
<p><code>MAIL_WARN</code></p>
|
|||
|
<p><code>MAIL_WARNING</code> (bash compatibility)</p>
|
|||
|
<p><span id="index-ONE_005fCMD"></span>
|
|||
|
<span id="index-NO_005fONE_005fCMD"></span>
|
|||
|
<span id="index-ONECMD"></span> <span id="index-NOONECMD"></span></p>
|
|||
|
<p><code>ONE_CMD</code></p>
|
|||
|
<p><code>SINGLE_COMMAND</code> (bash compatibility)</p>
|
|||
|
<p><span id="index-PHYSICAL"></span>
|
|||
|
<span id="index-NO_005fPHYSICAL"></span>
|
|||
|
<span id="index-NOPHYSICAL"></span></p>
|
|||
|
<p><code>PHYSICAL</code></p>
|
|||
|
<p><code>CHASE_LINKS</code> (ksh and bash compatibility)</p>
|
|||
|
<p><span id="index-PROMPT_005fVARS"></span>
|
|||
|
<span id="index-NO_005fPROMPT_005fVARS"></span>
|
|||
|
<span id="index-PROMPTVARS"></span>
|
|||
|
<span id="index-NOPROMPTVARS"></span></p>
|
|||
|
<p><code>PROMPT_VARS</code></p>
|
|||
|
<p><code>PROMPT_SUBST</code> (bash compatibility)</p>
|
|||
|
<p><span id="index-STDIN"></span> <span id="index-NO_005fSTDIN"></span>
|
|||
|
<span id="index-NOSTDIN"></span></p>
|
|||
|
<p><code>STDIN</code></p>
|
|||
|
<p><code>SHIN_STDIN</code> (ksh compatibility)</p>
|
|||
|
<p><span id="index-TRACK_005fALL"></span>
|
|||
|
<span id="index-NO_005fTRACK_005fALL"></span>
|
|||
|
<span id="index-TRACKALL"></span> <span id="index-NOTRACKALL"></span></p>
|
|||
|
<p><code>TRACK_ALL</code></p>
|
|||
|
<p><code>HASH_CMDS</code> (ksh compatibility)</p>
|
|||
|
<hr />
|
|||
|
<p><span id="Single-Letter-Options"></span>
|
|||
|
<span id="Single-Letter-Options-1"></span></p>
|
|||
|
<h2 id="164-single-letter-options"><a class="header" href="#164-single-letter-options">16.4 Single Letter Options</a></h2>
|
|||
|
<p><span id="index-options_002c-single-letter"></span>
|
|||
|
<span id="index-single-letter-options"></span></p>
|
|||
|
<hr />
|
|||
|
<p><span id="Default-set"></span></p>
|
|||
|
<h3 id="1641-default-set"><a class="header" href="#1641-default-set">16.4.1 Default set</a></h3>
|
|||
|
<ul>
|
|||
|
<li>
|
|||
|
<p><code>-0</code><br />
|
|||
|
CORRECT</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-1</code><br />
|
|||
|
PRINT_EXIT_VALUE</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-2</code><br />
|
|||
|
*NO_*BAD_PATTERN</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-3</code><br />
|
|||
|
*NO_*NOMATCH</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-4</code><br />
|
|||
|
GLOB_DOTS</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-5</code><br />
|
|||
|
NOTIFY</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-6</code><br />
|
|||
|
BG_NICE</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-7</code><br />
|
|||
|
IGNORE_EOF</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-8</code><br />
|
|||
|
MARK_DIRS</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-9</code><br />
|
|||
|
AUTO_LIST</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-B</code><br />
|
|||
|
*NO_*BEEP</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-C</code><br />
|
|||
|
*NO_*CLOBBER</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-D</code><br />
|
|||
|
PUSHD_TO_HOME</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-E</code><br />
|
|||
|
PUSHD_SILENT</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-F</code><br />
|
|||
|
*NO_*GLOB</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-G</code><br />
|
|||
|
NULL_GLOB</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-H</code><br />
|
|||
|
RM_STAR_SILENT</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-I</code><br />
|
|||
|
IGNORE_BRACES</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-J</code><br />
|
|||
|
AUTO_CD</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-K</code><br />
|
|||
|
*NO_*BANG_HIST</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-L</code><br />
|
|||
|
SUN_KEYBOARD_HACK</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-M</code><br />
|
|||
|
SINGLE_LINE_ZLE</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-N</code><br />
|
|||
|
AUTO_PUSHD</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-O</code><br />
|
|||
|
CORRECT_ALL</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-P</code><br />
|
|||
|
RC_EXPAND_PARAM</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-Q</code><br />
|
|||
|
PATH_DIRS</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-R</code><br />
|
|||
|
LONG_LIST_JOBS</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-S</code><br />
|
|||
|
REC_EXACT</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-T</code><br />
|
|||
|
CDABLE_VARS</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-U</code><br />
|
|||
|
MAIL_WARNING</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-V</code><br />
|
|||
|
*NO_*PROMPT_CR</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-W</code><br />
|
|||
|
AUTO_RESUME</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-X</code><br />
|
|||
|
LIST_TYPES</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-Y</code><br />
|
|||
|
MENU_COMPLETE</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-Z</code><br />
|
|||
|
ZLE</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-a</code><br />
|
|||
|
ALL_EXPORT</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-e</code><br />
|
|||
|
ERR_EXIT</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-f</code><br />
|
|||
|
*NO_*RCS</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-g</code><br />
|
|||
|
HIST_IGNORE_SPACE</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-h</code><br />
|
|||
|
HIST_IGNORE_DUPS</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-i</code><br />
|
|||
|
INTERACTIVE</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-k</code><br />
|
|||
|
INTERACTIVE_COMMENTS</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-l</code><br />
|
|||
|
LOGIN</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-m</code><br />
|
|||
|
MONITOR</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-n</code><br />
|
|||
|
*NO_*EXEC</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-p</code><br />
|
|||
|
PRIVILEGED</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-r</code><br />
|
|||
|
RESTRICTED</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-s</code><br />
|
|||
|
SHIN_STDIN</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-t</code><br />
|
|||
|
SINGLE_COMMAND</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-u</code><br />
|
|||
|
*NO_*UNSET</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-v</code><br />
|
|||
|
VERBOSE</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-w</code><br />
|
|||
|
CHASE_LINKS</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-x</code><br />
|
|||
|
XTRACE</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-y</code><br />
|
|||
|
SH_WORD_SPLIT</p>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
<hr />
|
|||
|
<p><span id="sh_002fksh-emulation-set"></span></p>
|
|||
|
<h3 id="1642-shksh-emulation-set"><a class="header" href="#1642-shksh-emulation-set">16.4.2 sh/ksh emulation set</a></h3>
|
|||
|
<ul>
|
|||
|
<li>
|
|||
|
<p><code>-C</code><br />
|
|||
|
*NO_*CLOBBER</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-T</code><br />
|
|||
|
TRAPS_ASYNC</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-X</code><br />
|
|||
|
MARK_DIRS</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-a</code><br />
|
|||
|
ALL_EXPORT</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-b</code><br />
|
|||
|
NOTIFY</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-e</code><br />
|
|||
|
ERR_EXIT</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-f</code><br />
|
|||
|
*NO_*GLOB</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-i</code><br />
|
|||
|
INTERACTIVE</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-l</code><br />
|
|||
|
LOGIN</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-m</code><br />
|
|||
|
MONITOR</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-n</code><br />
|
|||
|
*NO_*EXEC</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-p</code><br />
|
|||
|
PRIVILEGED</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-r</code><br />
|
|||
|
RESTRICTED</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-s</code><br />
|
|||
|
SHIN_STDIN</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-t</code><br />
|
|||
|
SINGLE_COMMAND</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-u</code><br />
|
|||
|
*NO_*UNSET</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-v</code><br />
|
|||
|
VERBOSE</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-x</code><br />
|
|||
|
XTRACE</p>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
<hr />
|
|||
|
<p><span id="Also-note"></span></p>
|
|||
|
<h3 id="1643-also-note"><a class="header" href="#1643-also-note">16.4.3 Also note</a></h3>
|
|||
|
<ul>
|
|||
|
<li>
|
|||
|
<p><code>-A</code><br />
|
|||
|
Used by <code>set</code> for setting arrays</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-b</code><br />
|
|||
|
Used on the command line to specify end of option processing</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-c</code><br />
|
|||
|
Used on the command line to specify a single command</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-m</code><br />
|
|||
|
Used by <code>setopt</code> for pattern-matching option setting</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-o</code><br />
|
|||
|
Used in all places to allow use of long option names</p>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<p><code>-s</code><br />
|
|||
|
Used by <code>set</code> to sort positional parameters</p>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
<hr />
|
|||
|
<p>This document was generated on <em>February 15, 2020</em> using
|
|||
|
<a href="http://www.nongnu.org/texi2html/"><em>texi2html 5.0</em></a>.<br />
|
|||
|
Zsh version 5.8, released on February 14, 2020.</p>
|
|||
|
|
|||
|
</main>
|
|||
|
|
|||
|
<nav class="nav-wrapper" aria-label="Page navigation">
|
|||
|
<!-- Mobile navigation buttons -->
|
|||
|
|
|||
|
<a rel="prev" href="Parameters.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
|||
|
<i class="fa fa-angle-left"></i>
|
|||
|
</a>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<a rel="next" href="Shell-Builtin-Commands.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
|||
|
<i class="fa fa-angle-right"></i>
|
|||
|
</a>
|
|||
|
|
|||
|
|
|||
|
<div style="clear: both"></div>
|
|||
|
</nav>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<nav class="nav-wide-wrapper" aria-label="Page navigation">
|
|||
|
|
|||
|
<a rel="prev" href="Parameters.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
|||
|
<i class="fa fa-angle-left"></i>
|
|||
|
</a>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<a rel="next" href="Shell-Builtin-Commands.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
|||
|
<i class="fa fa-angle-right"></i>
|
|||
|
</a>
|
|||
|
|
|||
|
</nav>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<!-- Livereload script (if served using the cli tool) -->
|
|||
|
<script type="text/javascript">
|
|||
|
var socket = new WebSocket("ws://localhost:3000/__livereload");
|
|||
|
socket.onmessage = function (event) {
|
|||
|
if (event.data === "reload") {
|
|||
|
socket.close();
|
|||
|
location.reload();
|
|||
|
}
|
|||
|
};
|
|||
|
|
|||
|
window.onbeforeunload = function() {
|
|||
|
socket.close();
|
|||
|
}
|
|||
|
</script>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<script type="text/javascript">
|
|||
|
window.playground_copyable = true;
|
|||
|
</script>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<script src="elasticlunr.min.js" type="text/javascript" charset="utf-8"></script>
|
|||
|
<script src="mark.min.js" type="text/javascript" charset="utf-8"></script>
|
|||
|
<script src="searcher.js" type="text/javascript" charset="utf-8"></script>
|
|||
|
|
|||
|
|
|||
|
<script src="clipboard.min.js" type="text/javascript" charset="utf-8"></script>
|
|||
|
<script src="highlight.js" type="text/javascript" charset="utf-8"></script>
|
|||
|
<script src="book.js" type="text/javascript" charset="utf-8"></script>
|
|||
|
|
|||
|
<!-- Custom JS scripts -->
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</body>
|
|||
|
</html>
|