home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume35 / zsh / part04 < prev    next >
Encoding:
Text File  |  1993-02-19  |  54.8 KB  |  1,639 lines

  1. Newsgroups: comp.sources.misc
  2. From: zsh-list@cs.uow.edu.au (The Zsh Mailing List)
  3. Subject: v35i054:  zsh - The Z Shell, version 2.3.1, Part04/22
  4. Message-ID: <1993Feb20.212102.28243@sparky.imd.sterling.com>
  5. X-Md4-Signature: 0b48b3400b39b0422b305ef45a82156d
  6. Date: Sat, 20 Feb 1993 21:21:02 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: zsh-list@cs.uow.edu.au (The Zsh Mailing List)
  10. Posting-number: Volume 35, Issue 54
  11. Archive-name: zsh/part04
  12. Environment: UNIX
  13. Supersedes: zsh2.2: Volume 29, Issue 97-113
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then feed it
  17. # into a shell via "sh file" or similar.  To overwrite existing files,
  18. # type "sh file -c".
  19. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  20. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  21. # Contents:  FEATURES doc/zsh.texi.02
  22. # Wrapped by mattson@odin on Sat Feb  6 14:41:51 1993
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 4 (of 22)."'
  26. if test -f 'FEATURES' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'FEATURES'\"
  28. else
  29.   echo shar: Extracting \"'FEATURES'\" \(2684 characters\)
  30.   sed "s/^X//" >'FEATURES' <<'END_OF_FILE'
  31. Xvery close to ksh/sh grammar, with csh additions
  32. Xmost features of ksh, bash, and tcsh
  33. X75 builtins, 80 options, 149 key bindings
  34. Xshort for loops, ex: for i (*.c) echo $i
  35. Xselect
  36. Xshell functions
  37. Xconditional expressions (test builtin, [ ... ], and ksh-style [[ ... ]])
  38. Xglobal aliases (may be expanded anywhere on the line)
  39. Xdirectory stack access with =num
  40. Xprocess substitution (vi =(cmd) edits the output of cmd)
  41. Xgeneralized pipes (ls foo >>(cmd1) 2>>(cmd2) pipes stdout to cmd1
  42. X  and stderr to cmd2)
  43. Xarithmetic expressions
  44. Xadvanced globbing:
  45. X  ls **/file  searches recursively for "file" in subdirectories
  46. X  ls file<20->  matches file20, file30, file100, etc.
  47. X  ls *.(c|pro)  matches *.c and *.pro
  48. X  ls *(R)  matches only world-readable files
  49. X  ls *.c~lex.c  matches all .c files except lex.c
  50. Xnull command shorthands:
  51. X  "< file" is same as "more <file"
  52. X  "> file" is same as "cat >file"
  53. X  ">> file" is same as "cat >>file"
  54. Xksh-style coprocesses
  55. Xautomatic file stream teeing (ls >foo >bar puts output in two places)
  56. Xchpwd() function run every time you change directory (useful for
  57. X  updating the status line)
  58. Xjob control
  59. Xcsh-style history
  60. Xfull vi line editing, including "c2w" and "y$" and such things
  61. Xfull emacs line editing
  62. Xincremental history search
  63. Xmagic-space history
  64. Xspelling correction
  65. Xarray parameters
  66. X$HOSTTYPE, $LINENO, $RANDOM, $SECONDS, $cdpath, $COLUMNS, $fignore,
  67. X  $HISTCHARS, $mailpath
  68. Xwith autocd option, typing a directory name by itself is the same as
  69. X  typing "cd dirname"
  70. Xmenu completion: pressing TAB repeatedly cycles through the possible matches
  71. Xincremental path hashing
  72. Xautomatic process time reporting for commands that run over a certain limit
  73. Xfull tcsh-style prompt substitution
  74. Xutmp login/logout reporting
  75. Xwith histverify option, performing csh-style history expansions causes the
  76. X  input line to be brought up for editing instead of being executed
  77. Xwith sunkeyboardhack option, accidently typed trailing ` characters
  78. X  are removed from the input line (for those of you with Sun keyboards :-) )
  79. Xautoloaded functions (loaded from a file when they are first referenced)
  80. X"cd old new" replaces "old" with "new" in directory string
  81. Xgeneralized argument completion, including:
  82. X  - command name completion
  83. X  - filename and path completion
  84. X  - hostname completion
  85. X  - key binding completion
  86. X  - option completion
  87. X  - variable name completion
  88. X  - user-specified keyword completion
  89. Xprompt on right side of screen
  90. Xdirectory stacks
  91. Xhistory datestamps and execution time records
  92. Xcommand scheduling (like at(1), but in the shell's context)
  93. Xtty mode freezing
  94. Xup to 9 startup files (but you only need 1 or 2)
  95. X8-bit clean
  96. Xwhich -a cmd lists all occurences of "cmd" in the path
  97. END_OF_FILE
  98.   if test 2684 -ne `wc -c <'FEATURES'`; then
  99.     echo shar: \"'FEATURES'\" unpacked with wrong size!
  100.   fi
  101.   # end of 'FEATURES'
  102. fi
  103. if test -f 'doc/zsh.texi.02' -a "${1}" != "-c" ; then 
  104.   echo shar: Will not clobber existing file \"'doc/zsh.texi.02'\"
  105. else
  106.   echo shar: Extracting \"'doc/zsh.texi.02'\" \(49503 characters\)
  107.   sed "s/^X//" >'doc/zsh.texi.02' <<'END_OF_FILE'
  108. Xassociativity of expressions in C.  The following operators are
  109. Xsupported (listed in decreasing order of precedence):
  110. X
  111. X@table @code
  112. X@item + - ! ~ ++ --
  113. Xunary plus/minus, logical NOT, complement, @{pre,post@}@{in,de@}crement
  114. X@item &
  115. Xlogical AND
  116. X@item ^
  117. Xlogical XOR
  118. X@item |
  119. Xlogical OR
  120. X@item * / %
  121. Xmultiplication, division, remainder
  122. X@item + -
  123. Xaddition, subtraction
  124. X@item << >>
  125. Xlogical shift left, shift right
  126. X@item < > <= >=
  127. Xcomparison
  128. X@item == !=
  129. Xequality and inequality
  130. X@item &&
  131. Xboolean AND
  132. X@item || ^^
  133. Xboolean OR, XOR
  134. X@item ? :
  135. Xternary operator
  136. X@item = += -= *= /= %= &= ^= |= <<= >>= &&= ||= ^^=
  137. Xassignment
  138. X@item ,
  139. Xcomma operator
  140. X@end table
  141. X
  142. X@noindent
  143. XThe operators @code{&&}, @code{||}, @code{&&=}, and @code{||=} are
  144. Xshort-circuiting, and only one of the latter two expressions in a
  145. Xternary operator is evaluated.  Note the precedence of the logical AND,
  146. XOR, and XOR operators.@refill
  147. X
  148. X@noindent
  149. XNamed parameters can be referenced by name within an arithmetic
  150. Xexpression without using the parameter substitution syntax.
  151. X
  152. X@cindex parameters, integer
  153. X@cindex integer parameters
  154. X@findex integer, use of
  155. X@noindent
  156. XAn internal integer representation of a named parameter can be specified
  157. Xwith the @code{integer} builtin.  Arithmetic evaluation is performed on
  158. Xthe value of each assignment to a named parameter declared integer in
  159. Xthis manner.@refill
  160. X
  161. X@findex let, use of
  162. X@noindent
  163. XSince many of the arithmetic operators require quoting, an alternative
  164. Xform of the @code{let} command is provided.  For any command which
  165. Xbegins with a @code{((}, all the characters until a matching @code{))}
  166. Xare treated as a quoted expression.  More precisely, @code{(( @dots{} ))} is
  167. Xequivalent to @code{let "@dots{}"}.@refill
  168. X
  169. X@node Conditional Expressions, Zsh Line Editor, Arithmetic Evaluation, Top
  170. X@chapter Conditional Expressions
  171. X@cindex conditional expressions
  172. X@cindex expressions, conditional
  173. X
  174. X@noindent
  175. XA @dfn{conditional expression} is used with the @code{[[} compound
  176. Xcommand to test attributes of files and to compare strings.  Each
  177. Xexpression can be constructed from one or more of the following unary or
  178. Xbinary expressions:@refill
  179. X
  180. X@table @code
  181. X@item -a @var{file}
  182. Xtrue if @var{file} exists.
  183. X@item -b @var{file}
  184. Xtrue if @var{file} exists and is a block special file.
  185. X@item -c @var{file}
  186. Xtrue if @var{file} exists and is a character special file.
  187. X@item -d @var{file}
  188. Xtrue if @var{file} exists and is a directory.
  189. X@item -e @var{file}
  190. Xtrue if @var{file} exists.
  191. X@item -f @var{file}
  192. Xtrue if @var{file} exists and is an ordinary file.
  193. X@item -g @var{file}
  194. Xtrue if @var{file} exists and has its setgid bit set.
  195. X@item -h @var{file}
  196. Xtrue if @var{file} exists and is a symbolic link.
  197. X@item -k @var{file}
  198. Xtrue if @var{file} exists and has its sticky bit set.
  199. X@item -n @var{string}
  200. Xtrue if length of @var{string} is non-zero.
  201. X@item -o @var{option}
  202. Xtrue if option named @var{option} is on.
  203. X@item -p @var{file}
  204. Xtrue if @var{file} exists and is a fifo special file or a pipe.
  205. X@item -r @var{file}
  206. Xtrue if @var{file} exists and is readable by current process.
  207. X@item -s @var{file}
  208. Xtrue if @var{file} exists and has size greater than zero.
  209. X@item -t @var{fd}
  210. Xtrue if file descriptor number @var{fd} is open and associated with a
  211. Xterminal device (note: @var{fd} is not optional).@refill
  212. X@item -u @var{file}
  213. Xtrue if @var{file} exists and has its setuid bit set.
  214. X@item -w @var{file}
  215. Xtrue if @var{file} exists and is writable by current process.
  216. X@item -x @var{file}
  217. Xtrue if @var{file} exists and is executable by current process.  If
  218. X@var{file} exists and is a directory, then the current process has
  219. Xpermission to search in the directory.@refill
  220. X@item -z @var{string}
  221. Xtrue if length of @var{string} is zero.
  222. X@item -L @var{file}
  223. Xtrue if @var{file} exists and is a symbolic link.
  224. X@item -O @var{file}
  225. Xtrue if @var{file} exists and is owned by the effective user id of this
  226. Xprocess.
  227. X@item -G @var{file}
  228. Xtrue if @var{file} exists and its group matches the effective group id
  229. Xof this process.
  230. X@item -S @var{file}
  231. Xtrue if @var{file} exists and is a socket.
  232. X@item @var{file1} -nt @var{file2}
  233. Xtrue if @var{file1} exists and is newer than @var{file2}.
  234. X@item @var{file1} -ot @var{file2}
  235. Xtrue if @var{file1} exists and is older than @var{file2}.
  236. X@item @var{file1} -ef @var{file2}
  237. Xtrue if @var{file1} and @var{file2} exist and refer to the same file.
  238. X@item @var{string} = @var{pattern}
  239. Xtrue if @var{string} matches @var{pattern}.
  240. X@item @var{string} != @var{pattern}
  241. Xtrue if @var{string} does not match @var{pattern}.
  242. X@item @var{string1} < @var{string2}
  243. Xtrue if @var{string1} comes before @var{string2} based on ASCII value of
  244. Xtheir characters.@refill
  245. X@item @var{string1} > @var{string2}
  246. Xtrue if @var{string1} comes after @var{string2} based on ASCII value of
  247. Xtheir characters.@refill
  248. X@item @var{exp1} -eq @var{exp2}
  249. Xtrue if @var{exp1} is equal to @var{exp2}.
  250. X@item @var{exp1} -ne @var{exp2}
  251. Xtrue if @var{exp1} is not equal to @var{exp2}.
  252. X@item @var{exp1} -lt @var{exp2}
  253. Xtrue if @var{exp1} is less than @var{exp2}.
  254. X@item @var{exp1} -gt @var{exp2}
  255. Xtrue if @var{exp1} is greater than @var{exp2}.
  256. X@item @var{exp1} -le @var{exp2}
  257. Xtrue if @var{exp1} is less than or equal to @var{exp2}.
  258. X@item @var{exp1} -ge @var{exp2}
  259. Xtrue if @var{exp1} is greater than or equal to @var{exp2}.
  260. X@item ( @var{exp} )
  261. Xtrue if @var{exp} is true.
  262. X@item ! @var{exp}
  263. Xtrue if @var{exp} is false.
  264. X@item @var{exp1} && @var{exp2}
  265. Xtrue if @var{exp1} and @var{exp2} are both true.
  266. X@item @var{exp1} || @var{exp2}
  267. Xtrue if either @var{exp1} or @var{exp2} is true.
  268. X@end table
  269. X
  270. X@noindent
  271. XIn each of the above expressions, if @var{file} is of the form
  272. X@samp{/dev/fd/@var{n}}, where @var{n} is an integer, then the test
  273. Xapplied to the open file whose descriptor number is @var{n} , even if
  274. Xthe underlying system does not support the @file{/dev/fd}
  275. Xdirectory.@refill
  276. X
  277. X@node Zsh Line Editor, Parameters, Conditional Expressions, Top
  278. X@chapter Zsh Line Editor
  279. X@cindex line editor
  280. X@cindex editor, line
  281. X
  282. X@pindex ZLE, use of
  283. X@noindent
  284. XIf the @code{ZLE} option is set (it is by default) and the shell input is
  285. Xattached to the terminal, the user is allowed to edit command lines.@refill
  286. X
  287. X@vindex TERM
  288. X@pindex SINGLE_LINE_ZLE, use of
  289. X@cindex ksh, editor mode
  290. X@cindex editor, modes
  291. X@noindent
  292. XThere are two display modes.  The first, multiline mode, is the default.
  293. XIt only works if the @code{TERM} parameter is set to a valid terminal
  294. Xtype that can move the cursor up.  The second, single line mode, is used
  295. Xif @code{TERM} is invalid or incapable of moving the cursor up, or if the
  296. X@code{SINGLE_LINE_ZLE} option is set.  This mode is similar to ksh, and
  297. Xuses no termcap sequences.@refill
  298. X
  299. X@cindex bindings, key
  300. X@cindex key bindings
  301. X@findex bindkey, use of
  302. X@vindex VISUAL
  303. X@vindex EDITOR
  304. X@noindent
  305. XCommand bindings may be set using the @code{bindkey} builtin.  There are
  306. Xtwo keymaps---the main keymap and the alternate keymap.  The alternate
  307. Xkeymap is bound to @code{vi} command mode.  The main keymap is bound to
  308. X@code{emacs} mode by default.  To bind the main keymap to @code{vi}
  309. Xinsert mode, use @code{bindkey -v}, or set one of the @code{VISUAL} or
  310. X@code{EDITOR} environment variables to a string containing
  311. X@code{vi}.@refill
  312. X
  313. X@noindent
  314. XThe following is a list of all the key commands and their default
  315. Xbindings in emacs and vi command mode.
  316. X
  317. X@menu
  318. X* Movement::                    
  319. X* History Control::             
  320. X* Modifying Text::              
  321. X* Arguments::                   
  322. X* Completion::                  
  323. X* Miscellaneous::               
  324. X@end menu
  325. X
  326. X@node Movement, History Control,  , Zsh Line Editor
  327. X@section Movement
  328. X
  329. X@table @code
  330. X@tindex vi-backward-blank-word
  331. X@kindex B
  332. X@item vi-backward-blank-word (unbound) (B)
  333. XMove backward one word, where a word is defined as a series of non-blank
  334. Xcharacters.
  335. X@tindex backward-char
  336. X@kindex CTRL-B
  337. X@kindex ESC-[D
  338. X@item backward-char (@ctrl{B} @key{ESC}-[D) (unbound)
  339. XMove backward one character.
  340. X@tindex vi-backward-char
  341. X@kindex ESC-B
  342. X@kindex ESC-b
  343. X@item vi-backward-char (unbound) (h)
  344. XMove backward one character, without changing lines.
  345. X@tindex backward-word
  346. X@item backward-word (@key{ESC}-B @key{ESC}-b) (unbound)
  347. XMove to the beginning of the previous word.
  348. X@tindex emacs-backward-word
  349. X@item emacs-backward-word
  350. XMove to the beginning of the previous word.
  351. X@tindex vi-backward-word
  352. X@kindex b
  353. X@item vi-backward-word (unbound) (b)
  354. XMove to the beginning of the previous word, vi-style.
  355. X@tindex beginning-of-line
  356. X@kindex CTRL-A
  357. X@kindex 0
  358. X@item beginning-of-line (@ctrl{A}) (0)
  359. XMove to the beginning of the line.  If already at the beginning of the
  360. Xline, move to the beginning of the previous line, if any.
  361. X@tindex vi-beginning-of-line
  362. X@item vi-beginning-of-line
  363. XMove to the beginning of the line, without changing lines.
  364. X@tindex end-of-line
  365. X@kindex CTRL-E
  366. X@item end-of-line (@ctrl{E})
  367. XMove to the end of the line.  If already at the end of the line, move to
  368. Xthe end of the next line, if any.
  369. X@tindex vi-end-of-line
  370. X@kindex $
  371. X@item vi-end-of-line (unbound) ($)
  372. XMove to the end of the line.
  373. X@tindex vi-forward-blank-word
  374. X@kindex W
  375. X@item vi-forward-blank-word (unbound) (W)
  376. XMove forward one word, where a word is defined as a series of non-blank
  377. Xcharacters.
  378. X@tindex vi-forward-blank-word-end
  379. X@kindex E
  380. X@item vi-forward-blank-word-end (unbound) (E)
  381. XMove to the end of the current word, or, if at the end of the current
  382. Xword, to the end of the next word, where a word is defined as a series
  383. Xof non-blank characters.
  384. X@tindex forward-char
  385. X@kindex CTRL-F
  386. X@kindex ESC-[C
  387. X@item forward-char (@ctrl{F} @key{ESC}-[C)
  388. XMove forward one character.
  389. X@tindex vi-forward-char
  390. X@kindex l
  391. X@kindex SPACE
  392. X@item vi-forward-char (unbound) (space l)
  393. XMove forward one character.
  394. X@tindex vi-find-next-char
  395. X@kindex CTRL-X CTRL-F
  396. X@kindex f
  397. X@item vi-find-next-char (@ctrl{X}@ctrl{F}) (f)
  398. XRead a character from the keyboard, and move to the next occurrence of
  399. Xit in the line.
  400. X@tindex vi-find-next-char-skip
  401. X@kindex t
  402. X@item vi-find-next-char-skip (unbound) (t)
  403. XRead a character from the keyboard, and move to the position just before
  404. Xthe next occurrence of it in the line.
  405. X@tindex vi-find-prev-char
  406. X@kindex F
  407. X@item vi-find-prev-char (unbound) (F)
  408. XRead a character from the keyboard, and move to the previous occurrence
  409. Xof it in the line.
  410. X@tindex vi-find-prev-char-skip
  411. X@kindex T
  412. X@item vi-find-prev-char-skip (unbound) (T)
  413. XRead a character from the keyboard, and move to the position just after
  414. Xthe previous occurrence of it in the line.
  415. X@tindex vi-first-non-blank
  416. X@kindex ^
  417. X@item vi-first-non-blank (unbound) (^)
  418. XMove to the first non-blank character in the line.
  419. X@tindex vi-forward-word
  420. X@kindex w
  421. X@item vi-forward-word (unbound) (w)
  422. XMove forward one word, vi-style.
  423. X@tindex forward-word
  424. X@kindex ESC-F
  425. X@kindex ESC-f
  426. X@item forward-word (@key{ESC}-F @key{ESC}-f) (unbound)
  427. XMove to the beginning of the next word.  The editor's idea of a word is
  428. Xspecified with the @code{WORDCHARS} parameter.
  429. X@tindex emacs-forward-word
  430. X@item emacs-forward-word
  431. XMove to the end of the next word.
  432. X@tindex vi-forward-word-end
  433. X@kindex e
  434. X@item vi-forward-word-end (unbound) (e)
  435. XMove to the end of the next word.
  436. X@tindex vi-goto-column
  437. X@kindex ESC-|
  438. X@kindex |
  439. X@item vi-goto-column (@key{ESC}-|) (|)
  440. XMove to the column specified by the numeric argument.
  441. X@tindex vi-goto-mark
  442. X@kindex `
  443. X@item vi-goto-mark (unbound) (`)
  444. XMove to the specified mark.
  445. X@tindex vi-goto-mark-line
  446. X@kindex '
  447. X@item vi-goto-mark-line (unbound) (')
  448. XMove to beginning of the line containing the specified mark.
  449. X@tindex vi-repeat-find
  450. X@kindex ;
  451. X@item vi-repeat-find (unbound) (;)
  452. XRepeat the last @code{vi-find} command.
  453. X@tindex vi-rev-repeat-find
  454. X@kindex ,
  455. X@item vi-rev-repeat-find (unbound) (,)
  456. XRepeat the last @code{vi-find} command in the opposite direction.
  457. X@end table
  458. X
  459. X@node History Control, Modifying Text, Movement, Zsh Line Editor
  460. X@section History Control
  461. X
  462. X@table @code
  463. X@kindex ESC-<
  464. X@tindex beginning-of-buffer-or-history
  465. X@item beginning-of-buffer-or-history (@key{ESC}-<)
  466. XMove to the beginning of the buffer, or if already there, move to the
  467. Xfirst event in the history list.
  468. X@tindex beginning-of-line-hist
  469. X@item beginning-of-line-hist
  470. XMove to the beginning of the line.  If already at the beginning of the
  471. Xbuffer, move to the previous history line.
  472. X@tindex beginning-of-history
  473. X@item beginning-of-history
  474. XMove to the first event in the history list.
  475. X@tindex down-line-or-history
  476. X@kindex CTRL-N
  477. X@kindex ESC-[B
  478. X@kindex +
  479. X@kindex j
  480. X@item down-line-or-history (@ctrl{N} @key{ESC}-[B) (+ j)
  481. XMove down a line in the buffer, or if already at the bottom line, move
  482. Xto the next event in the history list.
  483. X@tindex down-line-or-search
  484. X@item down-line-or-search
  485. XMove down a line in the buffer, or if already at the bottom line,
  486. Xsearch forward in the history for a line beginning with the first
  487. Xword in the buffer.
  488. X@tindex down-history
  489. X@kindex CTRL-N
  490. X@item down-history (unbound) (@ctrl{N})
  491. XMove to the next event in the history list.
  492. X@tindex end-of-buffer-or-history
  493. X@kindex ESC->
  494. X@item end-of-buffer-or-history (@key{ESC}->)
  495. XMove to the end of the buffer, or if already there, move to the last
  496. Xevent in the history list.
  497. X@tindex end-of-line-hist
  498. X@item end-of-line-hist
  499. XMove to the end of the line.  If already at the end of the buffer, move
  500. Xto the next history line.
  501. X@tindex end-of-history
  502. X@item end-of-history
  503. XMove to the last event in the history list.
  504. X@tindex vi-fetch-history
  505. X@kindex G
  506. X@item vi-fetch-history (unbound) (G)
  507. XFetch the history line specified by the numeric argument.
  508. X@tindex history-incremental-search-backward
  509. X@kindex CTRL-R
  510. X@kindex CTRL-X r
  511. X@item history-incremental-search-backward (@ctrl{R} @ctrl{X}r)
  512. XSearch backward incrementally for a specified string.  The string may
  513. Xbegin with @code{^} to anchor the search to the beginning of the line.
  514. X@tindex history-incremental-search-forward
  515. X@kindex CTRL-S
  516. X@kindex CTRL-X s
  517. X@item history-incremental-search-forward (@ctrl{S} @ctrl{X}s)
  518. XSearch forward incrementally for a specified string.  The string may
  519. Xbegin with @code{^} to anchor the search to the beginning of the line.
  520. X@tindex history-search-backward
  521. X@kindex ESC-P
  522. X@kindex ESC-p
  523. X@kindex K
  524. X@item history-search-backward (@key{ESC}-P @key{ESC}-p) (K)
  525. XSearch backward in the history for a line beginning with the first word
  526. Xin the buffer.
  527. X@tindex vi-history-search-backward
  528. X@kindex /
  529. X@item vi-history-search-backward (unbound) (/)
  530. XSearch backward in the history for a specified string.  The string may
  531. Xbegin with @code{^} to anchor the search to the beginning of the line.
  532. X@tindex history-search-forward
  533. X@kindex ESC-N
  534. X@kindex ESC-n
  535. X@kindex J
  536. X@item history-search-forward (@key{ESC}-N @key{ESC}-n) (J)
  537. XSearch forward in the history for a line beginning with the first word
  538. Xin the buffer.
  539. X@tindex vi-history-search-forward
  540. X@kindex ?
  541. X@item vi-history-search-forward (unbound) (?)
  542. XSearch forward in the history for a specified string.  The string may
  543. Xbegin with @code{^} to anchor the search to the beginning of the line.
  544. X@tindex infer-next-history
  545. X@kindex CTRL-X CTRL-N
  546. X@item infer-next-history (@ctrl{X}@ctrl{N})
  547. XSearch in the history list for a line matching the current one and fetch
  548. Xthe event following it.
  549. X@tindex insert-last-word
  550. X@kindex ESC-_
  551. X@kindex ESC-.
  552. X@item insert-last-word (@key{ESC}-_ @key{ESC}-.)
  553. XInsert the last word from the previous history event at the cursor
  554. Xposition.
  555. X@tindex vi-repeat-search
  556. X@kindex n
  557. X@item vi-repeat-search (unbound) (n)
  558. XRepeat the last vi history search.
  559. X@tindex vi-rev-repeat-search
  560. X@kindex N
  561. X@item vi-rev-repeat-search (unbound) (N)
  562. XRepeat the last vi history
  563. Xsearch, but in reverse.
  564. X@tindex toggle-literal-history
  565. X@pindex HIST_LIT, use of
  566. X@kindex ESC-R
  567. X@kindex ESC-r
  568. X@item toggle-literal-history (@key{ESC}-R @key{ESC}-r)
  569. XToggle between literal and lexical history.  The default is lexical
  570. Xhistory unless the @code{HIST_LIT} option is set.
  571. X@kindex CTRL-P
  572. X@kindex ESC-[A
  573. X@kindex -
  574. X@kindex k
  575. X@tindex up-line-or-history
  576. X@item up-line-or-history (@ctrl{P} @key{ESC}-[A) (- k)
  577. XMove up a line in the buffer, or if already at the top line, move to the
  578. Xprevious event in the history list.
  579. X@tindex up-line-or-search
  580. X@item up-line-or-search
  581. XMove up a line in the buffer, or if already at the top line, search
  582. Xbackward in the history for a line beginning with the first word in the
  583. Xbuffer.
  584. X@tindex up-history
  585. X@kindex CTRL-P
  586. X@item up-history (unbound) (@ctrl{P})
  587. XMove to the previous event in the history list.
  588. X@end table
  589. X
  590. X@node Modifying Text, Arguments, History Control, Zsh Line Editor
  591. X@section Modifying Text
  592. X
  593. X@table @code
  594. X@tindex vi-add-eol
  595. X@kindex A
  596. X@item vi-add-eol (unbound) (A)
  597. XMove to the end of the line and enter insert mode.
  598. X@tindex vi-add-next
  599. X@kindex a
  600. X@item vi-add-next (unbound) (a)
  601. XMove forward one character and enter insert mode.
  602. X@tindex backward-delete-char
  603. X@kindex CTRL-H
  604. X@kindex CTRL-?
  605. X@item backward-delete-char (@ctrl{H} @ctrl{?}) (@ctrl{?})
  606. XDelete the character behind the cursor.
  607. X@tindex vi-backward-delete-char
  608. X@kindex X
  609. X@item vi-backward-delete-char (unbound) (X)
  610. XDelete the character behind the cursor, without changing lines.
  611. X@tindex backward-delete-word
  612. X@item backward-delete-word
  613. XDelete the word behind the cursor.
  614. X@tindex backward-kill-line
  615. X@item backward-kill-line
  616. XKill from the beginning of the line to the cursor position.
  617. X@tindex backward-kill-word
  618. X@kindex CTRL-W
  619. X@kindex ESC-CTRL-H
  620. X@kindex ESC-CTRL-?
  621. X@item backward-kill-word (@ctrl{W} @key{ESC}-@ctrl{H} @key{ESC}-@ctrl{?})
  622. XKill the word behind the cursor.
  623. X@tindex vi-backward-kill-word
  624. X@kindex CTRL-W
  625. X@item vi-backward-kill-word (unbound) (@ctrl{W})
  626. XKill the word behind the cursor.
  627. X@tindex capitalize-word
  628. X@kindex ESC-C
  629. X@kindex ESC-c
  630. X@item capitalize-word (@key{ESC}-C @key{ESC}-c)
  631. XCapitalize the current word and move past it.
  632. X@tindex vi-change
  633. X@kindex c
  634. X@item vi-change (unbound) (c)
  635. XRead a movement command from the keyboard, and kill from the cursor
  636. Xposition to the endpoint of the movement.  Then enter insert mode.  If
  637. Xthe command is @code{vi-change}, kill the current line.
  638. X@tindex vi-change-eol
  639. X@kindex C
  640. X@item vi-change-eol (unbound) (C)
  641. XKill to the end of the line and enter insert mode.
  642. X@tindex vi-change-whole-line
  643. X@kindex S
  644. X@kindex s
  645. X@item vi-change-whole-line (unbound) (S s)
  646. XKill the current line and enter insert mode.
  647. X@tindex copy-region-as-kill
  648. X@kindex ESC-W
  649. X@kindex ESC-w
  650. X@item copy-region-as-kill (@key{ESC}-W @key{ESC}-w)
  651. XCopy the area from the cursor to the mark to the kill buffer.
  652. X@tindex copy-prev-word
  653. X@kindex ESC-CTRL-_
  654. X@item copy-prev-word (@key{ESC}-@ctrl{_})
  655. XDuplicate the word behind the cursor.
  656. X@tindex vi-delete
  657. X@kindex d
  658. X@item vi-delete (unbound) (d)
  659. XRead a movement command from the keyboard, and kill from the cursor
  660. Xposition to the endpoint of the movement.  If the command is
  661. X@code{vi-delete}, kill the current line.@refill
  662. X@tindex delete-char
  663. X@kindex x
  664. X@item delete-char (unbound) (x)
  665. XDelete the character under the cursor.
  666. X@tindex vi-delete-char
  667. X@item vi-delete-char (unbound) (x)
  668. XDelete the character under the cursor.
  669. X@tindex delete-word
  670. X@kindex ESC-D
  671. X@kindex ESC-d
  672. X@item delete-word (@key{ESC}-D @key{ESC}-d)
  673. XDelete the current word.
  674. X@tindex down-case-word
  675. X@kindex ESC-L
  676. X@kindex ESC-l
  677. X@item down-case-word (@key{ESC}-L @key{ESC}-l)
  678. XConvert the current word to all lowercase and move past it.
  679. X@tindex kill-word
  680. X@item kill-word
  681. XKill the current word.
  682. X@tindex gosmacs-transpose-chars
  683. X@item gosmacs-transpose-chars
  684. XExchange the two characters behind the cursor.
  685. X@kindex >
  686. X@tindex vi-indent
  687. X@item vi-indent (unbound) (>)
  688. XIndent a number of lines.
  689. X@kindex i
  690. X@tindex vi-insert
  691. X@item vi-insert (unbound) (i)
  692. XEnter insert mode.
  693. X@kindex I
  694. X@tindex vi-insert-bol
  695. X@item vi-insert-bol (unbound) (I)
  696. XMove to the beginning of the line and enter insert mode.
  697. X@tindex vi-join
  698. X@kindex CTRL-X CTRL-J
  699. X@item vi-join (@ctrl{X}@ctrl{J})
  700. XJoin the current line with the next one.
  701. X@tindex kill-line
  702. X@kindex CTRL-K
  703. X@kindex D
  704. X@item kill-line (@ctrl{K}) (D)
  705. XKill from the cursor to the end of the line.
  706. X@tindex kill-region
  707. X@item kill-region
  708. XKill from the cursor to the mark.
  709. X@tindex kill-buffer
  710. X@kindex CTRL-X CTRL-K
  711. X@kindex CTRL-U
  712. X@item kill-buffer (@ctrl{X}@ctrl{K}) (@ctrl{U})
  713. XKill the entire buffer.
  714. X@tindex kill-whole-line
  715. X@kindex CTRL-U
  716. X@item kill-whole-line (@ctrl{U}) (unbound)
  717. XKill the current line.
  718. X@tindex vi-match-bracket
  719. X@kindex CTRL-X CTRL-B
  720. X@kindex %
  721. X@item vi-match-bracket (@ctrl{X}@ctrl{B}) (%)
  722. XMove to the bracket character (one of @code{@{@}}, @code{()}, or
  723. X@code{[]}) that matches the one under the cursor.@refill
  724. X@tindex vi-open-line-above
  725. X@kindex O
  726. X@item vi-open-line-above (unbound) (O)
  727. XOpen a line above the cursor and enter insert mode.
  728. X@tindex vi-open-line-below
  729. X@kindex o
  730. X@item vi-open-line-below (unbound) (o)
  731. XOpen a line below the cursor and enter insert mode.
  732. X@tindex vi-oper-swap-case
  733. X@item vi-oper-swap-case
  734. XRead a movement command from the keyboard, and swap the case of all
  735. Xcharacters from the cursor position to the endpoint of the movement.  If
  736. Xthe movement command is @code{vi-oper-swap-case}, swap the case of all
  737. Xcharacters on the current line.@refill
  738. X@tindex overwrite-mode
  739. X@kindex CTRL-X CTRL-O
  740. X@item overwrite-mode (@ctrl{X}@ctrl{O})
  741. XToggle between overwrite mode and insert mode.
  742. X@tindex vi-put-after
  743. X@kindex p
  744. X@item vi-put-after (unbound) (p)
  745. XInsert the contents of the kill buffer after the cursor.
  746. X@tindex quoted-insert
  747. X@kindex CTRL-V
  748. X@item quoted-insert (@ctrl{V})
  749. XInsert the next character typed into the buffer literally.
  750. X@tindex quote-line
  751. X@kindex ESC-'
  752. X@item quote-line (@key{ESC}-')
  753. XQuote the current line; that is, put a @code{'} character at the
  754. Xbeginning and the end, and convert all @code{'} characters to @code{\'} @refill .
  755. X@tindex quote-region
  756. X@kindex ESC-"
  757. X@item quote-region (@key{ESC}-")
  758. XQuote the region from the cursor to the mark.
  759. X@tindex vi-replace
  760. X@kindex R
  761. X@item vi-replace (unbound) (R)
  762. XEnter overwrite mode.
  763. X@tindex vi-repeat-change
  764. X@kindex .
  765. X@item vi-repeat-change (unbound) (.)
  766. XRepeat the last vi mode text modification.
  767. X@tindex vi-replace-chars
  768. X@kindex r
  769. X@item vi-replace-chars (unbound) (r)
  770. XReplace the character under the cursor with a character read from the
  771. Xkeyboard.
  772. X@tindex self-insert
  773. X@item self-insert (printable characters)
  774. XPut a character in the buffer at the cursor position.
  775. X@tindex self-insert-unmeta
  776. X@kindex ESC-CTRL-I
  777. X@kindex ESC-CTRL-J
  778. X@kindex ESC-CTRL-M
  779. X@item self-insert-unmeta (@key{ESC}-@ctrl{I} @key{ESC}-@ctrl{J} @key{ESC}-@ctrl{M})
  780. XPut a character in the buffer after stripping the meta bit and
  781. Xconverting @ctrl{M} to @ctrl{J}.
  782. X@tindex vi-substitute
  783. X@kindex s
  784. X@item vi-substitute (unbound) (s)
  785. XSubstitute the next character(s).
  786. X@tindex vi-swap-case
  787. X@kindex ~
  788. X@item vi-swap-case (unbound) (~)
  789. XSwap the case of the character under the cursor and move past it.
  790. X@tindex transpose-chars
  791. X@kindex CTRL-T
  792. X@item transpose-chars (@ctrl{T})
  793. XExchange the two characters to the left of the cursor if at end of line,
  794. Xelse exchange the character under the cursor with the character to the
  795. Xleft.
  796. X@tindex transpose-words
  797. X@kindex ESC-T
  798. X@kindex ESC-t
  799. X@item transpose-words (@key{ESC}-T @key{ESC}-t)
  800. XExchange the current word with the one before it.
  801. X@tindex vi-unindent
  802. X@kindex <
  803. X@item vi-unindent (unbound) (<)
  804. XUnindent a number of lines.
  805. X@tindex up-case-word
  806. X@kindex ESC-U
  807. X@kindex ESC-u
  808. X@item up-case-word (@key{ESC}-U @key{ESC}-u)
  809. XConvert the current word to all caps and move past it.
  810. X@tindex yank
  811. X@kindex CTRL-Y
  812. X@kindex P
  813. X@item yank (@ctrl{Y}) (P)
  814. XInsert the contents of the kill buffer at the cursor position.
  815. X@tindex yank-pop
  816. X@kindex ESC-y
  817. X@item yank-pop (@key{ESC}-y) (unbound)
  818. XRemove the text just yanked, rotate the kill-ring, and yank the new top.
  819. XOnly works following @code{yank} or @code{yank-pop}.
  820. X@tindex vi-yank
  821. X@kindex y
  822. X@item vi-yank (unbound) (y)
  823. XRead a movement command from the keyboard, and copy the region from the
  824. Xcursor position to the endpoint of the movement into the kill buffer.
  825. XIf the command is @code{vi-yank}, copy the current line.
  826. X@kindex Y
  827. X@tindex vi-yank-eol
  828. X@item vi-yank-eol (unbound) (Y)
  829. XCopy the region from the cursor position to the end of the line into the
  830. Xkill buffer.
  831. X@end table
  832. X
  833. X@node Arguments, Completion, Modifying Text, Zsh Line Editor
  834. X@section Arguments
  835. X
  836. X@table @code
  837. X@tindex digit-argument
  838. X@kindex ESC-0
  839. X@kindex ESC-9
  840. X@kindex 0
  841. X@kindex 9
  842. X@item digit-argument (@key{ESC}-0@dots{}@key{ESC}-9) (0-9)
  843. XStart a new numeric argument, or add to the current one.
  844. X@tindex universal-argument
  845. X@item universal-argument
  846. XMultiply the argument of the next command by 4.
  847. X@end table
  848. X
  849. X@node Completion, Miscellaneous, Arguments, Zsh Line Editor
  850. X@section Completion
  851. X
  852. X@table @code
  853. X@tindex accept-and-menu-complete
  854. X@item accept-and-menu-complete
  855. XIn a menu completion, insert the current completion into the buffer, and
  856. Xadvance to the next possible completion.
  857. X@tindex complete-word
  858. X@kindex \
  859. X@item complete-word (unbound) (\)
  860. XAttempt completion on the current word.
  861. X@tindex delete-char-or-list
  862. X@kindex CTRL-D
  863. X@item delete-char-or-list (@ctrl{D})
  864. XDelete the character under the cursor.  If the cursor is at the end of
  865. Xthe line, list possible completions for the current word.
  866. X@tindex execute-named-cmd
  867. X@kindex ESC-x
  868. X@item execute-named-cmd (@key{ESC}-x)
  869. XRead the name of a editor command and execute it.
  870. X@tindex execute-last-named-cmd
  871. X@kindex ESC-z
  872. X@item execute-last-named-cmd (@key{ESC}-z)
  873. XRedo the last function executed
  874. Xwith @code{execute-named-cmd}.
  875. X@tindex expand-cmd-path
  876. X@item expand-cmd-path
  877. XExpand the current command to its full pathname.
  878. X@tindex expand-or-complete
  879. X@kindex TAB
  880. X@kindex CTRL-X
  881. X@item expand-or-complete (@key{TAB}) (@key{TAB} @ctrl{X})
  882. XAttempt shell expansion on the current word.  If that fails, attempt
  883. Xcompletion.
  884. X@tindex expand-history
  885. X@kindex ESC-SPACE
  886. X@kindex ESC-!
  887. X@item expand-history (@key{ESC}-@key{SPACE} @key{ESC}-!)
  888. XPerform history expansion on the edit buffer.
  889. X@tindex expand-word
  890. X@kindex CTRL-X *
  891. X@item expand-word (@ctrl{X}*)
  892. XAttempt shell expansion on the current word.
  893. X@tindex list-choices
  894. X@kindex ESC-CTRL-D
  895. X@kindex CTRL-D
  896. X@kindex =
  897. X@item list-choices (@key{ESC}-@ctrl{D}) (@ctrl{D} =)
  898. XList possible completions for the current word.
  899. X@tindex list-expand
  900. X@kindex CTRL-X g
  901. X@kindex CTRL-X G
  902. X@kindex CTRL-G
  903. X@item list-expand (@ctrl{X}g @ctrl{X}G) (@ctrl{G})
  904. XList the expansion of the current word.
  905. X@tindex magic-space
  906. X@item magic-space
  907. XPerform history expansion and insert a space into the buffer.  This is
  908. Xintended to be bound to space.
  909. X@tindex menu-complete
  910. X@pindex MENU_COMPLETE, use of
  911. X@item menu-complete
  912. XLike @code{complete-word}, except that menu completion is used.
  913. X@xref{Options}, for the @code{MENU_COMPLETE} option.@refill
  914. X@tindex menu-expand-or-complete
  915. X@item menu-expand-or-complete
  916. XLike @code{expand-or-complete}, except that menu completion is used.
  917. X@tindex reverse-menu-complete
  918. X@item reverse-menu-complete
  919. X@xref{Options}, for the @code{MENU_COMPLETE} option.
  920. X@end table
  921. X
  922. X@node Miscellaneous,  , Completion, Zsh Line Editor
  923. X@section Miscellaneous
  924. X
  925. X@table @code
  926. X@tindex accept-and-hold
  927. X@kindex ESC-A
  928. X@kindex ESC-a
  929. X@item accept-and-hold (@key{ESC}-A @key{ESC}-a)
  930. XPush the contents of the buffer on the buffer stack and execute it.
  931. X@tindex accept-and-infer-next-history
  932. X@item accept-and-infer-next-history
  933. XExecute the contents of the buffer.  Then search the history list for a
  934. Xline matching the current one and push the event following onto the
  935. Xbuffer stack.
  936. X@tindex accept-line
  937. X@kindex CTRL-J
  938. X@kindex CTRL-M
  939. X@item accept-line (@ctrl{J} @ctrl{M})
  940. XExecute the contents of the buffer.
  941. X@tindex accept-line-and-down-history
  942. X@kindex CTRL-O
  943. X@item accept-line-and-down-history (@ctrl{O})
  944. XExecute the current line, and push the next history event on the the
  945. Xbuffer stack.
  946. X@tindex vi-cmd-mode
  947. X@kindex CTRL-X CTRL-V
  948. X@kindex CTRL-[
  949. X@item vi-cmd-mode (@ctrl{X}@ctrl{V}) (@ctrl{[})
  950. XEnter command mode; that is, use the alternate keymap.  Yes, this is
  951. Xbound by default in emacs mode.
  952. X@tindex vi-caps-lock-panic
  953. X@kindex H
  954. X@kindex K
  955. X@item vi-caps-lock-panic (unbound) (H K)
  956. XHang until any lowercase key is pressed.  This is for @code{vi} users
  957. Xwithout the mental capacity to keep track of their caps lock key (like
  958. Xthe author).@refill
  959. X@tindex clear-screen
  960. X@kindex CTRL-L
  961. X@kindex ESC-CTRL-L
  962. X@item clear-screen (@ctrl{L} @key{ESC}-@ctrl{L})
  963. XClear the screen and redraw the prompt.
  964. X@tindex exchange-point-and-mark
  965. X@kindex CTRL-X CTRL-X
  966. X@item exchange-point-and-mark (@ctrl{X}@ctrl{X})
  967. XExchange the cursor position with the position of the mark.
  968. X@tindex get-line
  969. X@kindex ESC-G
  970. X@kindex ESC-g
  971. X@item get-line (@key{ESC}-G @key{ESC}-g)
  972. XPop the top line off the buffer stack and insert it at the cursor
  973. Xposition.
  974. X@tindex pound-insert
  975. X@kindex #
  976. X@pindex INTERACTIVE_COMMENTS, use of
  977. X@item pound-insert (unbound) (#)
  978. XIf there is no @code{#} character at the beginning of the current line,
  979. Xadd one.  If there is one, remove it.  In either case, accept the
  980. Xcurrent line.  The @code{INTERACTIVE_COMMENTS} option must be set for
  981. Xthis to have any usefulness.@refill
  982. X@tindex push-line
  983. X@kindex CTRL-Q
  984. X@kindex ESC-Q
  985. X@kindex ESC-q
  986. X@item push-line (@ctrl{Q} @key{ESC}-Q @key{ESC}-q)
  987. XPush the current buffer onto the buffer stack and clear the buffer.
  988. XNext time the editor starts up, the buffer will be popped off the top of
  989. Xthe buffer stack and loaded into the editing buffer.
  990. X@tindex redisplay
  991. X@kindex CTRL-R
  992. X@item redisplay (unbound) (@ctrl{R})
  993. XRedisplays the edit buffer.
  994. X@tindex run-help
  995. X@kindex ESC-H
  996. X@kindex ESC-h
  997. X@item run-help (@key{ESC}-H @key{ESC}-h)
  998. XPush the buffer onto the buffer stack, and execute the command
  999. X@code{run-help @var{cmd}}, where @var{cmd} is the current command.
  1000. X@code{run-help} is normally aliased to @code{man}.@refill
  1001. X@tindex send-break
  1002. X@kindex CTRL-C
  1003. X@item send-break (@ctrl{C})
  1004. XAbort the parsing of the current line.
  1005. X@tindex vi-set-buffer
  1006. X@kindex "
  1007. X@item vi-set-buffer (unbound) (")
  1008. XSpecify a buffer to be used in the following command.
  1009. X@tindex vi-set-mark
  1010. X@kindex m
  1011. X@item vi-set-mark (unbound) (m)
  1012. XSet the specified mark at the cursor position.
  1013. X@tindex set-mark-command
  1014. X@kindex CTRL-@@
  1015. X@item set-mark-command (@ctrl{@@})
  1016. XSet the mark at the cursor position.
  1017. X@tindex spell-word
  1018. X@kindex ESC-$
  1019. X@kindex ESC-S
  1020. X@kindex ESC-s
  1021. X@item spell-word (@key{ESC}-$ @key{ESC}-S @key{ESC}-s)
  1022. XAttempt spelling correction on the current word.
  1023. X@tindex undefined-key
  1024. X@item undefined-key
  1025. XBeep.
  1026. X@tindex undo
  1027. X@kindex CTRL-_
  1028. X@kindex CTRL-X CTRL-U
  1029. X@kindex CTRL-X u
  1030. X@kindex u
  1031. X@item undo (@ctrl{_} @ctrl{X}@ctrl{U} @ctrl{X}u) (u)
  1032. XIncrementally undo the last text modification.
  1033. X@tindex which-command
  1034. X@kindex ESC-?
  1035. X@item which-command (@key{ESC}-?)
  1036. XPush the buffer onto the buffer stack, and execute the command
  1037. X@code{which-command @var{cmd}}, where @var{cmd} is the current command.
  1038. X@code{which-command} is normally aliased to @code{whence}.
  1039. X@end table
  1040. X
  1041. X@node Parameters, Options, Zsh Line Editor, Top
  1042. X@chapter Parameters
  1043. X@cindex parameters
  1044. X
  1045. X@findex typeset, use of
  1046. X@findex set, use of
  1047. X@noindent
  1048. XA parameter has a name, a value, and a number of attributes.  A name may
  1049. Xbe any sequence of alphanumeric characters and @code{_}'s, or the single
  1050. Xcharacters @code{*}, @code{@@}, @code{#}, @code{?}, @code{-}, @code{$},
  1051. Xor @code{!}.  The value may be either a @var{scalar} (a string), an
  1052. Xinteger, or an array.  To assign a scalar or integer value to a
  1053. Xparameter, use the @code{typeset} builtin.  To assign an array value,
  1054. Xuse @samp{set -A @var{name} @var{value} @dots{}}.  The value of a parameter
  1055. Xmay also be assigned by writing:@refill
  1056. X
  1057. X@code{@var{name}=@var{value} @dots{}}
  1058. X
  1059. X@noindent
  1060. XIf the integer attribute, @code{-i}, is set for @var{name}, the
  1061. X@var{value} is subject to arithmetic evaluation.@refill
  1062. X
  1063. X@menu
  1064. X* Array Parameters::            
  1065. X* Positional Parameters::       
  1066. X* Parameters Set By The Shell::  
  1067. X* Parameters Used By The Shell::  
  1068. X@end menu
  1069. X
  1070. X@node Array Parameters, Positional Parameters,  , Parameters
  1071. X@section Array Parameters
  1072. X
  1073. X@noindent
  1074. XThe value of an array parameter may be assigned by writing:
  1075. X
  1076. X@var{name}=(@var{value} @dots{}) @dots{}
  1077. X
  1078. X@cindex array elements
  1079. X@noindent
  1080. XIndividual elements of an array may be selected using a subscript.  A
  1081. Xsubscript of the form @code{[@var{exp}]} selects the single element
  1082. X@var{exp}, where @var{exp} is an arithmetic expression.  The elements
  1083. Xare numbered beginning with 1.  A subscript of the form @code{[*]} or
  1084. X@code{[@@]} evaluates to all elements of an array; there is no
  1085. Xdifference between the two except when they appear within double quotes.
  1086. X@samp{$foo[*]} evaluates to @samp{$foo[1] $foo[2] @dots{}}, while
  1087. X@samp{$foo[@@]} evaluates to @samp{$foo[1]} @samp{$foo[2]}, etc.  A
  1088. Xsubscript of the form @code{[@var{exp1},@var{exp2}]} selects all
  1089. Xelements in the range @var{exp1} to @var{exp2}, inclusive.  If one of
  1090. Xthe subscripts evaluates to a negative number, say @code{-@var{n}}, then
  1091. Xthe @var{n}th element from the end of the array is used.  Thus
  1092. X@samp{$foo[-3]} is the third element from the end of the array
  1093. X@code{foo}, and @samp{$foo[1,-1]} is the same as @samp{$foo[*]}.@refill
  1094. X
  1095. X@cindex substrings
  1096. X@noindent
  1097. XSubscripting may also be performed on non-array values, in which case
  1098. Xthe subscripts specify a substring to be extracted.  For example, if
  1099. X@code{FOO} is set to @code{foobar}, then @code{echo $FOO[2,5]} prints
  1100. X@code{ooba}.@refill
  1101. X
  1102. X@node Positional Parameters, Parameters Set By The Shell, Array Parameters, Parameters
  1103. X@section Positional Parameters
  1104. X
  1105. X@noindent
  1106. XPositional parameters are set by the shell on invocation, by the
  1107. X@code{set} builtin, or by direct assignment.  The parameter @var{n},
  1108. Xwhere @var{n} is a number, is the @var{n}th positional parameter.  The
  1109. Xparameters @code{*}, @code{@@}, and @code{argv} are arrays containing all
  1110. Xthe positional parameters; thus @code{argv[@var{n}]}, etc., is equivalent
  1111. Xto simply @var{n}.@refill
  1112. X
  1113. X@node Parameters Set By The Shell, Parameters Used By The Shell, Positional Parameters, Parameters
  1114. X@section Parameters Set By The Shell
  1115. X
  1116. X@noindent
  1117. XThe following parameters are automatically set by the shell:
  1118. X
  1119. X@table @code
  1120. X@vindex !
  1121. X@item !
  1122. XThe process id of the last background command invoked.
  1123. X@vindex #
  1124. X@item #
  1125. XThe number of positional parameters in decimal.
  1126. X@vindex ARGC
  1127. X@item ARGC
  1128. XSame as @code{#}.
  1129. X@vindex $
  1130. X@item $
  1131. XThe process id of this shell.
  1132. X@vindex -
  1133. X@item -
  1134. XFlags supplied to the shell on invocation or by the @code{set} or
  1135. X@code{setopt} commands.
  1136. X@vindex *
  1137. X@item *
  1138. XAn array containing the positional parameters.
  1139. X@vindex argv
  1140. X@item argv
  1141. XSame as @code{*}.
  1142. X@vindex @@
  1143. X@item @@
  1144. XSame as @code{argv[@@]}.
  1145. X@vindex ?
  1146. X@item ?
  1147. XThe exit value returned by the last command.
  1148. X@vindex status
  1149. X@item status
  1150. XSame as @code{?}.
  1151. X@vindex _
  1152. X@item _
  1153. XThe last argument of the previous command.  Also, this parameter is set
  1154. Xin the environment of every command executed to the full pathname of the
  1155. Xcommand.
  1156. X@vindex ERRNO
  1157. X@item ERRNO
  1158. XThe value of errno as set by the most recently failed system call.  This
  1159. Xvalue is system dependent and is intended for debugging purposes.
  1160. X@vindex GID
  1161. X@item GID
  1162. XThe group id of the shell process.
  1163. X@vindex HOST
  1164. X@item HOST
  1165. XThe current hostname.
  1166. X@vindex HOSTTYPE
  1167. X@item HOSTTYPE
  1168. XA string corresponding to the type of the host the shell is running on.
  1169. X@vindex LINENO
  1170. X@item LINENO
  1171. XThe line number of the current line within the current script being
  1172. Xexecuted.
  1173. X@vindex OLDPWD
  1174. X@item OLDPWD
  1175. XThe previous working directory.
  1176. X@vindex OPTARG
  1177. X@item OPTARG
  1178. XThe value of the last option argument processed by the @code{getopts}
  1179. Xcommand.
  1180. X@vindex OPTIND
  1181. X@item OPTIND
  1182. XThe index of the last option argument processed by the @code{getopts}
  1183. Xcommand.
  1184. X@vindex PPID
  1185. X@item PPID
  1186. XThe process id of the parent of the shell.
  1187. X@vindex PWD
  1188. X@item PWD
  1189. XThe present working directory.
  1190. X@vindex RANDOM
  1191. X@item RANDOM
  1192. XA random integer from 0 to 32767, newly generated each time this
  1193. Xparameter is referenced.  The random number generator can be seeded by
  1194. Xassigning a numeric value to @code{RANDOM}.
  1195. X@vindex SECONDS
  1196. X@item SECONDS
  1197. XThe number of seconds since shell invocation.  If this parameter is
  1198. Xassigned a value, then the value returned upon reference will be the
  1199. Xvalue that was assigned plus the number of seconds since the assignment.
  1200. X@vindex SHLVL
  1201. X@item SHLVL
  1202. XIncremented by one each time a new shell is started.
  1203. X@vindex signals
  1204. X@item signals
  1205. XAn array containing the names of the signals.
  1206. X@vindex TTY
  1207. X@item TTY
  1208. XThe name of the tty associated with the shell, if any.
  1209. X@vindex UID
  1210. X@item UID
  1211. XThe user id of the shell process.
  1212. X@vindex USERNAME
  1213. X@item USERNAME
  1214. X@vindex LOGNAME
  1215. X@itemx LOGNAME
  1216. XThe username corresponding to the user id of the shell process.
  1217. X@vindex VERSION
  1218. X@item VERSION
  1219. XThe version number of this @code{zsh}.
  1220. X@end table
  1221. X
  1222. X@node Parameters Used By The Shell,  , Parameters Set By The Shell, Parameters
  1223. X@section Parameters Used By The Shell
  1224. X
  1225. X@noindent
  1226. XThe following parameters are used by the shell:
  1227. X
  1228. X@table @code
  1229. X@vindex BAUD
  1230. X@item BAUD
  1231. XThe baud rate of the current connection.  Used by the line editor update
  1232. Xmechanism to compensate for a slow terminal by delaying updates until
  1233. Xnecessary.  This may be profitably set to a lower value in some
  1234. Xcircumstances, e.g. for slow modems dialing into a communications server
  1235. Xwhich is connected to a host via a fast link; in this case, this
  1236. Xvariable would be set by default to the speed of the fast link, and not
  1237. Xthe modem.  This parameter should be set to the baud rate of the slowest
  1238. Xpart of the link for best performance.
  1239. X@vindex bindcmds
  1240. X@item bindcmds
  1241. XAn write-only array of command names which take line editor function
  1242. Xnames as arguments, and which therefore should allow binding completion.
  1243. X@vindex cdpath
  1244. X@vindex CDPATH
  1245. X@item cdpath (CDPATH)
  1246. XAn array (colon-separated list) of directories specifying the search
  1247. Xpath for the @code{cd} command.
  1248. X@vindex COLUMNS
  1249. X@item COLUMNS
  1250. XThe number of columns for this terminal session.  Used for printing
  1251. Xselect lists and for the line editor.
  1252. X@vindex DIRSTACKSIZE
  1253. X@pindex AUTO_PUSHD, use of
  1254. X@item DIRSTACKSIZE
  1255. XThe maximum size of the directory stack.  If the stack gets larger than
  1256. Xthis, it will be truncated automatically.  This is useful with the
  1257. X@code{AUTO_PUSHD} option.
  1258. X@vindex FCEDIT
  1259. X@item FCEDIT
  1260. XThe default editor for the @code{fc} builtin.
  1261. X@vindex fignore
  1262. X@vindex FIGNORE
  1263. X@item fignore (FIGNORE)
  1264. XAn array (colon-separated list) containing the suffixes of files to be
  1265. Xignored during filename completion.
  1266. X@vindex fpath
  1267. X@vindex FPATH
  1268. X@item fpath (FPATH)
  1269. XAn array (colon-separated list) of directories specifying the search
  1270. Xpath for function definitions.  This path is searched when a function
  1271. Xwith the @code{-u} attribute is referenced.  If an executable file is
  1272. Xfound, then it is read and executed in the current environment.
  1273. X@vindex HISTCHARS
  1274. X@item HISTCHARS
  1275. XThree characters used by the shell's history and lexical analysis
  1276. Xmechanism.  The first character signals the start of a history
  1277. Xsubstitution (default @code{!}).  The second character signals the start
  1278. Xof a quick history substitution (default @code{^}).  The third character
  1279. Xis the comment character (default @code{#}).@refill
  1280. X@vindex HISTFILE
  1281. X@item HISTFILE
  1282. XThe file to save the history in when an interactive shell exits.  If
  1283. Xunset, the history is not saved.
  1284. X@vindex HISTSIZE
  1285. X@item HISTSIZE
  1286. XThe maximum size of the history list.
  1287. X@vindex HOME
  1288. X@item HOME
  1289. XThe default argument for the @code{cd} command.
  1290. X@vindex hostcmds
  1291. X@item hostcmds
  1292. XAn write-only array of command names which take hostnames as arguments,
  1293. Xand which should therefore allow hostname completion.  This sort of
  1294. Xcompletion is also used in words containing a @code{@@} character.
  1295. X@vindex hosts
  1296. X@vindex HOSTS
  1297. X@item hosts (HOSTS)
  1298. XAn array (colon-separated list) of hostnames to use for hostname
  1299. Xcompletion.
  1300. X@vindex IFS
  1301. X@item IFS
  1302. XInternal field separators, normally space, tab, and newline, that are
  1303. Xused to separate words which result from command or parameter
  1304. Xsubstitution and words read by the @code{read} builtin.
  1305. X@vindex LINES
  1306. X@item LINES
  1307. XThe number of lines for this terminal session.  Used for printing select
  1308. Xlists and for the line editor.
  1309. X@vindex LISTMAX
  1310. X@item LISTMAX
  1311. XIn the line editor, the number of filenames to list without asking
  1312. Xfirst.
  1313. X@vindex LITHISTSIZE
  1314. X@item LITHISTSIZE
  1315. XThe maximum size of the literal history list (before history expansion).
  1316. X@vindex LOGCHECK
  1317. X@item LOGCHECK
  1318. XThe interval in seconds between checks for login/logout activity using
  1319. Xthe @code{watch} parameter.
  1320. X@vindex MAIL
  1321. X@item MAIL
  1322. XIf this parameter is set and @code{mailpath} is not set, the shell looks
  1323. Xfor mail in the specified file.
  1324. X@vindex MAILCHECK
  1325. X@item MAILCHECK
  1326. XThe interval in seconds between checks for new mail.
  1327. X@vindex mailpath
  1328. X@vindex MAILPATH
  1329. X@item mailpath (MAILPATH)
  1330. XAn array (colon-separated list) of filenames to check for new mail.
  1331. XEach filename can be followed by a @code{?} and a message that will be
  1332. Xprinted.  The sequence @code{$_} in the message will be replaced by the
  1333. Xname of the mail file.  The default message is @samp{You have new
  1334. Xmail}.@refill
  1335. X@vindex manpath
  1336. X@vindex MANPATH
  1337. X@item manpath (MANPATH)
  1338. XAn array (colon-separated list) whose value is not used by the shell.
  1339. XThe @code{manpath} array can be useful, however, since setting it also
  1340. Xsets @code{MANPATH}, and vice versa.
  1341. X@vindex NULLCMD
  1342. X@item NULLCMD
  1343. XThe command name to assume if a redirection is specified with no
  1344. Xcommand.  Defaults to @code{cat}.  For sh/ksh-like behavior, change this
  1345. Xto @code{:}.  For csh-like behavior, unset this parameter; the shell will
  1346. Xprint an error message if null commands are entered.
  1347. X@vindex optcmds
  1348. X@item optcmds
  1349. XAn write-only array of commands which take options as arguments, and
  1350. Xwhich therefore should allow option completion.
  1351. X@vindex path
  1352. X@vindex PATH
  1353. X@item path (PATH)
  1354. XAn array (colon-separated list) of directories to search for commands.
  1355. XWhen this parameter is set, each directory is scanned and all files
  1356. Xfound are put in a hash table.
  1357. X@vindex POSTEDIT
  1358. X@item POSTEDIT
  1359. XThis string is output whenever the line editor exits.  It usually
  1360. Xcontains termcap strings to reset the terminal.
  1361. X@vindex PROMPT
  1362. X@item PROMPT
  1363. XThe primary prompt string, printed before a command is read; the default
  1364. Xis @samp{%m%# }.  If the escape sequence takes an optional
  1365. Xinteger, it should appear between the @samp{%} and the next character of the
  1366. Xsequence.  The following escape sequences are recognized:
  1367. X
  1368. X@table @code
  1369. X@item %d, %/
  1370. XPresent working directory (@code{$PWD}).
  1371. X@item %~
  1372. X@code{$PWD}.  If it has a named directory as its prefix, that part is
  1373. Xreplaced by a @code{~} followed by the name of the directory.  If it
  1374. Xstarts with @code{$HOME}, that part is replaced by a @code{~}.@refill
  1375. X@item %c, %, %C
  1376. XTrailing component of @code{$PWD}.  An integer may follow the @samp{%} to get 
  1377. Xmore than one component.  Unless @code{%C} is used, tilde expansion is
  1378. Xperformed first.@refill
  1379. X@item !, %h, %!
  1380. XCurrent history event number
  1381. X@item %M
  1382. XThe full machine hostname.
  1383. X@item %m
  1384. XThe hostname up to the first @samp{.}.  An integer may follow the @samp{%} to
  1385. Xspecify how many components of the hostname are desired.@refill
  1386. X@item %S (%s)
  1387. XStart (stop) standout mode.
  1388. X@item %U (%u)
  1389. XStart (stop) underline mode.
  1390. X@item %B (%b)
  1391. XStart (stop) boldface mode.
  1392. X@item %t
  1393. X@itemx %@@
  1394. XCurrent time of day, in 12-hour, am/pm format.
  1395. X@item %T
  1396. XCurrent time of day, in 24-hour format.
  1397. X@item %*
  1398. XCurrent time of day in 24-hour format, with seconds.
  1399. X@item %n
  1400. X@code{$USERNAME}.
  1401. X@item %w
  1402. XThe date in day-dd format.
  1403. X@item %W
  1404. XThe date in mm/dd/yy format.
  1405. X@item %D
  1406. XThe date in yy-mm-dd format.
  1407. X@item %D @{@var{string}@}
  1408. X@var{string} is formatted using the @code{strftime} function.  See
  1409. X@code{strftime(3)} for more details, if your system has it.@refill
  1410. X@item %l
  1411. XThe line (tty) the user is logged in on.
  1412. X@item %?
  1413. XThe return code of the last command executed just before the prompt.
  1414. X@item %#
  1415. XA @code{#} if the shell is running as root, a @code{%} if not.
  1416. X@item %v
  1417. XThe value of the first element of the @code{psvar} array
  1418. Xparameter.  Following the @samp{%} with an integer gives that element 
  1419. Xof the array.@refill
  1420. X@item %@{@dots{}%@}
  1421. XInclude a string as a literal escape sequence.  The string within the
  1422. Xbraces should not change the cursor position.
  1423. X@end table
  1424. X
  1425. X@vindex PROMPT2
  1426. X@item PROMPT2
  1427. XThe secondary prompt, printed when the shell needs more information to
  1428. Xcomplete a command.  Recognizes the same escape sequences as
  1429. X@code{PROMPT}.  The default is @samp{> }.@refill
  1430. X@vindex PROMPT3
  1431. X@item PROMPT3
  1432. XSelection prompt used within a @code{select} loop.  Recognizes the same
  1433. Xescape sequences as @code{PROMPT}.  The default is @samp{?# }.@refill
  1434. X@vindex PROMPT4
  1435. X@item PROMPT4
  1436. XThe execution trace prompt.  Default is @samp{+ }.
  1437. X@vindex PS1
  1438. X@vindex PS2
  1439. X@vindex PS3
  1440. X@vindex PS4
  1441. X@item PS1, PS2, PS3, PS4
  1442. XSame as @code{PROMPT}, @code{PROMPT2}, @code{PROMPT3}, and @code{PROMPT4},
  1443. Xrespectively.@refill
  1444. X@vindex psvar
  1445. X@vindex PSVAR
  1446. X@item psvar (PSVAR)
  1447. XAn array (colon-separated list) whose first nine values can be used in
  1448. X@code{PROMPT} strings.  Setting @code{psvar} also sets @code{PSVAR}, and vice
  1449. Xversa.
  1450. X@vindex prompt
  1451. X@item prompt
  1452. XSame as @code{PROMPT}.
  1453. X@vindex READNULLCMD
  1454. X@item READNULLCMD
  1455. XThe command name to assume if a single input redirection is specified
  1456. Xwith no command.  Defaults to @code{more}.
  1457. X@vindex REPORTTIME
  1458. X@item REPORTTIME
  1459. XIf nonzero, commands whose combined user and system execution times
  1460. X(measured in seconds) are greater than this value have timing statistics
  1461. Xprinted for them.
  1462. X@vindex RPROMPT
  1463. X@vindex RPS1
  1464. X@item RPROMPT, RPS1
  1465. XThis prompt is displayed on the right-hand side of the screen when the
  1466. Xprimary prompt is being displayed on the left.  This does not work if
  1467. Xthe @code{SINGLE_LINE_ZLE} option is set.  Recognizes the same escape
  1468. Xsequences as @code{PROMPT}, except that termcap sequences like
  1469. X@code{%s}, etc., will not work.@refill
  1470. X@vindex SAVEHIST
  1471. X@item SAVEHIST
  1472. XThe maximum number of history events to save in the history file.
  1473. X@vindex SPROMPT
  1474. X@item SPROMPT
  1475. XThe prompt used for spelling correction.  The sequence @code{%R} expands
  1476. Xto the string which presumably needs spelling correction, and @code{%r}
  1477. Xexpands to the proposed correction.  All other @code{PROMPT} escapes are
  1478. Xalso allowed.@refill
  1479. X@vindex STTY
  1480. X@item STTY
  1481. XIf this parameter is set in a command's environment, the shell runs the
  1482. X@code{stty} command with the value of this parameter as arguments in
  1483. Xorder to set up the terminal before executing the command.@refill
  1484. X@vindex TIMEFMT
  1485. X@item TIMEFMT
  1486. XThe format of process time reports with the @code{time} keyword.  The
  1487. Xdefault is @samp{%E real %U user %S system %P}.  Recognizes the
  1488. Xfollowing escape sequences:@refill
  1489. X
  1490. X@table @code
  1491. X@item %U
  1492. XCPU seconds spent in user mode.
  1493. X@item %S
  1494. XCPU seconds spent in kernel mode.
  1495. X@item %E
  1496. XElapsed time in seconds.
  1497. X@item %P
  1498. XThe CPU percentage, computed as (%U+%S)/%E.
  1499. X@item %W
  1500. XNumber of times the process was swapped.
  1501. X@item %X
  1502. XThe average amount in (shared) text space used in Kbytes.
  1503. X@item %D
  1504. XThe average amount in (unshared) data/stack space used in Kbytes.
  1505. X@item %K
  1506. XThe total space used (%X+%D) in Kbytes.
  1507. X@item %M
  1508. XThe maximum memory the process had in use at any time in Kbytes.
  1509. X@item %F
  1510. XThe number of major page faults (page needed to be brought from
  1511. Xdisk).@refill
  1512. X@item %R
  1513. XThe number of minor page faults.
  1514. X@item %I
  1515. XThe number of input operations.
  1516. X@item %O
  1517. XThe number of output operations.
  1518. X@item %r
  1519. XThe number of socket messages received.
  1520. X@item %s
  1521. XThe number of socket messages sent.
  1522. X@item %k
  1523. XThe number of signals received.
  1524. X@item %w
  1525. XNumber of voluntary context switches (waits).
  1526. X@item %c
  1527. XNumber of involuntary context switches.
  1528. X@item %J
  1529. XThe name of this job.
  1530. X@end table
  1531. X
  1532. X@vindex TMOUT
  1533. X@item TMOUT
  1534. XIf this parameter is nonzero, the shell will terminate if a command is
  1535. Xnot entered within the specified number of seconds after issuing a
  1536. Xprompt.
  1537. X@vindex TMPPREFIX
  1538. X@item TMPPREFIX
  1539. XA pathname prefix which the shell will use for all temporary files.
  1540. X@vindex varcmds
  1541. X@item varcmds
  1542. XAn write-only array of command names which take parameter names as
  1543. Xarguments, and which therefore should allow parameter completion.
  1544. X@vindex watch
  1545. X@vindex WATCH
  1546. X@item watch (WATCH)
  1547. XAn array (colon-separated list) of login/logout events to report.  If it
  1548. Xcontains the single word @samp{all}, then all login/logout events are
  1549. Xreported.  If it contains the single word @samp{notme}, then all
  1550. Xlogin/logout events are reported except for those originating from
  1551. X@code{$USERNAME}.  An entry in this list may consist of a username, an
  1552. X@code{@@} followed by a remote hostname, and a @code{%} followed by a
  1553. Xline (tty).  Any or all of these components may be present in an entry;
  1554. Xif a login/logout event matches all of them, it is reported.@refill
  1555. X@vindex WATCHFMT
  1556. X@item WATCHFMT
  1557. XThe format of login/logout reports if the @code{watch} parameter is set.
  1558. XDefault is @samp{%n has %a %l from %m}.  Recognizes the following escape
  1559. Xsequences:@refill
  1560. X
  1561. X@table @code
  1562. X@item %n
  1563. XThe name of the user that logged in/out.
  1564. X@item %a
  1565. XThe observed action, i.e. @samp{logged on} or @samp{logged off}.
  1566. X@item %l
  1567. XThe line (tty) the user is logged in on.
  1568. X@item %M
  1569. XThe full hostname of the remote host.
  1570. X@item %m
  1571. XThe hostname up to the first @samp{.}.  If only the ip address is
  1572. Xavailable or the utmp field contains the name of an X-windows display,
  1573. Xthe whole name is printed.@refill
  1574. X@item %S (%s)
  1575. XStart (stop) standout mode.
  1576. X@item %U (%u)
  1577. XStart (stop) underline mode.
  1578. X@item %B (%b)
  1579. XStart (stop) boldface mode.
  1580. X@item %t
  1581. X@itemx %@@
  1582. XThe time, in 12-hour, am/pm format.
  1583. X@item %T
  1584. XThe time, in 24-hour format.
  1585. X@item %w
  1586. XThe date in day-dd format.
  1587. X@item %W
  1588. XThe date in mm/dd/yy format.
  1589. X@item %D
  1590. XThe date in yy-mm-dd format.
  1591. X@end table
  1592. X
  1593. X@vindex WORDCHARS
  1594. X@item WORDCHARS
  1595. XA list of nonalphanumeric characters considered part of a word by the
  1596. Xline editor.
  1597. X@vindex ZDOTDIR
  1598. X@item ZDOTDIR
  1599. XThe directory to search for shell startup files (@file{.zshrc}, etc), if
  1600. Xnot @code{$HOME}.@refill
  1601. X@end table
  1602. X
  1603. X@node Options, Shell Builtin Commands, Parameters, Top
  1604. X@chapter Options
  1605. X@cindex options
  1606. X
  1607. X@noindent
  1608. XThe following options may be set upon invocation of the shell, or with
  1609. Xthe @code{set} or @code{setopt} builtins:@refill
  1610. X
  1611. X@table @code
  1612. X@cindex export, automatic
  1613. X@pindex ALLEXPORT
  1614. X@item ALLEXPORT (-a)
  1615. END_OF_FILE
  1616.   if test 49503 -ne `wc -c <'doc/zsh.texi.02'`; then
  1617.     echo shar: \"'doc/zsh.texi.02'\" unpacked with wrong size!
  1618.   fi
  1619.   # end of 'doc/zsh.texi.02'
  1620. fi
  1621. echo shar: End of archive 4 \(of 22\).
  1622. cp /dev/null ark4isdone
  1623. MISSING=""
  1624. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ; do
  1625.     if test ! -f ark${I}isdone ; then
  1626.     MISSING="${MISSING} ${I}"
  1627.     fi
  1628. done
  1629. if test "${MISSING}" = "" ; then
  1630.     echo You have unpacked all 22 archives.
  1631.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1632. else
  1633.     echo You still must unpack the following archives:
  1634.     echo "        " ${MISSING}
  1635. fi
  1636. exit 0
  1637.  
  1638. exit 0 # Just in case...
  1639.