2021-05-11 02:29:21 +02:00
|
|
|
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
|
|
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
|
|
|
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
|
|
|
|
|
|
|
|
|
|
- [16 Options](#16-options)
|
|
|
|
|
- [16.1 Specifying Options](#161-specifying-options)
|
|
|
|
|
- [16.2 Description of Options](#162-description-of-options)
|
|
|
|
|
- [16.2.1 Changing Directories](#1621-changing-directories)
|
|
|
|
|
- [16.2.2 Completion](#1622-completion)
|
|
|
|
|
- [16.2.3 Expansion and Globbing](#1623-expansion-and-globbing)
|
|
|
|
|
- [16.2.4 History](#1624-history)
|
|
|
|
|
- [16.2.5 Initialisation](#1625-initialisation)
|
|
|
|
|
- [16.2.6 Input/Output](#1626-inputoutput)
|
|
|
|
|
- [16.2.7 Job Control](#1627-job-control)
|
|
|
|
|
- [16.2.8 Prompting](#1628-prompting)
|
|
|
|
|
- [16.2.9 Scripts and Functions](#1629-scripts-and-functions)
|
|
|
|
|
- [16.2.10 Shell Emulation](#16210-shell-emulation)
|
|
|
|
|
- [16.2.11 Shell State](#16211-shell-state)
|
|
|
|
|
- [16.2.12 Zle](#16212-zle)
|
|
|
|
|
- [16.3 Option Aliases](#163-option-aliases)
|
|
|
|
|
- [16.4 Single Letter Options](#164-single-letter-options)
|
|
|
|
|
- [16.4.1 Default set](#1641-default-set)
|
|
|
|
|
- [16.4.2 sh/ksh emulation set](#1642-shksh-emulation-set)
|
|
|
|
|
- [16.4.3 Also note](#1643-also-note)
|
|
|
|
|
|
|
|
|
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="Options"></span> <span id="Options-3"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
# 16 Options
|
|
|
|
|
|
|
|
|
|
<span id="index-options"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="Specifying-Options"></span> <span
|
|
|
|
|
id="Specifying-Options-1"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
## 16.1 Specifying Options
|
|
|
|
|
|
|
|
|
|
<span id="index-options_002c-specifying"></span>
|
|
|
|
|
|
|
|
|
|
Options are primarily referred to by name. These names are case
|
2022-08-24 15:13:36 +02:00
|
|
|
|
insensitive and underscores are ignored. For example, ‘allexport’ is
|
|
|
|
|
equivalent to ‘A\_\_lleXP_ort’.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
The sense of an option name may be inverted by preceding it with ‘no’,
|
|
|
|
|
so ‘setopt No_Beep’ is equivalent to ‘unsetopt beep’. This inversion can
|
|
|
|
|
only be done once, so ‘nonobeep’ is *not* a synonym for ‘beep’.
|
|
|
|
|
Similarly, ‘tify’ is not a synonym for ‘nonotify’ (the inversion of
|
|
|
|
|
‘notify’).
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
emulate sh/ksh (used when the SH_OPTION_LETTERS option is set). The
|
2021-05-11 02:29:21 +02:00
|
|
|
|
single letter options can be used on the shell command line, or with the
|
2022-08-24 15:13:36 +02:00
|
|
|
|
set, setopt and unsetopt builtins, as normal Unix options preceded by
|
|
|
|
|
‘-’.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
The sense of the single letter options may be inverted by using ‘+’
|
|
|
|
|
instead of ‘-’. Some of the single letter option names refer to an
|
2021-05-11 02:29:21 +02:00
|
|
|
|
option being off, in which case the inversion of that name refers to the
|
2022-08-24 15:13:36 +02:00
|
|
|
|
option being on. For example, ‘+n’ is the short name of ‘exec’, and ‘-n’
|
|
|
|
|
is the short name of its inversion, ‘noexec’.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
In strings of single letter options supplied to the shell at startup,
|
2022-08-24 15:13:36 +02:00
|
|
|
|
trailing whitespace will be ignored; for example the string ‘-f ’ will
|
|
|
|
|
be treated just as ‘-f’, but the string ‘-f i’ is an error. This is
|
|
|
|
|
because many systems which implement the ‘#!’ mechanism for calling
|
|
|
|
|
scripts do not strip trailing whitespace.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
It is possible for options to be set within a function scope. See the
|
|
|
|
|
description of the option LOCAL_OPTIONS below.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
<span id="Description-of-Options"></span> <span
|
|
|
|
|
id="Description-of-Options-1"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
## 16.2 Description of Options
|
|
|
|
|
|
|
|
|
|
<span id="index-options_002c-description"></span>
|
|
|
|
|
|
|
|
|
|
In the following list, options set by default in all emulations are
|
2022-08-24 15:13:36 +02:00
|
|
|
|
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 ‘setopt’, ‘unsetopt’, ‘set -o’ or ‘set +o’), those
|
|
|
|
|
turned on by default appear in the list prefixed with ‘no’. Hence
|
|
|
|
|
(unless KSH_OPTION_PRINT is set), ‘setopt’ shows all options whose
|
|
|
|
|
settings are changed from the default.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="Changing-Directories"></span>
|
|
|
|
|
|
|
|
|
|
### 16.2.1 Changing Directories
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
AUTO_CD (-J)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If a command is issued that can’t be executed as a normal command, and
|
2022-08-24 15:13:36 +02:00
|
|
|
|
the command is the name of a directory, perform the cd command to that
|
|
|
|
|
directory. This option is only applicable if the option SHIN_STDIN is
|
2021-05-11 02:29:21 +02:00
|
|
|
|
set, i.e. if commands are being read from standard input. The option is
|
2022-08-24 15:13:36 +02:00
|
|
|
|
designed for interactive use; it is recommended that cd be used
|
2021-05-11 02:29:21 +02:00
|
|
|
|
explicitly in scripts to avoid ambiguity.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
AUTO_PUSHD (-N)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Make cd push the old directory onto the directory stack.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-CDABLE_005fVARS"></span> <span
|
|
|
|
|
id="index-NO_005fCDABLE_005fVARS"></span> <span
|
|
|
|
|
id="index-CDABLEVARS"></span> <span id="index-NOCDABLEVARS"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-cd_002c-to-parameter"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
CDABLE_VARS (-T)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
If the argument to a cd command (or an implied cd with the AUTO_CD
|
2021-05-11 02:29:21 +02:00
|
|
|
|
option set) is not a directory, and does not begin with a slash, try to
|
2022-08-24 15:13:36 +02:00
|
|
|
|
expand the expression as if it were preceded by a ‘\~’ (see [Filename
|
2021-05-11 02:29:21 +02:00
|
|
|
|
Expansion](Expansion.html#Filename-Expansion)).
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
CD_SILENT
|
|
|
|
|
|
|
|
|
|
Never print the working directory after a cd (whether explicit or
|
|
|
|
|
implied with the AUTO_CD option set). cd normally prints the working
|
|
|
|
|
directory when the argument given to it was -, a stack entry, or the
|
|
|
|
|
name of a directory found under CDPATH. Note that this is distinct from
|
|
|
|
|
pushd’s stack-printing behaviour, which is controlled by PUSHD_SILENT.
|
|
|
|
|
This option overrides the printing-related effects of POSIX_CD.
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
CHASE_DOTS
|
|
|
|
|
|
|
|
|
|
When changing to a directory containing a path segment ‘..’ which would
|
|
|
|
|
otherwise be treated as canceling the previous segment in the path (in
|
|
|
|
|
other words, ‘foo/..’ would be removed from the path, or if ‘..’ 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 CHASE_LINKS.
|
|
|
|
|
|
|
|
|
|
For example, suppose /foo/bar is a link to the directory /alt/rod.
|
|
|
|
|
Without this option set, ‘cd /foo/bar/..’ changes to /foo; with it set,
|
|
|
|
|
it changes to /alt. The same applies if the current directory is
|
|
|
|
|
/foo/bar and ‘cd ..’ is used. Note that all other symbolic links in the
|
|
|
|
|
path will also be resolved.
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
CHASE_LINKS (-w)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Resolve symbolic links to their true values when changing directory.
|
2022-08-24 15:13:36 +02:00
|
|
|
|
This also has the effect of CHASE_DOTS, i.e. a ‘..’ path segment will be
|
|
|
|
|
treated as referring to the physical parent, even if the preceding path
|
|
|
|
|
segment is a symbolic link.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="index-POSIX_005fCD"></span> <span id="index-POSIXCD"></span>
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-NO_005fPOSIX_005fCD"></span> <span
|
|
|
|
|
id="index-NOPOSIXCD"></span> <span
|
|
|
|
|
id="index-CDPATH_002c-order-of-checking"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
POSIX_CD \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Modifies the behaviour of cd, chdir and pushd commands to make them more
|
|
|
|
|
compatible with the POSIX standard. The behaviour with the option unset
|
|
|
|
|
is described in the documentation for the cd builtin in [Shell Builtin
|
2021-05-11 02:29:21 +02:00
|
|
|
|
Commands](Shell-Builtin-Commands.html#Shell-Builtin-Commands). If the
|
|
|
|
|
option is set, the shell does not test for directories beneath the local
|
2022-08-24 15:13:36 +02:00
|
|
|
|
directory (‘.’) until after all directories in cdpath have been tested,
|
|
|
|
|
and the cd and chdir commands do not recognise arguments of the form
|
|
|
|
|
‘{+\|-}`n`’ as directory stack entries.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
stack with pushd is still limited to interactive shells); and any use of
|
|
|
|
|
a component of CDPATH, including a ‘.’ but excluding an empty component
|
|
|
|
|
that is otherwise treated as ‘.’, causes the directory to be printed.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PUSHD_IGNORE_DUPS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Don’t push multiple copies of the same directory onto the directory
|
|
|
|
|
stack.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-PUSHD_005fMINUS"></span> <span
|
|
|
|
|
id="index-NO_005fPUSHD_005fMINUS"></span> <span
|
|
|
|
|
id="index-PUSHDMINUS"></span> <span id="index-NOPUSHDMINUS"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-directory-stack_002c-controlling-syntax"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PUSHD_MINUS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Exchanges the meanings of ‘+’ and ‘-’ when used with a number to specify
|
|
|
|
|
a directory in the stack.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-PUSHD_005fSILENT"></span> <span
|
|
|
|
|
id="index-NO_005fPUSHD_005fSILENT"></span> <span
|
|
|
|
|
id="index-PUSHDSILENT"></span> <span id="index-NOPUSHDSILENT"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-directory-stack_002c-silencing"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PUSHD_SILENT (-E)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Do not print the directory stack after pushd or popd.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-pushd_002c-to-home"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PUSHD_TO_HOME (-D)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Have pushd with no arguments act like ‘pushd $HOME’.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="Completion-4"></span>
|
|
|
|
|
|
|
|
|
|
### 16.2.2 Completion
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
ALWAYS_LAST_PROMPT \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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 *no* numeric argument.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
ALWAYS_TO_END
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
AUTO_LIST (-9) \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Automatically list choices on an ambiguous completion.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
AUTO_MENU \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Automatically use menu completion after the second consecutive request
|
|
|
|
|
for completion, for example by pressing the tab key repeatedly. This
|
2022-08-24 15:13:36 +02:00
|
|
|
|
option is overridden by MENU_COMPLETE.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-directories_002c-named"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
AUTO_NAME_DIRS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
‘%\~’ and related prompt sequences, and will be available when
|
|
|
|
|
completion is performed on a word starting with ‘\~’. (Otherwise, the
|
|
|
|
|
parameter must be used in the form ‘\~`param`’ first.)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
AUTO_PARAM_KEYS \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If a parameter name was completed and a following character (normally a
|
|
|
|
|
space) automatically inserted, and the next character typed is one of
|
2022-08-24 15:13:36 +02:00
|
|
|
|
those that have to come directly after the name (like ‘}’, ‘:’, 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 ‘,’, which
|
|
|
|
|
will be removed if ‘}’ is typed next.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
AUTO_PARAM_SLASH \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If a parameter is completed whose content is the name of a directory,
|
|
|
|
|
then add a trailing slash instead of a space.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
AUTO_REMOVE_SLASH \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-completion_002c-listing-choices_002c-bash-style"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
BASH_AUTO_LIST
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
On an ambiguous completion, automatically list choices when the
|
|
|
|
|
completion function is called twice in succession. This takes precedence
|
2022-08-24 15:13:36 +02:00
|
|
|
|
over AUTO_LIST. The setting of LIST_AMBIGUOUS is respected. If AUTO_MENU
|
|
|
|
|
is set, the menu behaviour will then start with the third press. Note
|
|
|
|
|
that this will not work with MENU_COMPLETE, since repeated completion
|
|
|
|
|
calls immediately cycle through the list in that case.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
COMPLETE_ALIASES
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
COMPLETE_IN_WORD
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-GLOB_005fCOMPLETE"></span> <span
|
|
|
|
|
id="index-NO_005fGLOB_005fCOMPLETE"></span> <span
|
|
|
|
|
id="index-GLOBCOMPLETE"></span> <span id="index-NOGLOBCOMPLETE"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
GLOB_COMPLETE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
cycle through them like MENU_COMPLETE. The matches are generated as if a
|
|
|
|
|
‘\*’ was added to the end of the word, or inserted at the cursor when
|
|
|
|
|
COMPLETE_IN_WORD is set. This actually uses pattern matching, not
|
2021-05-11 02:29:21 +02:00
|
|
|
|
globbing, so it works not only for files but for any completion, such as
|
|
|
|
|
options, user names, etc.
|
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
turning on the GLOB_COMPLETE option does not have this effect.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HASH_LIST_ALL \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
LIST_AMBIGUOUS \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
This option works when AUTO_LIST or BASH_AUTO_LIST 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 BASH_AUTO_LIST, this means that the list will be delayed to the third
|
|
|
|
|
call of the function.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
LIST_BEEP \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Beep on an ambiguous completion. More accurately, this forces the
|
|
|
|
|
completion widgets to return status 1 on an ambiguous completion, which
|
2022-08-24 15:13:36 +02:00
|
|
|
|
causes the shell to beep if the option BEEP is also set; this may be
|
2021-05-11 02:29:21 +02:00
|
|
|
|
modified if completion is called from a user-defined widget.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-LIST_005fPACKED"></span> <span
|
|
|
|
|
id="index-NO_005fLIST_005fPACKED"></span> <span
|
|
|
|
|
id="index-LISTPACKED"></span> <span id="index-NOLISTPACKED"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-completion_002c-listing"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
LIST_PACKED
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Try to make the completion list smaller (occupying less lines) by
|
|
|
|
|
printing the matches in columns with different widths.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
LIST_ROWS_FIRST
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
LIST_TYPES (-X) \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
When listing files that are possible completions, show the type of each
|
|
|
|
|
file with a trailing identifying mark.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-MENU_005fCOMPLETE"></span> <span
|
|
|
|
|
id="index-NO_005fMENU_005fCOMPLETE"></span> <span
|
|
|
|
|
id="index-MENUCOMPLETE"></span> <span id="index-NOMENUCOMPLETE"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-completion_002c-menu-1"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
MENU_COMPLETE (-Y)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
2022-08-24 15:13:36 +02:00
|
|
|
|
reverse-menu-complete may be used to loop through the list in the other
|
|
|
|
|
direction. This option overrides AUTO_MENU.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
REC_EXACT (-S)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="Expansion-and-Globbing"></span>
|
|
|
|
|
|
|
|
|
|
### 16.2.3 Expansion and Globbing
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
BAD_PATTERN (+2) \<C> \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If a pattern for filename generation is badly formed, print an error
|
|
|
|
|
message. (If this option is unset, the pattern will be left unchanged.)
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
BARE_GLOB_QUAL \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
In a glob pattern, treat a trailing set of parentheses as a qualifier
|
2022-08-24 15:13:36 +02:00
|
|
|
|
list, if it contains no ‘\|’, ‘(’ or (if special) ‘\~’ characters. See
|
|
|
|
|
[Filename Generation](Expansion.html#Filename-Generation).
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
BRACE_CCL
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Expand expressions in braces which would not otherwise undergo brace
|
|
|
|
|
expansion to a lexically ordered list of all the characters. See [Brace
|
|
|
|
|
Expansion](Expansion.html#Brace-Expansion).
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
CASE_GLOB \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
will cause case-insensitive matching. For example, cvs(/) can match the
|
|
|
|
|
directory CVS owing to the presence of the globbing flag (unless the
|
|
|
|
|
option BARE_GLOB_QUAL is unset).
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
CASE_MATCH \<D>
|
|
|
|
|
|
|
|
|
|
Make regular expressions using the zsh/regex module (including matches
|
|
|
|
|
with =\~) sensitive to case.
|
|
|
|
|
|
|
|
|
|
<span id="index-CASE_005fPATHS"></span> <span
|
|
|
|
|
id="index-NO_005fCASE_005fPATHS"></span> <span
|
|
|
|
|
id="index-CASEPATHS"></span> <span id="index-NOCASEPATHS"></span> <span
|
|
|
|
|
id="index-case_002dsensitive-globbing_002c-option"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
CASE_PATHS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
If CASE_PATHS is not set (the default), CASE_GLOB affects the
|
|
|
|
|
interpretation of *every* path component, whenever a special character
|
|
|
|
|
appears in *any* component. When CASE_PATHS is set, file path components
|
|
|
|
|
that do *not* contain special filename generation characters are always
|
|
|
|
|
sensitive to case, thus restricting NO_CASE_GLOB to components that
|
|
|
|
|
contain globbing characters.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Note that if the filesystem itself is not sensitive to case, then
|
|
|
|
|
CASE_PATHS has no effect.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
CSH_NULL_GLOB \<C>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
in a command have no matches. Overrides NOMATCH.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="index-EQUALS"></span> <span id="index-NO_005fEQUALS"></span>
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-NOEQUALS"></span> <span
|
|
|
|
|
id="index-filename-expansion_002c-_003d"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
EQUALS \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Perform = filename expansion. (See [Filename
|
2021-05-11 02:29:21 +02:00
|
|
|
|
Expansion](Expansion.html#Filename-Expansion).)
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-EXTENDED_005fGLOB"></span> <span
|
|
|
|
|
id="index-NO_005fEXTENDED_005fGLOB"></span> <span
|
|
|
|
|
id="index-EXTENDEDGLOB"></span> <span id="index-NOEXTENDEDGLOB"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-globbing_002c-extended"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
EXTENDED_GLOB
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Treat the ‘#’, ‘\~’ and ‘^’ characters as part of patterns for filename
|
|
|
|
|
generation, etc. (An initial unquoted ‘\~’ always produces named
|
|
|
|
|
directory expansion.)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
FORCE_FLOAT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
GLOB (+F, ksh: +f) \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Perform filename generation (globbing). (See [Filename
|
|
|
|
|
Generation](Expansion.html#Filename-Generation).)
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-GLOB_005fASSIGN"></span> <span
|
|
|
|
|
id="index-NO_005fGLOB_005fASSIGN"></span> <span
|
|
|
|
|
id="index-GLOBASSIGN"></span> <span id="index-NOGLOBASSIGN"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
GLOB_ASSIGN \<C>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If this option is set, filename generation (globbing) is performed on
|
|
|
|
|
the right hand side of scalar parameter assignments of the form
|
2022-08-24 15:13:36 +02:00
|
|
|
|
‘`name`=`pattern` (e.g. ‘foo=\*’). 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
|
|
|
|
|
‘`name`=(`value`)’ (e.g. ‘foo=(\*)’) 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.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
GLOB_DOTS (-4)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Do not require a leading ‘.’ in a filename to be matched explicitly.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
GLOB_STAR_SHORT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
When this option is set and the default zsh-style globbing is in effect,
|
2022-08-24 15:13:36 +02:00
|
|
|
|
the pattern ‘\*\*/\*’ can be abbreviated to ‘\*\*’ and the pattern
|
|
|
|
|
‘\*\*\*/\*’ can be abbreviated to \*\*\*. Hence ‘\*\*.c’ finds a file
|
|
|
|
|
ending in .c in any subdirectory, and ‘\*\*\*.c’ does the same while
|
|
|
|
|
also following symbolic links. A / immediately after the ‘\*\*’ or
|
|
|
|
|
‘\*\*\*’ forces the pattern to be treated as the unabbreviated form.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-GLOB_005fSUBST"></span> <span
|
|
|
|
|
id="index-NO_005fGLOB_005fSUBST"></span> <span
|
|
|
|
|
id="index-GLOBSUBST"></span> <span id="index-NOGLOBSUBST"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
GLOB_SUBST \<C> \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_SUBST_PATTERN
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Substitutions using the :s and :& history modifiers are performed with
|
|
|
|
|
pattern matching instead of string matching. This occurs wherever
|
2021-05-11 02:29:21 +02:00
|
|
|
|
history modifiers are valid, including glob qualifiers and parameters.
|
|
|
|
|
See [Modifiers](Expansion.html#Modifiers).
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
IGNORE_BRACES (-I) \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Do not perform brace expansion. For historical reasons this also
|
2022-08-24 15:13:36 +02:00
|
|
|
|
includes the effect of the IGNORE_CLOSE_BRACES option.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
IGNORE_CLOSE_BRACES
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
When neither this option nor IGNORE_BRACES is set, a sole close brace
|
|
|
|
|
character ‘}’ is syntactically significant at any point on a command
|
2021-05-11 02:29:21 +02:00
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
in command position. Unlike IGNORE_BRACES, this option does not disable
|
|
|
|
|
brace expansion.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
For example, with both options unset a function may be defined in the
|
|
|
|
|
following fashion:
|
|
|
|
|
|
|
|
|
|
<div class="example">
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
```zsh
|
2021-05-11 02:29:21 +02:00
|
|
|
|
args() { echo $# }
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
while if either option is set, this does not work and something
|
|
|
|
|
equivalent to the following is required:
|
|
|
|
|
|
|
|
|
|
<div class="example">
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
```zsh
|
2021-05-11 02:29:21 +02:00
|
|
|
|
args() { echo $#; }
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-KSH_005fGLOB"></span> <span
|
|
|
|
|
id="index-NO_005fKSH_005fGLOB"></span> <span id="index-KSHGLOB"></span>
|
|
|
|
|
<span id="index-NOKSHGLOB"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
KSH_GLOB \<K>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
In pattern matching, the interpretation of parentheses is affected by a
|
2022-08-24 15:13:36 +02:00
|
|
|
|
preceding ‘@’, ‘\*’, ‘+’, ‘?’ or ‘!’. See [Filename
|
2021-05-11 02:29:21 +02:00
|
|
|
|
Generation](Expansion.html#Filename-Generation).
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
MAGIC_EQUAL_SUBST
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
All unquoted arguments of the form ‘`anything`=`expression`’ appearing
|
2021-05-11 02:29:21 +02:00
|
|
|
|
after the command name have filename expansion (that is, where
|
2022-08-24 15:13:36 +02:00
|
|
|
|
`expression` has a leading ‘\~’ or ‘=’) performed on `expression` as if
|
|
|
|
|
it were a parameter assignment. The argument is not otherwise treated
|
2021-05-11 02:29:21 +02:00
|
|
|
|
specially; it is passed to the command as a single argument, and not
|
2022-08-24 15:13:36 +02:00
|
|
|
|
used as an actual parameter assignment. For example, in echo
|
|
|
|
|
foo=\~/bar:\~/rod, both occurrences of \~ would be replaced. Note that
|
|
|
|
|
this happens anyway with typeset and similar statements.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
This option respects the setting of the KSH_TYPESET option. In other
|
2021-05-11 02:29:21 +02:00
|
|
|
|
words, if both options are in effect, arguments looking like assignments
|
|
|
|
|
will not undergo word splitting.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
MARK_DIRS (-8, ksh: -X)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Append a trailing ‘/’ to all directory names resulting from filename
|
2021-05-11 02:29:21 +02:00
|
|
|
|
generation (globbing).
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
MULTIBYTE \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
The option is on by default if the shell was compiled with
|
2022-08-24 15:13:36 +02:00
|
|
|
|
MULTIBYTE_SUPPORT; otherwise it is off by default and has no effect if
|
2021-05-11 02:29:21 +02:00
|
|
|
|
turned on.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
<span id="index-NOMATCH"></span> <span id="index-NO_005fNOMATCH"></span>
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-NONOMATCH"></span> <span
|
|
|
|
|
id="index-globbing_002c-no-matches"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
NOMATCH (+3) \<C> \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If a pattern for filename generation has no matches, print an error,
|
|
|
|
|
instead of leaving it unchanged in the argument list. This also applies
|
2022-08-24 15:13:36 +02:00
|
|
|
|
to file expansion of an initial ‘\~’ or ‘=’.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
NULL_GLOB (-G)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If a pattern for filename generation has no matches, delete the pattern
|
2022-08-24 15:13:36 +02:00
|
|
|
|
from the argument list instead of reporting an error. Overrides NOMATCH.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
NUMERIC_GLOB_SORT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If numeric filenames are matched by a filename generation pattern, sort
|
|
|
|
|
the filenames numerically rather than lexicographically.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
RC_EXPAND_PARAM (-P)
|
|
|
|
|
|
|
|
|
|
Array expansions of the form ‘`foo`${`xx`}`bar`’, where the parameter
|
|
|
|
|
`xx` is set to (`a b c`), are substituted with
|
|
|
|
|
‘`fooabar foobbar foocbar`’ instead of the default ‘`fooa b cbar`’. Note
|
|
|
|
|
that an empty array will therefore cause all arguments to be removed.
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
REMATCH_PCRE
|
|
|
|
|
|
|
|
|
|
If set, regular expression matching with the =\~ operator will use
|
|
|
|
|
Perl-Compatible Regular Expressions from the PCRE library. (The zsh/pcre
|
|
|
|
|
module must be available.) If not set, regular expressions will use the
|
|
|
|
|
extended regexp syntax provided by the system libraries.
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
SH_GLOB \<K> \<S>
|
|
|
|
|
|
|
|
|
|
Disables the special meaning of ‘(’, ‘\|’, ‘)’ and ’\<’ for globbing the
|
|
|
|
|
result of parameter and command substitutions, and in some other places
|
|
|
|
|
where the shell accepts patterns. If SH_GLOB is set but KSH_GLOB 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. !(true) is interpreted as if there were a space after
|
|
|
|
|
the !. This option is set by default if zsh is invoked as sh or ksh.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="index-UNSET"></span> <span id="index-NO_005fUNSET"></span>
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-NOUNSET"></span> <span
|
|
|
|
|
id="index-parameters_002c-substituting-unset"></span> <span
|
|
|
|
|
id="index-unset-parameters_002c-substituting"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
UNSET (+u, ksh: +u) \<K> \<S> \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
WARN_CREATE_GLOBAL
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
typeset -g 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
|
2021-05-11 02:29:21 +02:00
|
|
|
|
indicate an error.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
WARN_NESTED_VAR
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
warning. This is the companion to WARN_CREATE_GLOBAL as in this case the
|
|
|
|
|
warning is only printed when a parameter is *not* created. Where
|
|
|
|
|
possible, use of typeset -g to set the parameter suppresses the error,
|
2021-05-11 02:29:21 +02:00
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
‘functions -W’.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
For example, the following code produces a warning for the assignment
|
2022-08-24 15:13:36 +02:00
|
|
|
|
inside the function nested as that overrides the value within toplevel
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<div class="example">
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
```zsh
|
2021-05-11 02:29:21 +02:00
|
|
|
|
toplevel() {
|
|
|
|
|
local foo="in fn"
|
|
|
|
|
nested
|
|
|
|
|
}
|
|
|
|
|
nested() {
|
|
|
|
|
foo="in nested"
|
|
|
|
|
}
|
|
|
|
|
setopt warn_nested_var
|
|
|
|
|
toplevel
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="History"></span>
|
|
|
|
|
|
|
|
|
|
### 16.2.4 History
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
APPEND_HISTORY \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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%
|
2022-08-24 15:13:36 +02:00
|
|
|
|
beyond the value specified by $SAVEHIST (see also the HIST_SAVE_BY_COPY
|
|
|
|
|
option).
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
BANG_HIST (+K) \<C> \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Perform textual history expansion, csh-style, treating the character ‘!’
|
|
|
|
|
specially.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
EXTENDED_HISTORY \<C>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
‘: `<beginning time>`:`<elapsed seconds>`;`<command>`’.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_ALLOW_CLOBBER
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Add ‘\|’ to output redirections in the history. This allows history
|
|
|
|
|
references to clobber files even when CLOBBER is unset.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_BEEP \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Beep in ZLE when a widget attempts to access a history entry which isn’t
|
|
|
|
|
there.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_EXPIRE_DUPS_FIRST
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
should be sure to set the value of HISTSIZE to a larger number than
|
|
|
|
|
SAVEHIST in order to give you some room for the duplicated events,
|
|
|
|
|
otherwise this option will behave just like HIST_IGNORE_ALL_DUPS once
|
2021-05-11 02:29:21 +02:00
|
|
|
|
the history fills up with unique events.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_FCNTL_LOCK
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
When writing out the history file, by default zsh uses ad-hoc file
|
|
|
|
|
locking to avoid known problems with locking on some operating systems.
|
2022-08-24 15:13:36 +02:00
|
|
|
|
With this option locking is done by means of the system’s fcntl call,
|
2021-05-11 02:29:21 +02:00
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_FIND_NO_DUPS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_IGNORE_ALL_DUPS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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).
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_IGNORE_DUPS (-h)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Do not enter command lines into the history list if they are duplicates
|
|
|
|
|
of the previous event.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_IGNORE_SPACE (-g)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_LEX_WORDS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_NO_FUNCTIONS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_NO_STORE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Remove the history (fc -l) 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.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_REDUCE_BLANKS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Remove superfluous blanks from each command line being added to the
|
|
|
|
|
history list.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_SAVE_BY_COPY \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
When the history file is re-written, we normally write out a copy of the
|
2022-08-24 15:13:36 +02:00
|
|
|
|
file named $HISTFILE.new and then rename it over the old one. However,
|
2021-05-11 02:29:21 +02:00
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
When writing out a copy of the history file, zsh preserves the old
|
2022-08-24 15:13:36 +02:00
|
|
|
|
file’s permissions and group information, but will refuse to write out a
|
|
|
|
|
new file if it would change the history file’s owner.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_SAVE_NO_DUPS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
When writing out the history file, older commands that duplicate newer
|
|
|
|
|
ones are omitted.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-HIST_005fVERIFY"></span> <span
|
|
|
|
|
id="index-NO_005fHIST_005fVERIFY"></span> <span
|
|
|
|
|
id="index-HISTVERIFY"></span> <span id="index-NOHISTVERIFY"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-history_002c-verifying-substitution"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_VERIFY
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
INC_APPEND_HISTORY
|
|
|
|
|
|
|
|
|
|
This option works like APPEND_HISTORY except that new history lines are
|
|
|
|
|
added to the $HISTFILE 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 $SAVEHIST (see also the HIST_SAVE_BY_COPY
|
|
|
|
|
option).
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
INC_APPEND_HISTORY_TIME
|
|
|
|
|
|
|
|
|
|
This option is a variant of INC_APPEND_HISTORY 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 EXTENDED_HISTORY 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.
|
|
|
|
|
|
|
|
|
|
This option is only useful if INC_APPEND_HISTORY and SHARE_HISTORY are
|
|
|
|
|
turned off. The three options should be considered mutually exclusive.
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
SHARE_HISTORY \<K>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
This option both imports new commands from the history file, and also
|
|
|
|
|
causes your typed commands to be appended to the history file (the
|
2022-08-24 15:13:36 +02:00
|
|
|
|
latter is like specifying INC_APPEND_HISTORY, which should be turned off
|
|
|
|
|
if this option is in effect). The history lines are also output with
|
|
|
|
|
timestamps ala EXTENDED_HISTORY (which makes it easier to find the spot
|
|
|
|
|
where we left off reading the file after it gets re-written).
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
If you find that you want more control over when commands get imported,
|
2022-08-24 15:13:36 +02:00
|
|
|
|
you may wish to turn SHARE_HISTORY off, INC_APPEND_HISTORY or
|
|
|
|
|
INC_APPEND_HISTORY_TIME (see above) on, and then manually import
|
|
|
|
|
commands whenever you need them using ‘fc -RI’.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="Initialisation"></span>
|
|
|
|
|
|
|
|
|
|
### 16.2.5 Initialisation
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
ALL_EXPORT (-a, ksh: -a)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
All parameters subsequently defined are automatically exported.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-GLOBAL_005fEXPORT"></span> <span
|
|
|
|
|
id="index-NO_005fGLOBAL_005fEXPORT"></span> <span
|
|
|
|
|
id="index-GLOBALEXPORT"></span> <span id="index-NOGLOBALEXPORT"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-environment_002c-and-local-parameters"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
GLOBAL_EXPORT \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
If this option is set, passing the -x flag to the builtins declare,
|
|
|
|
|
float, integer, readonly and typeset (but not local) will also set the
|
|
|
|
|
-g flag; hence parameters exported to the environment will not be made
|
|
|
|
|
local to the enclosing function, unless they were already or the flag +g
|
|
|
|
|
is given explicitly. If the option is unset, exported parameters will be
|
|
|
|
|
made local in just the same way as any other parameter.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
This option is set by default for backward compatibility; it is not
|
|
|
|
|
recommended that its behaviour be relied upon. Note that the builtin
|
2022-08-24 15:13:36 +02:00
|
|
|
|
export always sets both the -x and -g flags, and hence its effect
|
2021-05-11 02:29:21 +02:00
|
|
|
|
extends beyond the scope of the enclosing function; this is the
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
GLOBAL_RCS (+d) \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
If this option is unset, the startup files /etc/zprofile, /etc/zshrc,
|
|
|
|
|
/etc/zlogin and /etc/zlogout will not be run. It can be disabled and
|
|
|
|
|
re-enabled at any time, including inside local startup files (.zshrc,
|
|
|
|
|
etc.).
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-RCS"></span> <span id="index-NO_005fRCS"></span> <span
|
|
|
|
|
id="index-NORCS"></span> <span
|
|
|
|
|
id="index-startup-files_002c-sourcing"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
RCS (+f) \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
After /etc/zshenv is sourced on startup, source the .zshenv,
|
|
|
|
|
/etc/zprofile, .zprofile, /etc/zshrc, .zshrc, /etc/zlogin, .zlogin, and
|
|
|
|
|
.zlogout files, as described in [Files](Files.html#Files). If this
|
|
|
|
|
option is unset, the /etc/zshenv 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.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="Input_002fOutput"></span>
|
|
|
|
|
|
|
|
|
|
### 16.2.6 Input/Output
|
|
|
|
|
|
|
|
|
|
<span id="index-ALIASES"></span> <span id="index-NO_005fALIASES"></span>
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-NOALIASES"></span> <span
|
|
|
|
|
id="index-aliases_002c-expansion"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
ALIASES \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Expand aliases.
|
|
|
|
|
|
|
|
|
|
<span id="index-CLOBBER"></span> <span id="index-NO_005fCLOBBER"></span>
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-NOCLOBBER"></span> <span
|
|
|
|
|
id="index-clobbering_002c-of-files"></span> <span
|
|
|
|
|
id="index-file-clobbering_002c-allowing"></span>
|
|
|
|
|
|
|
|
|
|
CLOBBER (+C, ksh: +C) \<D>
|
|
|
|
|
|
|
|
|
|
Allows ‘>’ redirection to truncate existing files. Otherwise ‘>!’ or
|
|
|
|
|
‘>\|’ must be used to truncate a file.
|
|
|
|
|
|
|
|
|
|
If the option is not set, and the option APPEND_CREATE is also not set,
|
|
|
|
|
‘>\>!’ or ‘>\>\|’ must be used to create a file. If either option is
|
|
|
|
|
set, ‘>\>’ may be used.
|
|
|
|
|
|
|
|
|
|
<span id="index-CLOBBER_005fEMPTY"></span> <span
|
|
|
|
|
id="index-NO_005fCLOBBER_005fEMPTY"></span> <span
|
|
|
|
|
id="index-CLOBBEREMPTY"></span> <span id="index-NOCLOBBEREMPTY"></span>
|
|
|
|
|
<span id="index-clobbering_002c-of-empty-files"></span> <span
|
|
|
|
|
id="index-file-clobbering_002c-of-empty-files"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
CLOBBER_EMPTY
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
This option is only used if the option CLOBBER is not set: note that it
|
|
|
|
|
is set by default.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
If this option is set, then regular files of zero length may be
|
|
|
|
|
ovewritten (‘clobbered’). Note that it is possible another process has
|
|
|
|
|
written to the file between this test and use of the file by the current
|
|
|
|
|
process. This option should therefore not be used in cases where files
|
|
|
|
|
to be clobbered may be written to asynchronously.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="index-CORRECT"></span> <span id="index-NO_005fCORRECT"></span>
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-NOCORRECT"></span> <span
|
|
|
|
|
id="index-correction_002c-spelling"></span> <span
|
|
|
|
|
id="index-spelling-correction"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
CORRECT (-0)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Try to correct the spelling of commands. Note that, when the
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HASH_LIST_ALL option is not set or when some directories in the path are
|
|
|
|
|
not readable, this may falsely report spelling errors the first time
|
2021-05-11 02:29:21 +02:00
|
|
|
|
some commands are used.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
The shell variable CORRECT_IGNORE may be set to a pattern to match words
|
|
|
|
|
that will never be offered as corrections.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-CORRECT_005fALL"></span> <span
|
|
|
|
|
id="index-NO_005fCORRECT_005fALL"></span> <span
|
|
|
|
|
id="index-CORRECTALL"></span> <span id="index-NOCORRECTALL"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
CORRECT_ALL (-O)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Try to correct the spelling of all arguments in a line.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
The shell variable CORRECT_IGNORE_FILE may be set to a pattern to match
|
|
|
|
|
file names that will never be offered as corrections.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="index-DVORAK"></span> <span id="index-NO_005fDVORAK"></span>
|
|
|
|
|
<span id="index-NODVORAK"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
DVORAK
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Use the Dvorak keyboard instead of the standard qwerty keyboard as a
|
2022-08-24 15:13:36 +02:00
|
|
|
|
basis for examining spelling mistakes for the CORRECT and CORRECT_ALL
|
|
|
|
|
options and the spell-word editor command.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-FLOW_005fCONTROL"></span> <span
|
|
|
|
|
id="index-NO_005fFLOW_005fCONTROL"></span> <span
|
|
|
|
|
id="index-FLOWCONTROL"></span> <span id="index-NOFLOWCONTROL"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-flow-control"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
FLOW_CONTROL \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If this option is unset, output flow control via start/stop characters
|
|
|
|
|
(usually assigned to ^S/^Q) is disabled in the shell’s editor.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
IGNORE_EOF (-7)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Do not exit on end-of-file. Require the use of exit or logout instead.
|
|
|
|
|
However, ten consecutive EOFs will cause the shell to exit anyway, to
|
|
|
|
|
avoid the shell hanging if its tty goes away.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
INTERACTIVE_COMMENTS (-k) \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Allow comments even in interactive shells.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HASH_CMDS \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
at all. However, when CORRECT is set, commands whose names do not appear
|
|
|
|
|
in reporting them as spelling errors.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HASH_DIRS \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
neither HASH_CMDS nor CORRECT is set.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HASH_EXECUTABLES_ONLY
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
When hashing commands because of HASH_CMDS, check that the is unset by
|
2021-05-11 02:29:21 +02:00
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-MAIL_005fWARNING"></span> <span
|
|
|
|
|
id="index-NO_005fMAIL_005fWARNING"></span> <span
|
|
|
|
|
id="index-MAILWARNING"></span> <span id="index-NOMAILWARNING"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-mail_002c-warning-of-reading"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
MAIL_WARNING (-U)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Print a warning message if a mail file has been accessed since the shell
|
|
|
|
|
last checked.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PATH_DIRS (-Q)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Perform a path search even on command names with slashes in them. Thus
|
2022-08-24 15:13:36 +02:00
|
|
|
|
if ‘/usr/local/bin’ is in the user’s path, and he or she types
|
|
|
|
|
‘X11/xinit’, the command ‘/usr/local/bin/X11/xinit’ will be executed
|
|
|
|
|
(assuming it exists). Commands explicitly beginning with ‘/’, ‘./’ or
|
|
|
|
|
‘../’ are not subject to the path search. This also applies to the ‘.’
|
|
|
|
|
and source builtins.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Note that subdirectories of the current directory are always searched
|
2022-08-24 15:13:36 +02:00
|
|
|
|
for indicated by this option, and regardless of whether ‘.’ or the
|
2021-05-11 02:29:21 +02:00
|
|
|
|
current directory appear in the command search path.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-PATH_005fSCRIPT"></span> <span
|
|
|
|
|
id="index-NO_005fPATH_005fSCRIPT"></span> <span
|
|
|
|
|
id="index-PATHSCRIPT"></span> <span id="index-NOPATHSCRIPT"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-path-search_002c-for-script-argument-to-shell"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PATH_SCRIPT \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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 [Invocation](Invocation.html#Invocation).
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PRINT_EIGHT_BIT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Print eight bit characters literally in completion lists, etc. This
|
|
|
|
|
option is not necessary if your system correctly returns the
|
2022-08-24 15:13:36 +02:00
|
|
|
|
printability of eight bit characters (see ctype(3)).
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PRINT_EXIT_VALUE (-1)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Print the exit value of programs with non-zero exit status. This is only
|
|
|
|
|
available at the command line in interactive shells.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
RC_QUOTES
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Allow the character sequence ‘’’’ to signify a single quote within
|
2021-05-11 02:29:21 +02:00
|
|
|
|
singly quoted strings. Note this does not apply in quoted strings using
|
2022-08-24 15:13:36 +02:00
|
|
|
|
the format $’`...`’, where a backslashed single quote can be used.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
RM_STAR_SILENT (-H) \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Do not query the user before executing ‘rm \*’ or ‘rm path/\*’.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
RM_STAR_WAIT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
If querying the user before executing ‘rm \*’ or ‘rm path/\*’, first
|
2021-05-11 02:29:21 +02:00
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
the ‘\*’ in ZLE (with tab).
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-SHORT_005fLOOPS"></span> <span
|
|
|
|
|
id="index-NO_005fSHORT_005fLOOPS"></span> <span
|
|
|
|
|
id="index-SHORTLOOPS"></span> <span id="index-NOSHORTLOOPS"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
SHORT_LOOPS \<C> \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Allow the short forms of for, repeat, select, if, and function
|
2021-05-11 02:29:21 +02:00
|
|
|
|
constructs.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-SHORT_005fREPEAT"></span> <span
|
|
|
|
|
id="index-NO_005fSHORT_005fREPEAT"></span> <span
|
|
|
|
|
id="index-SHORTREPEAT"></span> <span id="index-NOSHORTREPEAT"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
SHORT_REPEAT
|
|
|
|
|
|
|
|
|
|
Allow the short form repeat as SHORT_LOOPS but without enabling it for
|
|
|
|
|
the other constructs.
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
SUN_KEYBOARD_HACK (-L)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
KEYBOARD_HACK lets you choose the character to be removed.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="Job-Control"></span>
|
|
|
|
|
|
|
|
|
|
### 16.2.7 Job Control
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
AUTO_CONTINUE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
with the disown builtin command are automatically sent a CONT signal to
|
|
|
|
|
make them running.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
AUTO_RESUME (-W)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Treat single word simple commands without redirection as candidates for
|
|
|
|
|
resumption of an existing job.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
BG_NICE (-6) \<C> \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Run all background jobs at a lower priority. This option is set by
|
|
|
|
|
default.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
CHECK_JOBS \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Report the status of background and suspended jobs before exiting a
|
|
|
|
|
shell with job control; a second attempt to exit the shell will succeed.
|
2022-08-24 15:13:36 +02:00
|
|
|
|
NO_CHECK_JOBS is best used only in combination with NO_HUP, else such
|
|
|
|
|
jobs will be killed automatically.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
The check is omitted if the commands run from the previous command line
|
2022-08-24 15:13:36 +02:00
|
|
|
|
included a ‘jobs’ command, since it is assumed the user is aware that
|
|
|
|
|
there are background or suspended jobs. A ‘jobs’ command run from one of
|
|
|
|
|
the hook functions defined in the section ‘Special Functions’ in
|
2021-05-11 02:29:21 +02:00
|
|
|
|
[Functions](Functions.html#Functions) is not counted for this purpose.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
CHECK_RUNNING_JOBS \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Check for both running and suspended jobs when CHECK_JOBS is enabled.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
When this option is disabled, zsh checks only for suspended jobs, which
|
|
|
|
|
matches the default behavior of bash.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
This option has no effect unless CHECK_JOBS is set.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-HUP"></span> <span id="index-NO_005fHUP"></span> <span
|
|
|
|
|
id="index-NOHUP"></span> <span id="index-jobs_002c-HUP"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HUP \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Send the HUP signal to running jobs when the shell exits.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-jobs_002c-list-format"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
LONG_LIST_JOBS (-R)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Print job notifications in the long format by default.
|
|
|
|
|
|
|
|
|
|
<span id="index-MONITOR"></span> <span id="index-NO_005fMONITOR"></span>
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-NOMONITOR"></span> <span
|
|
|
|
|
id="index-job-control_002c-allowing"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
MONITOR (-m, ksh: -m)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Allow job control. Set by default in interactive shells.
|
|
|
|
|
|
|
|
|
|
<span id="index-NOTIFY"></span> <span id="index-NO_005fNOTIFY"></span>
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-NONOTIFY"></span> <span
|
|
|
|
|
id="index-background-jobs_002c-notification"></span> <span
|
|
|
|
|
id="index-notification-of-background-jobs"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
NOTIFY (-5, ksh: -b) \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Report the status of background jobs immediately, rather than waiting
|
|
|
|
|
until just before printing a prompt.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
POSIX_JOBS \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
This option makes job control more compliant with the POSIX standard.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
When the option is not set, the MONITOR option is unset on entry to
|
2021-05-11 02:29:21 +02:00
|
|
|
|
subshells, so that job control is no longer active. When the option is
|
2022-08-24 15:13:36 +02:00
|
|
|
|
set, the MONITOR option and job control remain active in the subshell,
|
2021-05-11 02:29:21 +02:00
|
|
|
|
but note that the subshell has no access to jobs in the parent shell.
|
|
|
|
|
|
|
|
|
|
When the option is not set, jobs put in the background or foreground
|
2022-08-24 15:13:36 +02:00
|
|
|
|
with bg or fg are displayed with the same information that would be
|
|
|
|
|
reported by jobs. When the option is set, only the text is printed. The
|
|
|
|
|
output from jobs itself is not affected by the option.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
When the option is not set, job information from the parent shell is
|
|
|
|
|
saved for output within a subshell (for example, within a pipeline).
|
2022-08-24 15:13:36 +02:00
|
|
|
|
When the option is set, the output of jobs is empty until a job is
|
2021-05-11 02:29:21 +02:00
|
|
|
|
started within the subshell.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
In previous versions of the shell, it was necessary to enable POSIX_JOBS
|
|
|
|
|
in order for the builtin command wait to return the status of background
|
|
|
|
|
jobs that had already exited. This is no longer the case.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="Prompting"></span>
|
|
|
|
|
|
|
|
|
|
### 16.2.8 Prompting
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-PROMPT_005fBANG"></span> <span
|
|
|
|
|
id="index-NO_005fPROMPT_005fBANG"></span> <span
|
|
|
|
|
id="index-PROMPTBANG"></span> <span id="index-NOPROMPTBANG"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-prompt_002c-_0021-expansion"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PROMPT_BANG \<K>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
If set, ‘!’ is treated specially in prompt expansion. See [Prompt
|
2021-05-11 02:29:21 +02:00
|
|
|
|
Expansion](Prompt-Expansion.html#Prompt-Expansion).
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PROMPT_CR (+V) \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PROMPT_SP \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
the PROMPT_CR option. This works by outputting some cursor-control
|
2021-05-11 02:29:21 +02:00
|
|
|
|
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).
|
|
|
|
|
|
|
|
|
|
When a partial line is preserved, by default you will see an
|
2022-08-24 15:13:36 +02:00
|
|
|
|
inverse+bold character at the end of the partial line: a ‘%’ for a
|
|
|
|
|
normal user or a ‘#’ for root. If set, the shell parameter
|
|
|
|
|
PROMPT_EOL_MARK can be used to customize how the end of partial lines
|
2021-05-11 02:29:21 +02:00
|
|
|
|
are shown.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
NOTE: if the PROMPT_CR option is not set, enabling this option will have
|
|
|
|
|
no effect. This option is on by default.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PROMPT_PERCENT \<C> \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
If set, ‘%’ is treated specially in prompt expansion. See [Prompt
|
2021-05-11 02:29:21 +02:00
|
|
|
|
Expansion](Prompt-Expansion.html#Prompt-Expansion).
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-PROMPT_005fSUBST"></span> <span
|
|
|
|
|
id="index-NO_005fPROMPT_005fSUBST"></span> <span
|
|
|
|
|
id="index-PROMPTSUBST"></span> <span id="index-NOPROMPTSUBST"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-prompt_002c-parameter-expansion"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PROMPT_SUBST \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If set, *parameter expansion*, *command substitution* and *arithmetic
|
|
|
|
|
expansion* are performed in prompts. Substitutions within prompts do not
|
|
|
|
|
affect the command status.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-TRANSIENT_005fRPROMPT"></span> <span
|
|
|
|
|
id="index-NO_005fTRANSIENT_005fRPROMPT"></span> <span
|
|
|
|
|
id="index-TRANSIENTRPROMPT"></span> <span
|
|
|
|
|
id="index-NOTRANSIENTRPROMPT"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
TRANSIENT_RPROMPT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Remove any right prompt from display when accepting a command line. This
|
|
|
|
|
may be useful with terminals with other cut/paste methods.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="Scripts-and-Functions"></span>
|
|
|
|
|
|
|
|
|
|
### 16.2.9 Scripts and Functions
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-functions_002c-defining-with-expanded-aliases"></span>
|
|
|
|
|
<span id="index-aliases_002c-expanding-in-function-definition"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
ALIAS_FUNC_DEF \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
By default, zsh does not allow the definition of functions using the
|
2022-08-24 15:13:36 +02:00
|
|
|
|
‘`name` ()’ syntax if `name` was expanded as an alias: this causes an
|
|
|
|
|
error. This is usually the desired behaviour, as otherwise the
|
2021-05-11 02:29:21 +02:00
|
|
|
|
combination of an alias and a function based on the same definition can
|
|
|
|
|
easily cause problems.
|
|
|
|
|
|
|
|
|
|
When this option is set, aliases can be used for defining functions.
|
|
|
|
|
|
|
|
|
|
For example, consider the following definitions as they might occur in a
|
|
|
|
|
startup file.
|
|
|
|
|
|
|
|
|
|
<div class="example">
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
```zsh
|
2021-05-11 02:29:21 +02:00
|
|
|
|
alias foo=bar
|
|
|
|
|
foo() {
|
|
|
|
|
print This probably does not do what you expect.
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Here, foo is expanded as an alias to bar before the () is encountered,
|
|
|
|
|
so the function defined would be named bar. By default this is instead
|
|
|
|
|
an error in native mode. Note that quoting any part of the function
|
|
|
|
|
name, or using the keyword function, avoids the problem, so is
|
|
|
|
|
recommended when the function name can also be an alias.
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
C_BASES
|
|
|
|
|
|
|
|
|
|
Output hexadecimal numbers in the standard C format, for example ‘0xFF’
|
|
|
|
|
instead of the usual ‘16#FF’. If the option OCTAL_ZEROES is also set (it
|
|
|
|
|
is not by default), octal numbers will be treated similarly and hence
|
|
|
|
|
appear as ‘077’ instead of ‘8#77’. 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 C_BASES.
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
C_PRECEDENCES
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
This alters the precedence of arithmetic operators to be more like C and
|
|
|
|
|
other programming languages; [Arithmetic
|
|
|
|
|
Evaluation](Arithmetic-Evaluation.html#Arithmetic-Evaluation) has an
|
|
|
|
|
explicit list.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
DEBUG_BEFORE_CMD \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Run the DEBUG trap before each command; otherwise it is run after each
|
2021-05-11 02:29:21 +02:00
|
|
|
|
command. Setting this option mimics the behaviour of ksh 93; with the
|
|
|
|
|
option unset the behaviour is that of ksh 88.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
ERR_EXIT (-e, ksh: -e)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
If a command has a non-zero exit status, execute the ZERR trap, if set,
|
|
|
|
|
and exit. This is disabled while running initialization scripts.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
The behaviour is also disabled inside DEBUG traps. In this case the
|
2021-05-11 02:29:21 +02:00
|
|
|
|
option is handled specially: it is unset on entry to the trap. If the
|
2022-08-24 15:13:36 +02:00
|
|
|
|
option DEBUG_BEFORE_CMD is set, as it is by default, and the option
|
|
|
|
|
ERR_EXIT is found to have been set on exit, then the command for which
|
|
|
|
|
the DEBUG trap is being executed is skipped. The option is restored
|
2021-05-11 02:29:21 +02:00
|
|
|
|
after the trap exits.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Non-zero status in a command list containing && or \|\| is ignored for
|
2021-05-11 02:29:21 +02:00
|
|
|
|
commands not at the end of the list. Hence
|
|
|
|
|
|
|
|
|
|
<div class="example">
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
```zsh
|
2021-05-11 02:29:21 +02:00
|
|
|
|
false && true
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
does not trigger exit.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Exiting due to ERR_EXIT has certain interactions with asynchronous jobs
|
|
|
|
|
noted in [Jobs & Signals](Jobs-_0026-Signals.html#Jobs-_0026-Signals).
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
ERR_RETURN
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If a command has a non-zero exit status, return immediately from the
|
2022-08-24 15:13:36 +02:00
|
|
|
|
enclosing function. The logic is similar to that for ERR_EXIT, except
|
|
|
|
|
that an implicit return statement is executed instead of an exit. This
|
|
|
|
|
will trigger an exit at the outermost level of a non-interactive script.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Normally this option inherits the behaviour of ERR_EXIT that code
|
|
|
|
|
followed by ‘&&’ ‘\|\|’ does not trigger a return. Hence in the
|
2021-05-11 02:29:21 +02:00
|
|
|
|
following:
|
|
|
|
|
|
|
|
|
|
<div class="example">
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
```zsh
|
2021-05-11 02:29:21 +02:00
|
|
|
|
summit || true
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
no return is forced as the combined effect always has a zero return
|
|
|
|
|
status.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Note. however, that if summit in the above example is itself a function,
|
|
|
|
|
code inside it is considered separately: it may force a return from
|
|
|
|
|
summit (assuming the option remains set within summit), but not from the
|
|
|
|
|
enclosing context. This behaviour is different from ERR_EXIT which is
|
|
|
|
|
unaffected by function scope.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-EVAL_005fLINENO"></span> <span
|
|
|
|
|
id="index-NO_005fEVAL_005fLINENO"></span> <span
|
|
|
|
|
id="index-EVALLINENO"></span> <span id="index-NOEVALLINENO"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-line-number_002c-in-evaluated-expression"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
EVAL_LINENO \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
If set, line numbers of expressions evaluated using the builtin eval are
|
|
|
|
|
tracked separately of the enclosing environment. This applies both to
|
|
|
|
|
the parameter LINENO and the line number output by the prompt escape %i.
|
|
|
|
|
If the option is set, the prompt escape %N will output the string
|
|
|
|
|
‘(eval)’ instead of the script or function name as an indication. (The
|
|
|
|
|
two prompt escapes are typically used in the parameter PS4 to be output
|
|
|
|
|
when the option XTRACE is set.) If EVAL_LINENO is unset, the line number
|
|
|
|
|
of the surrounding script or function is retained during the evaluation.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-EXEC"></span> <span id="index-NO_005fEXEC"></span> <span
|
|
|
|
|
id="index-NOEXEC"></span> <span
|
|
|
|
|
id="index-command-execution_002c-enabling"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
EXEC (+n, ksh: +n) \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Do execute commands. Without this option, commands are read and checked
|
|
|
|
|
for syntax errors, but not executed. This option cannot be turned off in
|
2022-08-24 15:13:36 +02:00
|
|
|
|
an interactive shell, except when ‘-n’ is supplied to the shell at
|
2021-05-11 02:29:21 +02:00
|
|
|
|
startup.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
FUNCTION_ARGZERO \<C> \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
When executing a shell function or sourcing a script, set $0 temporarily
|
|
|
|
|
to the name of the function/script. Note that toggling FUNCTION_ARGZERO
|
|
|
|
|
from on to off (or off to on) does not change the current value of $0.
|
|
|
|
|
Only the state upon entry to the function or script has an effect.
|
|
|
|
|
Compare POSIX_ARGZERO.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
LOCAL_LOOPS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
When this option is not set, the effect of break and continue commands
|
|
|
|
|
may propagate outside function scope, affecting loops in calling
|
|
|
|
|
functions. When the option is set in a calling function, a break or a
|
|
|
|
|
continue 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.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-LOCAL_005fOPTIONS"></span> <span
|
|
|
|
|
id="index-NO_005fLOCAL_005fOPTIONS"></span> <span
|
|
|
|
|
id="index-LOCALOPTIONS"></span> <span id="index-NOLOCALOPTIONS"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
LOCAL_OPTIONS \<K>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
function are restored; options that are not restored are PRIVILEGED and
|
|
|
|
|
RESTRICTED. Otherwise, only this option, and the LOCAL_LOOPS, XTRACE and
|
|
|
|
|
PRINT_EXIT_VALUE 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 ‘emulate -L zsh’; the -L activates
|
|
|
|
|
LOCAL_OPTIONS.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-LOCAL_005fPATTERNS"></span> <span
|
|
|
|
|
id="index-NO_005fLOCAL_005fPATTERNS"></span> <span
|
|
|
|
|
id="index-LOCALPATTERNS"></span> <span
|
|
|
|
|
id="index-NOLOCALPATTERNS"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
LOCAL_PATTERNS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If this option is set at the point of return from a shell function, the
|
2022-08-24 15:13:36 +02:00
|
|
|
|
state of pattern disables, as set with the builtin command ‘disable -p’,
|
|
|
|
|
is restored to what it was when the function was entered. The behaviour
|
|
|
|
|
of this option is similar to the effect of LOCAL_OPTIONS on options;
|
|
|
|
|
hence ‘emulate -L sh’ (or indeed any other emulation with the -L option)
|
|
|
|
|
activates LOCAL_PATTERNS.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-LOCAL_005fTRAPS"></span> <span
|
|
|
|
|
id="index-NO_005fLOCAL_005fTRAPS"></span> <span
|
|
|
|
|
id="index-LOCALTRAPS"></span> <span id="index-NOLOCALTRAPS"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
LOCAL_TRAPS \<K>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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 *prior* to
|
2022-08-24 15:13:36 +02:00
|
|
|
|
altering the trap behaviour in a function; unlike LOCAL_OPTIONS, the
|
2021-05-11 02:29:21 +02:00
|
|
|
|
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,
|
|
|
|
|
|
|
|
|
|
<div class="example">
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
```zsh
|
2021-05-11 02:29:21 +02:00
|
|
|
|
unsetopt localtraps
|
|
|
|
|
trap - INT
|
|
|
|
|
fn() { setopt localtraps; trap '' INT; sleep 3; }
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
will restore normal handling of SIGINT after the function exits.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
MULTI_FUNC_DEF \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Allow definitions of multiple functions at once in the form ‘fn1
|
|
|
|
|
fn2`...`()’; if the option is not set, this causes a parse error.
|
|
|
|
|
Definition of multiple functions with the function keyword is always
|
2021-05-11 02:29:21 +02:00
|
|
|
|
allowed. Multiple function definitions are not often used and can cause
|
|
|
|
|
obscure errors.
|
|
|
|
|
|
|
|
|
|
<span id="index-MULTIOS"></span> <span id="index-NO_005fMULTIOS"></span>
|
|
|
|
|
<span id="index-NOMULTIOS"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
MULTIOS \<Z>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Perform implicit tees or cats when multiple redirections are attempted
|
|
|
|
|
(see [Redirection](Redirection.html#Redirection)).
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-OCTAL_005fZEROES"></span> <span
|
|
|
|
|
id="index-NO_005fOCTAL_005fZEROES"></span> <span
|
|
|
|
|
id="index-OCTALZEROES"></span> <span id="index-NOOCTALZEROES"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-octal_002c-arithmetic-expressions"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
OCTAL_ZEROES \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Sequences of digits indicating a numeric base such as the ‘08’ component
|
|
|
|
|
in ‘08#77’ are always interpreted as decimal, regardless of leading
|
|
|
|
|
zeroes.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PIPE_FAIL
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
By default, when a pipeline exits the exit status recorded by the shell
|
2022-08-24 15:13:36 +02:00
|
|
|
|
and returned by the shell variable $? reflects that of the rightmost
|
2021-05-11 02:29:21 +02:00
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-SOURCE_005fTRACE"></span> <span
|
|
|
|
|
id="index-NO_005fSOURCE_005fTRACE"></span> <span
|
|
|
|
|
id="index-SOURCETRACE"></span> <span id="index-NOSOURCETRACE"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
SOURCE_TRACE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
XTRACE option, with the message \<sourcetrace>. A file may be loaded by
|
|
|
|
|
the shell itself when it starts up and shuts down (Startup/Shutdown
|
|
|
|
|
Files) or by the use of the ‘source’ and ‘dot’ builtin commands.
|
|
|
|
|
|
|
|
|
|
<span id="index-TYPESET_005fSILENT"></span> <span
|
|
|
|
|
id="index-NO_005fTYPESET_005fSILENT"></span> <span
|
|
|
|
|
id="index-TYPESETSILENT"></span> <span
|
|
|
|
|
id="index-NOTYPESETSILENT"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
TYPESET_SILENT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
If this is unset, executing any of the ‘typeset’ 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
|
|
|
|
|
‘-m’ option. The option ‘-p’ is available whether or not the option is
|
|
|
|
|
set.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-TYPESET_005fTO_005fUNSET"></span> <span
|
|
|
|
|
id="index-NO_005fTYPESET_005fTO_005fUNSET"></span> <span
|
|
|
|
|
id="index-TYPESETTOUNSET"></span> <span
|
|
|
|
|
id="index-NOTYPESETTOUNSET"></span>
|
|
|
|
|
|
|
|
|
|
TYPESET_TO_UNSET \<K> \<S>
|
|
|
|
|
|
|
|
|
|
When declaring a new parameter with any of the ‘typeset’ family of
|
|
|
|
|
related commands, the parameter remains unset unless and until a value
|
|
|
|
|
is explicity assigned to it, either in the ‘typeset’ command itself or
|
|
|
|
|
as a later assignment statement.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="index-VERBOSE"></span> <span id="index-NO_005fVERBOSE"></span>
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-NOVERBOSE"></span> <span
|
|
|
|
|
id="index-tracing_002c-of-input-lines"></span> <span
|
|
|
|
|
id="index-input_002c-tracing"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
VERBOSE (-v, ksh: -v)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Print shell input lines as they are read.
|
|
|
|
|
|
|
|
|
|
<span id="index-XTRACE"></span> <span id="index-NO_005fXTRACE"></span>
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-NOXTRACE"></span> <span
|
|
|
|
|
id="index-tracing_002c-of-commands"></span> <span
|
|
|
|
|
id="index-commands_002c-tracing"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
XTRACE (-x, ksh: -x)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Print commands and their arguments as they are executed. The output is
|
2022-08-24 15:13:36 +02:00
|
|
|
|
preceded by the value of $PS4, formatted as described in [Prompt
|
2021-05-11 02:29:21 +02:00
|
|
|
|
Expansion](Prompt-Expansion.html#Prompt-Expansion).
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="Shell-Emulation"></span>
|
|
|
|
|
|
|
|
|
|
### 16.2.10 Shell Emulation
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
APPEND_CREATE \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
This option only applies when NO_CLOBBER (-C) is in effect.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If this option is not set, the shell will report an error when a append
|
2022-08-24 15:13:36 +02:00
|
|
|
|
redirection (>\>) is used on a file that does not already exists (the
|
|
|
|
|
traditional zsh behaviour of NO_CLOBBER). If the option is set, no error
|
|
|
|
|
is reported (POSIX behaviour).
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
BASH_REMATCH
|
|
|
|
|
|
|
|
|
|
When set, matches performed with the =\~ operator will set the
|
|
|
|
|
BASH_REMATCH array variable, instead of the default MATCH and match
|
|
|
|
|
variables. The first element of the BASH_REMATCH array will contain the
|
|
|
|
|
entire matched text and subsequent elements will contain extracted
|
|
|
|
|
substrings. This option makes more sense when KSH_ARRAYS 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 MATCH variable
|
|
|
|
|
contains the entire matched text and the match array variable contains
|
|
|
|
|
substrings.
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
BSD_ECHO \<S>
|
|
|
|
|
|
|
|
|
|
Make the echo builtin compatible with the BSD echo(1) command. This
|
|
|
|
|
disables backslashed escape sequences in echo strings unless the -e
|
|
|
|
|
option is specified.
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
CONTINUE_ON_ERROR
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If a fatal error is encountered (see
|
|
|
|
|
[Errors](Shell-Grammar.html#Errors)), 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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
CSH_JUNKIE_HISTORY \<C>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
CSH_JUNKIE_LOOPS \<C>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Allow loop bodies to take the form ‘`list`; end’ instead of ‘do `list`;
|
|
|
|
|
done’.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
CSH_JUNKIE_QUOTES \<C>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
strings, it is made impossible to escape ‘$’, ‘‘’ or ‘"’ (and ‘\\’
|
|
|
|
|
itself no longer needs escaping). Command substitutions are only
|
|
|
|
|
expanded once, and cannot be nested.
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
CSH_NULLCMD \<C>
|
|
|
|
|
|
|
|
|
|
Do not use the values of NULLCMD and READNULLCMD when running
|
2021-05-11 02:29:21 +02:00
|
|
|
|
redirections with no command. This make such redirections fail (see
|
|
|
|
|
[Redirection](Redirection.html#Redirection)).
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
KSH_ARRAYS \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
braces are required to delimit a subscript (‘${path\[2\]}’ rather than
|
|
|
|
|
just ‘$path\[2\]’) or to apply modifiers to any parameter (‘${PWD:h}’
|
|
|
|
|
rather than ‘$PWD:h’).
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-KSH_005fAUTOLOAD"></span> <span
|
|
|
|
|
id="index-NO_005fKSH_005fAUTOLOAD"></span> <span
|
|
|
|
|
id="index-KSHAUTOLOAD"></span> <span id="index-NOKSHAUTOLOAD"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
KSH_AUTOLOAD \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.)
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
KSH_OPTION_PRINT \<K>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-KSH_005fTYPESET"></span> <span
|
|
|
|
|
id="index-NO_005fKSH_005fTYPESET"></span> <span
|
|
|
|
|
id="index-KSHTYPESET"></span> <span id="index-NOKSHTYPESET"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-argument-splitting_002c-in-typeset-etc_002e"></span>
|
|
|
|
|
<span id="index-ksh_002c-argument-splitting-in-typeset"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
KSH_TYPESET
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
This option is now obsolete: a better appropximation to the behaviour of
|
2022-08-24 15:13:36 +02:00
|
|
|
|
other shells is obtained with the reserved word interface to declare,
|
|
|
|
|
export, float, integer, local, readonly and typeset. Note that the
|
|
|
|
|
option is only applied when the reserved word interface is *not* in use.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Alters the way arguments to the typeset family of commands, including
|
|
|
|
|
declare, export, float, integer, local and readonly, 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.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
KSH_ZERO_SUBSCRIPT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
subscript 1. Ignored if KSH_ARRAYS is also set.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
If neither this option nor KSH_ARRAYS is set, accesses to an element of
|
|
|
|
|
an array or string with subscript zero return an empty element or
|
2021-05-11 02:29:21 +02:00
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
KSH_ZERO_SUBSCRIPT is not set,
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<div class="example">
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
```zsh
|
2021-05-11 02:29:21 +02:00
|
|
|
|
array[0]=(element)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
is an error, while
|
|
|
|
|
|
|
|
|
|
<div class="example">
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
```zsh
|
2021-05-11 02:29:21 +02:00
|
|
|
|
array[0,1]=(element)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
is not and will replace the first element of the array.
|
|
|
|
|
|
|
|
|
|
This option is for compatibility with older versions of the shell and is
|
|
|
|
|
not recommended in new code.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-POSIX_005fALIASES"></span> <span
|
|
|
|
|
id="index-NO_005fPOSIX_005fALIASES"></span> <span
|
|
|
|
|
id="index-POSIXALIASES"></span> <span id="index-NOPOSIXALIASES"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
POSIX_ALIASES \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
[Reserved Words](Shell-Grammar.html#Reserved-Words).
|
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
example, when running a command with ‘zsh -c’, or even ‘zsh -o
|
|
|
|
|
posixaliases -c’, the entire command argument is parsed as one unit, so
|
2021-05-11 02:29:21 +02:00
|
|
|
|
aliases defined within the argument are not available even in later
|
|
|
|
|
lines. If in doubt, avoid use of aliases in non-interactive code.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-POSIX_005fARGZERO"></span> <span
|
|
|
|
|
id="index-NO_005fPOSIX_005fARGZERO"></span> <span
|
|
|
|
|
id="index-POSIXARGZERO"></span> <span id="index-NOPOSIXARGZERO"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-_00240_002c-using"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
POSIX_ARGZERO
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
This option may be used to temporarily disable FUNCTION_ARGZERO and
|
|
|
|
|
thereby restore the value of $0 to the name used to invoke the shell (or
|
|
|
|
|
as set by the -c command line option). For compatibility with previous
|
|
|
|
|
versions of the shell, emulations use NO_FUNCTION_ARGZERO instead of
|
|
|
|
|
POSIX_ARGZERO, which may result in unexpected scoping of $0 if the
|
|
|
|
|
emulation mode is changed inside a function or script. To avoid this,
|
|
|
|
|
explicitly enable POSIX_ARGZERO in the emulate command:
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<div class="example">
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
```zsh
|
2021-05-11 02:29:21 +02:00
|
|
|
|
emulate sh -o POSIX_ARGZERO
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Note that NO_POSIX_ARGZERO has no effect unless FUNCTION_ARGZERO was
|
2021-05-11 02:29:21 +02:00
|
|
|
|
already enabled upon entry to the function or script.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-POSIX_005fBUILTINS"></span> <span
|
|
|
|
|
id="index-NO_005fPOSIX_005fBUILTINS"></span> <span
|
|
|
|
|
id="index-POSIXBUILTINS"></span> <span
|
|
|
|
|
id="index-NOPOSIXBUILTINS"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
POSIX_BUILTINS \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
When this option is set the command 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 command builtin. Special builtins
|
|
|
|
|
are ., :, break, continue, declare, eval, exit, export, integer, local,
|
|
|
|
|
readonly, return, set, shift, source, times, trap and unset.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
In addition, various error conditions associated with the above builtins
|
2022-08-24 15:13:36 +02:00
|
|
|
|
or exec cause a non-interactive shell to exit and an interactive shell
|
2021-05-11 02:29:21 +02:00
|
|
|
|
to return to its top-level processing.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Furthermore, functions and shell builtins are not executed after an exec
|
|
|
|
|
prefix; the command to be executed must be an external command found in
|
|
|
|
|
the path.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Furthermore, the getopts builtin behaves in a POSIX-compatible fashion
|
|
|
|
|
in that the associated variable OPTIND is not made local to functions,
|
|
|
|
|
and its value is calculated differently to match other shells.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Moreover, the warning and special exit code from \[\[ -o
|
|
|
|
|
`non_existent_option` \]\] are suppressed.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-POSIX_005fIDENTIFIERS"></span> <span
|
|
|
|
|
id="index-NO_005fPOSIX_005fIDENTIFIERS"></span> <span
|
|
|
|
|
id="index-POSIXIDENTIFIERS"></span> <span
|
|
|
|
|
id="index-NOPOSIXIDENTIFIERS"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
POSIX_IDENTIFIERS \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
When this option is set, only the ASCII characters a to z, A to Z, 0 to
|
|
|
|
|
9 and \_ may be used in identifiers (names of shell parameters and
|
|
|
|
|
modules).
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
In addition, setting this option limits the effect of parameter
|
2022-08-24 15:13:36 +02:00
|
|
|
|
substitution with no braces, so that the expression $# is treated as the
|
|
|
|
|
parameter $# even if followed by a valid parameter name. When it is
|
|
|
|
|
unset, zsh allows expressions of the form $#`name` to refer to the
|
|
|
|
|
length of $`name`, even for special variables, for example in
|
|
|
|
|
expressions such as $#- and $#\*.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Another difference is that with the option set assignment to an unset
|
|
|
|
|
variable in arithmetic context causes the variable to be created as a
|
2022-08-24 15:13:36 +02:00
|
|
|
|
scalar rather than a numeric type. So after ‘unset t; (( t = 3 ))’.
|
|
|
|
|
without POSIX_IDENTIFIERS set t has integer type, while with it set it
|
|
|
|
|
has scalar type.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
When the option is unset and multibyte character support is enabled
|
2022-08-24 15:13:36 +02:00
|
|
|
|
(i.e. it is compiled in and the option MULTIBYTE is set), then
|
2021-05-11 02:29:21 +02:00
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
not sufficient as the syntax `variable`=`value` has already been parsed
|
|
|
|
|
as a command rather than an assignment.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
POSIX_STRINGS \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
This option affects processing of quoted strings. Currently it only
|
|
|
|
|
affects the behaviour of null characters, i.e. character 0 in the
|
|
|
|
|
|
|
|
|
|
When this option is not set, null characters embedded within strings of
|
2022-08-24 15:13:36 +02:00
|
|
|
|
the form $’`...`’ 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.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
When this option is set, the $’`...`’ expression is truncated at the
|
2021-05-11 02:29:21 +02:00
|
|
|
|
null character. Note that remaining parts of the same string beyond the
|
|
|
|
|
termination of the quotes are not truncated.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
For example, the command line argument a$’b\\0c’d is treated with the
|
|
|
|
|
option off as the characters a, b, null, c, d, and with the option on as
|
|
|
|
|
the characters a, b, d.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
POSIX_TRAPS \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
When this option is set, the usual zsh behaviour of executing traps for
|
2022-08-24 15:13:36 +02:00
|
|
|
|
EXIT on exit from shell functions is suppressed. In that case,
|
|
|
|
|
manipulating EXIT traps always alters the global trap for exiting the
|
|
|
|
|
shell; the LOCAL_TRAPS option is ignored for the EXIT trap.
|
|
|
|
|
|
|
|
|
|
Also, a return 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.
|
|
|
|
|
|
|
|
|
|
Furthermore, if a trap is set to be ignored, this state persists when a
|
|
|
|
|
subshell is entered. Without the option, the trap would be reset to its
|
|
|
|
|
default state at this point.
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
SH_FILE_EXPANSION \<K> \<S>
|
|
|
|
|
|
|
|
|
|
Perform filename expansion (e.g., \~ expansion) *before* parameter
|
2021-05-11 02:29:21 +02:00
|
|
|
|
expansion, command substitution, arithmetic expansion and brace
|
|
|
|
|
expansion. If this option is unset, it is performed *after* brace
|
2022-08-24 15:13:36 +02:00
|
|
|
|
expansion, so things like ‘\~$USERNAME’ and ‘\~{pfalstad,rc}’ will work.
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
SH_NULLCMD \<K> \<S>
|
|
|
|
|
|
|
|
|
|
Do not use the values of NULLCMD and READNULLCMD when doing
|
|
|
|
|
redirections, use ‘:’ instead (see
|
2021-05-11 02:29:21 +02:00
|
|
|
|
[Redirection](Redirection.html#Redirection)).
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
SH_OPTION_LETTERS \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If this option is set the shell tries to interpret single letter options
|
2022-08-24 15:13:36 +02:00
|
|
|
|
(which are used with set and setopt) like ksh does. This also affects
|
|
|
|
|
the value of the - special parameter.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
SH_WORD_SPLIT (-y) \<K> \<S>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Causes field splitting to be performed on unquoted parameter expansions.
|
|
|
|
|
Note that this option has nothing to do with word splitting. (See
|
|
|
|
|
[Parameter Expansion](Expansion.html#Parameter-Expansion).)
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-TRAPS_005fASYNC"></span> <span
|
|
|
|
|
id="index-NO_005fTRAPS_005fASYNC"></span> <span
|
|
|
|
|
id="index-TRAPSASYNC"></span> <span id="index-NOTRAPSASYNC"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-traps_002c-asynchronous"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
TRAPS_ASYNC
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="Shell-State"></span>
|
|
|
|
|
|
|
|
|
|
### 16.2.11 Shell State
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-INTERACTIVE"></span> <span
|
|
|
|
|
id="index-NO_005fINTERACTIVE"></span> <span
|
|
|
|
|
id="index-NOINTERACTIVE"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
INTERACTIVE (-i, ksh: -i)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
input. (See the discussion of SHIN_STDIN.) This heuristic may be
|
2021-05-11 02:29:21 +02:00
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
<span id="index-LOGIN"></span> <span id="index-NO_005fLOGIN"></span>
|
|
|
|
|
<span id="index-NOLOGIN"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
LOGIN (-l, ksh: -l)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
This is a login shell. If this option is not explicitly set, the shell
|
2022-08-24 15:13:36 +02:00
|
|
|
|
becomes a login shell if the first character of the argv\[0\] passed to
|
|
|
|
|
the shell is a ‘-’.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-PRIVILEGED"></span> <span
|
|
|
|
|
id="index-NO_005fPRIVILEGED"></span> <span
|
|
|
|
|
id="index-NOPRIVILEGED"></span> <span id="index-privileged-mode"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-mode_002c-privileged"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PRIVILEGED (-p, ksh: -p)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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
|
2022-08-24 15:13:36 +02:00
|
|
|
|
the -p option to zsh so that it takes effect during startup.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<div class="example">
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
```zsh
|
2021-05-11 02:29:21 +02:00
|
|
|
|
#!/bin/zsh -p
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
|
|
<div class="example">
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
```zsh
|
2021-05-11 02:29:21 +02:00
|
|
|
|
unsetopt privileged || exit
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
The PRIVILEGED option disables sourcing user startup files. If zsh is
|
|
|
|
|
invoked as ‘sh’ or ‘ksh’ with this option set, /etc/suid_profile is
|
|
|
|
|
sourced (after /etc/profile on interactive shells). Sourcing \~/.profile
|
|
|
|
|
is disabled and the contents of the ENV variable is ignored. This option
|
|
|
|
|
cannot be changed using the -m option of setopt and unsetopt, and
|
|
|
|
|
changing it inside a function always changes it globally regardless of
|
|
|
|
|
the LOCAL_OPTIONS option.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-RESTRICTED-1"></span> <span
|
|
|
|
|
id="index-NO_005fRESTRICTED"></span> <span
|
|
|
|
|
id="index-NORESTRICTED"></span> <span
|
|
|
|
|
id="index-restricted-shell-1"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
RESTRICTED (-r)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
Enables restricted mode. This option cannot be changed using unsetopt,
|
2021-05-11 02:29:21 +02:00
|
|
|
|
and setting it inside a function always changes it globally regardless
|
2022-08-24 15:13:36 +02:00
|
|
|
|
of the LOCAL_OPTIONS option. See [Restricted
|
2021-05-11 02:29:21 +02:00
|
|
|
|
Shell](Invocation.html#Restricted-Shell).
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-SHIN_005fSTDIN"></span> <span
|
|
|
|
|
id="index-NO_005fSHIN_005fSTDIN"></span> <span
|
|
|
|
|
id="index-SHINSTDIN"></span> <span id="index-NOSHINSTDIN"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
SHIN_STDIN (-s, ksh: -s)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Commands are being read from the standard input. Commands are read from
|
2022-08-24 15:13:36 +02:00
|
|
|
|
standard input if no command is specified with -c and no file of
|
|
|
|
|
commands is specified. If SHIN_STDIN is set explicitly on the command
|
2021-05-11 02:29:21 +02:00
|
|
|
|
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
|
|
|
|
|
*actually* 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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
SINGLE_COMMAND (-t, ksh: -t)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If the shell is reading from standard input, it exits after a single
|
|
|
|
|
command has been executed. This also makes the shell non-interactive,
|
2022-08-24 15:13:36 +02:00
|
|
|
|
unless the INTERACTIVE option is explicitly set on the command line. The
|
|
|
|
|
value of this option can only be changed via flags supplied at
|
2021-05-11 02:29:21 +02:00
|
|
|
|
invocation of the shell. It cannot be changed once zsh is running.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="Zle"></span>
|
|
|
|
|
|
|
|
|
|
### 16.2.12 Zle
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-BEEP"></span> <span id="index-NO_005fBEEP"></span> <span
|
|
|
|
|
id="index-NOBEEP"></span> <span id="index-beep_002c-enabling"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-enabling-the-beep"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
BEEP (+B) \<D>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Beep on error in ZLE.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
COMBINING_CHARS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
If this option is set, the pattern test \[\[:WORD:\]\] matches a
|
2021-05-11 02:29:21 +02:00
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
<span id="index-EMACS"></span> <span id="index-NO_005fEMACS"></span>
|
|
|
|
|
<span id="index-NOEMACS"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
EMACS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If ZLE is loaded, turning on this option has the equivalent effect of
|
2022-08-24 15:13:36 +02:00
|
|
|
|
‘bindkey -e’. 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; bindkey is the
|
|
|
|
|
recommended interface.
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
OVERSTRIKE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Start up the line editor in overstrike mode.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<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>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
SINGLE_LINE_ZLE (-M) \<K>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Use single-line command line editing instead of multi-line.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-VI"></span> <span id="index-NO_005fVI"></span> <span
|
|
|
|
|
id="index-NOVI"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
VI
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
If ZLE is loaded, turning on this option has the equivalent effect of
|
2022-08-24 15:13:36 +02:00
|
|
|
|
‘bindkey -v’. 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; bindkey is the
|
|
|
|
|
recommended interface.
|
|
|
|
|
|
|
|
|
|
<span id="index-ZLE"></span> <span id="index-NO_005fZLE"></span> <span
|
|
|
|
|
id="index-NOZLE"></span> <span id="index-editor_002c-enabling"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
<span id="index-enabling-the-editor"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
ZLE (-Z)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
Use the zsh line editor. Set by default in interactive shells connected
|
|
|
|
|
to a terminal.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="Option-Aliases"></span> <span id="Option-Aliases-1"></span>
|
|
|
|
|
|
|
|
|
|
## 16.3 Option Aliases
|
|
|
|
|
|
|
|
|
|
<span id="index-options_002c-aliases"></span>
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-BRACE_005fEXPAND"></span> <span
|
|
|
|
|
id="index-NO_005fBRACE_005fEXPAND"></span> <span
|
|
|
|
|
id="index-BRACEEXPAND"></span> <span id="index-NOBRACEEXPAND"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
BRACE_EXPAND
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
*NO\_*IGNORE_BRACES (ksh and bash compatibility)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-DOT_005fGLOB"></span> <span
|
|
|
|
|
id="index-NO_005fDOT_005fGLOB"></span> <span id="index-DOTGLOB"></span>
|
|
|
|
|
<span id="index-NODOTGLOB"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
DOT_GLOB
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
GLOB_DOTS (bash compatibility)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-HASH_005fALL"></span> <span
|
|
|
|
|
id="index-NO_005fHASH_005fALL"></span> <span id="index-HASHALL"></span>
|
|
|
|
|
<span id="index-NOHASHALL"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HASH_ALL
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HASH_CMDS (bash compatibility)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-HIST_005fAPPEND"></span> <span
|
|
|
|
|
id="index-NO_005fHIST_005fAPPEND"></span> <span
|
|
|
|
|
id="index-HISTAPPEND"></span> <span id="index-NOHISTAPPEND"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_APPEND
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
APPEND_HISTORY (bash compatibility)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-HIST_005fEXPAND"></span> <span
|
|
|
|
|
id="index-NO_005fHIST_005fEXPAND"></span> <span
|
|
|
|
|
id="index-HISTEXPAND"></span> <span id="index-NOHISTEXPAND"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HIST_EXPAND
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
BANG_HIST (bash compatibility)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-LOG"></span> <span id="index-NO_005fLOG"></span> <span
|
|
|
|
|
id="index-NOLOG"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
LOG
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
*NO\_*HIST_NO_FUNCTIONS (ksh compatibility)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-MAIL_005fWARN"></span> <span
|
|
|
|
|
id="index-NO_005fMAIL_005fWARN"></span> <span
|
|
|
|
|
id="index-MAILWARN"></span> <span id="index-NOMAILWARN"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
MAIL_WARN
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
MAIL_WARNING (bash compatibility)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-ONE_005fCMD"></span> <span
|
|
|
|
|
id="index-NO_005fONE_005fCMD"></span> <span id="index-ONECMD"></span>
|
|
|
|
|
<span id="index-NOONECMD"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
ONE_CMD
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
SINGLE_COMMAND (bash compatibility)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-PHYSICAL"></span> <span
|
|
|
|
|
id="index-NO_005fPHYSICAL"></span> <span id="index-NOPHYSICAL"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PHYSICAL
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
CHASE_LINKS (ksh and bash compatibility)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-PROMPT_005fVARS"></span> <span
|
|
|
|
|
id="index-NO_005fPROMPT_005fVARS"></span> <span
|
|
|
|
|
id="index-PROMPTVARS"></span> <span id="index-NOPROMPTVARS"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PROMPT_VARS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
PROMPT_SUBST (bash compatibility)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="index-STDIN"></span> <span id="index-NO_005fSTDIN"></span>
|
|
|
|
|
<span id="index-NOSTDIN"></span>
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
STDIN
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
SHIN_STDIN (ksh compatibility)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-TRACK_005fALL"></span> <span
|
|
|
|
|
id="index-NO_005fTRACK_005fALL"></span> <span
|
|
|
|
|
id="index-TRACKALL"></span> <span id="index-NOTRACKALL"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
TRACK_ALL
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
HASH_CMDS (ksh compatibility)
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="Single-Letter-Options"></span> <span
|
|
|
|
|
id="Single-Letter-Options-1"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
## 16.4 Single Letter Options
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
<span id="index-options_002c-single-letter"></span> <span
|
|
|
|
|
id="index-single-letter-options"></span>
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="Default-set"></span>
|
|
|
|
|
|
|
|
|
|
### 16.4.1 Default set
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-0
|
|
|
|
|
CORRECT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-1
|
|
|
|
|
PRINT_EXIT_VALUE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-2
|
|
|
|
|
*NO\_*BAD_PATTERN
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-3
|
|
|
|
|
*NO\_*NOMATCH
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-4
|
|
|
|
|
GLOB_DOTS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-5
|
|
|
|
|
NOTIFY
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-6
|
|
|
|
|
BG_NICE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-7
|
|
|
|
|
IGNORE_EOF
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-8
|
|
|
|
|
MARK_DIRS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-9
|
|
|
|
|
AUTO_LIST
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-B
|
|
|
|
|
*NO\_*BEEP
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-C
|
|
|
|
|
*NO\_*CLOBBER
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-D
|
|
|
|
|
PUSHD_TO_HOME
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-E
|
|
|
|
|
PUSHD_SILENT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-F
|
|
|
|
|
*NO\_*GLOB
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-G
|
|
|
|
|
NULL_GLOB
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-H
|
|
|
|
|
RM_STAR_SILENT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-I
|
|
|
|
|
IGNORE_BRACES
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-J
|
|
|
|
|
AUTO_CD
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-K
|
|
|
|
|
*NO\_*BANG_HIST
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-L
|
|
|
|
|
SUN_KEYBOARD_HACK
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-M
|
|
|
|
|
SINGLE_LINE_ZLE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-N
|
|
|
|
|
AUTO_PUSHD
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-O
|
|
|
|
|
CORRECT_ALL
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-P
|
|
|
|
|
RC_EXPAND_PARAM
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-Q
|
|
|
|
|
PATH_DIRS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-R
|
|
|
|
|
LONG_LIST_JOBS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-S
|
|
|
|
|
REC_EXACT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-T
|
|
|
|
|
CDABLE_VARS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-U
|
|
|
|
|
MAIL_WARNING
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-V
|
|
|
|
|
*NO\_*PROMPT_CR
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-W
|
|
|
|
|
AUTO_RESUME
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-X
|
|
|
|
|
LIST_TYPES
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-Y
|
|
|
|
|
MENU_COMPLETE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-Z
|
|
|
|
|
ZLE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-a
|
|
|
|
|
ALL_EXPORT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-e
|
|
|
|
|
ERR_EXIT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-f
|
|
|
|
|
*NO\_*RCS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-g
|
|
|
|
|
HIST_IGNORE_SPACE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-h
|
|
|
|
|
HIST_IGNORE_DUPS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-i
|
|
|
|
|
INTERACTIVE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-k
|
|
|
|
|
INTERACTIVE_COMMENTS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-l
|
|
|
|
|
LOGIN
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-m
|
|
|
|
|
MONITOR
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-n
|
|
|
|
|
*NO\_*EXEC
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-p
|
|
|
|
|
PRIVILEGED
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-r
|
|
|
|
|
RESTRICTED
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-s
|
|
|
|
|
SHIN_STDIN
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-t
|
|
|
|
|
SINGLE_COMMAND
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-u
|
|
|
|
|
*NO\_*UNSET
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-v
|
|
|
|
|
VERBOSE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-w
|
|
|
|
|
CHASE_LINKS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-x
|
|
|
|
|
XTRACE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-y
|
|
|
|
|
SH_WORD_SPLIT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="sh_002fksh-emulation-set"></span>
|
|
|
|
|
|
|
|
|
|
### 16.4.2 sh/ksh emulation set
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-C
|
|
|
|
|
*NO\_*CLOBBER
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-T
|
|
|
|
|
TRAPS_ASYNC
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-X
|
|
|
|
|
MARK_DIRS
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-a
|
|
|
|
|
ALL_EXPORT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-b
|
|
|
|
|
NOTIFY
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-e
|
|
|
|
|
ERR_EXIT
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-f
|
|
|
|
|
*NO\_*GLOB
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-i
|
|
|
|
|
INTERACTIVE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-l
|
|
|
|
|
LOGIN
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-m
|
|
|
|
|
MONITOR
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-n
|
|
|
|
|
*NO\_*EXEC
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-p
|
|
|
|
|
PRIVILEGED
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-r
|
|
|
|
|
RESTRICTED
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-s
|
|
|
|
|
SHIN_STDIN
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-t
|
|
|
|
|
SINGLE_COMMAND
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-u
|
|
|
|
|
*NO\_*UNSET
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-v
|
|
|
|
|
VERBOSE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-x
|
|
|
|
|
XTRACE
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
|
|
|
|
<span id="Also-note"></span>
|
|
|
|
|
|
|
|
|
|
### 16.4.3 Also note
|
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-A
|
|
|
|
|
Used by set for setting arrays
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-b
|
|
|
|
|
Used on the command line to specify end of option processing
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-c
|
|
|
|
|
Used on the command line to specify a single command
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-m
|
|
|
|
|
Used by setopt for pattern-matching option setting
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-o
|
|
|
|
|
Used in all places to allow use of long option names
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
-s
|
|
|
|
|
Used by set to sort positional parameters
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
------------------------------------------------------------------------
|
2021-05-11 02:29:21 +02:00
|
|
|
|
|
2022-08-24 15:13:36 +02:00
|
|
|
|
This document was generated on *May 14, 2022* using [*texi2html
|
|
|
|
|
5.0*](http://www.nongnu.org/texi2html/).
|
|
|
|
|
Zsh version 5.9, released on May 14, 2022.
|