home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume43 / zsh / part03 < prev    next >
Encoding:
Internet Message Format  |  1994-07-14  |  87.0 KB

  1. From: zsh-list@sterling.com (Bas de Bakker)
  2. Newsgroups: comp.sources.misc
  3. Subject: v43i092:  zsh - The Z shell, version 2.5.0, Part03/18
  4. Date: 13 Jul 1994 23:02:00 -0500
  5. Organization: Sterling Software
  6. Sender: kent@sparky.sterling.com
  7. Approved: kent@sparky.sterling.com
  8. Message-ID: <302dbo$squ@sparky.sterling.com>
  9. X-Md4-Signature: 60d9e7e5109c9e98ad1eb40085388320
  10.  
  11. Submitted-by: zsh-list@sterling.com (Bas de Bakker)
  12. Posting-number: Volume 43, Issue 92
  13. Archive-name: zsh/part03
  14. Environment: UNIX
  15. Supersedes: zsh: Volume 35, Issue 51-72
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  zsh-2.5.0/man/zsh.1.A zsh-2.5.0/src/config/bz.config.h
  22. # Wrapped by kent@sparky on Tue Jul 12 16:47:17 1994
  23. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 3 (of 18)."'
  26. if test -f 'zsh-2.5.0/man/zsh.1.A' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'zsh-2.5.0/man/zsh.1.A'\"
  28. else
  29.   echo shar: Extracting \"'zsh-2.5.0/man/zsh.1.A'\" \(71886 characters\)
  30.   sed "s/^X//" >'zsh-2.5.0/man/zsh.1.A' <<'END_OF_FILE'
  31. X.\"
  32. X.TH ZSH 1 "3 June 1994" "zsh version 2.5.0"
  33. X.SH NAME
  34. Xzsh \- the Z shell
  35. X.SH SYNOPSIS
  36. X\fBzsh\fP [ \(+-\fIoptions\fP ] [ \(+-\fBo\fP \fIoption\fP ] ...  [ \-\fBc\fP \fIstring\fP ] [ \fIarg\fP ... ]
  37. X.SH "SHELL GRAMMAR"
  38. XA \fIsimple command\fP is a sequence of optional parameter
  39. Xassignments followed by blank-separated words,
  40. Xwith optional redirections interspersed.
  41. XThe first word is the command to be executed, and the remaining
  42. Xwords, if any, are arguments to the command.
  43. XIf a command name is given, the parameter assignments modify
  44. Xthe environment of the command when it is executed.
  45. XThe value of a simple command is its exit status,
  46. Xor 128 plus the signal number if terminated by a signal.
  47. X.PP
  48. XIf a simple command is preceded by the word \fBexec\fP,
  49. Xit is executed in the parent shell without forking.
  50. XIf preceded by \fBcommand\fP, the command word is taken
  51. Xto be the name of an external command, rather than a
  52. Xshell function or builtin.
  53. XIf preceded by \fBnoglob\fP, filename generation is not performed
  54. Xon any of the words.  If preceded by a \-, the command
  55. Xis executed with a \- prepended to its \fBargv[0]\fP string.
  56. XIf preceded by \fBnocorrect\fP, spelling correction is not
  57. Xdone on any of the words.
  58. X.PP
  59. XA \fIpipeline\fP is a sequence of one or more commands
  60. Xseparated by \fB|\fP or \fB|&\fP.  \fB|&\fP is shorthand
  61. Xfor \fB2>&1 |\fP.  The standard output of each command is
  62. Xconnected to the standard input of the next command in the
  63. Xpipeline.
  64. X.PP
  65. XThe value of a pipeline is the value of the last command.
  66. XIf a pipeline is preceded by a \fB!\fP, the value
  67. Xof that pipeline is the logical NOT of the value of the last
  68. Xcommand.
  69. X.PP
  70. XIf a pipeline is preceded by \fBcoproc\fP, it is
  71. Xexecuted as a coprocess; a two-way pipe is established
  72. Xbetween it and the parent shell.  The shell can read from or write to
  73. Xthe coprocess by means of the \fB>&p\fP and \fB<&p\fP
  74. Xredirection operators.
  75. X.PP
  76. XA \fIsublist\fP is a sequence of one or more pipelines
  77. Xseparated by \fB&&\fP or \fB|\||\fP.  If two pipelines
  78. Xare separated by \fB&&\fP, the second pipeline is executed
  79. Xonly if the first is successful (returns a zero value).
  80. XIf two pipelines are separated by \fB|\||\fP, the second is executed
  81. Xonly if the first is unsuccessful (returns a nonzero value).  Both
  82. Xoperators have equal precedence and are left associative.
  83. X.PP
  84. XA \fIlist\fP is a sequence of one or more sublists
  85. Xseparated by, and optionally terminated by, \fB;\fP, \fB&\fP,
  86. Xor a newline.
  87. XNormally the shell waits for each list to finish before executing
  88. Xthe next one.
  89. XIf a list is terminated by a \fB&\fP, the shell executes
  90. Xit in the background, and does not wait for it to finish.
  91. X.PP
  92. XA \fIcomplex command\fP is one of the following:
  93. X.PP
  94. X.RS
  95. X.PD 0
  96. X.TP
  97. X\fBfor\fP \fIname\fP [ \fBin\fP \fIword\fP ... ]
  98. X.TP
  99. X\fBdo\fP \fIlist\fP
  100. X.TP
  101. X\fBdone\fP
  102. X.PD
  103. XExpand the list of \fIword\fPs, and set the parameter
  104. X\fIname\fP to each of them in turn, executing
  105. X\fIlist\fP each time.  If the \fBin\fP \fIword\fP is omitted,
  106. Xuse the positional parameters instead of the \fIword\fPs.
  107. X.TP
  108. X\fBfor\fP \fIname\fP [ \fBin\fP \fIword\fP ... ] ; \fIsublist\fP
  109. XThis is a shorthand for \fBfor\fP.
  110. XThough it may cause confusion, it is included for convenience;
  111. Xits use in scripts is discouraged,
  112. Xunless \fIsublist\fP is a command of the form { \fIlist\fP }.
  113. X.PP
  114. X.PD 0
  115. X.TP
  116. X\fBforeach\fP \fIname\fP \fB(\fP \fIword\fP ... \fB)\fP
  117. X.TP
  118. X\fIlist\fP
  119. X.TP
  120. X\fBend\fP
  121. X.PD
  122. XAnother form of \fBfor\fP.
  123. X.PP
  124. X.PD 0
  125. X.TP
  126. X\fBfor\fP \fIname\fP \fBin\fP \fIword\fP ...
  127. X.TP
  128. X\fB{\fP
  129. X.TP
  130. X\fIlist\fP
  131. X.TP
  132. X\fB}\fP
  133. X.PD
  134. XAnother form of \fBfor\fP.
  135. X.PP
  136. X.PD 0
  137. X.TP
  138. X\fBfor\fP \fIname\fP \fB(\fP \fIword\fP ... \fB) {\fP
  139. X.TP
  140. X\fIlist\fP
  141. X.TP
  142. X\fB}\fP
  143. X.PD
  144. XAnother form of \fBfor\fP:  this requires the option \fBCSH_JUNKIE_PAREN\fP.
  145. X.PP
  146. X.PD 0
  147. X.TP
  148. X\fBfor\fP \fIname\fP \fB(\fP \fIword\fP ... \fB) \fIsublist\fP
  149. X.PD
  150. XAnother form of \fBfor\fP:  this also requires \fBCSH_JUNKIE_PAREN\fP.
  151. X.PP
  152. X.PD 0
  153. X.TP
  154. X\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP ... ]
  155. X.TP
  156. X\fBdo\fP \fIlist\fP
  157. X.TP
  158. X\fBdone\fP
  159. X.PD
  160. XPrint the set of \fIword\fPs, each preceded by a number.
  161. XIf the \fBin\fP \fIword\fP is omitted, use the positional parameters.
  162. XThe \fBPROMPT3\fP prompt is printed and a line is read from standard
  163. Xinput.  If this line consists of the number of one of the listed
  164. X\fIword\fPs, then the parameter \fIname\fP
  165. Xis set to the \fIword\fP corresponding to this number.
  166. XIf this line is empty, the selection list is printed again.
  167. XOtherwise, the value of the parameter \fIname\fP is set to null.
  168. XThe contents of the line read from standard input is saved
  169. Xin the parameter \fBREPLY\fP.  \fIlist\fP is executed
  170. Xfor each selection until a break or end-of-file is encountered.
  171. X.TP
  172. X\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP ] ; \fIsublist\fP
  173. XA short form of \fBselect\fP.
  174. X.TP
  175. X\fBcase\fP \fIword\fP \fBin\fP [ \fIpattern\fP ) \fIlist\fP ;; ] ...  \fBesac\fP
  176. XExecute the \fIlist\fP associated with the first \fIpattern\fP
  177. Xthat matches \fIword\fP, if any.  The form of the patterns
  178. Xis the same as that used for filename generation.  See
  179. X\fIFilename Generation\fP below.
  180. X.TP
  181. X\fBcase\fP \fIword\fP \fB{\fP [ \fIpattern\fP ) \fIlist\fP ;; ] ...  \fB}\fP
  182. XAnother form of \fBcase\fP.
  183. X.TP
  184. X.PD 0
  185. X\fBif\fP \fIlist\fP
  186. X.TP
  187. X\fBthen\fP \fIlist\fP
  188. X.TP
  189. X[ \fBelif\fP \fIlist\fP ; \fBthen\fP \fIlist\fP ] ...
  190. X.TP
  191. X[ \fBelse\fP \fIlist\fP ]
  192. X.TP
  193. X\fBfi\fP
  194. X.PD
  195. XThe \fBif\fP \fIlist\fP is executed, and,
  196. Xif it returns a zero exit status,
  197. Xthe \fBthen\fP \fIlist\fP is executed.
  198. XOtherwise, the \fBelif\fP \fIlist\fP is
  199. Xexecuted and, if its value is zero,
  200. Xthe \fBthen\fP \fIlist\fP is executed.
  201. XIf each \fBelif\fP \fIlist\fP returns
  202. Xnonzero, the \fBelse\fP \fIlist\fP is executed.
  203. X.TP
  204. X\fBif (\fP \fIlist\fP \fB)\fP \fIsublist\fP
  205. XA short form of \fBif\fP:  this requires the option \fBCSH_JUNKIE_PAREN\fP.
  206. X.PP
  207. X.PD 0
  208. X.TP
  209. X\fBif\fP \fB(\fP \fIlist\fP \fB) {\fP
  210. X.TP
  211. X\fIlist\fP
  212. X.TP
  213. X\fB} elif (\fP \fIlist\fP \fB) {\fP
  214. X.TP
  215. X\fIlist\fP
  216. X.TP
  217. X\fB} ... else {\fP
  218. X.TP
  219. X\fIlist\fP
  220. X.TP
  221. X\fB}\fP
  222. X.PD
  223. XAn alternative form of \fBif\fP. The parentheses surrounding
  224. X\fIlist\fP can be omitted if the only command in the list is a
  225. Xconditional expression of the form [[ exp ]] (see below).  This form
  226. Xalso requires \fBCSH_JUNKIE_PAREN\fP.
  227. X.TP
  228. X.PD 0
  229. X\fBwhile\fP \fIlist\fP
  230. X.TP
  231. X\fBdo\fP \fIlist\fP
  232. X.TP
  233. X\fBdone\fP
  234. X.PD
  235. XExecute the \fBdo\fP \fIlist\fP as long as the \fBwhile\fP \fIlist\fP
  236. Xreturns a zero exit status.
  237. X.PP
  238. X.PD 0
  239. X.TP
  240. X\fBwhile (\fP \fIlist\fP \fB) {\fP
  241. X.TP
  242. X\fIlist\fP
  243. X.TP
  244. X\fB}\fP
  245. X.PD
  246. XAn alternative form of \fBwhile\fP:  this requires the option
  247. X\fBCSH_JUNKIE_PAREN\fP.
  248. X.TP
  249. X.PD 0
  250. X\fBuntil\fP \fIlist\fP
  251. X.TP
  252. X\fBdo\fP \fIlist\fP
  253. X.TP
  254. X\fBdone\fP
  255. X.PD
  256. XExecute the \fBdo\fP \fIlist\fP as long as \fBuntil\fP \fIlist\fP
  257. Xreturns a nonzero exit status.
  258. X.TP
  259. X.PD 0
  260. X\fBrepeat\fP \fIword\fP
  261. X.TP
  262. X\fBdo\fP \fIlist\fP
  263. X.TP
  264. X\fBdone\fP
  265. X.PD
  266. X\fIword\fP is expanded and treated as an arithmetic expression,
  267. Xwhich must evaluate to a number \fIn\fP.
  268. X\fIlist\fP is then executed \fBn\fP times.
  269. X.TP
  270. X\fBrepeat\fP \fIword\fP \fIsublist\fP
  271. XThis is a short form of \fBrepeat\fP.
  272. X.TP
  273. X( \fIlist\fP )
  274. XExecute \fIlist\fP in a subshell.
  275. X.TP
  276. X{ \fIlist\fP }
  277. XExecute \fIlist\fP.
  278. X.TP
  279. X.PD 0
  280. X\fBfunction\fP \fIword\fP [ (\|) ] ... { \fIlist\fP }
  281. X.TP
  282. X\fIword\fP ... (\|) { \fIlist\fP }
  283. X.TP
  284. X\fIword\fP ... (\|) \fIsublist\fP
  285. X.PD
  286. XDefine a function which is referenced by any one of \fIword\fP.
  287. XNormally, only one \fIword\fP is provided; multiple \fIword\fPs
  288. Xare usually only useful for setting traps.
  289. XThe body of the function is the \fIlist\fP between
  290. Xthe { and }.
  291. XSee \fBFUNCTIONS\fP below.
  292. X.TP
  293. X\fBtime\fP [ \fIpipeline\fP ]
  294. XThe \fIpipeline\fP is executed, and timing statistics are
  295. Xreported on the standard error in the form specified
  296. Xby the \fBTIMEFMT\fP parameter.
  297. XIf \fIpipeline\fP is omitted, print statistics about the
  298. Xshell process and its children.
  299. X.TP
  300. X[[ \fIexp\fP ]]
  301. XEvaluates the conditional expression \fIexp\fP
  302. Xand return a zero exit status if it is true.
  303. XSee \fBConditional Expressions\fP below for a description
  304. Xof \fIexp\fP.
  305. X.SH "RESERVED WORDS"
  306. XThe following words are recognized as reserved words when used 
  307. Xas the first word of a command
  308. Xunless quoted or removed using the \fBunalias\fP builtin:
  309. X.RS
  310. X.PP
  311. X\fBdo done esac then elif else fi for case
  312. Xif while function repeat time until exec command
  313. Xselect coproc noglob \- nocorrect foreach end\fP
  314. X.RE
  315. X.SH COMMENTS
  316. XIn noninteractive shells, or in interactive shells with the
  317. X\fBINTERACTIVE_COMMENTS\fP option set, a word beginning
  318. Xwith the third character of the \fBHISTCHARS\fP parameter
  319. X(`#' by default) causes that word and all the following
  320. Xcharacters up to a newline to be ignored.
  321. X.SH ALIASING
  322. XEvery token in the shell input is checked to see if there
  323. Xis an alias defined for it.
  324. XIf so, it is replaced by the text of the alias if it is in command
  325. Xposition (if it could be the first word of a simple command),
  326. Xor if the alias is global.
  327. XIf the text ends with a space, the next word in the shell input
  328. Xis treated as though it were in command position for purposes of alias
  329. Xexpansion.
  330. XAn alias is defined using the \fBalias\fP builtin; global aliases
  331. Xmay be defined using the \-\fBg\fP option to that builtin.
  332. X.PP
  333. XAlias substitution is done on the shell input before any
  334. Xother substitution except history substitution.  Therefore,
  335. Xif an alias is defined for the word \fBfoo\fP, alias substitution
  336. Xmay be avoided by quoting part of the word, e.g. \fB\efoo\fP.
  337. XBut there is nothing to prevent an alias being defined
  338. Xfor \fB\efoo\fP as well.
  339. X.SH QUOTING
  340. XA character may be \fIquoted\fP (that is, made
  341. Xto stand for itself) by preceding it with a \e\|.
  342. X\e followed by a newline is ignored.
  343. XAll characters enclosed between a pair of single quotes ('')
  344. Xare quoted, except the first character of HISTCHARS ( `!' by default).
  345. XA single quote cannot appear within single quotes.
  346. XInside double quotes (""), parameter and command substitution
  347. Xoccurs, and \e quotes the characters \e\|, `, ", and $.
  348. X.SH EXPANSION
  349. XExpansion is performed on the command line after it has been
  350. Xparsed.  The types of expansions performed are
  351. X\fIfilename expansion\fP, 
  352. X\fIprocess substitution\fP,
  353. X\fIparameter expansion\fP,
  354. X\fIcommand substitution\fP,
  355. X\fIarithmetic expansion\fP,
  356. X\fIbrace expansion\fP,
  357. Xand \fIfilename generation\fP.
  358. X.SS Filename Expansion
  359. XEach word is checked to see if it begins with an unquoted ~.
  360. XIf it does, then the word up to a / is checked to see if it matches
  361. Xthe name of a named directory.  If so, then the ~ and the matched portion
  362. Xare replaced with the value of the named directory.
  363. XA ~ by itself or followed by a / is replaced by the value of the
  364. X\fBHOME\fP parameter.
  365. XA ~ followed by a + or a \- is replaced by the value of 
  366. X\fBPWD\fP or \fBOLDPWD\fP, respectively.
  367. X.PP
  368. XNamed directories are typically login directories for users on the system.
  369. XThey may also be defined if the text after the ~ is the name
  370. Xof a string shell parameter whose value begins with a /.
  371. XIn certain circumstances (in prompts, for instance), when the shell
  372. Xprints a path, the path is checked to see if it has a named
  373. Xdirectory as its prefix.  If so, then the prefix portion
  374. Xis replaced with a ~ followed by the name of the directory.
  375. XThe longest match is preferred.
  376. X.PP
  377. XIf a word begins with an unquoted \fB=\fP and the
  378. X\fBNO_EQUALS\fP option is not set,
  379. Xthe remainder of the word is taken as the
  380. Xname of a command or alias.  If a command
  381. Xexists by that name, the word is replaced
  382. Xby the full pathname of the command.
  383. XIf an alias exists by that name, the word
  384. Xis replaced with the text of the alias.
  385. XOtherwise the word is checked up to a /
  386. Xto see if it is a number or a \-.  If so,
  387. Xthe matched portion is replaced with
  388. Xthe \fIn\fPth directory in the directory stack,
  389. Xwhere \fIn\fP is the number matched, or
  390. Xthe last directory in the directory stack
  391. Xif a \- is matched.
  392. X.PP
  393. XFilename expansion is performed on the right hand side of a parameter
  394. Xassignment, including those appearing after commands of the
  395. X\fBtypeset\fR family.  In this case, the right hand side will be treated
  396. Xas a colon-separated list in the manner of \fBPATH\fR so that a ~ or an
  397. X= following a : is eligible for expansion.  All such behavior can be
  398. Xdisabled by quoting the ~, the =, or the whole expression (but not
  399. Xsimply the colon); the \fBNO_EQUALS\fP option is also respected.
  400. X.PP
  401. XIf the option \fBMAGIC_EQUAL_SUBST\fP is set, any unquoted shell
  402. Xargument in the form \fIidentifier\fP=\fIexpression\fP becomes eligible
  403. Xfor file expansion as described in the previous paragraph.  Quoting the
  404. Xfirst = also inhibits this.
  405. X.SS Process Substitution
  406. XEach command argument of the form
  407. X\fB<(\fIlist\^\fB)\fR
  408. Xor
  409. X\fB>(\fIlist\^\fB)\fR
  410. Xor
  411. X\fB=(\fIlist\^\fB)\fR
  412. Xis subject to process substitution.
  413. XIn the case of the
  414. X.B <
  415. Xor
  416. X.B >
  417. Xforms, the shell will run process
  418. X.I list
  419. Xasynchronously connected to a named pipe (FIFO).
  420. XThe name of this pipe will become the argument to the command.
  421. XIf the form with
  422. X.B >
  423. Xis selected then writing on this file will provide input for
  424. X.IR list .
  425. XIf
  426. X.B <
  427. Xis used,
  428. Xthen the file passed as an argument will
  429. Xbe a named pipe connected to the output of the
  430. X.I list
  431. Xprocess.
  432. XFor example,
  433. X.RS
  434. X.PP
  435. X\fBpaste <(cut \-f1\fP \fIfile1\fB) <(cut \-f3\fP \fIfile2\fB) | tee >(\fIprocess1\fB) >(\fIprocess2\fB)\fR >/dev/null
  436. X.RE
  437. X.PP
  438. X.BR cut s
  439. Xfields 1 and 3 from
  440. Xthe files
  441. X.I file1
  442. Xand
  443. X.I file2
  444. Xrespectively,
  445. X.BR paste s
  446. Xthe results together, and sends it to the processes
  447. X.I process1
  448. Xand
  449. X.IR process2 .
  450. XNote that the file, which is passed as an argument to the command,
  451. Xis a system
  452. Xpipe 
  453. Xso programs that expect to
  454. X.BR lseek (2)
  455. Xon the file will not work.
  456. XAlso note that the previous example can be more compactly and
  457. Xefficiently written as:
  458. X.RS
  459. X.PP
  460. X\fBpaste <(cut \-f1\fP \fIfile1\fB) <(cut \-f3\fP \fIfile2\fB) > >(\fIprocess1\fB) > >(\fIprocess2\fB)\fR
  461. X.RE
  462. X.PP
  463. XThe shell uses pipes instead of FIFOs to implement the latter
  464. Xtwo process substitutions in the above example.
  465. X.PP
  466. XIf
  467. X.B =
  468. Xis used,
  469. Xthen the file passed as an argument will be the name
  470. Xof a temporary file containing
  471. Xthe output of the
  472. X.I list
  473. Xprocess.  This may be used instead of the
  474. X.B <
  475. Xform for a program that expects to \fBlseek\fP(2) on the input file.
  476. X.SS Parameter Expansion
  477. XThe character \fB$\fP is used to introduce parameter expansions.
  478. XSee \fBPARAMETERS\fP below for a description of parameters.
  479. X.PD
  480. X.RS
  481. X.TP
  482. X\fB${\fIname\fB}\fR
  483. XThe value, if any, of the parameter \fIname\fP is substituted.
  484. XThe braces are required if \fIname\fP is followed by
  485. Xa letter, digit, or underscore that is not to be interpreted
  486. Xas part of its name.
  487. XIf \fIname\fP is an array parameter, then the values of each
  488. Xelement of \fIname\fP is substituted, one element per word.
  489. XOtherwise, the expansion results in one word only; no
  490. Xword splitting is done on the result.
  491. X.TP
  492. X\fB${+\fIname\fB}\fR
  493. XIf \fIname\fP is the name of a set parameter `1' is substituted,
  494. Xotherwise `0' is substituted.
  495. X.TP
  496. X\fB${\fIname\fB:\-\fIword\fB}\fR
  497. XIf \fIname\fP is set and is non-null then substitute its
  498. Xvalue; otherwise substitute \fIword\fP.
  499. X.TP
  500. X\fB${\fIname\fB:=\fIword\fB}\fR
  501. XIf \fIname\fP is unset or is null then
  502. Xset it to \fIword\fP; the value of the parameter is then
  503. Xsubstituted.
  504. X.TP
  505. X\fB${\fIname\fB:?\fIword\fB}\fR
  506. XIf \fIname\fP is set and is non-null, then substitute
  507. Xits value; otherwise, print \fIword\fP and exit from the shell.
  508. XIf \fIword\fP is omitted, then a standard message is printed.
  509. X.TP
  510. X\fB${\fIname\fB:+\fIword\fB}\fR
  511. XIf \fIname\fP is set and is non-null then substitute
  512. X\fIword\fP; otherwise substitute nothing.
  513. X.PD 0
  514. X.TP
  515. X\fB${\fIname\fB#\fIpattern\fB}\fR
  516. X.TP
  517. X\fB${\fIname\fB##\fIpattern\fB}\fR
  518. X.PD
  519. XIf the \fIpattern\fP matches the beginning of the value of
  520. X\fIname\fP, then substitute the value of \fIname\fP with
  521. Xthe matched portion deleted; otherwise, just
  522. Xsubstitute the value of \fIname\fP.  In the first
  523. Xform, the smallest matching pattern is preferred;
  524. Xin the second form, the largest matching pattern is preferred.
  525. X.PD 0
  526. X.TP
  527. X${\fIname\fB%\fIpattern\fR}
  528. X.TP
  529. X${\fIname\fB%%\fIpattern\fR}
  530. X.PD
  531. XIf the \fIpattern\fP matches the end of the value of
  532. X\fIname\fP, then substitute the value of \fIname\fP with
  533. Xthe matched portion deleted; otherwise, just
  534. Xsubstitute the value of \fIname\fP.  In the first
  535. Xform, the smallest matching pattern is preferred;
  536. Xin the second form, the largest matching pattern is preferred.
  537. X.TP
  538. X${\fB#\fIspec\fR}
  539. XIf \fIspec\fP is one of the above substitutions, substitute
  540. Xthe length in characters of the result instead of
  541. Xthe result itself.  If \fIspec\fP is an array expression,
  542. Xsubstitute the number of elements of the result.
  543. X.TP
  544. X${\fB^\fIspec\fR}
  545. XToggle the value of the \fBRC_EXPAND_PARAM\fP option for the
  546. Xevaluation of \fIspec\fP.
  547. XWhen this option is set, array expansions of the form
  548. X\fIfoo\fB${\fIxx\fB}\fIbar\fR, where the parameter
  549. X\fIxx\fP is set to (\fIa b c\fP), are substituted with
  550. X\fIfooabar foobbar foocbar\fP instead of the default
  551. X\fIfooa b cbar\fP.
  552. X.TP
  553. X${\fB=\fIspec\fR}
  554. XToggle the value of the \fBSH_WORD_SPLIT\fP option for the
  555. Xevaluation of \fIspec\fP.
  556. XWhen this option is set, parameter values are split into
  557. Xseparate words using \fBIFS\fP as a delimiter
  558. Xbefore substitution.
  559. XThis is done by default in most other shells.
  560. X.TP
  561. X${\fB~\fIspec\fR}
  562. XToggle the value of the \fBGLOB_SUBST\fP option for the evaluation of
  563. X\fIspec\fP.  When this option is set, any pattern characters resulting
  564. Xfrom the substitution become eligible for file expansion and filename
  565. Xgeneration.
  566. X.PD
  567. X.RE
  568. X.PP
  569. XIf the colon is omitted from one of the above expressions
  570. Xcontaining a colon, then the shell only checks whether
  571. X\fIname\fP is set or not, not whether it is null.
  572. X.PP
  573. XIf the opening brace is directly followed by an opening parentheses
  574. Xthe string up to the matching closing parentheses will be taken as a
  575. Xlist of flags.  Where arguments are valid, any character, or the
  576. Xmatching pairs `(...)', `{...}', `[...]', or `<...>',  may be used
  577. Xin place of the colon as delimiters.  The following flags are supported:
  578. X.PD
  579. X.RS
  580. X.TP
  581. X.B o
  582. XSort the resulting words in ascending order.
  583. X.TP
  584. X.B O
  585. XSort the resulting words in descending order.
  586. X.TP
  587. X.B i
  588. XWith \fBo\fP or \fBO\fP, sort case-independently.
  589. X.TP
  590. X.B L
  591. XConvert all letters in the result to lower case.
  592. X.TP
  593. X.B U
  594. XConvert all letters in the result to upper case.
  595. X.TP
  596. X.B C
  597. XCapitalize the resulting words.
  598. X.TP
  599. X.B c
  600. XWith ${#\fIname\fP}, count the total number of characters in an array,
  601. Xas if the elements were concatenated with spaces between them.
  602. X.TP
  603. X.B w
  604. XWith ${#\fIname\fP}, count words in arrays or strings; the \fIs\fP
  605. Xflag may be used to set a word delimiter.
  606. X.TP
  607. X.B l:\fIexpr\fB::\fIstring1\fB::\fIstring2\fB:
  608. XPad the resulting words on the left.  Each word will be truncated if
  609. Xrequired and placed in a field \fIexpr\fP characters wide.  The space
  610. Xto the left will be filled with \fIstring1\fP (concatenated as often
  611. Xas needed) or spaces if \fIstring1\fP is not given.  If both
  612. X\fIstring1\fP and \fIstring2\fP are given, this string will be placed
  613. Xexactly once directly to the left of the resulting word.
  614. X.TP
  615. X.B r:\fIexpr\fB::\fIstring1\fB::\fIstring2\fB:
  616. XAs \fBl...\fP, but pad the words on the right.
  617. X.TP
  618. X.B j:\fIstring\fB:
  619. XJoin the words of arrays together using \fIstring\fP as a separator.
  620. XNote that this occurs before word splitting by the \fBSH_WORD_SPLIT\fP
  621. Xoption.
  622. X.TP
  623. X.B s:\fIstring\fB:
  624. XForce word splitting (see the option \fBSH_WORD_SPLIT\fP) at the
  625. Xseparator \fIstring\fP.  Splitting only occurs in places where an
  626. Xarray value is valid.
  627. X.TP
  628. X.B S
  629. X(This and all remaining flags are used with the \fB${...#...}\fP or
  630. X\fB${...%...}\fP forms):
  631. Xsearch substrings as well as beginnings or ends.
  632. X.TP
  633. X.B I:\fIexpr\fB:
  634. XSearch the \fIexpr\fP'th match (where \fIexpr\fP evaluates to a number).
  635. X.TP
  636. X.B M
  637. XInclude the matched portion in the result.
  638. X.TP
  639. X.B R
  640. XInclude the unmatched portion in the result (the \fIR\fPest).
  641. X.TP
  642. X.B B
  643. XInclude the index of the beginning of the match in the result.
  644. X.TP
  645. X.B E
  646. XInclude the index of the end of the match in the result.
  647. X.TP
  648. X.B N
  649. XInclude the length of the match in the result.
  650. X.PD
  651. X.RE
  652. X.PP
  653. X.SS Command Substitution
  654. XA command enclosed in parentheses
  655. Xpreceded by a dollar sign, like so: $(...) or quoted with grave
  656. Xaccents: `...` is replaced with its standard output.
  657. XIf the substitution is not enclosed in double quotes, the
  658. Xoutput is broken into words using the \fBIFS\fP parameter.
  659. XThe substitution \fB$(cat foo)\fP may be replaced
  660. Xby the equivalent but faster \fB$(<foo)\fP.  In either case, if the
  661. Xoption \fBGLOB_SUBST\fP is set the output is eligible for filename
  662. Xgeneration.
  663. X.SS Arithmetic Expansion
  664. XA string of the form \fB$[\fIexp\fB]\fR is substituted
  665. Xwith the value of the arithmetic expression \fIexp\fP.
  666. XSee \fBARITHMETIC EVALUATION\fP below.
  667. X.SS Brace Expansion
  668. XA string of the form
  669. X\fIfoo\fB{\fIxx\fB,\fIyy\fB,\fIzz\fB}\fIbar\fR
  670. Xis expanded to the individual words
  671. X\fIfooxxbar\fP, \fIfooyybar\fP, and \fIfoozzbar\fP.
  672. XLeft-to-right order is preserved.  This construct
  673. Xmay be nested.  Malformed brace expansion expressions,
  674. Xincluding expressions without a comma, are left unchanged
  675. Xby the shell.
  676. X.PP
  677. XAn expression of the form
  678. X\fB{\fIx\fB\-\fIy\fB}\fR,
  679. Xwhere \fIx\fP and \fIy\fP are single characters,
  680. Xis expanded to every character between
  681. X\fIx\fP and \fIy\fP, inclusive.
  682. X.SS Filename Generation
  683. XIf a word contains an unquoted instance of one of the characters
  684. X*, |, <, [, or ?, it is regarded
  685. Xas a pattern for filename generation, unless the \fBNO_GLOB\fP option is set.
  686. XIf the \fBEXTENDED_GLOB\fP option is set, the
  687. X^,  ~ and # characters also denote a pattern; otherwise
  688. X(except for an initial ~, see \fBFilename Expansion\fP above)
  689. Xthey are not treated specially by the shell.
  690. XThe word is replaced with a list of sorted filenames that match
  691. Xthe pattern.  If no matching pattern is found, the shell gives
  692. Xan error message, unless the \fBNULL_GLOB\fP option is set,
  693. Xin which case the word is deleted; or unless the \fBNO_NOMATCH\fP
  694. Xoption is set, in which case the word is left unchanged.
  695. XIn filename generation,
  696. Xthe character / must be matched explicitly; also, a . must be matched
  697. Xexplicitly at the beginning of a pattern or after a /, unless the
  698. X\fBGLOB_DOTS\fP option is set.  No filename generation pattern
  699. Xmatches the files "." or "..".  In other instances of pattern
  700. Xmatching, the / and . are not treated specially.
  701. X.PP
  702. X.RS
  703. X.PD 0
  704. X.TP
  705. X.B *
  706. Xmatches any string, including the null string.
  707. X.TP
  708. X.B ?
  709. Xmatches any character.
  710. X.TP
  711. X\fB[ ... ]\fP
  712. Xmatches any of the enclosed characters.
  713. X.TP
  714. X\fB[^ ... ]\fP
  715. Xmatches any character except the enclosed characters.
  716. X\fB[! ... ]\fP
  717. Xis the same as the above.
  718. X.TP
  719. X\fB<x\-y>\fP
  720. Xmatches any number in the range x to y, inclusive.
  721. XIf x is omitted, the number must be less than or equal to y.
  722. XIf y is omitted, the number must be greater than or equal to x.
  723. XA pattern of the form \fB<\->\fP or
  724. Xsimply \fB<>\fP matches any number.
  725. X.TP
  726. X\fB^x\fP
  727. Xmatches anything except the pattern x.
  728. X.TP
  729. X\fBx|y\fP
  730. Xmatches either x or y.
  731. X.TP
  732. X\fBx#\fP
  733. Xmatches zero or more occurrences of the pattern x.
  734. X.TP
  735. X\fBx##\fP
  736. Xmatches one or more occurrences of the pattern x.
  737. X.RE
  738. X.PD
  739. X.PP
  740. XParentheses may be used for grouping.  Note that the \fB|\fP character
  741. Xmust be within parentheses, so that the lexical analyzer does
  742. Xnot think it is a pipe character.  Also note that "/" has a
  743. Xhigher precedence than "^"; that is:
  744. X.RS
  745. X.PP
  746. Xls
  747. X.BI ^ foo / bar
  748. X.RE
  749. X.PP
  750. Xwill search directories in "." except "./foo" for a file named bar.
  751. X.PP
  752. XA pathname component of the form
  753. X.BI ( foo /)#
  754. Xmatches a path consisting of zero or more directories
  755. Xmatching the pattern foo.
  756. XAs a shorthand,
  757. X.B **/
  758. Xis equivalent to
  759. X.BR (*/)# .
  760. XThus:
  761. X.RS
  762. X.PP
  763. Xls
  764. X.BI (*/)# bar
  765. X.RE
  766. X.PP
  767. Xor
  768. X.RS
  769. X.PP
  770. Xls
  771. X.BI **/ bar
  772. X.RE
  773. X.PP
  774. Xdoes a recursive directory search for files named bar.
  775. X.PP
  776. XIf used for filename generation, a pattern may contain an exclusion
  777. Xspecifier.  Such patterns are of the form \fIpat1\fB~\fIpat2\fR.
  778. XThis pattern will generate all files matching \fIpat1\fP, but which
  779. Xdo not match \fIpat2\fP.  For example, \fB*.c~lex.c\fP will match
  780. Xall files ending in .c, except the file \fBlex.c\fP.  This may appear
  781. Xinside parentheses.  Note that "~" has a higher precedence than "|",
  782. Xso that \fIpat1\fB|\fIpat2\fB~\fIpat3\fR matches any time that
  783. X\fIpat1\fR matches, or if \fIpat2\fR matches while \fIpat3\fR does
  784. Xnot.  Note also that "/" characters are not treated specially in the
  785. Xexclusion specifier so that a "*" will match multiple path segments if
  786. Xthey appear in the pattern to the left of the "~".
  787. X.PP
  788. XPatterns used for filename generation may also end in a
  789. Xlist of qualifiers enclosed in parentheses.
  790. XThe qualifiers
  791. Xspecify which filenames that otherwise match the given pattern
  792. Xwill be inserted in the argument list.
  793. XA qualifier may be any one of the following:
  794. X.PD 0
  795. X.RS
  796. X.TP
  797. X.B /
  798. Xdirectories
  799. X.TP
  800. X.B .
  801. Xplain files
  802. X.TP
  803. X.B @
  804. Xsymbolic links
  805. X.TP
  806. X.B =
  807. Xsockets
  808. X.TP
  809. X.B p
  810. Xnamed pipes (FIFOs)
  811. X.TP
  812. X.B *
  813. Xexecutable plain files (0100)
  814. X.TP
  815. X.B %
  816. Xdevice files (character or block special)
  817. X.TP
  818. X.B %b
  819. Xblock special files
  820. X.TP
  821. X.B %c
  822. Xcharacter special files
  823. X.TP
  824. X.B r
  825. Xreadable files (0400)
  826. X.TP
  827. X.B w
  828. Xwritable files (0200)
  829. X.TP
  830. X.B x
  831. Xexecutable files (0100)
  832. X.TP
  833. X.B R
  834. Xworld-readable files (0004)
  835. X.TP
  836. X.B W
  837. Xworld-writable files (0002)
  838. X.TP
  839. X.B X
  840. Xworld-executable files (0001)
  841. X.TP
  842. X.B s
  843. Xsetuid files (04000)
  844. X.TP
  845. X.B S
  846. Xsetgid files (02000)
  847. X.TP
  848. X\fBd\fIdev\fR
  849. Xfiles on the device \fIdev\fP
  850. X.TP
  851. X\fBl\fI[-|+]ct\fR
  852. Xfiles having a link count less than \fIct\fP (-), greater than
  853. X\fIct\fP (+), or is equal to \fIct\fP
  854. X.TP
  855. X\fBU\fP
  856. Xfiles owned by the effective user id
  857. X.TP
  858. X\fBG\fP
  859. Xfiles owned by the effective group id
  860. X.TP
  861. X\fBu\fIid\fR
  862. Xfiles owned by user id \fIid\fP if it is a number, if not, than the
  863. Xcharacter after the \fBu\fP will be used as a separator and the string
  864. Xbetween it and the next matching separator (`(', `[', `{', and `<'
  865. Xmatch `)', `]', `}', and `>' respectively, any other character matches
  866. Xitself) will be taken as a user name and the user id of this user will
  867. Xbe taken (e.g. \fBu:foo:\fP or \fBu[foo]\fP for user \fBfoo\fP)
  868. X.TP
  869. X\fBg\fIid\fR
  870. Xlike \fBu\fIid\fR but with group ids or names
  871. X.TP
  872. X\fBa\fI[-|+]n\fR
  873. Xfiles accessed within last \fIn\fP days (-), more than \fIn\fP days
  874. Xago (+), or \fIn\fP days ago\fP
  875. X.TP
  876. X\fBm\fI[-|+]n\fR
  877. Xfiles modified within last \fIn\fP days (-), more than \fIn\fP days
  878. Xago (+), or \fIn\fP days ago\fP
  879. X.TP
  880. X\fBc\fI[-|+]n\fR
  881. Xfiles whose inode changed within last \fIn\fP days (-), more than
  882. X\fIn\fP days ago (+), or \fIn\fP days ago.
  883. XIf any of the flags \fBa\fP, \fBm\fP, or \fBc\fP is directly followed by a
  884. X\fBM\fP, \fBw\fP, \fBh\fP, or \fBm\fP (e.g. \fBmh+5\fP) the check is
  885. Xperformed with months (of 30 days), weeks, hours, or minutes instead
  886. Xof days, respectively.
  887. X.TP
  888. X\fBL\fI[+|-]n\fR
  889. Xfiles less than n bytes (-), more than n bytes (+), or
  890. Xexactly n bytes in length.
  891. X.TP
  892. X\fB^\fP
  893. Xnegates all qualifiers following it
  894. X.TP
  895. X\fB\-\fP
  896. Xtoggles between making the qualifiers work on symbolic links (the
  897. Xdefault) and the files they point to
  898. X.TP
  899. X\fBM\fP
  900. Xsets the \fBMARK_DIRS\fP option for the current pattern
  901. X.TP
  902. X\fBT\fP
  903. Xappends a traling qualifier mark to the file names, analogous to the
  904. X\fBLIST_TYPES\fP option, for the current pattern (overrides \fBM\fP)
  905. X.TP
  906. X\fBN\fP
  907. Xsets the \fBNULL_GLOB\fP option for the current pattern
  908. X.TP
  909. X\fBD\fP
  910. Xsets the \fBGLOB_DOTS\fP option for the current pattern
  911. X.PD
  912. X.RE
  913. X.PP
  914. XMore than one of these lists can be combined, separated by commas. The
  915. Xwhole list matches if at least one of the sublists matches (they are
  916. X`or'ed', the qualifiers in the sublists are `and'ed').
  917. X.PP
  918. XIf a : appears in a qualifier list, the remainder of the expression in
  919. Xparenthesis is interpreted as a modifier (see the subsection
  920. X\fBModifiers\fR of the section \fBHISTORY\fR).  Note that each modifier
  921. Xmust be introduced by a separate :.  Note also that the result after
  922. Xmodification does not have to be an existing file.  The name of any
  923. Xexisting file can be followed by a modifier of the form (:..) even if no
  924. Xfilename generation is performed.
  925. X.PP
  926. XThus:
  927. X.RS
  928. X.PP
  929. Xls
  930. X.B *(\-/)
  931. X.RE
  932. X.PP
  933. Xlists all directories and symbolic links that point to directories,
  934. Xand
  935. X.RS
  936. X.PP
  937. Xls
  938. X.B *(%W)
  939. X.RE
  940. X.PP
  941. Xlists all world-writable device files in the current directory,
  942. Xand
  943. X.RS
  944. X.PP
  945. Xls
  946. X.B *(W,X)
  947. X.RE
  948. X.PP
  949. Xlists all files in the current directory that are 
  950. Xworld-writable or world-executable, and
  951. X.RS
  952. X.PP
  953. Xecho
  954. X.B /tmp/foo*(u0^@:t)
  955. X.RE
  956. X.PP
  957. Xoutputs the basename of all root-owned files beginning with the string
  958. X"foo" in /tmp, ignoring symlinks, and
  959. X.RS
  960. X.PP
  961. Xls
  962. X.B *.*~(lex|parse).[ch](^D^l1)
  963. X.RE
  964. X.PP
  965. Xlists all files having a link count of one whose names contain a dot
  966. X(but not those starting with a dot, since \fBGLOB_DOTS\fP is explicitly
  967. Xswitched off) except for lex.c, lex.h, parse.c, and parse.h.
  968. XA "/" at the end of a pattern
  969. Xis equivalent to "(\|/\|)".
  970. X.SH REDIRECTION
  971. XBefore a command is executed, its input and output
  972. Xmay be redirected.
  973. XThe following may appear anywhere in a simple command
  974. Xor may precede or follow a complex command.
  975. XSubstitution occurs before
  976. X.I word
  977. Xis used except as noted below.
  978. XIf the result of substitution on
  979. X.I word
  980. Xproduces more than one filename,
  981. Xredirection occurs for each
  982. Xseparate filename in turn.
  983. X.TP
  984. X.BI < word
  985. XOpen file
  986. X.I word
  987. Xas standard input.
  988. X.TP
  989. X.BI > word
  990. XOpen file
  991. X.I word
  992. Xas standard output.
  993. XIf the file does not exist then it is created.
  994. XIf the file exists, and the
  995. X.B NO_CLOBBER
  996. Xoption is set,
  997. Xthis causes an error;
  998. Xotherwise, it is truncated to zero length.
  999. X.TP
  1000. X.BI >! " word"
  1001. XSame as
  1002. X.BR > ,
  1003. Xexcept that the file is truncated to zero length
  1004. Xif it exists, even if
  1005. X.B NO_CLOBBER
  1006. Xis set.
  1007. X.TP
  1008. X.BI >> word
  1009. XOpen file
  1010. X.I word
  1011. Xas standard output.
  1012. XIf the file exists then output is appended to it.
  1013. XIf the file does not exist, and the
  1014. X.B NO_CLOBBER
  1015. Xoption is set,
  1016. Xthis causes an error;
  1017. Xotherwise, the file is created.
  1018. X.TP
  1019. X.BI >>! " word"
  1020. XSame as
  1021. X.BR >> ,
  1022. Xexcept that the file is created if it does not
  1023. Xexist, even if
  1024. X.B NO_CLOBBER
  1025. Xis set.
  1026. X.TP
  1027. X\fB<<\fP[\-] \fIword\fP
  1028. XThe shell input is read up to a line that is the same as
  1029. X.IR word ,
  1030. Xor to an end-of-file.
  1031. XNo parameter substitution, command substitution or
  1032. Xfilename generation is performed on
  1033. X.IR word .
  1034. XThe resulting document,
  1035. Xcalled a
  1036. X.IR here-document ,
  1037. Xbecomes
  1038. Xthe standard input.
  1039. XIf any character of \fIword\fP is quoted with
  1040. Xsingle or double quotes or a \e,
  1041. Xno interpretation
  1042. Xis placed upon the characters of the document.
  1043. XOtherwise, parameter and command substitution
  1044. Xoccurs, \e followed by a newline is removed,
  1045. Xand \e must be used to quote the characters
  1046. X\e, $, `, and the first character of \fIword\fP.
  1047. XIf <<\- is used, then all leading
  1048. Xtabs are stripped from \fIword\fP and from the document.
  1049. X.TP
  1050. X.BI <<< word
  1051. XOpen a file containing \fIword\fP, after expansion,
  1052. Xas standard input.
  1053. X.TP
  1054. X.BI <& digit
  1055. XThe standard input
  1056. Xis duplicated from file descriptor
  1057. X.I digit
  1058. X(see
  1059. X.IR dup (2)).
  1060. XSimilarly for standard output using
  1061. X\fB>&\fIdigit\fP.
  1062. X.TP
  1063. X.BI >& word
  1064. XSame as
  1065. X.BI > word
  1066. X\fB2>&\fP1.
  1067. X.TP
  1068. X.BI >>& word
  1069. XSame as
  1070. X.BI >> word
  1071. X\fB2>&\fP1.
  1072. X.TP
  1073. X.BI <&\-
  1074. XClose the standard input.
  1075. X.TP
  1076. X.BI >&\-
  1077. XClose the standard output.
  1078. X.TP
  1079. X.BI <&p
  1080. XThe input from the coprocess is moved to the standard input.
  1081. X.TP
  1082. X.BI >&p
  1083. XThe output to the coprocess is moved to the standard output.
  1084. X.PP
  1085. XIf one of the above is preceded by a digit, then the file
  1086. Xdescriptor referred to is that specified by the digit
  1087. X(instead of the default 0 or 1).
  1088. XThe order in which redirections are specified is significant.
  1089. XThe shell evaluates each redirection in terms of the
  1090. X.RI ( "file descriptor" ", " file )
  1091. Xassociation at the time of evaluation.
  1092. XFor example:
  1093. X.RS
  1094. X.PP
  1095. X\&.\|.\|. \|1>\fIfname\^\fP 2>&1
  1096. X.RE
  1097. X.PP
  1098. Xfirst associates file descriptor 1 with file
  1099. X.IR fname .
  1100. XIt then associates file descriptor 2 with the file associated with file
  1101. Xdescriptor 1 (that is,
  1102. X.IR fname ).
  1103. XIf the order of redirections were reversed, file descriptor 2 would be associated
  1104. Xwith the terminal (assuming file descriptor 1 had been) and then file descriptor
  1105. X1 would be associated with file
  1106. X.IR fname .
  1107. X.PP
  1108. XIf the user tries to open a file descriptor for writing more than once,
  1109. Xthe shell opens the file descriptor as a pipe to a process that copies
  1110. Xits input to all the specified outputs, similar to tee(1).  Thus:
  1111. X.RS
  1112. X.PP
  1113. X.B date >foo >bar
  1114. X.RE
  1115. X.PP
  1116. Xwrites the date to two files, named "foo" and "bar".
  1117. XNote that a pipe is an implicit indirection; thus
  1118. X.RS
  1119. X.PP
  1120. X.B date >foo | cat
  1121. X.RE
  1122. X.PP
  1123. Xwrites the date to the file "foo", and also pipes it to cat.
  1124. X.PP
  1125. XIf the user tries to open a file descriptor for reading more than once,
  1126. Xthe shell opens the file descriptor as a pipe to a process that copies
  1127. Xall the specified inputs to its output in the order
  1128. Xspecified, similar to cat(1).  Thus
  1129. X.RS
  1130. X.PP
  1131. X.B sort <foo <fubar
  1132. X.RE
  1133. X.PP
  1134. Xor even
  1135. X.RS
  1136. X.PP
  1137. X.B sort <f{oo,ubar}
  1138. X.RE
  1139. X.PP
  1140. Xis equivalent to "cat foo bar | sort".  Similarly, you can do
  1141. X.RS
  1142. X.PP
  1143. X.B echo exit 0 >> *.sh
  1144. X.RE
  1145. X.PP
  1146. XNote that a pipe is in implicit indirection; thus
  1147. X.RS
  1148. X.PP
  1149. X.B cat bar | sort <foo
  1150. X.RE
  1151. X.PP
  1152. Xis equivalent to "cat bar foo | sort" (note the order of the inputs).
  1153. X.PP
  1154. XIf a simple command consists of one or more redirection operators
  1155. Xand zero or more parameter assignments, but no command name,
  1156. Xthe command \fBcat\fP is assumed.  Thus
  1157. X.RS
  1158. X.PP
  1159. X.B < file
  1160. X.RE
  1161. X.PP
  1162. Xprints the contents of \fBfile\fP.
  1163. X.PP
  1164. XIf a command is followed by
  1165. X.B &
  1166. Xand job control is not active,
  1167. Xthen the default standard input
  1168. Xfor the command
  1169. Xis the empty file
  1170. X.BR /dev/null .
  1171. XOtherwise, the environment for the execution of a command contains the
  1172. Xfile descriptors of the invoking shell as modified by
  1173. Xinput/output specifications.
  1174. X.SH "COMMAND EXECUTION"
  1175. XIf a command name contains no slashes, the shell attempts to locate
  1176. Xit.  If there exists a shell function by that name, the function
  1177. Xis invoked as described below in \fBFUNCTIONS\fP.  If there exists
  1178. Xa shell builtin by that name, the builtin is invoked.
  1179. X.PP
  1180. XOtherwise, the shell searches each element of \fBpath\fP for a
  1181. Xdirectory containing an executable file by that name.  If the
  1182. Xsearch is unsuccessful, the shell prints an error message and returns
  1183. Xa nonzero exit status.
  1184. X.PP
  1185. XIf execution fails because the file is not in executable format,
  1186. Xand the file is not a directory, it is assumed to be a shell
  1187. Xscript.  /bin/sh is spawned to execute it.  If the program
  1188. Xis a file beginning with \fB#!\fP, the remainder of the first line
  1189. Xspecifies an interpreter for the program.  The shell will
  1190. Xexecute the specified interpreter on operating systems that do
  1191. Xnot handle this executable format in the kernel.
  1192. X.SH FUNCTIONS
  1193. X.PP
  1194. XThe
  1195. X.B function
  1196. Xreserved word is used to define shell functions.
  1197. XShell functions are read in and stored internally.
  1198. XAlias names are resolved when the function is read.
  1199. XFunctions are executed like commands with the arguments
  1200. Xpassed as positional parameters.
  1201. X(See
  1202. X.I Execution
  1203. Xbelow).
  1204. X.PP
  1205. XFunctions execute in the same process as the caller and
  1206. Xshare all files
  1207. Xand present working directory with the
  1208. Xcaller.
  1209. XA trap on
  1210. X.B EXIT
  1211. Xset inside a function
  1212. Xis executed after the function completes in the environment
  1213. Xof the caller.
  1214. X.PP
  1215. XThe
  1216. X.B return
  1217. Xbuiltin is used to return
  1218. Xfrom function calls.
  1219. X.PP
  1220. XFunction identifiers
  1221. Xcan be listed with the
  1222. X.B functions
  1223. Xbuiltin.
  1224. XFunctions can be undefined with the
  1225. X.B unfunction
  1226. Xbuiltin.
  1227. X.PP
  1228. XThe following functions, if defined, have special meaning to
  1229. Xthe shell:
  1230. X.PP
  1231. X.PD 0
  1232. X.TP
  1233. X\fBchpwd\fP
  1234. XExecuted whenever the current working directory is changed.
  1235. X.TP
  1236. X\fBprecmd\fP
  1237. XExecuted before each prompt.
  1238. X.TP
  1239. X\fBperiodic\fP
  1240. XIf the parameter
  1241. X.B PERIOD
  1242. Xis set, this function is executed every
  1243. X.B PERIOD
  1244. Xseconds, just before a prompt.
  1245. X.TP
  1246. X\fBTRAPxxx\fP
  1247. XIf defined and non-null,
  1248. Xthis function will be executed whenever the shell
  1249. Xcatches a signal \fBSIGxxx\fP, where \fBxxx\fP is a signal
  1250. Xname as specified for the \fBkill\fP builtin (see below).
  1251. XThe signal number will be passed as the first parameter to the function.
  1252. XIn addition, \fBTRAPZERR\fP is executed whenever a command has a non-zero
  1253. Xexit status, \fBTRAPDEBUG\fP is executed after each command, and
  1254. X\fBTRAPEXIT\fP
  1255. Xis executed when the shell exits,
  1256. Xor when the current function exits if defined
  1257. Xinside a function.
  1258. XIf a function of this form is defined and null,
  1259. Xthe shell and processes spawned by it will ignore \fBSIGxxx\fP.
  1260. X.PD
  1261. X.SH JOBS
  1262. X.PP
  1263. XIf the
  1264. X.B MONITOR
  1265. Xoption is set,
  1266. Xan interactive shell associates a \fIjob\fR with each pipeline.
  1267. XIt keeps
  1268. Xa table of current jobs, printed by the
  1269. X.B jobs
  1270. Xcommand, and assigns them small integer numbers.
  1271. XWhen a job is started asynchronously with
  1272. X.BR & ,
  1273. Xthe shell prints a line which looks
  1274. Xlike:
  1275. X.PP
  1276. X.DT
  1277. X    [1] 1234
  1278. X.PP
  1279. Xindicating that the job which was started asynchronously was job number
  1280. X1 and had one (top-level) process, whose process id was 1234.
  1281. X.PP
  1282. XIf you are running a job and wish to do something else you may hit the key
  1283. X\fB^Z\fR (control-Z) which sends a TSTP signal to the current job.
  1284. XThe shell will then normally indicate that the job has been `suspended',
  1285. Xand print another prompt.
  1286. XYou can then manipulate the state of this job,
  1287. Xputting it in the background with the
  1288. X.B bg
  1289. Xcommand, or run some other
  1290. Xcommands and then eventually bring the job back into the foreground with
  1291. Xthe foreground command
  1292. X.BR fg .
  1293. XA \fB^Z\fR takes effect immediately and
  1294. Xis like an interrupt in that pending output and unread input are discarded
  1295. Xwhen it is typed.
  1296. X.PP
  1297. XA job being run in the background will suspend if it tries to read
  1298. Xfrom the terminal.
  1299. XBackground jobs are normally allowed to produce output,
  1300. Xbut this can be disabled by giving the command ``stty tostop''.
  1301. XIf you set this
  1302. Xtty option, then background jobs will suspend when they try to produce
  1303. Xoutput like they do when they try to read input.
  1304. X.PP
  1305. XThere are several ways to refer to jobs in the shell.
  1306. XA job can be referred to by the process id of any process of the job
  1307. Xor by one of the following:
  1308. X.PD 0
  1309. X.TP
  1310. X.BI % number
  1311. XThe job with the given number.
  1312. X.TP
  1313. X.BI % string
  1314. XAny job whose command line begins with
  1315. X.IR string .
  1316. X.TP
  1317. X.BI %? string
  1318. XAny job whose command line contains
  1319. X.IR string .
  1320. X.TP
  1321. X.BI %%
  1322. XCurrent job.
  1323. X.TP
  1324. X.BI %+
  1325. XEquivalent to
  1326. X.BR %% .
  1327. X.TP
  1328. X.BI %\-
  1329. XPrevious job.
  1330. X.PD
  1331. X.PP
  1332. XThe shell learns immediately whenever a process changes state.
  1333. XIt normally informs you whenever a job becomes blocked so that
  1334. Xno further progress is possible.  If
  1335. X.B notify
  1336. Xis not set, it waits until
  1337. Xjust before it prints
  1338. Xa prompt before it informs you.
  1339. X.PP
  1340. XWhen the monitor mode is on, each background job that completes
  1341. Xtriggers any trap set for
  1342. X.BR CHLD .
  1343. X.PP
  1344. XWhen you try to leave the shell while jobs are running or suspended, you will
  1345. Xbe warned that `You have suspended (running) jobs.'
  1346. XYou may use the
  1347. X.B jobs
  1348. Xcommand to see what they are.
  1349. XIf you do this or immediately try to
  1350. Xexit again, the shell will not warn you a second time; the suspended
  1351. Xjobs will be terminated, and the running jobs will be sent
  1352. Xa \fBSIGHUP\fP signal.
  1353. XTo avoid having the shell terminate the running jobs, either
  1354. Xuse the \fBnohup\fP(1) command or the \fBdisown\fP builtin (see below).
  1355. X.SH SIGNALS
  1356. XThe INT and QUIT signals for an invoked
  1357. Xcommand are ignored if the command is followed by
  1358. X.B &
  1359. Xand the job
  1360. X.B MONITOR
  1361. Xoption is not active.
  1362. XOtherwise, signals have the values
  1363. Xinherited by the shell from its parent
  1364. X(but see the \fBTRAPxxx\fP special function above).
  1365. X.SH HISTORY
  1366. XHistory substitution allows you to use words from previous command
  1367. Xlines in the command line you are typing.  This simplifies spelling
  1368. Xcorrections and the repetition of complicated commands or arguments.
  1369. XCommand lines are saved in the history list, the size of which
  1370. Xis controlled by the
  1371. X.B HISTSIZE
  1372. Xvariable.  The most recent command is retained in any case.
  1373. XA history substitution begins with a
  1374. X.B !
  1375. Xand may occur anywhere on the command line; history
  1376. Xsubstitutions do not nest.  The
  1377. X.B !
  1378. Xcan be escaped with
  1379. X.B \e
  1380. Xto suppress its special meaning.
  1381. XSingle or double quotes will \fInot\fP work for this.
  1382. X.PP
  1383. XInput lines containing history substitutions are echoed on the
  1384. Xterminal after being expanded, but before any other
  1385. Xsubstitutions take place or the command gets executed.
  1386. X.SS Event Designators
  1387. X.PP
  1388. XAn event designator is a reference to a command-line entry in
  1389. Xthe history list.
  1390. X.RS
  1391. X.PD 0
  1392. X.TP
  1393. X.B !
  1394. XStart a history substitution, except when followed by a blank, newline,
  1395. X.BR = ,
  1396. Xor
  1397. X.BR ( .
  1398. X.TP
  1399. X.B !!
  1400. XRefer to the previous command. 
  1401. XBy itself, this substitution
  1402. Xrepeats the previous command.
  1403. X.TP
  1404. X.BI ! n
  1405. XRefer to command-line
  1406. X.IR n .
  1407. X.TP
  1408. X.BI ! \-n
  1409. XRefer to the current command-line minus
  1410. X.IR n .
  1411. X.TP
  1412. X.BI  ! str
  1413. XRefer to the most recent command starting with
  1414. X.IR str .
  1415. X.TP
  1416. X.BI  !? str\fR[\fP ? \fR]\fP
  1417. XRefer to the most recent command containing
  1418. X.IR str .
  1419. X.TP
  1420. X.B !#
  1421. XRefer to the current command line typed in so far.
  1422. X.TP
  1423. X.BR !{ .\|.\|. }
  1424. XInsulate a history reference from adjacent characters (if necessary).
  1425. X.PD
  1426. X.RE
  1427. X.SS Word Designators
  1428. X.PP
  1429. XA word designator indicates which word or words of a given command line will
  1430. Xbe included in a history reference.  A
  1431. X.RB ` : '
  1432. Xseparates the event specification from the word designator. 
  1433. XIt can be omitted if the word designator begins with a
  1434. X.BR ^ ,
  1435. X.BR $ ,
  1436. X.BR * ,
  1437. X.B \-
  1438. Xor
  1439. X.BR % .
  1440. XWord designators include:
  1441. X.RS
  1442. X.PD 0
  1443. X.TP
  1444. X.B 0
  1445. XThe first input word (command).
  1446. X.TP
  1447. X.I n
  1448. XThe
  1449. X.IR n 'th
  1450. Xargument.
  1451. X.TP
  1452. X.B ^
  1453. XThe first argument, that is,
  1454. X.BR 1 .
  1455. X.TP
  1456. X.B $
  1457. XThe last argument.
  1458. X.TP
  1459. X.B %
  1460. XThe word matched by (the most recent)
  1461. X.BI ? str
  1462. Xsearch.
  1463. X.TP
  1464. X.IB x \- y
  1465. XA range of words;
  1466. X.BI \- y
  1467. Xabbreviates
  1468. X.BI 0\- y\fR.
  1469. X.TP
  1470. X.B *
  1471. XAll the arguments, or a null value if there is just
  1472. Xone word in the event.
  1473. X.TP
  1474. X.IB x *
  1475. XAbbreviates
  1476. X.IB x \-$ .
  1477. X.TP
  1478. X.IB x \-
  1479. XLike
  1480. X.I x*
  1481. Xbut omitting word
  1482. X.BR $ .
  1483. X.PD
  1484. X.RE
  1485. XNote that a
  1486. X.RB ` % '
  1487. Xword designator will only work when used as
  1488. X.B !%,
  1489. X.B !:%,
  1490. X.BI !? str ?:%
  1491. Xand only when used after a !? substitution.  Anything else will result
  1492. Xin an error, although the error may not be the most obvious one.
  1493. X.PP
  1494. X.SS Modifiers
  1495. X.PP
  1496. XAfter the optional word designator, you can add
  1497. Xa sequence of one or more of the following modifiers,
  1498. Xeach preceded by a
  1499. X.BR : .
  1500. XThese modifiers also work on the result
  1501. Xof filename and parameter expansion.
  1502. X.RS
  1503. X.TP
  1504. X.B h
  1505. XRemove a trailing pathname component, leaving the head.
  1506. X.PD 0
  1507. X.TP
  1508. X.B r
  1509. XRemove a trailing suffix of the form
  1510. X.RB ` "\&.\fIxxx" ',
  1511. Xleaving the basename.
  1512. X.TP
  1513. X.B e
  1514. XRemove all but the suffix.
  1515. X.TP
  1516. X.B t
  1517. XRemove all leading pathname components, leaving the tail.
  1518. X.TP
  1519. X.B &
  1520. XRepeat the previous substitution.
  1521. X.TP
  1522. X.B g
  1523. XApply the change to the first occurrence of a match in each word,
  1524. Xby prefixing the above (for example,
  1525. X.BR g& ).
  1526. X.TP
  1527. X.B p
  1528. XPrint the new command but do not execute it.
  1529. X.TP
  1530. X.B q
  1531. XQuote the substituted words, escaping further substitutions.
  1532. X.TP
  1533. X.B x
  1534. XLike
  1535. X.BR q ,
  1536. Xbut break into words at each blank.
  1537. X.TP
  1538. X.B l
  1539. XConvert the words to all lowercase.
  1540. X.TP
  1541. X.B u
  1542. XConvert the words to all uppercase.
  1543. X.TP
  1544. X.B f
  1545. XRepeats the immediately (without a colon) following modifier until the
  1546. Xresulting word doesn't change any more. This one and the following
  1547. Xfour only work with parameter and filename expansion.
  1548. X.TP
  1549. X.B F:\fIexpr\fB:
  1550. XLike \fBf\fP, but repeats only \fIn\fP times if the expression
  1551. X\fIexpr\fP evaluates to \fIn\fP. Any character can be used instead of
  1552. Xthe `:', if any of `(', `[', or `{' is used as the opening delimiter
  1553. Xthe second one has to be ')', `]', or `}' respectively.
  1554. X.TP
  1555. X.B w
  1556. XMakes the immediately following modifier work on each word in the
  1557. Xstring.
  1558. X.TP
  1559. X.B W:\fIsep\fB:
  1560. XLike \fBw\fP but words are considered to be the parts of the string
  1561. Xthat are separated by \fIsep\fP. Any character can be used instead of
  1562. Xthe `:', opening parentheses are handled specially, see above.
  1563. X.TP
  1564. X.BI s/ l / r\fR[\fP / \fR]\fP
  1565. XSubstitute
  1566. X.I r
  1567. Xfor
  1568. X.IR l .
  1569. X.PD
  1570. X.RE
  1571. X.PP
  1572. XUnless preceded by a
  1573. X.BR g ,
  1574. Xthe substitution is done only for the
  1575. Xfirst string that matches
  1576. X.IR l .
  1577. X.PP
  1578. XThe left-hand side of substitutions are not regular expressions,
  1579. Xbut character strings.
  1580. XAny character can be used as the delimiter in place of
  1581. X.BR / .
  1582. XA backslash quotes the delimiter character.
  1583. XThe character
  1584. X.BR & ,
  1585. Xin the right hand side, is replaced by the text
  1586. Xfrom the left-hand-side. 
  1587. XThe
  1588. X.B &
  1589. Xcan be quoted with a backslash. 
  1590. XA null
  1591. X.I l
  1592. Xuses the previous string either from a
  1593. X.I l
  1594. Xor from a contextual scan string
  1595. X.I s
  1596. Xfrom
  1597. X.BI !? s\fR.
  1598. XYou can omit the rightmost delimiter if a newline
  1599. Ximmediately follows
  1600. X.IR r ;
  1601. Xthe rightmost
  1602. X.B ?
  1603. Xin a context scan can similarly be omitted.
  1604. X.PP
  1605. XBy default, a history reference with no event specification refers to the same
  1606. Xline as the last history reference on that command line, unless it is the
  1607. Xfirst history reference in a command.  In that case, a history reference
  1608. Xwith no event specification always refers to the previous command.  However,
  1609. Xif the option \fBCSH_JUNKIE_HISTORY\fP is set, then history reference with no
  1610. Xevent specification will \fIalways\fP refer to the previous command.
  1611. XFor example,
  1612. X.B !!:1
  1613. Xwill always refer to the first word of the previous command and
  1614. X.B !!$
  1615. Xwill always refer to the last word of the previous command.  And with
  1616. X\fBCSH_JUNKIE_HISTORY\fP set, then
  1617. X.B !:1
  1618. Xand
  1619. X.B !$
  1620. Xwill function in the same manner as
  1621. X.B !!:1
  1622. Xand
  1623. X.B !!$,
  1624. Xrespectively.  However, if \fBCSH_JUNKIE_HISTORY\fP is unset, then
  1625. X.B !:1 
  1626. Xand
  1627. X.B !$
  1628. Xwill refer to the first and last words respectively, of the last command
  1629. Xreferenced on the current command line.  However, if they are the first history
  1630. Xreference on the command line, then they refer to the previous command.
  1631. X.PP
  1632. XThe character sequence
  1633. X.BI ^ foo ^ bar
  1634. Xrepeats the last command, replacing the string "foo" with the
  1635. Xstring "bar".
  1636. X.PP
  1637. XIf the shell encounters the character sequence
  1638. X\fB!"\fP
  1639. Xin the input, the history mechanism is temporarily disabled until
  1640. Xthe current list is fully parsed.  The
  1641. X\fB!"\fP
  1642. Xis removed from the input, and any subsequent
  1643. X.B !
  1644. Xcharacters have no special significance.
  1645. X.PP
  1646. XA less convenient but more comprehensible
  1647. Xform of command history support
  1648. Xis provided by the
  1649. X.B fc
  1650. Xbuiltin (see below).
  1651. X.SH "ARITHMETIC EVALUATION"
  1652. XAn ability to perform integer arithmetic
  1653. Xis provided with the builtin
  1654. X.BR let .
  1655. XEvaluations are performed using
  1656. X.I long
  1657. Xarithmetic.
  1658. XConstants are of the form
  1659. X[\fIbase\fB#\^\fR]\fIn\^\fP
  1660. Xwhere
  1661. X.I base
  1662. Xis a decimal number between two and thirty-six
  1663. Xrepresenting the arithmetic base
  1664. Xand
  1665. X.I n
  1666. Xis a number in that base (for example, `16#ff' is 255 in hexadecimal).
  1667. XIf
  1668. X.I base
  1669. Xis omitted
  1670. Xthen base 10 is used.  For backwards compatibility the form `[16]ff'
  1671. Xis also accepted.
  1672. X.PP
  1673. XAn arithmetic expression uses nearly the same syntax, precedence, and
  1674. Xassociativity of
  1675. Xexpressions in C.
  1676. XThe following operators are supported (listed in decreasing order
  1677. Xof precedence):
  1678. X.PP
  1679. X.PD 0
  1680. X.RS
  1681. X.TP
  1682. X.B + \- ! \(ap ++ \-\|\-
  1683. Xunary plus/minus, logical NOT, complement, {pre,post}{in,de}crement
  1684. X.TP
  1685. X.B &
  1686. Xlogical AND
  1687. X.TP
  1688. X.B ^
  1689. Xlogical XOR
  1690. X.TP
  1691. X.B |
  1692. Xlogical OR
  1693. X.TP
  1694. X.B * / % **
  1695. Xmultiplication, division, remainder, exponentiation
  1696. X.TP
  1697. X.B + \-
  1698. Xaddition, subtraction
  1699. X.TP
  1700. X.B << >>
  1701. Xlogical shift left, shift right
  1702. X.TP
  1703. X.B < > <= >=
  1704. Xcomparison
  1705. X.TP
  1706. X.B == !=
  1707. Xequality and inequality
  1708. X.TP
  1709. X.B &&
  1710. Xboolean AND
  1711. X.TP
  1712. X.B |\|| ^^
  1713. Xboolean OR, XOR
  1714. X.TP
  1715. X.B ? :
  1716. Xternary operator
  1717. X.TP
  1718. X.B
  1719. X= += \-= *= /= %= &= ^= |= <<= >>= &&= |\||= ^^= **=
  1720. Xassignment
  1721. X.TP
  1722. X.B ,
  1723. Xcomma operator
  1724. X.PD
  1725. X.RE
  1726. X.PP
  1727. XThe operators &&, |\||, &&=, and |\||= are short-circuiting,
  1728. Xand only one of the latter two expressions in a ternary operator
  1729. Xis evaluated.  Note the precedence of the logical AND, OR,
  1730. Xand XOR operators.
  1731. X.PP
  1732. XAn expression of the form \fB#\\x\fP where \fBx\fP is any character
  1733. Xgives the ascii value of this character and an expression of the form
  1734. X\fB#foo\fP gives the ascii value of the first character of the value
  1735. Xof the parameter \fBfoo\fP.
  1736. X.PP
  1737. XNamed parameters can be referenced by name within an arithmetic expression
  1738. Xwithout using the parameter substitution syntax, but if it is an array
  1739. Xwith a subscript the leading \fB$\fP is needed.
  1740. X.PP
  1741. XAn internal integer representation of a named parameter
  1742. Xcan be specified with the
  1743. X.B integer
  1744. Xbuiltin.
  1745. XArithmetic evaluation is performed on the value of each
  1746. Xassignment to a named parameter declared integer
  1747. Xin this manner.
  1748. X.PP
  1749. XSince many of the arithmetic operators require
  1750. Xquoting, an alternative form of the
  1751. X.B let
  1752. Xcommand is provided.
  1753. XFor any command which begins with a
  1754. X.BR (( ,
  1755. Xall the characters until a matching
  1756. X.B ))
  1757. Xare treated as a quoted expression.
  1758. XMore precisely,
  1759. X.BR (( ... ))
  1760. Xis equivalent to
  1761. X.B let
  1762. X\fB"\fP...\fB"\fP.
  1763. X.SH "CONDITIONAL EXPRESSIONS"
  1764. XA \fIconditional expression\fP is used with the
  1765. X.B [[
  1766. Xcompound command to test attributes of files and to compare strings.
  1767. XEach expression can be constructed from one or more
  1768. Xof the following unary or binary expressions:
  1769. X.PD 0
  1770. X.TP
  1771. X\fB\-a\fP \fIfile\fP
  1772. Xtrue if
  1773. X.I file
  1774. Xexists.
  1775. X.TP
  1776. X\fB\-b\fP \fIfile\fP
  1777. Xtrue if
  1778. X.I file
  1779. Xexists and is a block special file.
  1780. X.TP
  1781. X\fB\-c\fP \fIfile\fP
  1782. Xtrue if
  1783. X.I file
  1784. Xexists and is a character special file.
  1785. X.TP
  1786. X\fB\-d\fP \fIfile\fP
  1787. Xtrue if
  1788. X.I file
  1789. Xexists and is a directory.
  1790. X.TP
  1791. X\fB\-e\fP \fIfile\fP
  1792. Xtrue if
  1793. X.I file
  1794. Xexists.
  1795. X.TP
  1796. X\fB\-f\fP \fIfile\fP
  1797. Xtrue if
  1798. X.I file
  1799. Xexists and is an ordinary file.
  1800. X.TP
  1801. X\fB\-g\fP \fIfile\fP
  1802. Xtrue if
  1803. X.I file
  1804. Xexists and has its setgid bit set.
  1805. X.TP
  1806. X\fB\-h\fP \fIfile\fP
  1807. Xtrue if
  1808. X.I file
  1809. Xexists and is a symbolic link.
  1810. X.TP
  1811. X\fB\-k\fP \fIfile\fP
  1812. Xtrue if
  1813. X.I file
  1814. Xexists and has its sticky bit set.
  1815. X.TP
  1816. X\fB\-n\fP \fIstring\fP
  1817. Xtrue if length of
  1818. X.I string
  1819. Xis non-zero.
  1820. X.TP
  1821. X\fB\-o\fP \fIoption\fP
  1822. Xtrue if option named
  1823. X.I option
  1824. Xis on.
  1825. X.TP
  1826. X\fB\-p\fP \fIfile\fP
  1827. Xtrue if
  1828. X.I file
  1829. Xexists and is a fifo special file or a pipe.
  1830. X.TP
  1831. X\fB\-r\fP \fIfile\fP
  1832. Xtrue if
  1833. X.I file
  1834. Xexists and is readable by current process.
  1835. X.TP
  1836. X\fB\-s\fP \fIfile\fP
  1837. Xtrue if
  1838. X.I file
  1839. Xexists and has size greater than zero.
  1840. X.TP
  1841. X\fB\-t\fP \fIfd\fP
  1842. Xtrue if file descriptor number
  1843. X.I fd
  1844. Xis open and associated with a terminal device.
  1845. X(note: \fIfd\fP is not optional)
  1846. X.TP
  1847. X\fB\-u\fP \fIfile\fP
  1848. Xtrue if
  1849. X.I file
  1850. Xexists and has its setuid bit set.
  1851. X.TP
  1852. X\fB\-w\fP \fIfile\fP
  1853. Xtrue if
  1854. X.I file
  1855. Xexists and is writable by current process.
  1856. X.TP
  1857. X\fB\-x\fP \fIfile\fP
  1858. Xtrue if
  1859. X.I file
  1860. Xexists and is executable by current process.
  1861. XIf
  1862. X.I file
  1863. Xexists and is a directory, then the current process
  1864. Xhas permission to search in the directory.
  1865. X.TP
  1866. X\fB\-z\fP \fIstring\fP
  1867. Xtrue if length of
  1868. X.I string
  1869. Xis zero.
  1870. X.TP
  1871. X\fB\-L\fP \fIfile\fP
  1872. Xtrue if
  1873. X.I file
  1874. Xexists and is a symbolic link.
  1875. X.TP
  1876. X\fB\-O\fP \fIfile\fP
  1877. Xtrue if
  1878. X.I file
  1879. Xexists and is owned by the effective user id of this process.
  1880. X.TP
  1881. X\fB\-G\fP \fIfile\fP
  1882. Xtrue if
  1883. X.I file
  1884. Xexists and its group matches the effective group id of this process.
  1885. X.TP
  1886. X\fB\-S\fP \fIfile\fP
  1887. Xtrue if
  1888. X.I file
  1889. Xexists and is a socket.
  1890. X.TP
  1891. X\fIfile1\fP \fB\-nt\fP \fIfile2\fP
  1892. Xtrue if
  1893. X.I file1
  1894. Xexists and is newer than
  1895. X.IR file2 .
  1896. X.TP
  1897. X\fIfile1\fP \fB\-ot\fP \fIfile2\fP
  1898. Xtrue if
  1899. X.I file1
  1900. Xexists and is older than
  1901. X.IR file2 .
  1902. X.TP
  1903. X\fIfile1\fP \fB\-ef\fP \fIfile2\fP
  1904. Xtrue if
  1905. X.I file1
  1906. Xand 
  1907. X.I file2
  1908. Xexist and refer to the same file.
  1909. X.TP
  1910. X\fIstring\fP \fB=\fP \fIpattern\fP
  1911. Xtrue if
  1912. X.I string
  1913. Xmatches
  1914. X.IR pattern .
  1915. X.TP
  1916. X\fIstring\fP \fB!=\fP \fIpattern\fP
  1917. Xtrue if
  1918. X.I string
  1919. Xdoes not match
  1920. X.IR pattern .
  1921. X.TP
  1922. X\fIstring1\fP \fB<\fP \fIstring2\fP
  1923. Xtrue if
  1924. X.I string1
  1925. Xcomes before
  1926. X.I string2
  1927. Xbased on ASCII value of their characters.
  1928. X.TP
  1929. X\fIstring1\fP \fB>\fP \fIstring2\fP
  1930. Xtrue if
  1931. X.I string1
  1932. Xcomes after
  1933. X.I string2
  1934. Xbased on ASCII value of their characters.
  1935. X.TP
  1936. X\fIexp1\fP \fB\-eq\fP \fIexp2\fP
  1937. Xtrue if
  1938. X.I exp1
  1939. Xis equal to
  1940. X.IR exp2.
  1941. X.TP
  1942. X\fIexp1\fP \fB\-ne\fP \fIexp2\fP
  1943. Xtrue if
  1944. X.I exp1
  1945. Xis not equal to
  1946. X.IR exp2.
  1947. X.TP
  1948. X\fIexp1\fP \fB\-lt\fP \fIexp2\fP
  1949. Xtrue if
  1950. X.I exp1
  1951. Xis less than
  1952. X.IR exp2.
  1953. X.TP
  1954. X\fIexp1\fP \fB\-gt\fP \fIexp2\fP
  1955. Xtrue if
  1956. X.I exp1
  1957. Xis greater than
  1958. X.IR exp2.
  1959. X.TP
  1960. X\fIexp1\fP \fB\-le\fP \fIexp2\fP
  1961. Xtrue if
  1962. X.I exp1
  1963. Xis less than or equal to
  1964. X.IR exp2.
  1965. X.TP
  1966. X\fIexp1\fP \fB\-ge\fP \fIexp2\fP
  1967. Xtrue if
  1968. X.I exp1
  1969. Xis greater than or equal to
  1970. X.IR exp2.
  1971. X.TP
  1972. X\fB(\fP \fIexp\fP \fB)\fP
  1973. Xtrue if \fIexp\fP is true.
  1974. X.TP
  1975. X\fB!\fP \fIexp\fP
  1976. Xtrue if \fIexp\fP is false.
  1977. X.TP
  1978. X\fIexp1\fP \fB&&\fP \fIexp2\fP
  1979. Xtrue if \fIexp1\fP and \fIexp2\fP are both true.
  1980. X.TP
  1981. X\fIexp1\fP \fB|\||\fP \fIexp2\fP
  1982. Xtrue if either \fIexp1\fP or \fIexp2\fP is true.
  1983. X.PD
  1984. X.PP
  1985. XIn each of the above expressions, if
  1986. X.I file
  1987. Xis of the form
  1988. X\fB/dev/fd/\fP\fIn\fR,
  1989. Xwhere
  1990. X.I n
  1991. Xis an integer,
  1992. Xthen the test applied to the open file whose
  1993. Xdescriptor number is
  1994. X.IR n ,
  1995. Xeven if the underlying system does not support
  1996. Xthe \fB/dev/fd\fP directory.
  1997. X.PD
  1998. X.SH "ZSH LINE EDITOR"
  1999. XIf the \fBZLE\fP option is set (it is by default)
  2000. Xand the shell input is attached to the terminal, the user
  2001. Xis allowed to edit command lines.
  2002. X.PP
  2003. XThere are two display modes.  The first, multiline mode, is the
  2004. Xdefault.  It only works if the \fBTERM\fP parameter is set to a valid
  2005. Xterminal type that can move the cursor up.  The second, single line
  2006. Xmode, is used if \fBTERM\fP is invalid or incapable of moving the
  2007. Xcursor up, or if the \fBSINGLE_LINE_ZLE\fP option is set.  This mode
  2008. Xis similar to ksh, and uses no termcap sequences.  If \fBTERM\fP is
  2009. X"emacs", the \fBZLE\fP option will be unset by the shell.
  2010. X.SS Bindings
  2011. XCommand bindings may be set using the \fBbindkey\fP builtin.
  2012. XThere are two keymaps\-the main keymap and the alternate keymap.
  2013. XThe alternate keymap is bound to vi command mode.
  2014. XThe main keymap is bound to emacs mode by default.
  2015. XTo bind the main keymap to vi insert mode, use 
  2016. X\fBbindkey \-v\fP. However, if one of the \fBVISUAL\fP or
  2017. X\fBEDITOR\fP environment variables contain the string \fBvi\fP when the shell
  2018. Xstarts up the main keymap will be bound to vi insert mode by default.
  2019. X.PP
  2020. XThe following is a list of all the key commands
  2021. Xand their default bindings in emacs and vi command mode.
  2022. X.SS Movement
  2023. X.TP
  2024. X\fBvi-backward-blank-word\fP (unbound) (B)
  2025. XMove backward one word, where a word is defined as a series of
  2026. Xnon-blank characters.
  2027. X.TP
  2028. X\fBbackward-char\fP (^B ESC-[D) (\|)
  2029. XMove backward one character.
  2030. X.TP
  2031. X\fBvi-backward-char\fP (\|) (h)
  2032. XMove backward one character, without changing lines.
  2033. X.TP
  2034. X\fBbackward-word\fP (ESC-B ESC-b) (unbound)
  2035. XMove to the beginning of the previous word.
  2036. X.TP
  2037. X\fBemacs-backward-word\fP
  2038. XMove to the beginning of the previous word.
  2039. X.TP
  2040. X\fBvi-backward-word\fP (unbound) (b)
  2041. XMove to the beginning of the previous word, vi-style.
  2042. X.TP
  2043. X\fBbeginning-of-line\fP (^A) (0)
  2044. XMove to the beginning of the line.  If already at the beginning
  2045. Xof the line, move to the beginning of the previous line, if any.
  2046. X.TP
  2047. X\fBvi-beginning-of-line\fP
  2048. XMove to the beginning of the line, without changing lines.
  2049. X.TP
  2050. X\fBend-of-line\fP (^E)
  2051. XMove to the end of the line.  If already at the end 
  2052. Xof the line, move to the end of the next line, if any.
  2053. X.TP
  2054. X\fBvi-end-of-line\fP (unbound) ($)
  2055. XMove to the end of the line.
  2056. X.TP
  2057. X\fBvi-forward-blank-word\fP (unbound) (W)
  2058. XMove forward one word, where a word is defined as a series of
  2059. Xnon-blank characters.
  2060. X.TP
  2061. X\fBvi-forward-blank-word-end\fP (unbound) (E)
  2062. XMove to the end of the current word,
  2063. Xor, if at the end of the current word,
  2064. Xto the end of the next word,
  2065. Xwhere a word is defined as a series of
  2066. Xnon-blank characters.
  2067. X.TP
  2068. X\fBforward-char\fP (^F ESC-[C)
  2069. XMove forward one character.
  2070. X.TP
  2071. X\fBvi-forward-char\fP (unbound) (space l)
  2072. XMove forward one character.
  2073. X.TP
  2074. X\fBvi-find-next-char\fP (^X^F) (f)
  2075. XRead a character from the keyboard, and move to
  2076. Xthe next occurrence of it in the line.
  2077. X.TP
  2078. X\fBvi-find-next-char-skip\fP (unbound) (t)
  2079. XRead a character from the keyboard, and move to
  2080. Xthe position just before the next occurrence of it in the line.
  2081. X.TP
  2082. X\fBvi-find-prev-char\fP (unbound) (F)
  2083. XRead a character from the keyboard, and move to
  2084. Xthe previous occurrence of it in the line.
  2085. X.TP
  2086. X\fBvi-find-prev-char-skip\fP (unbound) (T)
  2087. XRead a character from the keyboard, and move to
  2088. Xthe position just after the previous occurrence of it in the line.
  2089. X.TP
  2090. X\fBvi-first-non-blank\fP (unbound) (^)
  2091. XMove to the first non-blank character in the line.
  2092. X.TP
  2093. X\fBvi-forward-word\fP (unbound) (w)
  2094. XMove forward one word, vi-style.
  2095. X.TP
  2096. X\fBforward-word\fP (ESC-F ESC-f) (unbound)
  2097. XMove to the beginning of the next word.
  2098. XThe editor's idea of a word is specified with the \fBWORDCHARS\fP
  2099. Xparameter.
  2100. X.TP
  2101. X\fBemacs-forward-word\fP
  2102. XMove to the end of the next word.
  2103. X.TP
  2104. X\fBvi-forward-word-end\fP (unbound) (e)
  2105. XMove to the end of the next word.
  2106. X.TP
  2107. X\fBvi-goto-column\fP (ESC-|) (|)
  2108. XMove to the column specified by the numeric argument.
  2109. X.TP
  2110. X\fBvi-goto-mark\fP (unbound) (`)
  2111. XMove to the specified mark.
  2112. X.TP
  2113. X\fBvi-goto-mark-line\fP (unbound) (')
  2114. XMove to beginning of the line containing the specified mark.
  2115. X.TP
  2116. X\fBvi-repeat-find\fP (unbound) (;)
  2117. XRepeat the last \fBvi-find\fP command.
  2118. X.TP
  2119. X\fBvi-rev-repeat-find\fP (unbound) (,)
  2120. XRepeat the last \fBvi-find\fP command in the opposite direction.
  2121. X.SS History
  2122. X.TP
  2123. X\fBbeginning-of-buffer-or-history\fP (ESC-<)
  2124. XMove to the beginning of the buffer, or if already there,
  2125. Xmove to the first event in the history list.
  2126. X.TP
  2127. X\fBbeginning-of-line-hist\fP
  2128. XMove to the beginning of the line.  If already at the
  2129. Xbeginning of the buffer, move to the previous history line.
  2130. X.TP
  2131. X\fBbeginning-of-history\fP
  2132. XMove to the first event in the history list.
  2133. X.TP
  2134. X\fBdown-line-or-history\fP (^N ESC-[B) (+ j)
  2135. XMove down a line in the buffer, or if already at the bottom line,
  2136. Xmove to the next event in the history list.
  2137. X.TP
  2138. X\fBdown-line-or-search\fP
  2139. XMove down a line in the buffer, or if already at the bottom line,
  2140. Xsearch forward in the history for a line beginning with the first
  2141. Xword in the buffer.
  2142. X.TP
  2143. X\fBdown-history\fP (unbound) (^N)
  2144. XMove to the next event in the history list.
  2145. X.TP
  2146. X\fBhistory-beginning-search-backward\fP (unbound)
  2147. XSearch backward in the history for a line beginning with the current
  2148. Xline up to the cursor.
  2149. XThis leaves the cursor in its original position.
  2150. X.TP
  2151. X\fBend-of-buffer-or-history\fP (ESC->)
  2152. XMove to the end of the buffer, or if already there,
  2153. Xmove to the last event in the history list.
  2154. X.TP
  2155. X\fBend-of-line-hist\fP
  2156. XMove to the end of the line.  If already at the end of
  2157. Xthe buffer, move to the next history line.
  2158. X.TP
  2159. X\fBend-of-history\fP
  2160. XMove to the last event in the history list.
  2161. X.TP
  2162. X\fBvi-fetch-history\fP (unbound) (G)
  2163. XFetch the history line specified by the numeric argument.
  2164. X.TP
  2165. X\fBhistory-incremental-search-backward\fP (^R ^Xr)
  2166. XSearch backward incrementally for a specified string.
  2167. XThe string may begin with `^' to anchor the search to the
  2168. Xbeginning of the line. A restricted set of editing functions is available in
  2169. Xthe mini-buffer. An interrupt signal, as defined by the stty setting,  will
  2170. Xstop the search and go back to the original line. An undefined key will have
  2171. Xthe same effect. The supported functions are: backward-delete-char,
  2172. Xquoted-insert, accept-and-hold, accept-and-infer-next-history, accept-line and
  2173. Xaccept-line-and-down-history; magic-space just inserts a space. Any string
  2174. Xthat is bound to an out-string (via bindkey -s) will behave as if out-string
  2175. Xwere typed directly.
  2176. XTyping the binding of \fBhistory-incremental-search-backward\fP will get the
  2177. Xnext occurrence of the contents of the mini-buffer. Typing the binding of
  2178. X\fBhistory-incremental-search-forward\fP inverts the sense of the search. The
  2179. Xdirection of the search is indicated in the mini-buffer. Any multi-character
  2180. Xstring 
  2181. Xthat is not bound to one of the above functions will beep and interrupt the
  2182. Xsearch, leaving the last found line in the buffer. Any single character that
  2183. Xis not bound to one of the above functions, or self-insert or
  2184. Xself-insert-unmeta, will have the same effect but the function will be
  2185. Xexecuted.
  2186. X.TP
  2187. X\fBhistory-incremental-search-forward\fP (^Xs)
  2188. XSearch forward incrementally for a specified string.
  2189. XThe string may begin with `^' to anchor the search to the
  2190. Xbeginning of the line. The functions available in the mini-buffer are the same
  2191. Xas for \fBhistory-incremental-search-backward\fP.
  2192. X.TP
  2193. X\fBhistory-search-backward\fP (ESC-P ESC-p) (K)
  2194. XSearch backward in the history for a line beginning with the first
  2195. Xword in the buffer.
  2196. X.TP
  2197. X\fBvi-history-search-backward\fP (unbound) (/)
  2198. XSearch backward in the history for a specified string.
  2199. XThe string may begin with `^' to anchor the search to the
  2200. Xbeginning of the line. A restricted set of editing functions is available in
  2201. Xthe mini-buffer. An interrupt signal, as defined by the stty setting,  will
  2202. Xstop the search, as will a character bound to vi-cmd-mode. The functions
  2203. Xavailable in the mini-buffer are: accept-line, backward-delete-char,
  2204. Xvi-backward-delete-char and quoted-insert. Any string
  2205. Xthat is bound to an out-string (via bindkey -s) will behave as if out-string
  2206. Xwere typed directly. Any other character that is not bound to self-insert or
  2207. Xself-insert-unmeta will beep and be ignored. If the function is called from vi
  2208. Xcommand mode, the bindings of vi insert mode will be used.
  2209. X.TP
  2210. X\fBhistory-search-forward\fP (ESC-N ESC-n) (J)
  2211. XSearch forward in the history for a line beginning with the first
  2212. Xword in the buffer.
  2213. X.TP
  2214. X\fBvi-history-search-forward\fP (unbound) (?)
  2215. XSearch forward in the history for a specified string.
  2216. XThe string may begin with `^' to anchor the search to the
  2217. Xbeginning of the line. The functions available in the mini-buffer are the same
  2218. Xas for \fBvi-history-search-backward\fP.
  2219. X.TP
  2220. X\fBinfer-next-history\fP (^X^N)
  2221. XSearch in the history list for a line matching the current one and
  2222. Xfetch the event following it.
  2223. X.TP
  2224. X\fBinsert-last-word\fP (ESC-_ ESC-.)
  2225. XInsert the last word from the previous history event at the
  2226. Xcursor position.
  2227. X.TP
  2228. X\fBvi-repeat-search\fP (unbound) (n)
  2229. XRepeat the last vi history search.
  2230. X.TP
  2231. X\fBvi-rev-repeat-search\fP (unbound) (N)
  2232. XRepeat the last vi history search, but in reverse.
  2233. X.TP
  2234. X\fBtoggle-literal-history\fP (ESC-R ESC-r)
  2235. XToggle between literal and lexical history.  The default is
  2236. Xlexical history unless the \fBHISTLIT\fP option is set.
  2237. X.TP
  2238. X\fBup-line-or-history\fP (^P ESC-[A) (- k)
  2239. XMove up a line in the buffer, or if already at the top line,
  2240. Xmove to the previous event in the history list.
  2241. X.TP
  2242. X\fBup-line-or-search\fP
  2243. XMove up a line in the buffer, or if already at the top line,
  2244. Xsearch backward in the history for a line beginning with the
  2245. Xfirst word in the buffer.
  2246. X.TP
  2247. X\fBup-history\fP (unbound) (^P)
  2248. XMove to the previous event in the history list.
  2249. X.TP
  2250. X\fBhistory-beginning-search-forward\fP (unbound)
  2251. XSearch forward in the history for a line beginning with the current
  2252. Xline up to the cursor.
  2253. XThis leaves the cursor in its original position.
  2254. X.SS Modifying Text
  2255. X.TP
  2256. X\fBvi-add-eol\fP (unbound) (A)
  2257. XMove to the end of the line and enter insert mode.
  2258. X.TP
  2259. X\fBvi-add-next\fP (unbound) (a)
  2260. XMove forward one character and enter insert mode.
  2261. X.TP
  2262. X\fBbackward-delete-char\fP (^H ^?) (^?)
  2263. XDelete the character behind the cursor.
  2264. X.TP
  2265. X\fBvi-backward-delete-char\fP (unbound) (X)
  2266. XDelete the character behind the cursor, without changing lines.
  2267. X.TP
  2268. X\fBbackward-delete-word\fP
  2269. XDelete the word behind the cursor.
  2270. X.TP
  2271. X\fBbackward-kill-line\fP
  2272. XKill from the beginning of the line to the cursor position.
  2273. X.TP
  2274. X\fBbackward-kill-word\fP (^W ESC-^H ESC-^?)
  2275. XKill the word behind the cursor.
  2276. X.TP
  2277. X\fBvi-backward-kill-word\fP (unbound) (^W)
  2278. XKill the word behind the cursor.
  2279. X.TP
  2280. X\fBcapitalize-word\fP (ESC-C ESC-c)
  2281. XCapitalize the current word and move past it.
  2282. X.TP
  2283. X\fBvi-change\fP (unbound) (c)
  2284. XRead a movement command from the keyboard, and kill
  2285. Xfrom the cursor position to the endpoint of the movement.
  2286. XThen enter insert mode.
  2287. XIf the command is \fBvi-change\fP, kill the current line.
  2288. X.TP
  2289. X\fBvi-change-eol\fP (unbound) (C)
  2290. XKill to the end of the line and enter insert mode.
  2291. X.TP
  2292. X\fBvi-change-whole-line\fP (unbound) (S s)
  2293. XKill the current line and enter insert mode.
  2294. X.TP
  2295. X\fBcopy-region-as-kill\fP (ESC-W ESC-w)
  2296. XCopy the area from the cursor to the mark to the kill buffer.
  2297. X.TP
  2298. X\fBcopy-prev-word\fP (ESC-^_)
  2299. XDuplicate the word behind the cursor.
  2300. X.TP
  2301. X\fBvi-delete\fP (unbound) (d)
  2302. XRead a movement command from the keyboard, and kill 
  2303. Xfrom the cursor position to the endpoint of the movement.
  2304. XIf the command is \fBvi-delete\fP, kill the current line.
  2305. X.TP
  2306. X\fBdelete-char\fP (unbound) (x)
  2307. XDelete the character under the cursor.
  2308. X.TP
  2309. X\fBvi-delete-char\fP (unbound) (x)
  2310. XDelete the character under the cursor.
  2311. X.TP
  2312. X\fBdelete-word\fP (ESC-D ESC-d)
  2313. XDelete the current word.
  2314. X.TP
  2315. X\fBdown-case-word\fP (ESC-L ESC-l)
  2316. XConvert the current word to all lowercase and move past it.
  2317. X.TP
  2318. X\fBkill-word\fP
  2319. XKill the current word.
  2320. X.TP
  2321. X\fBgosmacs-transpose-chars\fP
  2322. XExchange the two characters behind the cursor.
  2323. X.TP
  2324. X\fBvi-indent\fP (unbound) (>)
  2325. XIndent a number of lines.
  2326. X.TP
  2327. X\fBvi-insert\fP (unbound) (i)
  2328. XEnter insert mode.
  2329. X.TP
  2330. X\fBvi-insert-bol\fP (unbound) (I)
  2331. XMove to the beginning of the line and enter insert mode.\fP
  2332. X.TP
  2333. X\fBvi-join\fP (^X^J)
  2334. XJoin the current line with the next one.
  2335. X.TP
  2336. X\fBkill-line\fP (^K) (D)
  2337. XKill from the cursor to the end of the line.
  2338. X.TP
  2339. X\fBvi-kill-line
  2340. XKill from the cursor to the beginning of the line.
  2341. X.TP
  2342. X\fBkill-region\fP
  2343. XKill from the cursor to the mark.
  2344. X.TP
  2345. X\fBkill-buffer\fP (^X^K) (^U)
  2346. XKill the entire buffer.
  2347. X.TP
  2348. X\fBkill-whole-line\fP (^U) (unbound)
  2349. XKill the current line.
  2350. X.TP
  2351. X\fBvi-match-bracket\fP (^X^B) (%)
  2352. XMove to the bracket character (one of {\|}, (\|), or [\|]) that
  2353. Xmatches the one under the cursor.
  2354. X.TP
  2355. X\fBvi-open-line-above\fP (unbound) (O)
  2356. XOpen a line above the cursor and enter insert mode.
  2357. X.TP
  2358. X\fBvi-open-line-below\fP (unbound) (o)
  2359. XOpen a line below the cursor and enter insert mode.
  2360. X.TP
  2361. X\fBvi-oper-swap-case\fP
  2362. XRead a movement command from the keyboard, and swap
  2363. Xthe case of all characters
  2364. Xfrom the cursor position to the endpoint of the movement.
  2365. XIf the movement command is \fBvi-oper-swap-case\fP,
  2366. Xswap the case of all characters on the current line.
  2367. X.TP
  2368. X\fBoverwrite-mode\fP (^X^O)
  2369. XToggle between overwrite mode and insert mode.
  2370. X.TP
  2371. X\fBvi-put-after\fP (unbound) (p)
  2372. XInsert the contents of the kill buffer after the cursor.
  2373. X.TP
  2374. X\fBquoted-insert\fP (^V)
  2375. XInsert the next character typed into the buffer literally.
  2376. X.TP
  2377. X\fBquote-line\fP (ESC-')
  2378. XQuote the current line; that is, put a ' character at the
  2379. Xbeginning and the end, and convert all ' characters
  2380. Xto '\e''.
  2381. X.TP
  2382. X\fBquote-region\fP (ESC-")
  2383. XQuote the region from the cursor to the mark.
  2384. X.TP
  2385. X\fBvi-replace\fP (unbound) (R)
  2386. XEnter overwrite mode.
  2387. X.TP
  2388. X\fBvi-repeat-change\fP (unbound) (.)
  2389. XRepeat the last vi mode text modification.
  2390. X.TP
  2391. X\fBvi-replace-chars\fP (unbound) (r)
  2392. XReplace the character under the cursor with a character
  2393. Xread from the keyboard.
  2394. X.TP
  2395. X\fBself-insert\fP (printable characters)
  2396. XPut a character in the buffer at the cursor position.
  2397. X.TP
  2398. X\fBself-insert-unmeta\fP (ESC-^I ESC-^J ESC-^M)
  2399. XPut a character in the buffer after stripping the meta bit
  2400. Xand converting \fB^M\fP to \fB^J\fP.
  2401. X.TP
  2402. X\fBvi-substitute\fP (unbound) (s)
  2403. XSubstitute the next character(s).
  2404. X.TP
  2405. X\fBvi-swap-case\fP (unbound) (~)
  2406. XSwap the case of the character under the cursor and move past it.
  2407. X.TP
  2408. X\fBtranspose-chars\fP (^T)
  2409. XExchange the two characters to the left of the
  2410. Xcursor if at end of line, else exchange the
  2411. Xcharacter under the cursor with the character
  2412. Xto the left.
  2413. X.TP
  2414. X\fBtranspose-words\fP (ESC-T ESC-t)
  2415. XExchange the current word with the one before it.
  2416. X.TP
  2417. X\fBvi-unindent\fP (unbound) (<)
  2418. XUnindent a number of lines.
  2419. X.TP
  2420. X\fBup-case-word\fP (ESC-U ESC-u)
  2421. XConvert the current word to all caps and move past it.
  2422. X.TP
  2423. X\fByank\fP (^Y) (P)
  2424. XInsert the contents of the kill buffer at the cursor position.
  2425. X.TP
  2426. X\fByank-pop\fP (ESC-y) (unbound)
  2427. XRemove the text just yanked, rotate the kill\-ring,
  2428. Xand yank the new top.  Only works following
  2429. X\fByank\fP or \fByank-pop\fP.
  2430. X.TP
  2431. X\fBvi-yank\fP (unbound) (y)
  2432. XRead a movement command from the keyboard, and copy the region
  2433. Xfrom the cursor position to the endpoint of the movement
  2434. Xinto the kill buffer.
  2435. XIf the command is \fBvi-yank\fP, copy the current line.
  2436. X.TP
  2437. X\fBvi-yank-eol\fP (unbound) (Y)
  2438. XCopy the region from the cursor position to the end of the line
  2439. Xinto the kill buffer.
  2440. X.SS Arguments
  2441. X.TP
  2442. X\fBdigit-argument\fP (ESC-0..ESC-9) (0-9)
  2443. XStart a new numeric argument, or add to the current one.
  2444. X.TP
  2445. X\fBneg-argument\fP (ESC-- unbound)
  2446. XChanges the sign of the following argument.
  2447. X.TP
  2448. X\fBuniversal-argument\fP
  2449. XMultiply the argument of the next command by 4.
  2450. X.SS Completion
  2451. X.TP
  2452. X\fBaccept-and-menu-complete\fP
  2453. XIn a menu completion, insert the current completion into the buffer,
  2454. Xand advance to the next possible completion.
  2455. X.TP
  2456. X\fBcomplete-word\fP (unbound) (\|\e\|)
  2457. XAttempt completion on the current word.
  2458. X.TP
  2459. X\fBdelete-char-or-list\fP (^D)
  2460. XDelete the character under the cursor.  If the cursor
  2461. Xis at the end of the line, list possible completions for the
  2462. Xcurrent word.
  2463. X.TP
  2464. X\fBexecute-named-cmd\fP (ESC-x) Read the name of a editor command and
  2465. Xexecute it. A restricted set of editing functions is available in the
  2466. Xmini-buffer. An interrupt signal, as defined by the stty setting, will
  2467. Xabort the function. The allowed functions are: backward-delete-char,
  2468. Xvi-backward-delete-char, kill-region (kills the last word),
  2469. Xbackward-kill-word, vi-backward-kill-word, kill-whole-line,
  2470. Xvi-kill-line, backward-kill-line, list-choices, delete-char-or-list
  2471. Xand accept-line. The space and tab characters, if not bound to one of
  2472. Xthese functions, will complete the name and then list the
  2473. Xpossibilities if the autolist option is set.
  2474. X.TP
  2475. X\fBexecute-last-named-cmd\fP (ESC-z)
  2476. XRedo the last function executed with \fBexecute-named-cmd\fP.
  2477. X.TP
  2478. X\fBexpand-cmd-path\fP
  2479. XExpand the current command to its full pathname.
  2480. X.TP
  2481. X\fBexpand-or-complete\fP (TAB) (TAB ^X)
  2482. XAttempt shell expansion on the current word.
  2483. XIf that fails,
  2484. Xattempt completion.
  2485. X.TP
  2486. X\fBexpand-or-complete-prefix\fP (unbound)
  2487. XAttempt shell expansion on the current word upto cursor.
  2488. X.TP
  2489. X\fBexpand-history\fP (ESC-space ESC-!)
  2490. XPerform history expansion on the edit buffer.
  2491. X.TP
  2492. X\fBexpand-word\fP (^X*)
  2493. XAttempt shell expansion on the current word.
  2494. X.TP
  2495. X\fBlist-choices\fP (ESC-^D) (^D =)
  2496. XList possible completions for the current word.
  2497. X.TP
  2498. X\fBlist-expand\fP (^Xg ^XG) (^G)
  2499. XList the expansion of the current word.
  2500. X.TP
  2501. X\fBmagic-space\fP
  2502. XPerform history expansion and insert a space into the
  2503. Xbuffer.  This is intended to be bound to space.
  2504. X.TP
  2505. X\fBmenu-complete\fP
  2506. XLike \fBcomplete-word\fP, except that menu completion is used.
  2507. XSee the \fBMENU_COMPLETE\fP option below.
  2508. X.TP
  2509. X\fBmenu-expand-or-complete\fP
  2510. XLike \fBexpand-or-complete\fP, except that menu completion is used.
  2511. X.TP
  2512. X\fBreverse-menu-complete\fP
  2513. XSee the \fBMENU_COMPLETE\fP option below.
  2514. X.SS Miscellaneous
  2515. X.TP
  2516. X\fBaccept-and-hold\fP (ESC-A ESC-a)
  2517. XPush the contents of the buffer on the buffer stack
  2518. Xand execute it.
  2519. X.TP
  2520. X\fBaccept-and-infer-next-history\fP
  2521. XExecute the contents of the buffer.
  2522. XThen search the history list for a line matching the current one
  2523. Xand push the event following onto the buffer stack.
  2524. X.TP
  2525. X\fBaccept-line\fP (^J ^M)
  2526. XExecute the contents of the buffer.
  2527. X.TP
  2528. X\fBaccept-line-and-down-history\fP (^O)
  2529. XExecute the current line, and push the next history
  2530. Xevent on the the buffer stack.
  2531. X.TP
  2532. X\fBvi-cmd-mode\fP (^X^V) (^[)
  2533. XEnter command mode; that is, use the alternate keymap.
  2534. XYes, this is bound by default in emacs mode.
  2535. X.TP
  2536. X\fBvi-caps-lock-panic\fP (unbound) (H K)
  2537. XHang until any lowercase key is pressed.
  2538. XThis is for vi users without the mental capacity to keep
  2539. Xtrack of their caps lock key (like the author).
  2540. X.TP
  2541. X\fBclear-screen\fP (^L ESC-^L)
  2542. XClear the screen and redraw the prompt.
  2543. X.TP
  2544. X\fBexchange-point-and-mark\fP (^X^X)
  2545. XExchange the cursor position with the position of the mark.
  2546. X.TP
  2547. X\fBget-line\fP (ESC-G ESC-g)
  2548. XPop the top line off the buffer stack and insert it at the
  2549. Xcursor position.
  2550. X.TP
  2551. X\fBpound-insert\fP (unbound) (#)
  2552. XIf there is no # character at the beginning of the current line,
  2553. Xadd one.  If there is one, remove it.  In either case, accept the
  2554. Xcurrent line.  The \fBINTERACTIVE_COMMENTS\fP option must be set
  2555. Xfor this to have any usefulness.
  2556. X.TP
  2557. X\fBpush-input\fP
  2558. XPush the entire current multiline construct onto the buffer stack and
  2559. Xreturn to the top-level (\fBPS1\fP) prompt.
  2560. XIf the current parser construct is only a single line, this is exactly
  2561. Xlike \fBpush-line\fP.
  2562. XNext time the editor starts up or is popped with \fBget-line\fP, the
  2563. Xconstruct will be popped off the top of the buffer stack and loaded
  2564. Xinto the editing buffer.
  2565. X.TP
  2566. X\fBpush-line\fP (^Q ESC-Q ESC-q)
  2567. XPush the current buffer onto the buffer stack and clear
  2568. Xthe buffer.
  2569. XNext time the editor starts up, the buffer will be popped
  2570. Xoff the top of the buffer stack and loaded into the editing
  2571. Xbuffer.
  2572. X.TP
  2573. X\fBpush-line-or-edit\fP
  2574. XAt the top-level (\fBPS1\fP) prompt, equivalent to \fBpush-line\fP.
  2575. XAt a secondary (\fBPS2\fP) prompt, move the entire current multiline
  2576. Xconstruct into the editor buffer.
  2577. XThe latter is equivalent to \fBpush-input\fP followed by \fBget-line\fP.
  2578. X.TP
  2579. X\fBredisplay\fP (unbound) (^R)
  2580. XRedisplays the edit buffer.
  2581. END_OF_FILE
  2582.   if test 71886 -ne `wc -c <'zsh-2.5.0/man/zsh.1.A'`; then
  2583.     echo shar: \"'zsh-2.5.0/man/zsh.1.A'\" unpacked with wrong size!
  2584.   elif test -f 'zsh-2.5.0/man/zsh.1.B'; then
  2585.     echo shar: Combining  \"'zsh-2.5.0/man/zsh.1'\" \(155263 characters\)
  2586.     cat 'zsh-2.5.0/man/zsh.1.A' 'zsh-2.5.0/man/zsh.1.B' > 'zsh-2.5.0/man/zsh.1'
  2587.     if test 155263 -ne `wc -c <'zsh-2.5.0/man/zsh.1'`; then
  2588.       echo shar: \"'zsh-2.5.0/man/zsh.1'\" combined with wrong size!
  2589.     else
  2590.       rm zsh-2.5.0/man/zsh.1.A zsh-2.5.0/man/zsh.1.B 
  2591.     fi
  2592.   fi
  2593.   # end of 'zsh-2.5.0/man/zsh.1.A'
  2594. fi
  2595. if test -f 'zsh-2.5.0/src/config/bz.config.h' -a "${1}" != "-c" ; then 
  2596.   echo shar: Will not clobber existing file \"'zsh-2.5.0/src/config/bz.config.h'\"
  2597. else
  2598.   echo shar: Extracting \"'zsh-2.5.0/src/config/bz.config.h'\" \(11328 characters\)
  2599.   sed "s/^X//" >'zsh-2.5.0/src/config/bz.config.h' <<'END_OF_FILE'
  2600. X# --- ${C_BLDDIR}config.h
  2601. X
  2602. Xif test -n "$B_config_h"
  2603. Xthen
  2604. X
  2605. XF_define=yep
  2606. XF_using=yep
  2607. X
  2608. Xecho
  2609. Xecho Building ${C_BLDDIR}config.h...
  2610. X
  2611. X(exec >${C_BLDDIR}config.h
  2612. X
  2613. X{
  2614. Xecho
  2615. Xecho '    starting features probing...'
  2616. Xecho
  2617. X} >&2
  2618. X
  2619. Xcat <<foo
  2620. X/* config.h */
  2621. X/* architecture-customized config.h for $VERSION
  2622. X * for architecture "$arch",
  2623. X * automagically generated by buildzsh -- do not edit */
  2624. X
  2625. Xfoo
  2626. X
  2627. Xset elfh elf.h ${headerdir}/sys
  2628. X. ./config/bz.walk
  2629. X
  2630. Xset resourceh resource.h ${headerdir}/sys
  2631. X. ./config/bz.walk
  2632. X
  2633. Xset 'test -n "$elfh" -o -z "$resourceh" -o -n "$SEQUENTPTX"' SYSV 1 'pure SYSV'
  2634. X. ./config/bz.ifdef
  2635. X
  2636. Xif test -n "$_yea"
  2637. Xthen
  2638. X  PATH=/usr/bin:$PATH
  2639. X  export PATH
  2640. X  echo '    forcing /usr/bin early in PATH...' >&2
  2641. X  if test -n "${elfh}"
  2642. X  then
  2643. X    echo '#define SYSVR4'
  2644. X    echo '    looks like a SYSVR4 system...' >&2
  2645. X    force_setpgid=1
  2646. X    force_strftime=1
  2647. X    if test -n "$SOLARIS"
  2648. X    then
  2649. X      echo '#define SOLARIS'
  2650. X      echo '    looks like a Solaris...' >& 2
  2651. X    fi
  2652. X    echo
  2653. X  fi
  2654. Xfi
  2655. X
  2656. Xecho '/* some environments have broken termios, for example ULTRIX */'
  2657. Xset 'test -z "$ULTRIX" -a -z "$APOLLO" -a -z "$BBN" -a -z "$NEXT" -a -f ${headerdir}/termios.h' HAS_TERMIOS 1 'termios'
  2658. X. ./config/bz.ifdef
  2659. X
  2660. Xif test -z "$_nay"
  2661. Xthen
  2662. X  test -n "$DGUX" && echo '#define CLOBBERS_TYPEAHEAD 1'
  2663. Xelse
  2664. X
  2665. Xset 'test -z "$ULTRIX" -a -z "`grep sgttyb ${headerdir}/sys/ioctl.h 2>/dev/null`"' HAS_TERMIO 1 'termio'
  2666. X. ./config/bz.ifdef
  2667. Xecho '    using sgttyb...' >&2
  2668. X
  2669. Xif test -z "$ULTRIX" -a -z "$NEXT"
  2670. Xthen
  2671. Xcat <<foo
  2672. X#define TTY_NEEDS_DRAINING 1
  2673. X#define CLOBBERS_TYPEAHEAD 1
  2674. X
  2675. Xfoo
  2676. Xfi
  2677. X
  2678. Xfi
  2679. X
  2680. Xtest -n "$IRIX5" && echo '#define IRIX5'
  2681. X  
  2682. Xset 'test -f ${headerdir}/dirent.h \
  2683. X          -a -z "$NEXT" -a -z "$ULTRIX"'\
  2684. X    HAS_DIRENT 1 '<dirent.h>'
  2685. X. ./config/bz.ifdef
  2686. X
  2687. Xset 'test -f ${headerdir}/unistd.h' HAS_UNISTD 1 '<unistd.h>'
  2688. X. ./config/bz.ifdef
  2689. X
  2690. Xset stdlibh stdlib.h "/usr/include/ansi ${headerdir}"
  2691. X. ./config/bz.walk
  2692. X
  2693. Xif test -n "$stdlibh"
  2694. Xthen
  2695. X   set 'grep alloc $stdlibh >/dev/null 2>&1' HAS_STDLIB 1 '<stdlib.h>'
  2696. X  . ./config/bz.ifdef
  2697. Xfi
  2698. X
  2699. Xset 'test -f ${headerdir}/string.h' HAS_STRING 1 '<string.h>' '<strings.h>'
  2700. X. ./config/bz.ifdef
  2701. X
  2702. Xif test -f ${headerdir}/strings.h -a -n "${NEXT}" -a Z"${NEXT}" != Z3.x
  2703. Xthen
  2704. Xcat <<foo
  2705. X/* BSD compat */
  2706. X#define strchr    index
  2707. X#define strrchr    rindex
  2708. Xfoo
  2709. Xfi
  2710. X
  2711. Xset 'test -f ${headerdir}/memory.h' HAS_MEMORY 1 '<memory.h>'
  2712. X. ./config/bz.ifdef
  2713. X
  2714. Xif test -n "$_nay"
  2715. Xthen
  2716. Xset 'grep memset ${headerdir}/string.h >/dev/null 2>&1' '' '' 'memcpy(),memset(),memcmp() from <string.h>' 'redefined memcpy(), memset(), memcmp()' '' '' '
  2717. X#define memcpy(dst, src, n)    bcopy(src, dst, n)
  2718. X#define memset(dst, ch, n)    do {\
  2719. X    char *__DST__ = (char *)(dst);\
  2720. X    int __N__ = (int)(n), __CH__ = (int)(ch);\
  2721. X    while (__N__--) { __DST__[__N__] = __CH__; } } while(0)
  2722. X#define memcmp(s1, s2, n)    bcmp(s1, s2, n)'
  2723. X. ./config/bz.ifdef
  2724. Xfi
  2725. X
  2726. Xset 'test -f ${headerdir}/locale.h' HAS_LOCALE 1 '<locale.h>'
  2727. X. ./config/bz.ifdef
  2728. X
  2729. Xif test -f "${headerdir}/utmpx.h"
  2730. Xthen
  2731. X  _utmp_hs_="${headerdir}/utmpx.h ${headerdir}/utmp.h"
  2732. Xelse
  2733. X  _utmp_hs_="${headerdir}/utmp.h"
  2734. Xfi
  2735. X
  2736. Xset utmph "utmpx.h utmp.h" ${headerdir}
  2737. X. ./config/bz.walk
  2738. X
  2739. Xset 'test Z$utmph = Z${headerdir}/utmpx.h' HAS_UTMPX 1 '<utmpx.h>' '<utmp.h>'
  2740. X. ./config/bz.ifdef
  2741. X
  2742. Xset 'grep ut_host $utmph >/dev/null 2>&1 && ( test Z"$host" != Zmips || test -n "$OSF1" )' UTMP_HOST 1 'host field in utmp'
  2743. X. ./config/bz.ifdef
  2744. X
  2745. Xset 'test -f ${headerdir}/time.h && (grep timeval ${headerdir}/time.h >/dev/null 2>&1 || test -n "$SCO" )' HAS_TIME 1 '<time.h>' '<sys/time.h>'
  2746. X. ./config/bz.ifdef
  2747. X
  2748. Xset waith wait.h "${headerdir} ${headerdir}/sys" "${headerdir}/sys/wait.h"
  2749. X. ./config/bz.walk
  2750. X
  2751. Xset 'test Z$waith = Z${headerdir}/wait.h' HAS_WAIT 1 '<wait.h>' '<sys/wait.h>'
  2752. X. ./config/bz.ifdef
  2753. X
  2754. Xset 'test -z "$NEXT" && grep "waitpid.*(" $waith >/dev/null 2>&1 || man 2 wait 2>/dev/null | sed "s/_.//g" | grep waitpid >/dev/null' HAS_WAITPID 1 'waitpid()'
  2755. X. ./config/bz.ifdef
  2756. X
  2757. Xset 'grep FD_SET ${headerdir}/sys/types.h >/dev/null 2>&1 || test -f ${headerdir}/sys/select.h || test -n "$LINUX"' HAS_SELECT 1 'select()'
  2758. X. ./config/bz.ifdef
  2759. X
  2760. Xset 'test -f ${headerdir}/sys/select.h \
  2761. X     && \
  2762. X     grep "struct  *fd_set " ${headerdir}/sys/select.h >/dev/null 2>&1' \
  2763. X     HAS_SYS_SELECT 1 \
  2764. X     '<sys/select.h>' '' '"struct fd_set" in <sys/select.h>'
  2765. X. ./config/bz.ifdef
  2766. X
  2767. Xcat <<foo
  2768. X/* we can't just test for S_IFIFO or check to see if the mknod worked,
  2769. X   because the NeXTs sold by a vendor which will remain nameless will
  2770. X   happily create the FIFO for you, and then panic when you try to do
  2771. X    something weird with them, because they aren't supported by the OS. */
  2772. Xfoo
  2773. Xset 'test -z "$NEXT" -o Z"$NEXT" != Z2.x' HAS_FIFOS 1 'fifos'
  2774. X. ./config/bz.ifdef
  2775. X
  2776. Xset 'test -n "$force_strftime" -o -n "$MIPS" -o -n "$AIX" -o -n "$LINUX" || \
  2777. X     man 3 strftime 2>/dev/null | grep return >/dev/null || \
  2778. X     man -s 3c strftime 2>/dev/null | grep return >/dev/null' \
  2779. X    HAS_STRFTIME 1 'strftime()'
  2780. X. ./config/bz.ifdef
  2781. X
  2782. Xset 'test -n "$MIPS" -o -n "$AIX" || \
  2783. X     grep tcsetpgrp ${headerdir}/unistd.h >/dev/null 2>&1 || \
  2784. X     man tcsetpgrp 2>/dev/null | grep process >/dev/null && test -z "$NEXT"' \
  2785. X    HAS_TCSETPGRP 1 'tcsetpgrp()'
  2786. X. ./config/bz.ifdef
  2787. X
  2788. X_term_hs_="${headerdir}/termio.h ${headerdir}/sys/termio.h ${headerdir}/termios.h ${headerdir}/sys/termios.h"
  2789. X
  2790. Xset 'test -z "$NEXT" -a -n "`grep tcgetattr $_term_hs_ 2>/dev/null`"' \
  2791. X     HAS_TCCRAP 1 'tcgetattr() and friends'
  2792. X. ./config/bz.ifdef
  2793. X
  2794. Xif test -n "$_nay" -a \( -n "$IRIX" -o -n "$MIPS" \)
  2795. Xthen
  2796. Xecho '
  2797. X/* some environments like IRIX have a broken setpgid()
  2798. X * setpgrp() might come to rescue */'
  2799. Xfi
  2800. Xset 'test -n "$AIX" -o -n "$LINUX" -o -n "$force_setpgid" || \
  2801. X     man setpgid 2>/dev/null | grep process >/dev/null && \
  2802. X     test -z "$IRIX" -a -z "$MIPS" -a -z "$NEXT"' \
  2803. X     HAS_SETPGID 1 'setpgid()' 'setpgrp()'
  2804. X. ./config/bz.ifdef
  2805. X
  2806. Xif test -n "$TITAN"
  2807. Xthen
  2808. Xecho '
  2809. X/* TitanOS has sigrelse(), sighold() and sigset() but it cannot use
  2810. X * them simultaneously with -43 */'
  2811. Xfi
  2812. X
  2813. X_signal_hs_="${headerdir}/signal.h ${headerdir}/sys/signal.h ${headerdir}/linux/signal.h"
  2814. X
  2815. Xset 'test -z "$HPUX" -a -z "$PYR" -a -z "$MIPS" -a -z "$AIX" -a -z "$TITAN" &&
  2816. X    (grep SIGRELSE $_signal_hs_ > /dev/null 2>&1 || \
  2817. X     man sigrelse 2>/dev/null | grep signal >/dev/null)' \
  2818. X    HAS_SIGRELSE 1 'sigrelse()' 'sigblock()'
  2819. X. ./config/bz.ifdef
  2820. X
  2821. Xset 'test -d /../.CONTROL' HAS_RFS 1 RFS
  2822. X. ./config/bz.ifdef
  2823. X
  2824. Xcat <<foo
  2825. X/* the stress is on "a working wait3()" because for example HP-UX has
  2826. X * sort of working getrusage() but nothing like wait3() */
  2827. Xfoo
  2828. Xset 'test -f $resourceh -a -z "$HPUX" -a -z "$UNICOS" -a -z "$SOLARIS"' HAS_RUSAGE 1 'getrusage() and wait3()'
  2829. X. ./config/bz.ifdef
  2830. X
  2831. Xif test Z"$host" = Zhp9000s700
  2832. Xthen
  2833. Xecho '    using hp9000s700 rlimit kludge...' >&2
  2834. Xecho '
  2835. X/* kludge RLIM code for HPUX s700 - These limits are all readable,and
  2836. X * some like coredumpsize are settable by users
  2837. X */
  2838. X#define RLIMIT_CPU    0        /* cpu time in milliseconds */
  2839. X#define RLIMIT_FSIZE    1        /* maximum file size */
  2840. X#define RLIMIT_DATA    2        /* data size */
  2841. X#define RLIMIT_STACK    3        /* stack size */
  2842. X#define RLIMIT_CORE    4        /* core file size */
  2843. X#define RLIMIT_RSS    5        /* resident set size */
  2844. X
  2845. X#define RLIM_INFINITY    0x7fffffff
  2846. X'
  2847. Xfi
  2848. X
  2849. XSTD_DUMP="cat /etc/passwd"
  2850. XNIS_DUMP="ypcat passwd.byname"
  2851. XNI_DUMP="nidump passwd /"
  2852. XDUMP_USERS="$STD_DUMP"
  2853. X
  2854. Xset 'test -f /usr/bin/ypcat && $NIS_DUMP > /dev/null 2>&1' HAS_NIS 1 NIS
  2855. X. ./config/bz.ifdef
  2856. X
  2857. Xif test -n "$_yea"
  2858. Xthen
  2859. X  DUMP_USERS="$NIS_DUMP"
  2860. Xelse
  2861. X  test -d /NextApps && $NI_DUMP > /dev/null 2>&1 && DUMP_USERS="$NI_DUMP"
  2862. Xfi
  2863. X
  2864. Xlot_user=`$DUMP_USERS | awk '{if(NR>'$LOTSA_USERS'){print;exit 1}}'`
  2865. Xif test -n "$B_query"
  2866. Xthen
  2867. X{
  2868. X  echo
  2869. X  echo "Username caching is useful if there are more than $LOTSA_USERS users..."
  2870. X} >&2
  2871. Xfi
  2872. XG_verb2_=use
  2873. Xset 'test -n "$lot_user"' CACHE_USERNAMES 1 'username caching'
  2874. X. ./config/bz.ifdef
  2875. X
  2876. Xset 'egrep "SIG_DFL|sighandler_t" $_signal_hs_ 2>/dev/null | grep void > /dev/null && test -z "$IRIX" || test -n "$SCO" ' SIGVOID 1 'signal handlers returning void' 'signal handlers returning int'
  2877. X. ./config/bz.ifdef
  2878. X
  2879. Xset 'test -n "`grep SIGTSTP $_signal_hs_ 2>/dev/null`"' \
  2880. X    HAS_AUTORESETHAND 1 'automatically reset signal handlers' \
  2881. X    'forced reset signal handlers'
  2882. X. ./config/bz.ifdef
  2883. X
  2884. Xif test -n "$_yea"
  2885. Xthen
  2886. Xset 'test -z "$HPUX" -a -z "$MIPS" -a -z "$IRIX" -a -z "$TITAN" -a -z "$AIX" \
  2887. X   && (man 2 sigset 2>/dev/null | grep handler >/dev/null )' \
  2888. X    USE_SIGSET 1 'sigset() to install said signal handlers'
  2889. X. ./config/bz.ifdef
  2890. Xfi
  2891. X
  2892. X{
  2893. Xecho
  2894. Xecho '    finished probing features...'
  2895. X} >&2
  2896. X
  2897. Xcat <<foo
  2898. X#if defined(SIGVOID) || defined(IRIX5) || defined(SCO)
  2899. X#define HANDTYPE void
  2900. X#else
  2901. X#define HANDTYPE int
  2902. X#define INTHANDTYPE
  2903. X#endif
  2904. X
  2905. X/* a string corresponding to the host type */
  2906. X
  2907. X#define HOSTTYPE "$host"
  2908. X
  2909. X/* the default editor for the fc builtin */
  2910. X#define DEFFCEDIT "vi"
  2911. Xfoo
  2912. Xecho
  2913. X
  2914. Xif test -n "`egrep 'UTMP_FILE|_PATH_UTMP' $_utmp_hs_ 2>/dev/null`"
  2915. Xthen :
  2916. Xelse 
  2917. Xset WTMP wtmp "/etc /usr/etc /var/adm /usr/adm" /dev/null
  2918. X. ./config/bz.walk
  2919. Xset UTMP utmp "/etc /usr/etc /var/adm /usr/adm" /dev/null
  2920. X. ./config/bz.walk
  2921. Xcat <<foo
  2922. X/* the path of wtmp */
  2923. X#define WTMP_FILE "$WTMP"
  2924. X
  2925. X/* the path of utmp */
  2926. X#define UTMP_FILE "$UTMP"
  2927. Xfoo
  2928. Xfi
  2929. X
  2930. X{
  2931. X  echo
  2932. X  echo '    defining installation specifics...'
  2933. X  echo
  2934. X} >&2
  2935. X
  2936. Xset DEFTMPPREFIX /tmp/zsh 'default prefix for temporary files' '' '"'
  2937. X. ./config/bz.define
  2938. X
  2939. XETCDIR=$C_ETCDIR
  2940. X
  2941. Xset GLOBALZSHENV ${ETCDIR}/zshenv \
  2942. X"the global file to source absolutely first whenever zsh is run;
  2943. Xif undefined, don't source anything" 1 '"'
  2944. X. ./config/bz.define
  2945. X
  2946. Xset GLOBALZSHRC ${ETCDIR}/zshrc \
  2947. X"the global file to source whenever zsh is run;
  2948. Xif undefined, don't source anything" 1 '"'
  2949. X. ./config/bz.define
  2950. X
  2951. Xset GLOBALZLOGIN ${ETCDIR}/zlogin \
  2952. X"the global file to source whenever zsh is run as a login shell;
  2953. Xif undefined, don't source anything" 1 '"'
  2954. X. ./config/bz.define
  2955. X
  2956. Xset GLOBALZPROFILE ${ETCDIR}/zprofile \
  2957. X"the global file to source whenever zsh is run as a login shell,
  2958. Xbefore zshrc is read; if undefined, don't source anything" 1 '"'
  2959. X. ./config/bz.define
  2960. X
  2961. XF_define=yep
  2962. X
  2963. Xif test -n "$B_query"
  2964. Xthen
  2965. X{
  2966. X  echo
  2967. X  echo "The following question is about the text printed by zsh"
  2968. X  echo "when a process is suspended/stopped under job control."
  2969. X} >&2
  2970. Xfi
  2971. XG_verb2_=prefer
  2972. Xset true USE_SUSPENDED 1 '"suspended" instead of "stopped"' '"stopped" instead of "suspended"'
  2973. X. ./config/bz.ifdef
  2974. X
  2975. Xset DEFAULT_HISTSIZE 30 \
  2976. X"the default history buffer size in lines"
  2977. X. ./config/bz.define
  2978. X
  2979. Xcat <<'foo'
  2980. X#define _BSD_COMPAT        /* this could be IRIX,  you never know */
  2981. X#define _BSD_TYPES        /* this could be IRIX5, you never know */
  2982. X#define _BSD            /* this could be HP-UX, you never know */
  2983. X#define _BSD_INCLUDES        /* this could be AIX,   you never know */
  2984. X#define _BBN_POSIX_SUPPORT    /* this could be nX,    you never know */
  2985. X
  2986. X/* if your compiler doesn't like void *,
  2987. X * change this to char * and ignore all the warnings. */
  2988. X
  2989. Xtypedef void * vptr;
  2990. X
  2991. X#define JOB_CONTROL
  2992. X
  2993. X/* define this if you want to use zsh's own allocator */
  2994. X/* #define USE_ZSH_MALLOC */
  2995. X
  2996. X#ifdef USE_ZSH_MALLOC
  2997. X
  2998. X/* define this if you want the allocator to store information */
  2999. X
  3000. X/* #define MEM_DEBUG */
  3001. X
  3002. X/* define this if you want to get error messages from the allocator */
  3003. X
  3004. X/* #define MEM_WARNING */
  3005. X
  3006. X/* define this if you want free() to be really save */
  3007. X
  3008. X/* #define SECURE_FREE */
  3009. X
  3010. X#endif /* USE_ZSH_MALLOC */
  3011. X
  3012. X/* end of config.h */
  3013. Xfoo
  3014. X
  3015. X{
  3016. X  echo
  3017. X  echo '    defined installation specifics...'
  3018. X} >&2
  3019. X
  3020. X)
  3021. Xfi
  3022. END_OF_FILE
  3023.   if test 11328 -ne `wc -c <'zsh-2.5.0/src/config/bz.config.h'`; then
  3024.     echo shar: \"'zsh-2.5.0/src/config/bz.config.h'\" unpacked with wrong size!
  3025.   fi
  3026.   # end of 'zsh-2.5.0/src/config/bz.config.h'
  3027. fi
  3028. echo shar: End of archive 3 \(of 18\).
  3029. cp /dev/null ark3isdone
  3030. MISSING=""
  3031. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
  3032.     if test ! -f ark${I}isdone ; then
  3033.     MISSING="${MISSING} ${I}"
  3034.     fi
  3035. done
  3036. if test "${MISSING}" = "" ; then
  3037.     echo You have unpacked all 18 archives.
  3038.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  3039. else
  3040.     echo You still must unpack the following archives:
  3041.     echo "        " ${MISSING}
  3042. fi
  3043. exit 0
  3044. exit 0 # Just in case...
  3045.