-
Notifications
You must be signed in to change notification settings - Fork 1
/
zsh.1
3465 lines (3465 loc) · 74.3 KB
/
zsh.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.TH ZSH 1
.SH NAME
zsh \- the Z shell
.SH SYNTAX
\fBzsh\fP
[
.B \-aefikmnstuvx0123456789ABCDEFGHIJK
] [
.B \-c
string ]
[ arg .\|.\|. ]
.SH DESCRIPTION
\fBzsh\fP
is a command interpreter and programming language
that executes commands read from a terminal
or a file.
See
.B Invocation
for the meanings of arguments to \fBzsh\fP.
.SS Definitions
A metacharacter can one of the following characters:
.RS
.PP
\fB; & ( ) { } \(bv < > blank newline\fP
.RE
.PP
A blank is a
.B tab
or a
.BR space .
An identifier
is a sequence of letters, digits, or underscores
starting with a letter or underscore.
Identifiers are used as names for
`named parameters'.
A word is a sequence of
characters separated by one or more non-quoted
metacharacters.
.PP
A command
is a sequence of characters in the syntax
of the shell language.
\fBzsh\fP reads each command and
carries out the desired action either directly or by invoking
separate utilities.
A builtin is a command that is carried out by the
parent shell without creating a separate process.
.SS Commands
A simple-command is a sequence of blank
separated words
which may be preceded by a parameter assignment list.
See
.B Environment
below.
The first word specifies the name of the command to
be executed.
Except as specified below,
the remaining words are passed as arguments
to the invoked command.
The command name is passed as argument 0
(see
.BR exec (2)).
The value of a simple-command is its exit status
if it terminates normally, or (octal) 200+\fIstatus\^\fP if
it terminates abnormally (see
.B signal
for a list of
status values).
.PP
A pipeline
is a sequence of one or more
commands
separated by
.B \(bv
or
.B \(bv&
("\fB\(bv&\fP" is actually shorthand for "\fB2>&1\ \|\(bv\fP\|". See
.B Input/Output
below).
The standard output of each command but the last
is connected by a
.B pipe
to the standard input of the next command.
Each command is run as a separate process;
\fBzsh\fP waits for all the commands to terminate.
The exit status of a pipeline is the exit
status of the last command to terminate. A pipeline may be preceded by
one of the following keywords:
.PP
.PD 0
.TP
\fBtime\fP
The user, system, and real times
of the commands in the pipeline are printed when the pipeline
completes.
.TP
\fBcoproc\fP
The processes are
run asynchronously with the input and output of the pipeline
connected to a two-way pipe to the parent shell. The parent
communicates with the coprocess using the \fB>&p\fP
and \fB<&p\fP redirection operators.
.TP
\fB!\fP
The exit status of the pipeline is the boolean NOT of the
exit status of the last command.
.PD
.PP
A sublist is a sequence of one or more pipelines
separated by
.BR &&
or
.BR || .
The symbol \fB&&\fP (\fB||\fP) causes the list following it to be
executed only if the preceding pipeline returns
a zero (non-zero) value.
.PP
A list is a sequence of one or more sublists separated
by, and optionally terminated by, either
.BR ;
or
.BR & .
A \fB;\fP causes sequential execution of the preceding
sublist; a \fB&\fP causes asynchronous execution of the preceding
sublist (that is, it does not wait for that sublist to finish).
An arbitrary number of newlines may appear in a
list, instead of a semicolon,
to delimit a command.
.PP
A command
is either a simple-command
or one of the following.
Unless otherwise stated,
the value returned by a command is that of the
last simple-command executed in the command.
.TP
\fBfor\fP \fIidentifier\^\fP [ \fBin\fP \fIword\^\fP .\|.\|. ] \fB;do\fP \fIlist\^\fP \fB;done\fP
Each time a
.B for
command is executed,
.I identifier
is set to the next
.I word
taken from the
.B in
.I word list.
If
.B in
.I word
\&.\|.\|.
is omitted, then the
.B for
command executes the \fBdo\fP \fIlist\^\fP once for each positional parameter
that is set
(see \fB"Parameter Substitution"\fP).
Execution ends when there are no more words in the list.
.TP
\fBselect\fP \fIidentifier\^\fP [ \fBin\fP \fIword\^\fP .\|.\|. ] \fB;do\fP \fIlist\^\fP \fB;done\fP
A
.B select
command prints on standard error (file descriptor 2), the set of
.IR word s,
each preceded by a number.
If
.BI in " word"
\&.\|.\|.
is omitted, then the positional parameters are used instead
(see
.B "Parameter Substitution"
below).
The
.B PROMPT3
prompt is printed
and a line is read from the standard input.
If this line consists of the number
of one of the listed
.IR word s,
then the value of the parameter
.I identifier
is set to the
.I word
corresponding to this number.
If this line is empty the selection list is
printed again.
Otherwise the value of the parameter
.I identifier
is set to null. The contents of the line read from standard input is
saved in the parameter \fBREPLY\fP. The
.I list
is executed for each selection until a
break or end-of-file is encountered.
.TP
\fBcase\fP \fIword\^\fP \fBin\fP [ \fIpattern\^\fP \fB)\fP \fIlist\^\fP \fB;;\fP ] .\|.\|. \fBesac\fP
A
.B case
command executes the
.I list
associated with the first
.I pattern
that matches
.IR word .
The form of the patterns is
the same as that used for
filename generation (see
.B "Filename Generation"
below).
.TP
\fBif\fP \fIlist\^\fP \fB;then\fP \fIlist\^\fP [ \
\fBelif\fP \fIlist\^\fP \fB;then\fP \fIlist\^\fP ] .\|.\|. \
[ \fB;else\fP \fIlist\^\fP ] \fB;f\&i\fP
The
.I list
following \fBif\fP is executed and,
if it
returns a zero exit status, the
.I list
following the first
.B then
is executed. Otherwise, the
.I list
following \fBelif\fP
is executed and, if its value is zero, the
.I list
following the next
.B then
is executed. Failing that, the
.B else
.I list
is executed. If no
.B else
.I list
or
.B then
.I list
is executed, then the
.B if
command returns a zero exit status.
.TP
.PD 0
\fBwhile\fP \fIlist\^\fP \fB;do\fP \fIlist\^\fP \fB;done\fP
.TP
\fBuntil\fP \fIlist\^\fP \fB;do\fP \fIlist\^\fP \fB;done\fP
.PD
A
.B while
command repeatedly executes the
.B while
.I list
and, if the exit status of the last command in the list is zero, executes
the
.B do
.IR list ;
otherwise the loop terminates.
If no commands in the
.B do
.I list
are executed, then the
.B while
command returns a zero exit status;
.B until
may be used in place of
.B while
to negate
the loop termination test.
.TP
\fBrepeat\fP \fInum\fP\fB ;do\fP \fIlist\^\fP \fB;done\fP
A
.B repeat
command executes the
.I list
a certain number of times, as specified by
.IR num .
If the exit status of
.I list
is nonzero, the loop terminates.
.TP
\fB(\fP\fIlist\^\fP\fB)\fP
Execute
.I list
in a separate environment.
Note, that if two adjacent open parentheses are
needed for nesting, a space must be inserted to avoid
arithmetic evaluation as described below.
.TP
\fB{\fP\fIlist\^\fP\fB}\fP
The
.I list
is simply executed.
.TP
.PD 0
\fBfunction\fP \fIidentifier\^\fP \fB{\fP\fIlist\fB}\fP
.TP
\fIidentifier\^\fP \fB() {\fP\fIlist\fB}\fP
.PD
Define a function which is referenced by
.IR identifier .
The body of the function is the
.I list
of commands between
.B {
and
.BR } .
(See
.B Functions
below).
.TP
\fBexec \fP\fIcommand\^\fP
.br
The
.I command
is executed in place of the parent shell, without forking.
.TP
\fBcommand \fP\fIcommand\^\fP
.br
The
.I command
is run, ignoring shell functions.
.PP
The following reserved words
are only recognized as the first word of a command
and when not quoted:
.RS
.PP
.B
if then else elif fi case esac for while until do done repeat function select time coproc ! exec command
.RE
.SS History Substitution
.LP
History substitution allows you to use words from previous command
lines in the command line you are typing. This simplifies spelling
corrections and the repetition of complicated commands or arguments.
Command lines are saved in the history list, the size of which
is controlled by the
.B HISTSIZE
variable. The most recent command is retained in any case.
A history substitution begins with a
.B !
and may occur anywhere on the command line; history
substitutions do not nest. The
.B !
can be escaped with
.B \e
to suppress its special meaning.
.LP
Input lines containing history substitutions are echoed on the
terminal after being expanded, but before any other
substitutions take place or the command gets executed.
.SS \fIEvent Designators\fP
.LP
An event designator is a reference to a command-line entry in
the history list.
.RS
.PD 0
.TP
.B !
Start a history substitution, except when followed by a blank, newline,
.BR = ,
or
.BR ( .
.TP
.B !!
Refer to the previous command.
By itself, this substitution
repeats the previous command.
.TP
.BI ! n
Refer to command-line
.IR n .
.TP
.BI ! \-n
Refer to the current command-line minus
.IR n .
.TP
.BI ! str
Refer to the most recent command starting with
.IR str .
.TP
.BI !? str\fR[\fP ? \fR]\fP
Refer to the most recent command containing
.IR str .
.TP
.B !#
Refer to the current command line typed in so far.
.TP
.BR !{ .\|.\|. }
Insulate a history reference from adjacent characters (if necessary).
.PD
.RE
.SS \fIWord Designators\fR
.LP
A
.RB ` : '
separates the event specification from the word designator.
It can be omitted if the word designator begins with a
.BR \*^ ,
.BR $ ,
.BR * ,
.B \-
or
.BR % .
If the word is to be selected from the previous command, the second
.B !
character can be omitted from the event specification. For instance,
.B !!:1
and
.B !:1
both refer to the first word of the previous command, while
.B !!$
and
.B !$
both refer to the last word in the previous command.
Word designators include:
.RS
.PD 0
.TP
.B 0
The first input word (command).
.TP
.I n
The
.IR n 'th
argument.
.TP
.B ^
The first argument, that is,
.BR 1 .
.TP
.B $
The last argument.
.TP
.B %
The word matched by (the most recent)
.BI ? s
search.
.TP
.IB x \- y
A range of words;
.BI \- y
abbreviates
.BI 0\- y\fR.
.TP
.B *
All the arguments, or a null value if there is just
one word in the event.
.TP
.IB x *
Abbreviates
.IB x \-$ .
.TP
.IB x \-
Like
.I x*
but omitting word
.BR $ .
.PD
.RE
.SS \fIModifiers\fR
.IX "history substitution modifiers"
.IX ": modifiers" "" "\fL:\fR modifiers \(em history substitution \(em \fLcsh\fR"
.LP
After the optional word designator, you can add
a sequence of one or more of the following modifiers,
each preceded by a
.BR : .
.RS
.TP
.B h
Remove a trailing pathname component, leaving the head.
.PD 0
.TP
.B r
Remove a trailing suffix of the form
.RB ` "\&.\fIxxx" ',
leaving the basename.
.TP
.B e
Remove all but the suffix.
.TP
.BI s/ l / r\fR[\fP / \fR]\fP
Substitute
.I r
for
.IR l .
.TP
.B t
Remove all leading pathname components, leaving the tail.
.TP
.B &
Repeat the previous substitution.
.TP
.B g
Apply the change to the first occurrence of a match in each word,
by prefixing the above (for example,
.BR g& ).
.TP
.B p
Print the new command but do not execute it.
.TP
.B q
Quote the substituted words, escaping further substitutions.
.TP
.B x
Like
.BR q ,
but break into words at each blank.
.PD
.RE
.LP
Unless preceded by a
.BR g ,
the modification is applied only to the
first string that matches
.IR l ;
an error results if no string matches.
.LP
The left-hand side of substitutions are not regular expressions,
but character strings.
Any character can be used as the delimiter in place of
.BR / .
A backslash quotes the delimiter character.
The character
.BR & ,
in the right hand side, is replaced by the text
from the left-hand-side.
The
.B &
can be quoted with a backslash.
A null
.I l
uses the previous string either from a
.I l
or from a contextual scan string
.I s
from
.BI !? s\fR.
You can omit the rightmost delimiter if a newline
immediately follows
.IR r ;
the rightmost
.B ?
in a context scan can similarly be omitted.
.LP
Without an event specification, a history reference refers either to the
previous command, or to a previous history reference on the command line
(if any).
.PP
.LP
.PP
The character sequence
.BI ^ foo ^ bar
repeats the last command, replacing the string "foo" with the
string "bar".
.PP
If \fBzsh\fP encounters the character sequence
\fB!"\fP
in the input, the history mechanism is temporarily disabled until
the current list is fully parsed. The
\fB!"\fP
is removed from the input, and any subsequent
.B !
characters have no special significance.
.PP
A less convenient but more comprehensible
form of command history support
is provided by the
.B fc
builtin (see below).
.SS Comments
In noninteractive shells,
a word beginning with
.B #
causes that word and all the following characters up to a newline
to be ignored.
.SS Aliasing
The first word of each command is replaced by the text of an
alias if an alias for this word has been defined.
The replacement string can contain any
valid input
including the metacharacters listed above.
If the last character of the alias value is a blank
then the word following the alias will also be checked for alias
substitution.
Aliases can be nested.
If an alias is defined with using the \-a flag (see the
.B alias
builtin below), it will be replaced no matter where it
appears in the command line.
Aliases can be used to redefine
builtin commands or the
`reserved words' listed above.
Aliases can be created and listed with the
alias
command and can be removed with the
unalias
command.
.PP
The following aliases
are compiled into \fBzsh\fP
but can be unset or redefined:
.RS 5
.PD 0
.TP
.B "false=\(fmlet 0\(fm"
.TP
.B "history=\(fmfc \-l\(fm"
.TP
.B "nohup=\(fmnohup\ \(fm"
.TP
.B "r=\(fmfc \-e \-\(fm"
.TP
.B "true=\(fm:\(fm"
.TP
.B "pwd=\(fmecho $PWD\(fm"
.PD
.RE
.SS Process Substitution
Each command argument of the form
\fB<(\fP\fIlist\^\fP\fB)\fP
or
\fB>(\fP\fIlist\^\fP\fB)\fP
or
\fB=(\fP\fIlist\^\fP\fB)\fP
is subject to process substitution.
In the case of the
.B <
or
.B >
forms, \fBzsh\fP
will run process
.I list
asynchronously connected to a named pipe (FIFO).
The name of this pipe will become the argument to the command.
If the form with
.B >
is selected then writing on this file will provide input for
.IR list .
If
.B <
is used,
then the file passed as an argument will
be a named pipe connected to the output of the
.I list
process.
For example,
.RS
.PP
\fBpaste <(cut \-f1\fP \fIfile1\fP\fB) <(cut \-f3\fP \fIfile2\fB) | tee >(\fP\fIprocess1\fP\fB) >(\fP\fIprocess2\fP\fB)\fP >/dev/null
.RE
.PP
.BR cut s
fields 1 and 3 from
the files
.I file1
and
.I file2
respectively,
.BR paste s
the results together, and sends it to the processes
.I process1
and
.IR process2 .
Note that the file, which is passed as an argument to the command,
is a system
pipe
so programs that expect to
.BR lseek (2)
on the file will not work.
Also note that the previous example can be more compactly and
efficiently written as:
.RS
.PP
\fBpaste <(cut \-f1\fP \fIfile1\fP\fB) <(cut \-f3\fP \fIfile2\fB) > >(\fP\fIprocess1\fP\fB) > >(\fP\fIprocess2\fP\fB)\fP
.RE
.PP
\fBzsh\fP uses socketpairs (pipes) instead of a FIFOs to implement the latter
two process substitutions in the above example.
.PP
If
.B =
is used,
then the file passed as an argument will be the name
of a temporary file containing
the output of the
.I list
process. This may be used instead of the
.B <
form for a program that expects to lseek on the input file.
.SS Parameter Substitution
A parameter is an identifier,
one or more digits,
or any of the characters
.BR \(** ,
.BR # ,
.BR ? ,
.BR \- ,
.BR $ ,
and
.BR !\\^ .
The value of a named
parameter may also be assigned by writing:
.RS
.PP
.IB name = value\^\|
[
.IB name = value
] .\|.\|.
.RE
.PP
If
.I name
was declared integer with the
.B integer
builtin, the
.I value
is subject to arithmetic evaluation as described below.
.PP
Positional parameters,
parameters denoted by a number,
may be assigned values with the
\fBset\fP
builtin. Parameter
.B $0
is set from argument zero when \fBzsh\fP
is invoked.
.PP
The character
.B $
is used to introduce parameter substitution.
Note that the results of such
substitution are quoted from all
further substitution.
.PP
.PD 0
.RS
.TP
\fB${\fP\fIparameter\^\fP\fB}\fP
The value, if any, of the parameter is substituted.
The braces are required when
.I parameter
is followed by a letter, digit, or underscore
that is not to be interpreted as part of its name
or when a named parameter is subscripted.
If
.I parameter
is one or more digits then it is a positional parameter.
.I parameter
may be followed by zero or more of any of the modifiers allowed in the
history mechanism except \fBq\fP and \fBx\fP.
.TP
\fB$*\fP
All the positional
parameters, starting with
.BR $1 ,
are substituted.
.TP
\fB${\fP\fIparameter\^\fP\fB:\-\fP\fIword\^\fP\fB}\fP
If
.I parameter
is set and is non-null then substitute its value;
otherwise substitute
.IR word .
.TP
\fB${\fP\fIparameter\^\fP\fB:=\fP\fIword\^\fP\fB}\fP
If
.I parameter
is not set or is null then set it to
.IR word ;
the value of the parameter is then substituted.
Positional parameters may be assigned to
in this way.
.TP
\fB${\fP\fIparameter\^\fP\fB:?\fP\fIword\^\fP\fB}\fP
If
.I parameter
is set and is non-null then substitute its value;
otherwise, print
.I word
and exit.
If
.I word
is omitted then a standard message is printed.
.TP
\fB${\fP\fIparameter\^\fP\fB:+\fP\fIword\^\fP\fB}\fP
If
.I parameter
is set and is non-null then substitute
.IR word ;
otherwise substitute nothing.
.TP
\fB${\fP\fIparameter\^\fP\fB#\fP\fIpattern\^\fP\fB}\fP
.TP
\fB${\fP\fIparameter\^\fP\fB##\fP\fIpattern\^\fP\fB}\fP
If the shell
.I pattern
matches the beginning of the value of
.IR parameter ,
then the value of
this substitution is the value of the
.I parameter
with the matched portion deleted;
otherwise the value of this
.I parameter
is substituted.
In the first form the smallest matching pattern is deleted and in the
second form the largest matching pattern is deleted.
.TP
\fB${\fP\fIparameter\^\fP\fB%\fP\fIpattern\^\fP\fB}\fP
.TP
\fB${\fP\fIparameter\^\fP\fB%%\fP\fIpattern\^\fP\fB}\fP
If
the shell
.I pattern
matches the end of the value of
.IR parameter ,
then the value of
this substitution is the value of the
.I parameter
with the matched part deleted;
otherwise substitute the value of
.IR parameter .
In the first form the smallest matching pattern is deleted and in the
second form the largest matching pattern is deleted.
.PD
.RE
.PP
In the above,
.I word
is not evaluated unless it is
to be used as the substituted string,
so that, in the following example,
pwd
is executed only if
.B d
is not set or is null:
.RS
.PP
.B "echo \|${d:\-\^$(\^pwd\^)\^}"
.RE
.PP
If the
.B :
is omitted from the above expressions,
then \fBzsh\fP only checks whether
.I parameter
is set or not.
.PP
The following parameters are automatically set by \fBzsh\fP:
.RS
.PD 0
.TP 10
.B #
The number of positional parameters in decimal.
.TP
.B \-
Flags supplied to \fBzsh\fP on invocation or by
the
.B setopt
command.
.TP
.B ?
The decimal value returned by the last executed command.
.TP
.B $
The process number of this shell.
.TP
.B !
The process number of the last background command invoked.
.TP
.B EUID
The effective user id of the shell process.
.TP
.B HOSTTYPE
A string corresponding to the architecture \fBzsh\fP is running on.
.TP
.B PPID
The process number of the parent of this shell.
.TP
.B PWD
The present working directory set by the
cd
command.
.TP
.B RANDOM
Each time this parameter is referenced, a random integer,
uniformly distributed between 0 and 32767, is generated.
The sequence of random numbers can be initialized by assigning
a numeric value to
RANDOM.
.TP
.B LINENO
In a script, the current line number.
.TP
.B REPLY
This parameter is set by the
.B select
statement and by
the
.B read
builtin when no arguments are supplied.
.TP
.B SECONDS
Each time this parameter is referenced, the number of
seconds since shell invocation is returned.
If this parameter is
assigned a value, then the value returned upon reference will
be the value that was assigned plus the number of seconds since the assignment.
.TP
.B TCxx
The string or value corresponding to the termcap entry \fBxx\fP.
.TP
.B UID
The user id of the shell process.
.TP
.B USERNAME
The name corresponding to the real user id of this shell process.
.TP
.B VERSION
The version number of this \fBzsh\fP.
.PD
.RE
.PP
The following parameters are used by \fBzsh\fP:
.RS
.PD 0
.TP
.B ARGV0
If placed in the environment for a command, \fBzsh\fP
will use its value as argv[0] for the \fBexec\fP(2) call
rather than the specified command name.
.TP
.B CDPATH
The search path for the
cd
command.
.TP
.B FCEDIT
The default editor name for the
.B fc
command.
.TP
.B IFS
Internal field separators,
normally
.BR space ,
.BR tab ,
and
.B newline
that is used to separate command words which result from
command or parameter substitution
and for separating words with the
.B read
builtin.
.TP
.B HISTSIZE
If this parameter is set when \fBzsh\fP is invoked, then
the number of previously entered commands that
are accessible by this shell
will be greater than or equal to this number.
The default is 128.
.TP
.B HOME
The default argument (home directory) for the
.B cd
command.
.TP
.B MAIL
If this parameter is set to the name of a mail file
then \fBzsh\fP informs the user of arrival of mail
in the specified file.
.TP
.B MAILCHECK
This variable specifies how often (in seconds) \fBzsh\fP
will check for changes in the modification time
of any of the files specified by the
.B MAIL
parameter.
The default value is 60 seconds.
When the time has elapsed
\fBzsh\fP will check before issuing the next prompt.
.TP
.B PROMPT
The value of this parameter is expanded
much like printf(3S),
using "%<char>" to signal an expansion.
The available sequences are:
.RS
.PP
.TP
.B %d \fPor\fB %/
The current working directory.
.TP
.B %\(ap
The current working directory; if it starts with $HOME, that part is
replaced by a \(ap.
.TP
.B %c \fPor\fB %.
The trailing component of the current working directory.
.TP
.B %h \fPor\fB %!
The current history event number.