Penguin
Annotated edit history of zsh(1) version 2, including all changes. View license author blame.
Rev Author # Line
1 JohnMcPherson 1 !!NAME
2 zsh - the Z shell
3
4 !!OVERVIEW
5 Because zsh contains many features, the zsh manual has been split into a number of sections:
6
7
8
9
10 ;''zsh'' Zsh overview (this section) :
11 ;''zshmisc'' Anything not fitting into the other sections :
12 ;''zshexpn'' Zsh command and parameter expansion :
13 ;''zshparam'' Zsh parameters :
14 ;''zshoptions'' Zsh options :
15 ;''zshbuiltins'' Zsh built-in functions :
16 ;''zshzle'' Zsh command line editing :
17 ;''zshcompwid'' Zsh completion widgets :
18 ;''zshcompsys'' Zsh completion system :
19 ;''zshcompctl'' Zsh completion control :
20 ;''zshmodules'' Zsh loadable modules :
21 ;''zshzftpsys'' Zsh built-in FTP client :
22 ;''zshall'' Meta-man page containing all of the above :
23
24
25
26 !!DESCRIPTION
27 Zsh is a [UNIX] command interpreter (shell) usable as an interactive login shell and as a shell script command processor. Of the standard shells, zsh most closely resembles __ksh__ but includes many enhancements. Zsh has command line editing, builtin spelling correction, programmable command completion, shell functions (with autoloading), a history mechanism, and a host of other features.
28
29 !!AUTHOR
30 Zsh was originally written by Paul Falstad __<pf__@__zsh.org>__. Zsh is now maintained by the members of the zsh-workers mailing list __<zsh-workers__@__sunsite.dk>__. The development is currently coordinated by Peter Stephenson __<pws__@__zsh.org>__. The coordinator can be contacted at __<coordinator__@__zsh.org>__, but matters relating to the code should generally go to the mailing list.
31
32 !!AVAILABILITY
33 Zsh is available from the following anonymous FTP sites. These mirror sites are kept frequently up to date. The sites marked with ''(H)'' may be mirroring __ftp.cs.elte.hu__ instead of the primary site.
34
35 ;Primary site:
36 __ftp://ftp.zsh.org/pub/zsh/__ %%%
37 __http://www.zsh.org/pub/zsh/__ %%%
38
39
40 ;Australia :
41 __ftp://ftp.zsh.org/pub/zsh/__ %%%
42 __http://www.zsh.org/pub/zsh/__ %%%
43
44
45 ;Denmark :
46 __ftp://sunsite.dk/pub/unix/shells/zsh/__ %%%
47
48
49 ;Finland :
50 __ftp://ftp.funet.fi/pub/unix/shells/zsh/__ %%%
51
52
53 ;Germany :
54 __ftp://ftp.fu-berlin.de/pub/unix/shells/zsh/__ ''(H)'' %%%
55 __ftp://ftp.gmd.de/packages/zsh/__ %%%
56 __ftp://ftp.uni-trier.de/pub/unix/shell/zsh/__ %%%
57
58
59 ;Hungary :
60 __ftp://ftp.cs.elte.hu/pub/zsh/__ %%%
61 __http://www.cs.elte.hu/pub/zsh/__ %%%
62 __ftp://ftp.kfki.hu/pub/packages/zsh/__ %%%
63
64
65 ;Israel :
66 __ftp://ftp.math.technion.ac.il/pub/zsh/__ %%%
67 __http://www.math.technion.ac.il/pub/zsh/__ %%%
68
69
70 ;Japan :
71 __ftp://ftp.win.ne.jp/pub/shell/zsh/__ %%%
72 __ftp://ftp.ayamura.org/pub/zsh/__ %%%
73
74
75 ;Korea :
76 __ftp://linux.sarang.net/mirror/system/shell/zsh/__ %%%
77
78
79 ;Netherlands :
80 __ftp://ftp.demon.nl/pub/mirrors/zsh/__ %%%
81
82
83 ;Norway :
84 __ftp://ftp.uit.no/pub/unix/shells/zsh/__ %%%
85
86
87 ;Poland :
88 __ftp://sunsite.icm.edu.pl/pub/unix/shells/zsh/__ %%%
89
90
91 ;Romania :
92 __ftp://ftp.roedu.net/pub/mirrors/ftp.zsh.org/pub/zsh/__ %%%
93 __ftp://ftp.kappa.ro/pub/mirrors/ftp.zsh.org/pub/zsh/__ %%%
94
95
96 ;Slovenia :
97 __ftp://ftp.siol.net/mirrors/zsh/__ %%%
98
99
100 ;Sweden :
101 __ftp://ftp.lysator.liu.se/pub/unix/zsh/__ %%%
102
103
104 ;UK :
105 __ftp://ftp.net.lut.ac.uk/zsh/__ %%%
106 __ftp://sunsite.org.uk/packages/zsh/__ %%%
107
108
109 ;USA :
110 __ftp://uiarchive.uiuc.edu/mirrors/ftp/ftp.zsh.org/pub/__ %%%
111 __ftp://ftp.rge.com/pub/shells/zsh/__ %%%
112 __http://zsh.disillusion.org/__ %%%
113 __http://foad.org/zsh/__ %%%
114
115
116 The up-to-date source code is available via anonymous CVS from Sourceforge. See __http://sourceforge.net/projects/zsh/__ for details.
117
118
119
120 !!MAILING LISTS
121 Zsh has 3 mailing lists:
122
123
124 ;__<zsh-announce__@__sunsite.dk>__: Announcements about releases, major changes in the shell and the monthly posting of the Zsh FAQ. (moderated)
125 ;__<zsh-users__@__sunsite.dk>__ : User discussions.
126 ;__<zsh-workers__@__sunsite.dk>__ : Hacking, development, bug reports and patches.
127
128 To subscribe or unsubscribe, send mail to the associated administrative address for the mailing list.
129
130
131
132
133 ;__<zsh-announce-subscribe__@__sunsite.dk>__ :
134 ;__<zsh-users-subscribe__@__sunsite.dk>__ :
135 ;__<zsh-workers-subscribe__@__sunsite.dk>__ :
136
137
138 ;__<zsh-announce-unsubscribe__@__sunsite.dk>__ :
139 ;__<zsh-users-unsubscribe__@__sunsite.dk>__ :
140 ;__<zsh-workers-unsubscribe__@__sunsite.dk>__ :
141
142
143 YOU ONLY NEED TO JOIN ONE OF THE MAILING LISTS AS THEY ARE NESTED. All submissions to __zsh-announce__ are automatically forwarded to __zsh-users__. All submissions to __zsh-users__ are automatically forwarded to __zsh-workers__.
144
145 If you have problems subscribing/unsubscribing to any of the mailing lists, send mail to __<listmaster__@__zsh.org>__. The mailing lists are maintained by Karsten Thygesen __<karthy__@__kom.auc.dk>__.
146
147 The mailing lists are archived; the archives can be accessed via the administrative addresses listed above. There is also a hypertext archive, maintained by Geoff Wing __<gcw__@__zsh.org>__, available at __http://www.zsh.org/mla/__.
148
149 !!THE ZSH FAQ
150 Zsh has a list of Frequently Asked Questions (FAQ), maintained by Peter Stephenson __<pws__@__zsh.org>__. It is regularly posted to the newsgroup __comp.unix.shell__ and the __zsh-announce__ mailing list. The latest version can be found at any of the Zsh FTP sites, or at __http://www.zsh.org/FAQ/__. The contact address for FAQ-related matters is __<faqmaster__@__zsh.org>__.
151
152 !!THE ZSH WEB PAGE
153 Zsh has a web page which is located at __http://www.zsh.org/__. This is maintained by Karsten Thygesen __<karthy__@__zsh.org>__, of SunSITE Denmark. The contact address for web-related matters is __<webmaster__@__zsh.org>__.
154
155 !!THE ZSH USERGUIDE
156 A userguide is currently in preparation. It is intended to complement the manual, with explanations and hints on issues where the manual can be cabbalistic, hierographic, or downright mystifying (for example, the word `hierographic' does not exist). It can be viewed in its current state at __http://zsh.sunsite.dk/Guide/__. At the time of writing, chapters dealing with startup files and their contents and the new completion system were essentially complete.
157
158 !!THE ZSH WIKI
159 A `wiki' website for zsh has been created at __http://www.zshwiki.org/__. This is a site which can be added to and modified directly by users without any special permission. You can add your own zsh tips and configurations.
160
161 !!INVOCATION OPTIONS
162 The following flags are interpreted by the shell when invoked to determine where the shell will read commands from:
163
164 ;__-c__: Take the first argument as a command to execute, rather than reading commands from a script or standard input. If any further arguments are given, the first one is assigned to __$0__, rather than being used as a positional parameter.
165 ;__-i__ : Force shell to be interactive.
166 ;__-s__ : Force shell to read commands from the standard input. If the __-s__ flag is not present and an argument is given, the first argument is taken to be the pathname of a script to execute.
167
168 After the first one or two arguments have been appropriated as described above, the remaining arguments are assigned to the positional parameters.
169
170 For further options, which are common to invocation and the __set__ builtin, see ''zshoptions''(1).
171
172 Options may be specified by name using the __-o__ option. __-o__ acts like a single-letter option, but takes a following string as the option name. For example,
173
174
175 __zsh -x -o shwordsplit scr__ %%%
176
177
178
179 runs the script __scr__, setting the __XTRACE__ option by the corresponding letter `__-x__' and the __SH_WORD_SPLIT__ option by name. Options may be turned ''off'' by name by using __+o__ instead of __-o__. __-o__ can be stacked up with preceding single-letter options, so for example `__-xo shwordsplit__' or `__-xoshwordsplit__' is equivalent to `__-x -o shwordsplit__'.
180
181
182 Options may also be specified by name in GNU long option style, `__- __''option-name'''. When this is done, `__-__' characters in the option name are permitted: they are translated into `_____', and thus ignored. So, for example, `__zsh - sh-word-split__' invokes zsh with the __SH_WORD_SPLIT__ option turned on. Like other option syntaxes, options can be turned off by replacing the initial `__-__' with a `__+__'; thus `__+-sh-word-split__' is equivalent to `__- no-sh-word-split__'. Unlike other option syntaxes, GNU-style long options cannot be stacked with any other options, so for example `__-x-shwordsplit__' is an error, rather than being treated like `__-x - shwordsplit__'.
183
184 The special GNU-style option `__- version__' is handled; it sends to standard output the shell's version information, then exits successfully. `__- help__' is also handled; it sends to standard output a list of options that can be used when invoking the shell, then exits successfully.
185
186 Option processing may be finished, allowing following arguments that start with `__-__' or `__+__' to be treated as normal arguments, in two ways. Firstly, a lone `__-__' (or `__+__') as an argument by itself ends option processing. Secondly, a special option `__- __' (or `__+-__'), which may be specified on its own (which is the standard POSIX usage) or may be stacked with preceding options (so `__-x-__' is equivalent to `__-x - __'). Options are not permitted to be stacked after `__- __' (so `__-x-f__' is an error), but note the GNU-style option form discussed above, where `__- shwordsplit__' is permitted and does not end option processing.
187
188 Except when the __sh__/__ksh__ emulation single-letter options are in effect, the option `__-b__' (or `__+b__') ends option processing. `__-b__' is like `__- __', except that further single-letter options can be stacked after the `__-b__' and will take effect as normal.
189
190
191
192 !!COMPATIBILITY
193 Zsh tries to emulate __sh__ or __ksh__ when it is invoked as __sh__ or __ksh__ respectively; more precisely, it looks at the first letter of the name by which it was invoked, excluding any initial `__r__' (assumed to stand for `restricted'), and if that is `__s__' or `__k__' it will emulate __sh__ or __ksh__. Furthermore, if invoked as __su__ (which happens on certain systems when the shell is executed by the __su__ command), the shell will try to find an alternative name from the __SHELL__ environment variable and perform emulation based on that.
194
195 In __sh__ and __ksh__ compatibility modes the following parameters are not special and not initialized by the shell: __ARGC__, __argv__, __cdpath__, __fignore__, __fpath__, __HISTCHARS__, __mailpath__, __MANPATH__, __manpath__, __path__, __prompt__, __PROMPT__, __PROMPT2__, __PROMPT3__, __PROMPT4__, __psvar__, __status__, __watch__.
196
197 The usual zsh startup/shutdown scripts are not executed. Login shells source __/etc/profile__ followed by __$HOME/.profile__. If the __ENV__ environment variable is set on invocation, __$ENV__ is sourced after the profile scripts. The value of __ENV__ is subjected to parameter expansion, command substitution, and arithmetic expansion before being interpreted as a pathname. Note that the __PRIVILEGED__ option also affects the execution of startup files.
198
199 The following options are set if the shell is invoked as __sh__ or __ksh__: __NO_BAD_PATTERN__, __NO_BANG_HIST__, __NO_BG_NICE__, __NO_EQUALS__, __NO_FUNCTION_ARGZERO__, __GLOB_SUBST__, __NO_GLOBAL_EXPORT__, __NO_HUP__, __INTERACTIVE_COMMENTS__, __KSH_ARRAYS__, __NO_MULTIOS__, __NO_NOMATCH__, __NO_NOTIFY__, __POSIX_BUILTINS__, __NO_PROMPT_PERCENT__, __RM_STAR_SILENT__, __SH_FILE_EXPANSION__, __SH_GLOB__, __SH_OPTION_LETTERS__, __SH_WORD_SPLIT__. Additionally the __BSD_ECHO__ and __IGNORE_BRACES__ options are set if zsh is invoked as __sh__. Also, the __KSH_OPTION_PRINT__, __LOCAL_OPTIONS__, __PROMPT_BANG__, __PROMPT_SUBST__ and __SINGLE_LINE_ZLE__ options are set if zsh is invoked as __ksh__.
200
201 !!RESTRICTED SHELL
202 When the basename of the command used to invoke zsh starts with the letter `__r__' or the `__-r__' command line option is supplied at invocation, the shell becomes restricted. Emulation mode is determined after stripping the letter `__r__' from the invocation name. The following are disabled in restricted mode:
203
204 * changing directories with the __cd__ builtin
205 * changing or unsetting the __PATH__, __path__, __MODULE_PATH__, __module_path__, __SHELL__, __HISTFILE__, __HISTSIZE__, __GID__, __EGID__, __UID__, __EUID__, __USERNAME__, __LD_LIBRARY_PATH__, __LD_AOUT_LIBRARY_PATH__, __LD_PRELOAD__ and __LD_AOUT_PRELOAD__ parameters
206 * specifying command names containing __/__
207 * specifying command pathnames using __hash__
208 * redirecting output to files
209 * using the __exec__ builtin command to replace the shell with another command
210 * using __jobs -Z__ to overwrite the shell process' argument and environment space
211 * using the __ARGV0__ parameter to override __argv[[0]__ for external commands
212 * turning off restricted mode with __set +r__ or __unsetopt RESTRICTED
213
214 These restrictions are enforced after processing the startup files. The startup files should set up __PATH__ to point to a directory of commands which can be safely invoked in the restricted environment. They may also add further restrictions by disabling selected builtins.
215
216 Restricted mode can also be activated any time by setting the __RESTRICTED__ option. This immediately enables all the restrictions described above even if the shell still has not processed all startup files.
217
218 !!STARTUP/SHUTDOWN FILES
219 Commands are first read from __/etc/zshenv__; this cannot be overridden. Subsequent behaviour is modified by the __RCS__ and __GLOBAL_RCS__ options; the former affects all startup files, while the second only affects those in the __/etc__ directory. If one of the options is unset at any point, any subsequent startup file(s) of the corresponding type will not be read. It is also possible for a file in __$ZDOTDIR__ to re-enable __GLOBAL_RCS__. Both __RCS__ and __GLOBAL_RCS__ are set by default.
220
221 Commands are then read from __$ZDOTDIR/.zshenv__. If the shell is a login shell, commands are read from __/etc/zprofile__ and then __$ZDOTDIR/.zprofile__. Then, if the shell is interactive, commands are read from __/etc/zshrc__ and then __$ZDOTDIR/.zshrc__. Finally, if the shell is a login shell, __/etc/zlogin__ and __$ZDOTDIR/.zlogin__ are read.
222
223 When a login shell exits, the files __$ZDOTDIR/.zlogout__ and then __/etc/zlogout__ are read. This happens with either an explicit exit via the __exit__ or __logout__ commands, or an implicit exit by reading end-of-file from the terminal. However, if the shell terminates due to __exec__'ing another process, the logout files are not read. These are also affected by the __RCS__ and __GLOBAL_RCS__ options. Note also that the __RCS__ option affects the saving of history files, i.e. if __RCS__ is unset when the shell exits, no history file will be saved.
224
225
226 If __ZDOTDIR__ is unset, __HOME__ is used instead. Those files listed above as being in __/etc__ may be in another directory, depending on the installation.
227
228 As __/etc/zshenv__ is run for all instances of zsh, it is important that it be kept as small as possible. In particular, it is a good idea to put code that does not need to be run for every single shell behind a test of the form `__if [[[[ -o rcs ]]; then ...__' so that it will not be executed when zsh is invoked with the `__-f__' option.
229
230 Any of these files may be pre-compiled with the __zcompile__ builtin command (see ''zshbuiltins''(1)). If a compiled file exists (named for the original file plus the __.zwc__ extension) and it is newer than the original file, the compiled file will be used instead.
231
232 !!FILES
233
234
235
236 ;__$ZDOTDIR/.zshenv__ :
237 ;__$ZDOTDIR/.zprofile__ :
238 ;__$ZDOTDIR/.zshrc__ :
239 ;__$ZDOTDIR/.zlogin__ :
240 ;__$ZDOTDIR/.zlogout__ :
241 ;__${TMPPREFIX}*__ (default is /tmp/zsh*) :
242 ;__/etc/zshenv__ :
243 ;__/etc/zprofile__ :
244 ;__/etc/zshrc__ :
245 ;__/etc/zlogin__ :
246 ;__/etc/zlogout__ (installation-specific - __/etc__ is the default) :
247
248
249
250 !!SEE ALSO
2 AristotlePagaltzis 251 ''sh(1)'', ''csh(1)'', ''tcsh(1)'', ''!rc(1)'', ''bash(1)'', ''!ksh(1)'', ''!zshbuiltins(1)'', ''!zshcompwid(1)'', ''!zshcompsys(1)'', ''!zshcompctl(1)'', ''!zshexpn(1)'', ''!zshmisc(1)'', ''!zshmodules(1)'', ''!zshoptions(1)'', ''!zshparam(1)'', ''!zshzle(1)''
1 JohnMcPherson 252
253 [IEEE] Standard for information Technology - Portable Operating System Interface ([POSIX]) - Part 2: Shell and Utilities, IEEE Inc, 1993, ISBN 1-55937-255-9.
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.