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

  1. From: zsh-list@sterling.com (Bas de Bakker)
  2. Newsgroups: comp.sources.misc
  3. Subject: v43i093:  zsh - The Z shell, version 2.5.0, Part04/18
  4. Date: 13 Jul 1994 23:02:22 -0500
  5. Organization: Sterling Software
  6. Sender: kent@sparky.sterling.com
  7. Approved: kent@sparky.sterling.com
  8. Message-ID: <302dce$ss0@sparky.sterling.com>
  9. References: <csm-v43i089=zsh.230017@sparky.sterling.com>
  10. X-Md4-Signature: d076e437bd7ffd648460e18118e55c8a
  11.  
  12. Submitted-by: zsh-list@sterling.com (Bas de Bakker)
  13. Posting-number: Volume 43, Issue 93
  14. Archive-name: zsh/part04
  15. Environment: UNIX
  16. Supersedes: zsh: Volume 35, Issue 51-72
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then feed it
  20. # into a shell via "sh file" or similar.  To overwrite existing files,
  21. # type "sh file -c".
  22. # Contents:  zsh-2.5.0/doc/zsh.texi.C zsh-2.5.0/src/config/bz.check
  23. #   zsh-2.5.0/src/config/bz.makeprobe
  24. # Wrapped by kent@sparky on Tue Jul 12 16:47:17 1994
  25. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  26. echo If this archive is complete, you will see the following message:
  27. echo '          "shar: End of archive 4 (of 18)."'
  28. if test -f 'zsh-2.5.0/doc/zsh.texi.C' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'zsh-2.5.0/doc/zsh.texi.C'\"
  30. else
  31.   echo shar: Extracting \"'zsh-2.5.0/doc/zsh.texi.C'\" \(69910 characters\)
  32.   sed "s/^X//" >'zsh-2.5.0/doc/zsh.texi.C' <<'END_OF_FILE'
  33. X@cindex links, symbolic
  34. X@cindex symbolic links
  35. X@pindex CHASE_LINKS
  36. X@item CHASE_LINKS (-w)
  37. XResolve symbolic links to their true values.
  38. X
  39. X@cindex aliases, completion of
  40. X@pindex COMPLETE_ALIASES
  41. X@item COMPLETE_ALIASES
  42. XIf set, aliases on the command line are not internally substituted
  43. Xbefore completion is attempted.
  44. X
  45. X@pindex COMPLETE_IN_WORD
  46. X@item COMPLETE_IN_WORD
  47. XIf unset, the cursor is moved to the end of the word if completion is
  48. Xstarted.  Otherwise it stays where it is and completion is done from
  49. Xboth ends.
  50. X
  51. X@cindex correction, spelling
  52. X@cindex spelling correction
  53. X@pindex CORRECT
  54. X@item CORRECT (-0)
  55. XTry to correct the spelling of commands.
  56. X
  57. X@pindex CORRECT_ALL
  58. X@item CORRECT_ALL (-O)
  59. XTry to correct the spelling of all arguments in a line.
  60. X
  61. X@cindex csh, history style
  62. X@pindex CSH_JUNKIE_HISTORY
  63. X@item CSH_JUNKIE_HISTORY
  64. XA history reference without an event specifier will always refer to the
  65. Xprevious command.
  66. X
  67. X@cindex csh, loop style
  68. X@cindex loop style, csh
  69. X@pindex CSH_JUNKIE_LOOPS
  70. X@item CSH_JUNKIE_LOOPS
  71. XAllow loop bodies to take the form @samp{@var{list}; end} instead of
  72. X@samp{do @var{list}; done}.@refill
  73. X
  74. X@pindex CSH_JUNKIE_PAREN
  75. X@item CSH_JUNKIE_PAREN
  76. XAllow @code{for}, @code{if} and @code{while} loops where the argument
  77. Xlist is given in parentheses.  Otherwise, the parentheses will be
  78. Xtreated as specifying a subshell.@refill
  79. X
  80. X@cindex csh, quoting style
  81. X@cindex quoting style, csh
  82. X@pindex CSH_JUNKIE_QUOTES
  83. X@item CSH_JUNKIE_QUOTES
  84. XComplain if a quoted expression runs off the end of a line; prevent
  85. Xquoted expressions from containing unescaped newlines.
  86. X
  87. X@pindex GLOB_SUBST
  88. X@item GLOB_SUBST
  89. XTreat any characters resulting from parameter substitution as being
  90. Xeligible for file expansion and filename generation, and any characters
  91. Xresulting from command substitution as being eligible for filename
  92. Xgeneration.@refill
  93. X
  94. X@cindex csh, null globbing style
  95. X@cindex null globbing, csh style
  96. X@cindex globbing, null, csh style
  97. X@pindex CSH_NULL_GLOB
  98. X@item CSH_NULL_GLOB
  99. XIf a pattern for filename generation has no matches, delete the pattern
  100. Xfrom the argument list; do not report an error unless all the patterns
  101. Xin a command have no matches.  Overrides @code{NULL_GLOB}.@refill
  102. X
  103. X@cindex exit status, trapping
  104. X@pindex ERR_EXIT
  105. X@item ERR_EXIT (-e)
  106. XIf a command has a non-zero exit status, execute the @code{ZERR} trap, if
  107. Xset, and exit.@refill
  108. X
  109. X@cindex globbing, extended
  110. X@pindex EXTENDED_GLOB
  111. X@item EXTENDED_GLOB
  112. XTreat the @code{#} and @code{^} characters as part of patterns for
  113. Xfilename generation, etc.  An initial unquoted @code{~} always produces
  114. Xnamed directory expansion (@pxref{Filename Expansion}).@refill
  115. X
  116. X@cindex history, timestamping
  117. X@pindex EXTENDED_HISTORY
  118. X@item EXTENDED_HISTORY
  119. XSave beginning and ending timestamps to the history file.  The format of
  120. Xthese timestamps is @code{:@var{<beginning time>}:@var{<ending
  121. Xtime>}:@var{<command>}}.@refill
  122. X
  123. X@pindex GLOB_COMPLETE
  124. X@item GLOB_COMPLETE
  125. XWhen the current word has a glob pattern, do not insert all the words
  126. Xresulting from the expansion but cycle through them like
  127. X@code{MENU_COMPLETE}.  If no matches are found, a @code{*} is added to
  128. Xthe end of the word, or inserted at the cursor if
  129. X@code{COMPLETE_IN_WORD} is set, and completion is attempted again.
  130. XUsing patterns works not only for files but for all completions, such as
  131. Xoptions, user names, etc.@refill
  132. X
  133. X@cindex globbing, of . files
  134. X@pindex GLOB_DOTS
  135. X@item GLOB_DOTS (-4)
  136. XDo not require a leading @code{.} in a filename to be matched
  137. Xexplicitly.@refill
  138. X
  139. X@cindex hashing, of commands
  140. X@cindex command hashing
  141. X@pindex HASH_CMDS
  142. X@item HASH_CMDS
  143. XPlace the location of each command in the hash table the first time it
  144. Xis executed.  If this option is unset, no path hashing will be done at
  145. Xall.@refill
  146. X
  147. X@cindex hashing, of directories
  148. X@cindex directories, hashing
  149. X@pindex HASH_DIRS
  150. X@item HASH_DIRS
  151. XWhenever a command is executed, hash the directory containing it, as
  152. Xwell as all directories that occur earlier in the path.  Has no effect
  153. Xif @code{HASH_CMDS} is unset.@refill
  154. X
  155. X@pindex HASH_LIST_ALL
  156. X@item HASH_LIST_ALL
  157. XWhenever a command completion is attempted, make sure the entire command
  158. Xpath is hashed first.  This makes the first completion slower.
  159. X
  160. X@cindex history, ignoring duplicates
  161. X@pindex HIST_IGNORE_DUPS
  162. X@item HIST_IGNORE_DUPS (-h)
  163. XDo not enter command lines into the history list if they are duplicates
  164. Xof the previous event.
  165. X
  166. X@cindex history, ignoring spaces
  167. X@pindex HIST_IGNORE_SPACE
  168. X@item HIST_IGNORE_SPACE (-g)
  169. XDo not enter command lines into the history list if they begin with a
  170. Xblank.
  171. X
  172. X@cindex history, storing as literal
  173. X@pindex HIST_LIT
  174. X@item HIST_LIT (-j)
  175. XUse literal (unparsed) versions of the history lines in the editor.
  176. X
  177. X@pindex HIST_NO_STORE
  178. X@item HIST_NO_STORE
  179. XRemove the @code{history} (@code{fc -l}) command from the history
  180. Xwhen invoked.@refill
  181. X
  182. X@cindex history, verifying substitution
  183. X@pindex HIST_VERIFY
  184. X@item HIST_VERIFY
  185. XWhenever the user enters a line with history substitution, don't execute
  186. Xthe line directly; instead, perform history substitution and reload the
  187. Xline into the editing buffer.
  188. X
  189. X@cindex brace expansion, disabling
  190. X@cindex expansion, brace, disabling
  191. X@cindex disabling brace expansion
  192. X@pindex IGNORE_BRACES
  193. X@item IGNORE_BRACES (-I)
  194. XDo not perform brace expansion.
  195. X
  196. X@cindex EOF, ignoring
  197. X@pindex IGNORE_EOF
  198. X@item IGNORE_EOF (-7)
  199. XDo not exit on end-of-file.  Require the use of @code{exit} or
  200. X@code{logout} instead.@refill
  201. X
  202. X@pindex INTERACTIVE
  203. X@item INTERACTIVE (-i)
  204. XThis is an interactive shell.
  205. X
  206. X@cindex comments, in interactive shells
  207. X@pindex INTERACTIVE_COMMENTS
  208. X@item INTERACTIVE_COMMENTS (-k)
  209. XAllow comments even in interactive shells.
  210. X
  211. X@cindex ksh, option printing style
  212. X@cindex option printing, ksh style
  213. X@pindex KSH_OPTION_PRINT
  214. X@item KSH_OPTION_PRINT
  215. XAlters the way options settings are printed.
  216. X
  217. X@cindex completions, ambiguous
  218. X@cindex ambiguous completions
  219. X@pindex LIST_AMBIGUOUS
  220. X@item LIST_AMBIGUOUS
  221. XIf this option is set completions are shown only if the completions
  222. Xdon't have an unambiguous prefix or suffix that could be inserted in the
  223. Xcommand line.
  224. X
  225. X@cindex files, marking type of
  226. X@cindex marking file types
  227. X@pindex LIST_TYPES
  228. X@item LIST_TYPES (-X)
  229. XWhen listing files that are possible completions, show the type of each
  230. Xfile with a trailing identifying mark.
  231. X
  232. X@pindex LOGIN
  233. X@item LOGIN (-l)
  234. XThis is a login shell.
  235. X
  236. X@cindex jobs, list format
  237. X@cindex list format, of jobs
  238. X@pindex LONG_LIST_JOBS
  239. X@item LONG_LIST_JOBS (-R)
  240. XList jobs in the long format by default.
  241. X
  242. X@pindex MAGIC_EQUAL_SUBST
  243. X@item MAGIC_EQUAL_SUBST
  244. XAll unquoted arguments of the form
  245. X@code{@var{identifier}=@var{expression}} have file expansion performed
  246. Xon @var{expression} as if it were a parameter assignment, although the
  247. Xargument is not otherwise treated specially.@refill
  248. X
  249. X@cindex mail, warning of arrival
  250. X@pindex MAIL_WARNING
  251. X@item MAIL_WARNING (-U)
  252. XPrint a warning message if a mail file has been accessed since the shell
  253. Xlast checked.
  254. X
  255. X@cindex directories, marking
  256. X@cindex marking directories
  257. X@pindex MARK_DIRS
  258. X@item MARK_DIRS (-8)
  259. XAppend a trailing @code{/} to all directory names resulting from filename
  260. Xgeneration (globbing).@refill
  261. X
  262. X@cindex completion, menu
  263. X@pindex MENU_COMPLETE
  264. X@item MENU_COMPLETE (-Y)
  265. XOn an ambiguous completion, instead of listing possibilities or beeping,
  266. Xinsert the first match immediately.  Then when completion is requested
  267. Xagain, remove the first match and insert the second match, etc.  When
  268. Xthere are no more matches, go back to the first one again.
  269. X@code{reverse-menu-complete} may be used to loop through the list in the
  270. Xother direction.  This option overrides @code{AUTO_MENU}.@refill
  271. X
  272. X@cindex job control, allowing
  273. X@pindex MONITOR
  274. X@item MONITOR (-m)
  275. XAllow job control.  Set by default in interactive shells.
  276. X
  277. X@cindex globbing, malformed pattern
  278. X@pindex NO_BAD_PATTERN
  279. X@item NO_BAD_PATTERN (-2)
  280. XIf a pattern for filename generation is badly formed, leave it unchanged
  281. Xin the argument list instead of printing an error.
  282. X
  283. X@cindex history, disabling substitution
  284. X@cindex disabling history substitution
  285. X@pindex NO_BANG_HIST
  286. X@item NO_BANG_HIST (-K)
  287. XDo not perform textual history substitution.  Do not treat the @code{!}
  288. Xcharacter specially.@refill
  289. X
  290. X@cindex beep, disabling
  291. X@cindex disabling the beep
  292. X@pindex NO_BEEP
  293. X@item NO_BEEP (-B)
  294. XDo not beep.
  295. X
  296. X@cindex file clobbering, preventing
  297. X@cindex clobbering, of files
  298. X@pindex NO_CLOBBER
  299. X@item NO_CLOBBER (-1)
  300. XPrevents @code{>} redirection from truncating existing files.  @code{>!}
  301. Xmay be used to truncate a file instead.  Also prevents @code{>>} from
  302. Xcreating files.  @code{>>!} may be used instead.@refill
  303. X
  304. X@cindex filename substitution, =
  305. X@pindex NO_EQUALS
  306. X@item NO_EQUALS
  307. XDon't perform @code{=} filename substitution.
  308. X
  309. X@cindex command execution, preventing
  310. X@pindex NO_EXEC
  311. X@item NO_EXEC (-n)
  312. XRead commands and check them for syntax errors, but do not execute them.
  313. X
  314. X@cindex flow control
  315. X@pindex NO_FLOW_CONTROL
  316. X@item NO_FLOW_CONTROL
  317. XDisable output flow control via start/stop characters (usually assigned
  318. Xto @kbd{^S}/@kbd{^Q}) in the shell's editor.@refill
  319. X
  320. X@cindex globbing, disabling
  321. X@cindex disabling globbing
  322. X@pindex NO_GLOB
  323. X@item NO_GLOB (-F)
  324. XDisable filename generation.
  325. X
  326. X@cindex history, beeping
  327. X@cindex beep, history
  328. X@pindex NO_HIST_BEEP
  329. X@item NO_HIST_BEEP
  330. XDon't beep when an attempt is made to access a history entry which isn't
  331. Xthere.
  332. X
  333. X@cindex jobs, nohup
  334. X@pindex NO_HUP
  335. X@item NO_HUP
  336. XDon't send the @code{HUP} signal to running jobs when the shell exits.
  337. X
  338. X@cindex completion, beep on ambiguous
  339. X@cindex beep, ambiguous completion
  340. X@pindex NO_LIST_BEEP
  341. X@item NO_LIST_BEEP
  342. XDon't beep on an ambiguous completion.
  343. X
  344. X@cindex globbing, no matches
  345. X@pindex NO_NOMATCH
  346. X@item NO_NOMATCH (-3)
  347. XIf a pattern for filename generation has no matches, leave it unchanged
  348. Xin the argument list instead of printing an error.  This also applies
  349. Xto file expansion of an initial @code{~} or @code{=}.@refill
  350. X
  351. X@cindex prompt, without CR
  352. X@pindex NO_PROMPT_CR
  353. X@item NO_PROMPT_CR (-V)
  354. XDon't print a carriage return just before printing a prompt in the line
  355. Xeditor.
  356. X
  357. X@cindex startup files, sourcing
  358. X@pindex NO_RCS
  359. X@item NO_RCS (-f)
  360. XSource only the @file{/etc/zshenv} file.
  361. XDo not source the @file{.zshenv}, @file{/etc/zprofile}, @file{.zprofile},
  362. X@file{/etc/zshrc}, @file{.zshrc}, @file{/etc/zlogin}, @file{.zlogin}, or 
  363. X@file{.zlogout} files.@refill
  364. X
  365. X@pindex NO_SHORT_LOOPS
  366. X@item NO_SHORT_LOOPS
  367. XDisallow the short forms of @code{for}, @code{select}, @code{if}, and
  368. X@code{function} constructs.@refill
  369. X
  370. X@cindex background jobs, notification
  371. X@cindex notification of background jobs
  372. X@pindex NOTIFY
  373. X@item NOTIFY (-5)
  374. XReport the status of background jobs immediately, rather than waiting
  375. Xuntil just before printing a prompt.
  376. X
  377. X@cindex parameters, error on substituting unset
  378. X@cindex unset parameters, error on substituting
  379. X@pindex NO_UNSET
  380. X@item NO_UNSET (-u)
  381. XTreat unset parameters as an error when substituting.
  382. X
  383. X@cindex globbing, no matches
  384. X@pindex NULL_GLOB
  385. X@item NULL_GLOB (-G)
  386. XIf a pattern for filename generation has no matches, delete the pattern
  387. Xfrom the argument list instead of reporting an error.  Overrides
  388. X@code{NO_NOMATCH}.@refill
  389. X
  390. X@cindex sorting, numerically
  391. X@pindex NUMERIC_GLOBSORT
  392. X@item NUMERIC_GLOBSORT
  393. XIf numeric filenames are matched by a filename generation pattern, sort
  394. Xthe filenames numerically rather than lexicographically.
  395. X
  396. X@cindex editor, overstrike mode
  397. X@cindex overstrike mode, of editor
  398. X@pindex OVERSTRIKE
  399. X@item OVERSTRIKE
  400. XStart up the line editor in overstrike mode.
  401. X
  402. X@cindex path search, extended
  403. X@pindex PATH_DIRS
  404. X@item PATH_DIRS (-Q)
  405. XPerform a path search even on command names with slashes in them.  Thus
  406. Xif @*@samp{/usr/local/bin} is in the user's path, and he types
  407. X@samp{X11/xinit}, the command @samp{/usr/local/bin/X11/xinit} will be
  408. Xexecuted (assuming it exists).  This applies to the @code{.} builtin as
  409. Xwell as to command execution.  Commands explicitly beginning with
  410. X@samp{./} or @samp{../} are not subject to path search.@refill
  411. X
  412. X@cindex exit status, printing
  413. X@pindex PRINT_EXIT_VALUE
  414. X@item PRINT_EXIT_VALUE (-C)
  415. XPrint the exit value of programs with non-zero exit status.
  416. X
  417. X@pindex PROMPT_SUBST
  418. X@item PROMPT_SUBST
  419. XExpressions like @code{$@{@dots{}@}}, @code{$(@dots{})}, and @code{$[@dots{}]}
  420. Xin prompts will be expanded.@refill
  421. X
  422. X@cindex directory stack, ignoring dups
  423. X@pindex PUSHD_IGNORE_DUPS
  424. X@item PUSHD_IGNORE_DUPS
  425. XDon't push multiple copies of the same directory onto the directory
  426. Xstack.
  427. X
  428. X@cindex popd, controlling syntax
  429. X@pindex PUSHD_MINUS
  430. X@item PUSHD_MINUS
  431. X@xref{Shell Builtin Commands}, for the @code{popd} command.
  432. X
  433. X@cindex directory stack, silencing
  434. X@pindex PUSHD_SILENT
  435. X@item PUSHD_SILENT (-E)
  436. XDo not print the directory stack after @code{pushd} or @code{popd}.
  437. X
  438. X@cindex pushd, to home
  439. X@pindex PUSHD_TO_HOME
  440. X@item PUSHD_TO_HOME (-D)
  441. XHave @code{pushd} with no arguments act like @code{pushd $HOME}.
  442. X
  443. X@pindex RC_EXPAND_PARAM
  444. X@item RC_EXPAND_PARAM (-P)
  445. X@xref{Parameter Expansion}.
  446. X
  447. X@cindex rc, quoting style
  448. X@cindex quoting style, rc
  449. X@pindex RC_QUOTES
  450. X@item RC_QUOTES
  451. X@ifinfo
  452. XAllow the character sequence @code{@'@'} to signify a single quote within
  453. X@end ifinfo
  454. X@iftex
  455. XAllow the character sequence @code{''} to signify a single quote within
  456. X@end iftex
  457. Xsingly quoted strings.@refill
  458. X
  459. X@cindex completion, exact matches
  460. X@pindex REC_EXACT
  461. X@item REC_EXACT (-S)
  462. XIn completion, recognize exact matches even if they are ambiguous.
  463. X
  464. X@cindex rm *, querying before
  465. X@cindex querying before rm *
  466. X@pindex RM_STAR_SILENT
  467. X@item RM_STAR_SILENT (-H)
  468. XDo not query the user before executing @code{rm *} or @code{rm path/*}.
  469. X
  470. X@pindex SHIN_STDIN
  471. X@item SHIN_STDIN (-s)
  472. XRead commands from the standard input.
  473. X
  474. X@cindex sh, word splitting style
  475. X@cindex word splitting, sh style
  476. X@pindex SH_WORD_SPLIT
  477. X@item SH_WORD_SPLIT (-y)
  478. X@xref{Parameter Expansion}.
  479. X
  480. X@cindex editor, single line mode
  481. X@pindex SINGLE_LINE_ZLE
  482. X@item SINGLE_LINE_ZLE (-M)
  483. XUse single-line command line editing instead of multi-line.
  484. X
  485. X@cindex sun keyboard, annoying
  486. X@cindex annoying keyboard, sun
  487. X@pindex SUN_KEYBOARD_HACK
  488. X@item SUN_KEYBOARD_HACK (-L)
  489. XIf a line ends with a backquote, and there are an odd number of
  490. Xbackquotes on the line, ignore the trailing backquote.  This is useful
  491. Xon some keyboards where the return key is too small, and the backquote
  492. Xkey lies annoyingly close to it.
  493. X
  494. X@cindex tracing, of input lines
  495. X@pindex VERBOSE
  496. X@item VERBOSE (-v)
  497. XPrint shell input lines as they are read.
  498. X
  499. X@cindex tracing, of commands
  500. X@pindex XTRACE
  501. X@item XTRACE (-x)
  502. XPrint commands and their arguments as they are executed.
  503. X
  504. X@cindex editor, disabling
  505. X@cindex disabling the editor
  506. X@pindex ZLE
  507. X@item ZLE (-Z)
  508. XUse the zsh line editor.
  509. X@end table
  510. X
  511. X@node Shell Builtin Commands, Invocation, Options, Top
  512. X@chapter Shell Builtin Commands
  513. X@cindex builtin commands
  514. X
  515. X@table @code
  516. X@findex .
  517. X@item . @var{file} [ @var{arg} @dots{} ]
  518. XRead and execute commands from @var{file} in the current shell
  519. Xenvironment.  If @var{file} does not contain a slash, or if
  520. X@code{PATH_DIRS} is set, the shell looks in the components of
  521. X@code{path} to find the directory containing @var{file}.  Files in the
  522. Xcurrent directory are not read unless @samp{.} appears somewhere in
  523. X@code{path}.  If any arguments @var{arg} are given, they become the
  524. Xpositional parameters; the old positional parameters are restored when
  525. Xthe @var{file} is done executing.  The exit status is the exit status of
  526. Xthe last command executed.@refill
  527. X
  528. X@cindex parameters, expanding
  529. X@cindex expanding parameters
  530. X@item : [ @var{arg} @dots{} ]
  531. XThis command only expands parameters.  A zero exit code is returned.
  532. X
  533. X@cindex alias
  534. X@findex alias
  535. X@item alias [ -grm ] [ @var{name}[=@var{value}] ] @dots{}
  536. XWith no arguments, print the list of aliases in the form
  537. X@code{@var{name}=@var{value}} on the standard output.  For each
  538. X@var{name} with a corresponding @var{value}, define an alias with that
  539. Xvalue.  A trailing space in @var{value} causes the next word to be
  540. Xchecked for alias substitution.  If the @code{-g} flag is given, define
  541. Xa global alias; global aliases are expanded even if they do not occur in
  542. Xcommand position.  For each @var{name} with no @var{value}, print the
  543. Xvalue of @var{name}, if any.  If only the @code{-g} or the @code{-r}
  544. Xflag is given only global or regular aliases are listed.  If the
  545. X@code{-m} flag is given the arguments are taken as patterns (they should
  546. Xbe quoted to preserve them from being interpreted as glob patterns) and
  547. Xthe aliases matching these patterns are printed.  The exit status is
  548. Xnonzero if a @var{name} (with no @var{value}) is given for which no
  549. Xalias has been defined.@refill
  550. X
  551. X@cindex functions, autoloading
  552. X@cindex autoloading functions
  553. X@findex autoload
  554. X@item autoload [ @var{name} @dots{} ]
  555. XFor each of the @var{name}s (which are names of functions), create a
  556. Xfunction marked undefined.  The @code{fpath} variable will be searched
  557. Xto find the actual function definition when the function is first
  558. Xreferenced.@refill
  559. X
  560. X@findex bg
  561. X@item bg [ @var{job} @dots{} ]
  562. X@itemx @var{job} @dots{} &
  563. XPut each specified @var{job} in the background, or the current job if
  564. Xnone is specified.@refill
  565. X
  566. X@cindex rebinding the keys
  567. X@cindex keys, rebinding
  568. X@findex bindkey
  569. X@item bindkey -mevd
  570. X@itemx bindkey -r @var{in-string} @dots{}
  571. X@itemx bindkey [ -a ] @var{in-string} [ @var{command} ] @dots{}
  572. X@itemx bindkey -s [ -a ] @var{in-string} @var{out-string} @dots{}
  573. XThe @code{-e} and @code{-v} options put the keymaps in emacs mode and vi
  574. Xmode respectively; they cannot be used simultaneously.  The @code{-d}
  575. Xoption resets all bindings to the compiled-in settings.  If not used
  576. Xwith options @code{-e} or @code{-v}, the maps will be left in emacs
  577. Xmode, or in vi mode if the @code{VISUAL} or @code{EDITOR} variables
  578. Xcontain the string @samp{vi}.  Metafied characters are bound to
  579. Xself-insert by default.  The @code{-m} option loads the compiled-in
  580. Xbindings of these characters for the mode determined by the previous
  581. Xoptions, or the current mode if used alone.  Any previous binding done
  582. Xby the user will be preserved.  If the @code{-r} option is given, remove
  583. Xany binding for each @var{in-string}.  If the @code{-s} option is not
  584. Xspecified, bind each @var{in-string} to a specified @var{command}.  If
  585. Xno @var{command} is specified, print the binding of @var{in-string} if
  586. Xit is bound, or return a nonzero exit code if it is not bound.  If the
  587. X@code{-s} option is specified, bind each @var{in-string} to each
  588. Xspecified @var{out-string}.  When @var{in-string} is typed,
  589. X@var{out-string} will be pushed back and treated as input to the line
  590. Xeditor.  The process is recursive, but to avoid infinite loops the shell
  591. Xwill report an error if more than 20 consecutive replacements happen.
  592. XIf the @code{-a} option is specified, bind the @var{in-string}s in the
  593. Xalternative keymap instead of the standard one.  The alternative keymap
  594. Xis used in vi command mode.@refill
  595. X
  596. X@noindent
  597. XIt's possible for an @var{in-string} to be bound to something and also
  598. Xbe the beginning of a longer bound string.  In this case the shell will
  599. Xwait a certain time to see if more characters are typed, otherwise it
  600. Xwill execute the shorter binding.  This timeout is defined by the
  601. X@code{KEYTIMEOUT} parameter; the default is 0.4 seconds.  No timeout is
  602. Xdone if the prefix string is not bound.@refill
  603. X
  604. X@noindent
  605. XFor either @var{in-string} or @var{out-string}, control characters may
  606. Xbe specified in the form @code{^X}, and the backslash may be used to
  607. Xintroduce one of the following escape sequences:@refill
  608. X
  609. X@table @code
  610. X@item \a
  611. XBell character
  612. X@item \n
  613. XLinefeed (newline)
  614. X@item \b
  615. XBackspace
  616. X@item \t
  617. XHorizontal tab
  618. X@item \v
  619. XVertical tab
  620. X@item \f
  621. XForm feed
  622. X@item \r
  623. XCarriage return
  624. X@item \e
  625. X@itemx \E
  626. XEscape
  627. X@item \@var{nnn}
  628. XCharacter code in octal
  629. X@item \x@var{nn}
  630. XCharacter code in hexadecimal
  631. X@item \M-@var{xxx}
  632. XCharacter or escape sequence with meta bit set.  The @code{-} after the
  633. X@code{M} is optional.@refill
  634. X@item \C-X
  635. XControl character.  The @code{-} after the @code{M} is optional.
  636. X@end table
  637. X
  638. XIn all other cases, @code{\} escapes the following character.  Delete is
  639. Xwritten as @code{^?}.  Note that @code{\M^?} and @code{^\M?} are not the
  640. Xsame.@refill
  641. X
  642. X@noindent
  643. XMulti-character @var{in-strings} cannot contain the null character
  644. X(@code{^@@} or @code{^ }).  If they appear in a bindkey command, they
  645. Xwill be silently translated to @code{\M-^@@}.  This restriction does not
  646. Xapply to @var{out-strings}, single-character @var{in-strings} and the
  647. Xfirst character of a multi-char @var{in-string}.@refill
  648. X
  649. X@cindex loops, exitting
  650. X@cindex exitting loops
  651. X@findex break
  652. X@item break [ @var{n} ]
  653. XExit from an enclosing @code{for}, @code{while}, @code{until},
  654. X@code{select}, or @code{repeat} loop.  If @var{n} is specified, then
  655. Xbreak @var{n} levels instead of just one.@refill
  656. X
  657. X@findex builtin
  658. X@item builtin @var{name} [ @var{args} ] @dots{}
  659. XExecutes the builtin @var{name}, with the given @var{args}.
  660. X
  661. X@findex bye
  662. X@item bye
  663. XSame as @code{exit}.
  664. X
  665. X@cindex directories, changing
  666. X@findex cd
  667. X@item cd [ @var{arg} ]
  668. X@itemx cd @var{old} @var{new}
  669. X@itemx cd [+-]n
  670. XChange the current directory.  In the first form, change the current
  671. Xdirectory to @var{arg}, or to the value of @code{HOME} if @var{arg} is
  672. Xnot specified.  If @var{arg} is @code{-}, change to the value of
  673. X@code{OLDPWD}, the previous directory.  If a directory named @var{arg}
  674. Xis not found in the current directory and @var{arg} does not begin with
  675. Xa slash, search each component of the shell parameter @code{cdpath}.  If
  676. Xthe option @code{CDABLEVARS} is set, and a parameter named @var{arg}
  677. Xexists whose value begins with a slash, treat its value as the
  678. Xdirectory.@refill
  679. X
  680. X@noindent
  681. XThe second form of @code{cd} substitutes the string @var{new} for the
  682. Xstring @var{old} in the name of the current directory, and tries to
  683. Xchange to this new directory.@refill
  684. X
  685. X@noindent
  686. XThe third form of @code{cd} is equivalent to @code{popd}.
  687. X
  688. X@findex chdir
  689. X@item chdir
  690. XSame as @code{cd}.
  691. X
  692. X@cindex completion, controlling
  693. X@findex compctl
  694. X@item compctl [ -cfqovbCDAIFpEjBaRGuderzNOZn ] [ -k @var{name} ] [ -X @var{explanation} ]
  695. X@itemx [ -K @var{function} ] [ -P @var{prefix} ] [ -S @var{suffix} ] [ -g @var{globstring} ]
  696. X@itemx [ -s @var{substring} ] [ -H @var{num pattern} ] [ -l @var{cmd} ] [ @var{arg} @dots{} ]
  697. X@itemx compctl @var{flags} + @var{flags} + @dots{}
  698. X@itemx compctl @var{flags} -x @var{pattern} @var{flags} - @dots{} -- @var{arg} @dots{}
  699. XControl the editor's completion behavior when one of @var{arg} is the
  700. Xcurrent command.  (Note that aliases are expanded before this is
  701. Xdetermined, unless the @code{COMPLETE_ALIASES} option is set.)  With the
  702. X@code{-D} flag, control default completion
  703. Xbehavior for commands not assigned any special behavior; with
  704. X@code{-C}, control completion when there is no current command.  The
  705. Xremaining options specify the type of command arguments to look for
  706. Xduring completion.  If completion is attempted for a command with a
  707. Xpathname containing slashes and no completion is found the search is
  708. Xretried with the last pathname component.@refill
  709. X
  710. X@table @code
  711. X@item -c
  712. XExpect command names.
  713. X
  714. X@item -f
  715. XExpect filenames and filesystem paths.
  716. X
  717. X@item -o
  718. XExpect option names.
  719. X
  720. X@item -v
  721. XExpect variable names.
  722. X
  723. X@item -b
  724. XExpect key binding names.
  725. X
  726. X@item -A
  727. XExpect array names.
  728. X
  729. X@item -I
  730. XExpect integer variable names.
  731. X
  732. X@item -F
  733. XExpect function names.
  734. X
  735. X@item -p
  736. XExpect parameter names.
  737. X
  738. X@item -E
  739. XExpect environment variable names.
  740. X
  741. X@item -j
  742. XExpect job names (the first word of the job leader's command line, useful
  743. Xwith the @code{kill} builtin).@refill
  744. X
  745. X@item -r
  746. XExpect names of running jobs.
  747. X
  748. X@item -z
  749. XExpect names of suspended jobs.
  750. X
  751. X@item -B
  752. XExpect names of builtin commands.
  753. X
  754. X@item -a
  755. XExpect alias names.
  756. X
  757. X@item -R
  758. XExpect names of regular aliases.
  759. X
  760. X@item -G
  761. XExpect names of global aliases.
  762. X
  763. X@item -u
  764. XExpect user names.
  765. X
  766. X@item -d
  767. XExpect names of disabled commands.
  768. X
  769. X@item -e
  770. XExpect names of executable (and enabled) commands.
  771. X
  772. X@item -N
  773. XExpect names of scalar parameters.
  774. X
  775. X@item -n
  776. XExpect named directories.
  777. X
  778. X@item -O
  779. XExpect names of readonly variables.
  780. X
  781. X@item -Z
  782. XExpect names of shell special parameters.
  783. X
  784. X@item -q
  785. XIf given together with a suffix (see the @code{-S} flag below) it makes
  786. Xthis suffix be removed if the next character typed is a blank or does
  787. Xnot insert anything (this is the same rule as used for the
  788. X@code{AUTO_REMOVE_SLASH} option).@refill
  789. X
  790. X@item -k @var{name}
  791. XExpect names taken from the elements of @code{$name} (which should be an
  792. Xarray).  Alternatively,
  793. Xthe argument @var{name} itself may be a set of space- or comma-separated
  794. Xvalues in parentheses, in which any delimiter may be escaped with a
  795. Xbackslash.  Example: @samp{compctl -k "(cputime filesize datasize
  796. Xstacksize coredumpsize resident descriptors)" limit}.@refill
  797. X
  798. X@item -K @var{function}
  799. XCall the given function to get the completions.  The function gets two
  800. Xarguments: the prefix and the suffix of the word on which completion is
  801. Xtried.  The function should set the variable @code{reply} to an array
  802. Xcontaining the completions (one completion per element); note that
  803. X@code{reply} should not be made local.  From such a function the command
  804. Xline can be accessed with the @code{-c} and @code{-l} flags to the
  805. X@code{read} builtin.  Example: @samp{function whoson @{ reply=(`users`);
  806. X@}; compctl -K whoson talk} completes only logged-on users after
  807. X@samp{talk}.  Note that @code{whoson} must return an array so that just
  808. X@samp{reply=`users`} is incorrect.@refill
  809. X
  810. X@item -X @var{explanation}
  811. XPrint the explanation string before the list of completions.  A @code{%n}
  812. Xin this string is replaced by the number of matches.@refill
  813. X
  814. X@item -P @var{prefix}
  815. XThe @var{prefix} is inserted just before the completed string; any
  816. Xinitial part already typed will be completed and the whole @var{prefix}
  817. Xignored for completion purposes.  Example: @samp{compctl -j -P "%"
  818. Xkill}.@refill
  819. X
  820. X@item -S @var{suffix}
  821. XAfter a unique completion is found the @var{suffix} is inserted after
  822. Xthe completed string.@refill
  823. X
  824. X@item -g @var{globstring}
  825. XThe @var{globstring} is expanded using filename globbing; it should be
  826. Xquoted to protect it from immediate expansion.  The resulting filenames
  827. Xare taken as the possible completions.  Use @code{*(/)} instead of
  828. X@code{*/} for directories.  The @code{fignore} special parameter is not
  829. Xused.  More than one of these pattern may be given separated by blanks.
  830. XNote that brace expansion is @emph{not} part of globbing.@refill
  831. X
  832. X@item -s @var{substring}
  833. XThe @var{substring} is split into words and these words are than
  834. Xexpanded using all shell expansion mechanisms.  The resulting words are
  835. Xtaken as possible completions.  The @code{fignore} special parameter is
  836. X@emph{not} used.  Note that @code{-g} is faster for filenames.@refill
  837. X
  838. X@item -H @var{num pattern}
  839. XThe possible completions are taken from the last @var{num} history
  840. Xlines.  Only words matching @var{pattern} are taken.  If @var{num} is
  841. Xzero or negative the whole history is searched and if @var{pattern} is
  842. Xthe empty string (or @code{*}, of course) all words are taken.@refill
  843. X
  844. X@item -l @var{cmd}
  845. XThis option cannot be combined with any other option.  If it is given it
  846. Xrestricts the range of command line words that are considered to be
  847. Xarguments.  By default this range contains all arguments without the
  848. Xcommand string.  If combined with extended completion (see below) and one of
  849. X@code{p[@dots{}]}, @code{r[@dots{}]}, or @code{R[@dots{}]} the range is
  850. Xrestricted to the arguments between the ones that are specified in the
  851. Xbrackets.  After the range of arguments is determined completion is done
  852. Xin it as if they were arguments to the @var{cmd} given with this option.
  853. XIf this string is empty the first word in the range is taken as the
  854. Xcommand name for which to complete.  In this case, if the cursor is in
  855. X@ifinfo
  856. Xthe first word, command names are completed.  Example: @samp{compctl -x
  857. X'r[-exec,;]' -l @'@' -- find} completes the arguments between @code{-exec}
  858. X@end ifinfo
  859. X@iftex
  860. Xthe first word, command names are completed.  Example: @samp{compctl -x
  861. X'r[-exec,;]' -l '' -- find} completes the arguments between @code{-exec}
  862. X@end iftex
  863. Xand the following @code{;} (or the end of the command line if there is
  864. Xno such string) as if they were specifying a command on their
  865. Xown.@refill
  866. X
  867. X@item -U
  868. XUse the whole list of possible completions, whether or not they actually
  869. Xmatch the word on the command line.  The word typed so far will be
  870. Xdeleted.  This is most useful with a function (@code{-K} option), which
  871. Xcan examine the word via the @code{read} builtin's @code{-c} and
  872. X@code{-l} flags and use its own criterion to decide what matches.@refill
  873. X@end table
  874. X
  875. X@noindent
  876. XThe second form specifies alternative options.  First completion is
  877. Xtried with the options before the first @code{+}.  If this produces no
  878. Xmatches completion is tried with the flags after the @code{+} and so on.
  879. XIf there are no flags after the last @code{+} this means that default
  880. Xcompletion is tried if no matches were found.@refill
  881. X
  882. X@noindent
  883. XThe third form specifies extended completion for the commands given as
  884. X@var{arg}.  Each @var{pattern} is examined in turn; when a match is
  885. Xfound, the corresponding @var{flags}, as described above for the
  886. Xordinary case, are used to generate possible completions.  If no
  887. X@var{pattern} matches, the @var{flags} given before the @code{-x} are
  888. Xused.  Note that each pattern should be supplied as a single argument
  889. Xand should be quoted to prevent expansion of metacharacters by the
  890. Xshell.  A @var{pattern} is built of sub-patterns separated by commas; it
  891. Xmatches if at least one of these sub-patterns matches (they are or'ed).
  892. XThese sub-patterns are in turn composed of other sub-patterns separated
  893. Xby white space which match if all of the sub-patterns match (they are
  894. Xand'ed).  An element of the sub-patterns is of the form
  895. X@code{c[@dots{}][@dots{}]}, where the pairs of brackets may be repeated as
  896. Xoften as necessary, and matches if any of the sets of brackets match (an
  897. Xor).  These elements may be any of the following:@refill
  898. X
  899. X@table @code
  900. X@item s[@var{string}] @dots{}
  901. XThe pattern matches if the current word on the command line starts with
  902. Xone of the strings given in brackets.  The @var{string} is not removed
  903. Xand is not part of the completion.@refill
  904. X
  905. X@item S[@var{string}] @dots{}
  906. XLike @code{s[@var{string}]} but the @var{string} is part of the
  907. Xcompletion.@refill
  908. X
  909. X@item p[@var{from},@var{to}] @dots{}
  910. XThe pattern matches if the number of the current word is between one of
  911. Xthe @var{from} and @var{to} pairs.  The comma and @var{to} are optional;
  912. X@var{to} defaults to the same value as @var{from}.  The numbers may be
  913. Xnegative: @var{-n} refers to the @var{n}'th last word on the
  914. Xline.@refill
  915. X
  916. X@item c[@var{offset},@var{string}] @dots{}
  917. XThe pattern matches if one of the @var{string}s matches the word offset
  918. Xby @var{offset} from the current word position.@refill
  919. X
  920. X@item C[@var{offset},@var{pattern}] @dots{}
  921. XLike @code{c} but uses pattern matching instead.
  922. X
  923. X@item w[@var{index},@var{string}] @dots{}
  924. XThe pattern matches if the word in position @var{index} is equal to the
  925. Xcorresponding @var{string}.  Note that the word count is made after
  926. Xalias expansion.@refill
  927. X
  928. X@item W[@var{index},@var{pattern}] @dots{}
  929. XLike @code{w} but uses pattern matching instead.
  930. X
  931. X@item n[@var{index},@var{string}] @dots{}
  932. XMatches if the current word contains @var{string}.  Anything up to the
  933. X@var{index}'th ocurrence of this string will not be considered part of
  934. Xthe completion, but the rest will.@refill
  935. X
  936. X@item N[@var{index},@var{string}] @dots{}
  937. XLike @code{n[@var{index},@var{string}]} but the string will be taken as
  938. Xa character class (anything up to the @var{index}'th ocurrence of any of
  939. Xthe characters in @var{string} will not be considered part of the
  940. Xcompletion).@refill
  941. X
  942. X@item m[@var{min},@var{max}] @dots{}
  943. XMatches if the total number of words lies between @var{min} and
  944. X@var{max} (inclusive).@refill
  945. X
  946. X@item r[@var{str1},@var{str2}]@dots{}
  947. XMatches if the cursor is after a word with prefix @var{str1}.  If there
  948. Xis also a word with prefix @var{str2} on the command line it matches
  949. Xonly if the cursor is before this word.@refill
  950. X
  951. X@item R[@var{str1},@var{str2}]@dots{}
  952. XLike @code{r} but uses pattern matching instead.
  953. X@end table
  954. X
  955. X@noindent
  956. XExample:
  957. X@noindent
  958. X@samp{compctl -u -x 's[+] c[-1,-f],s[-f+]' -g '~/Mail/*(:t)' -
  959. X's[-f],c[-1,-f]' -f -- mail}
  960. X@noindent
  961. XComplete users by default.  After a @code{-f} with an optional space,
  962. Xcomplete file names; if a @code{+} follows the @code{-f}, whether or not
  963. Xthere is a space in between, complete with the non-directory part of
  964. Xfiles in the directory @samp{~/Mail}.@refill
  965. X
  966. X@cindex loops, continuing
  967. X@cindex continuing loops
  968. X@findex continue
  969. X@item continue [ @var{num} ]
  970. XResume the next iteration of the enclosing @code{for}, @code{while},
  971. X@code{until}, @code{select}, or @code{repeat} loop.  If @var{n} is
  972. Xspecified, break out of @var{n}-1 loops and resume at the @var{n}'th
  973. Xenclosing loop.@refill
  974. X
  975. X@findex declare
  976. X@item declare [ @var{arg} @dots{} ]
  977. XSame as @code{typeset}.
  978. X
  979. X@cindex directory stack, printing
  980. X@findex dirs
  981. X@item dirs [ -v ] [ @var{arg} @dots{} ]
  982. XWith no arguments, print the contents of the directory stack.  If the
  983. X@code{-v} option is given, number the directories in the stack when
  984. Xprinting.  Directories are added to this stack with the @code{pushd}
  985. Xcommand, and removed with the @code{cd} or @code{popd} commands.  If
  986. Xarguments are specified, load them onto the directory stack, replacing
  987. Xanything that was there, and push the current directory onto the
  988. Xstack.@refill
  989. X
  990. X@cindex disabling commands
  991. X@cindex commands, disabling
  992. X@findex disable
  993. X@item disable [ -m ] @var{arg} @dots{}
  994. XDisable the builtin @var{arg} temporarily.  This allows you to use an
  995. Xexternal command with the same name as a shell builtin.  Without
  996. Xarguments all disabled builtins are printed; with the @code{-m} flag the
  997. Xarguments are taken as patterns (which should be quoted to preserve them
  998. Xfrom being taken as glob patterns) and all builtins matching these
  999. Xpatterns are disabled.  Actually the same as @code{unhash}.  Builtins
  1000. Xcan be enabled with the @code{enable} command.@refill
  1001. X
  1002. X@findex disown
  1003. X@item disown @var{job} @dots{}
  1004. XRemove the specified jobs from the job table; the shell will no longer
  1005. Xreport their status, and will not complain if you try to exit an
  1006. Xinteractive shell with them running or stopped.
  1007. X
  1008. X@findex echo
  1009. X@item echo [ -n ] [ @var{arg} @dots{} ]
  1010. XWrite each @var{arg} on the standard output, with a space separating
  1011. Xeach one.  If the @code{-n} flag is not present, print a newline at the
  1012. Xend.  @code{echo} recognizes the following escape sequences:@refill
  1013. X
  1014. X@table @code
  1015. X@item \a
  1016. XBell
  1017. X@item \b
  1018. XBackspace
  1019. X@item \c
  1020. XDon't print an ending newline
  1021. X@item \e
  1022. XEscape
  1023. X@item \f
  1024. XForm feed
  1025. X@item \n
  1026. XNewline
  1027. X@item \r
  1028. XCarriage return
  1029. X@item \t
  1030. XHorizontal tab
  1031. X@item \v
  1032. XVertical tab
  1033. X@item \\
  1034. XBackslash
  1035. X@item \0NNN
  1036. XCharacter code in octal, with a maximum of three digits after the zero.
  1037. XA non-octal digit terminates the number.
  1038. X@item \xNN
  1039. XCharacter code in hexadecimal, with a maximum of two digits after the
  1040. X@code{x}.  A non-hexadecimal digit terminates the number.@refill
  1041. X@end table
  1042. X
  1043. X@cindex termcap string, printing
  1044. X@findex echotc
  1045. X@item echotc @var{cap} [ @var{arg} @dots{} ]
  1046. XOutput the termcap string corresponding to the capability @var{cap},
  1047. Xwith optional arguments.@refill
  1048. X
  1049. X@findex enable
  1050. X@item enable [ -m ] @var{arg} @dots{}
  1051. XEnable the specified builtin commands, presumably disabled earlier with
  1052. X@code{disable}.  Without arguments the enabled builtins are printed;
  1053. Xwith the @code{-m} flag the arguments are taken as patterns (and hence
  1054. Xshould be quoted), and all builtins matching these patterns are
  1055. Xenabled.@refill
  1056. X
  1057. X@cindex evaluating arguments as commands
  1058. X@findex eval
  1059. X@item eval [ @var{arg} @dots{} ]
  1060. XRead the arguments as input to the shell and execute the resulting
  1061. Xcommand(s) in the current shell process.
  1062. X
  1063. X@pindex IGNORE_EOF, use of
  1064. X@findex exit
  1065. X@item exit [ @var{n} ]
  1066. XExit the shell with the exit code specified by @var{n}; if none is
  1067. Xspecified, use the exit code from the last command executed.  An
  1068. X@code{EOF} condition will also cause the shell to exit, unless the
  1069. X@code{IGNORE_EOF} option is set.@refill
  1070. X
  1071. X@findex export
  1072. X@item export [ @var{name}[=@var{value}] @dots{} ]
  1073. XThe specified @var{name}s are marked for automatic export to the
  1074. Xenvironment of subsequently executed commands.@refill
  1075. X
  1076. X@findex false
  1077. X@item false
  1078. XDo nothing and return an exit code of 1.
  1079. X
  1080. X@cindex history, editting
  1081. X@cindex editting the history
  1082. X@findex fc
  1083. X@item fc [ -e @var{ename} ] [ -nlrdDfEm ] [ @var{old}=@var{new} @dots{} ] [ @var{first} [ @var{last} ]]
  1084. X@itemx fc -ARWI [ @var{filename} ]
  1085. XSelect a range of commands from @var{first} to @var{last} from the
  1086. Xhistory list.  The arguments @var{first} and @var{last} may be specified
  1087. Xas a number or as a string.  A negative number is used as an offset to
  1088. Xthe current history event number.  A string specifies the most recent
  1089. Xevent beginning with the given string.  All substitutions
  1090. X@var{old}=@var{new}, if any, are then performed on the commands.  If the
  1091. X@code{-l} flag is given, the resulting commands are listed on standard
  1092. Xoutput.  If the @code{-m} flag is also given the first argument is taken
  1093. Xas a pattern (which should be quoted), and only the history events
  1094. Xmatching this pattern will be shown.  Otherwise the editor program
  1095. X@var{ename} is invoked on a file containing these history events.  If
  1096. X@var{ename} is not given, the value of the parameter @code{FCEDIT} is
  1097. Xused.  If @var{ename} is @code{-}, no editor is invoked.  When editing
  1098. Xis complete, the edited command(s) is executed.  If @var{first} is not
  1099. Xspecified, it will be set to -1 (the most recent event), or to -16 if
  1100. Xthe @code{-l} flag is given.  If @var{last} is not specified, it will be
  1101. Xset to @var{first}, or to -1 if the @code{-l} flag is given.  The flag
  1102. X@code{-r} reverses the order of the commands and the flag @code{-n}
  1103. Xsuppresses command numbers when listing.  Also when listing, @code{-d}
  1104. Xprints timestamps for each command, @code{-f} prints full time and date
  1105. Xstamps, and @code{-D} prints elapsed times.  Adding the @code{-E} flag
  1106. Xcauses the dates to be printed in the European format
  1107. X(@var{dd.mm.yyyy}).@refill
  1108. X
  1109. X@cindex history, file
  1110. X@cindex file, history
  1111. X@noindent
  1112. X@code{fc -R} reads the history from the given file, @code{fc -W} writes
  1113. Xthe history out to the given file, and @code{fc -A} appends the history
  1114. Xto the given file.  @code{fc -AI} (@code{-WI}) appends (writes) only
  1115. Xthose events that are new since the last incremental append (write) to
  1116. Xthe history file.  In any case the file will have no more than
  1117. X@code{SAVEHIST} entries.@refill
  1118. X
  1119. X@findex fg
  1120. X@item fg [ @var{job} @dots{} ]
  1121. X@itemx @var{job} @dots{}
  1122. XBring the specified @var{job}s to the foreground.  If no @var{job} is
  1123. Xspecified, use the current job.@refill
  1124. X
  1125. X@findex functions
  1126. X@item functions [ +-tum ] [ @var{name} @dots{} ]
  1127. XEquivalent to @code{typeset -f}.
  1128. X
  1129. X@cindex line, reading
  1130. X@cindex reading a line
  1131. X@findex getln
  1132. X@item getln @var{name} @dots{}
  1133. XRead the top value from the buffer stack and put it in the shell
  1134. Xparameter @var{name}.  Equivalent to @code{read -zr}.  The flags
  1135. X@code{-c}, @code{-l}, @code{-A}, @code{-e}, @code{-E}, and @code{-n} are
  1136. Xalso supported.@refill
  1137. X
  1138. X@cindex options, processing
  1139. X@findex getopts
  1140. X@item getopts @var{optstring} @var{name} [ @var{arg} @dots{} ]
  1141. XChecks @var{arg} for legal options.  If @var{arg} is omitted, use the
  1142. Xpositional parameters.  A valid option argument begins with a @code{+}
  1143. Xor a @code{-}.  An argument not beginning with a @code{+} or a @code{-},
  1144. Xor the argument @code{--}, ends the options.  @var{optstring} contains
  1145. Xthe letters that @code{getopts} recognizes.  If a letter is followed by
  1146. Xa @code{:}, that option is expected to have an argument.  The options
  1147. Xcan be separated from the argument by blanks.@refill
  1148. X
  1149. X@vindex OPTIND, use of
  1150. X@vindex OPTARG, use of
  1151. X@noindent
  1152. XEach time it is invoked, @code{getopts} places the option letter it
  1153. Xfinds in the shell parameter @var{name}, prepended with a @code{+} when
  1154. X@var{arg} begins with a @code{+}.  The index of the next @var{arg} is
  1155. Xstored in @code{OPTIND}.  The option argument, if any, is stored in
  1156. X@code{OPTARG}.@refill
  1157. X
  1158. X@noindent
  1159. XA leading @code{:} in @var{optstring} causes @code{getopts} to store the
  1160. Xletter of the invalid option in @code{OPTARG}, and to set @var{name} to
  1161. X@code{?} for an unknown option and to @code{:} when a required option is
  1162. Xmissing.  Otherwise, @code{getopts} prints an error message.  The exit
  1163. Xstatus is nonzero when there are no more options.@refill
  1164. X
  1165. X@findex hash
  1166. X@item hash @var{name} @var{path}
  1167. XPuts @var{name} in the command hash table, associating it with the
  1168. Xpathname @var{path}.  Whenever @var{name} is used as a command argument,
  1169. Xthe shell will try to execute the file given by @var{path}.@refill
  1170. X
  1171. X@findex history
  1172. X@item history [ -nrdDfEm ] [ @var{first} [ @var{last} ]]
  1173. XSame as @code{fc -l}.
  1174. X
  1175. X@findex integer
  1176. X@item integer [ +-lrtux ] [ @var{name}[=@var{value}] ]
  1177. XSame as @code{typeset -i}, except that options irrelevant to integers
  1178. Xare not permitted.@refill
  1179. X
  1180. X@findex jobs
  1181. X@item jobs [ -lprs ] [ @var{job} @dots{} ]
  1182. XLists information about each given job, or all jobs if @var{job} is
  1183. Xomitted.  The @code{-l} flag lists process ids, and the @code{-p} flag
  1184. Xlists process groups.  If the @code{-r} flag is given only running jobs
  1185. Xwill be listed; if the @code{-s} flag is given only stopped jobs are
  1186. Xshown.@refill
  1187. X
  1188. X@cindex jobs, killing
  1189. X@cindex killing jobs
  1190. X@findex kill
  1191. X@item kill [ -@var{sig} ] @var{job} @dots{}
  1192. X@itemx kill -l
  1193. XSends either @code{SIGTERM} or the specified signal to the given jobs or
  1194. Xprocesses.  Signals are given by number or by names (with the prefix
  1195. X@code{SIG} removed).  If the signal being sent is not @code{KILL} or
  1196. X@code{CONT}, then the job will be sent a @code{CONT} signal if it is
  1197. Xstopped.  The argument @var{job} can be the process id of a job not in
  1198. Xthe job list.  In the second form, @code{kill -l}, the signal names are
  1199. Xlisted.@refill
  1200. X
  1201. X@findex let
  1202. X@item let @var{arg} @dots{}
  1203. XEvaluate each @var{arg} as an arithmetic expression.
  1204. X@c
  1205. X@c Why does the next line cause Info-validate to say "invalid reference"?
  1206. X@c
  1207. X@xref{Arithmetic Evaluation}, for a description of arithmetic
  1208. Xexpressions.  The exit status is 0 if the value of the last expression
  1209. Xis nonzero, and 1 otherwise.@refill
  1210. X
  1211. X@cindex resource limits
  1212. X@cindex limits, resource
  1213. X@findex limit
  1214. X@item limit [ -h ] [ @var{resource} [ @var{limit} ]] @dots{}
  1215. X@itemx limit -s
  1216. XLimit the resource consumption of children of the current shell.  If
  1217. X@var{limit} is not specified, print the current limit placed on
  1218. X@var{resource}; otherwise set the limit to the specified value.  If the
  1219. X@code{-h} flag is given, use hard limits instead of soft limits.  If no
  1220. X@var{resource} is given, print all limits.  See also @code{ulimit}.
  1221. X@var{resource} is one of:@refill
  1222. X
  1223. X@table @code
  1224. X@item cputime
  1225. XMaximum CPU seconds per process.
  1226. X@item filesize
  1227. XLargest single file allowed.
  1228. X@item datasize
  1229. XMaximum data size (including stack) for each process.
  1230. X@item stacksize
  1231. XMaximum stack size for each process.
  1232. X@item coredumpsize
  1233. XMaximum size of a core dump.
  1234. X@item resident
  1235. X@itemx memoryuse
  1236. XMaximum resident set size.
  1237. X@item memorylocked
  1238. XMaximum amount of memory locked in RAM.
  1239. X@item descriptors
  1240. XMaximum value for a file descriptor.
  1241. X@item openfiles
  1242. XMaximum number of open files.
  1243. X@item vmemorysize
  1244. XMaximum amount of virtual memory.
  1245. X@end table
  1246. X
  1247. XWhich of these resource limits are available depends on the system.
  1248. X@var{limit} is a number, with an optional scaling factor, as
  1249. Xfollows:@refill
  1250. X
  1251. X@table @code
  1252. X@item @var{n}h
  1253. XHours.
  1254. X@item @var{n}k
  1255. XKilobytes.  This is the default for all but cputime.
  1256. X@item @var{n}m
  1257. XMegabytes or minutes.
  1258. X@item @var{mm}:@var{ss}
  1259. XMinutes and seconds.
  1260. X@end table
  1261. X
  1262. X@findex local
  1263. X@item local [ +-LRZilrtu [@var{n}]] [ @var{name}[=@var{value}] ]
  1264. XSame as @code{typeset}, except that the options @code{-x} and @code{-f}
  1265. Xare not permitted.@refill
  1266. X
  1267. X@cindex users, watching
  1268. X@cindex watching users
  1269. X@vindex watch, use of
  1270. X@findex log
  1271. X@item log
  1272. XList all users currently logged in who are affected by the current
  1273. Xsetting of the @code{watch} parameter.@refill
  1274. X
  1275. X@findex logout
  1276. X@item logout
  1277. XExit the shell, if this is a login shell.
  1278. X
  1279. X@pindex PUSHD_MINUS, use of
  1280. X@findex popd
  1281. X@item popd [ +-@var{n} ]
  1282. XRemoves entries from the directory stack.  With no arguments, removes
  1283. Xthe top directory from the stack, and performs a @code{cd} to the new
  1284. Xtop directory.  With an argument of the form @code{+@var{n}}, remove the
  1285. X@var{n}'th entry counting from the left of the list shown by the
  1286. X@code{dirs} command, starting with zero, and change to that directory.
  1287. XWith an argument of the form @code{-@var{n}}, remove the @var{n}'th entry
  1288. Xcounting from the right.  If the @code{PUSHD_MINUS} option is set, the
  1289. Xmeanings of @code{+} and @code{-} in this context are swapped.@refill
  1290. X
  1291. X@findex print
  1292. X@item print [ -RnrslzpNDPoOic ] [ -u@var{n} ] [ @var{arg} @dots{} ]
  1293. XWith no flags or with flag @code{-}, the arguments are printed on the
  1294. Xstandard output as described by @code{echo}, with the following
  1295. Xdifferences: the escape sequence @code{\M-x} metafies the character
  1296. X@code{x} (sets the highest bit), @code{\C-x} produces a control
  1297. Xcharacter (@code{\C-@@} and @code{\C-?} give the characters NULL and
  1298. Xdelete) and @code{\E} is a synonym for @code{\e}.  Finally, if not in an
  1299. Xescape sequence, @code{\} escapes the following character and is not
  1300. Xprinted.@refill
  1301. X
  1302. X@table @code
  1303. X@item -R
  1304. X@itemx -r
  1305. XIgnore the escape conventions of @code{echo}.  The @code{-R} option
  1306. Xwill print all subsequent arguments and options.@refill
  1307. X@item -s
  1308. XPlace the results in the history list instead of on the standard
  1309. Xoutput.@refill
  1310. X@item -n
  1311. XDo not add a newline to the output.
  1312. X@item -l
  1313. XPrint the arguments separated by newlines instead of spaces.
  1314. X@item -N
  1315. XPrint the arguments separated and terminated by nulls.
  1316. X@item -o
  1317. XPrint the arguments sorted in ascending order.
  1318. X@item -O
  1319. XPrint the arguments sorted in descending order.
  1320. X@item -i
  1321. XIf given together with @code{-o} or @code{-O}, makes the sort be
  1322. Xcase-insensitive.@refill
  1323. X@item -c
  1324. XPrint the arguments in columns.
  1325. X@item -u@var{n}
  1326. XPrint the arguments to file descriptor @var{n}.
  1327. X@item -p
  1328. XPrint the arguments to the input of the coprocess.
  1329. X@item -z
  1330. XPush the arguments onto the editing buffer stack, separated by spaces;
  1331. Xno escape sequences are recognized.@refill
  1332. X@item -D
  1333. XTreat the arguments as directory names, replacing prefixes with @code{~}
  1334. Xexpressions, as appropriate.@refill
  1335. X@item -P
  1336. XRecognize the same escape sequences as in the @code{PROMPT}
  1337. Xparameter.@refill
  1338. X@end table
  1339. X
  1340. X@findex pushd
  1341. X@pindex PUSHD_TO_HOME, use of
  1342. X@pindex CDABLEVARS, use of
  1343. X@pindex PUSHD_SILENT, use of
  1344. X@item pushd [ @var{arg} ]
  1345. X@itemx pushd @var{old} @var{new}
  1346. X@itemx pushd +-@var{n}
  1347. XChange the current directory, and push the old current directory onto
  1348. Xthe directory stack.  In the first form, change the current directory to
  1349. X@var{arg}.  If @var{arg} is not specified, change to the second
  1350. Xdirectory on the stack (that is, exchange the top two entries), or
  1351. Xchange to the value of @code{HOME} if the @code{PUSHD_TO_HOME} option is
  1352. Xset or if there is only one entry on the stack.  If @var{arg} is
  1353. X@code{-}, change to the value of @code{OLDPWD}, the previous directory.
  1354. XIf a directory named @var{arg} is not found in the current directory and
  1355. X@var{arg} does not contain a slash, search each component of the shell
  1356. Xparameter @code{cdpath}.  If the option @code{CDABLEVARS} is set, and a
  1357. Xparameter named @var{arg} exists whose value begins with a slash, treat
  1358. Xits value as the directory.  If the option @code{PUSHD_SILENT} is not
  1359. Xset, the directory stack will be printed after a @code{pushd} is
  1360. Xperformed.@refill
  1361. X
  1362. X@noindent
  1363. XThe second form of @code{pushd} substitutes the string @var{new} for the
  1364. Xstring @var{old} in the name of the current directory, and tries to
  1365. Xchange to this new directory.@refill
  1366. X
  1367. X@noindent
  1368. XThe third form of @code{pushd} is equivalent to @code{popd}.
  1369. X
  1370. X@findex pushln
  1371. X@item pushln
  1372. XEquivalent to @code{print -nZ}.
  1373. X
  1374. X@findex pwd
  1375. X@item pwd
  1376. XEquivalent to @code{print -R $PWD}.
  1377. X
  1378. X@findex r
  1379. X@item r
  1380. XEquivalent to @code{fc -e -}.
  1381. X
  1382. X@vindex IFS
  1383. X@findex read
  1384. X@item read [ -rzpqAclneE ] [ -k [@var{num}] ] [ -u@var{n} ] [ @var{name}?@var{prompt} ] [ @var{name} @dots{} ] 
  1385. XRead one line and break it into fields using the characters in
  1386. X@code{IFS} as separators.  In raw mode, @code{-r}, a @code{\} at the end
  1387. Xof a line does not signify line continuation.  With the @code{-q} flag
  1388. Xread only one character and set @var{name} to @samp{y} if this character
  1389. Xwas @samp{y} or @samp{Y}, and to @samp{n} otherwise.  With this flag set
  1390. Xthe return value is zero only if the character was @samp{y} or @samp{Y}.
  1391. XIf the @code{-k}
  1392. Xflag is given read only one (or @var{num}) characters.  If the @code{-z}
  1393. Xflag is given, read from the editor buffer stack.  The first field is
  1394. Xassigned to the first @var{name}, the second field to the second
  1395. X@var{name}, etc, with leftover fields assigned to the last @var{name}.
  1396. XIf the @code{-e} or the @code{-E} flag is given, the words read are
  1397. Xprinted after the whole line is read.  If the @code{-e} flag is given,
  1398. Xthe words are not assigned to the parameters.  If the @code{-A} flag is
  1399. Xgiven, the first @var{name} is taken as the name of an array and all
  1400. Xwords are assigned to it.  If @var{name} is omitted then @code{REPLY} is
  1401. Xused for scalars and @code{reply} for arrays.  The @code{-c} and
  1402. X@code{-l} flags are allowed only if called inside a function used for
  1403. Xcompletion (specified with the @code{-K} flag to @code{compctl}).  If
  1404. Xthe @code{-c} flag is given, the words of the current command are read.
  1405. XIf the @code{-l} flag is given, the whole line is assigned as a scalar.
  1406. XTogether with the @code{-n} flag these options give the number of the
  1407. Xword the cursor is on and the index of the character the cursor is on
  1408. Xrespectively.  If @code{-u@var{n}} is specified, then input is read from
  1409. Xfile descriptor @var{n}; if @code{-p} is specified, then input is read
  1410. Xfrom the coprocess.  If the first argument contains a @code{?}, the remainder
  1411. Xof this word is used as a @var{prompt} on standard error when the shell
  1412. Xis interactive.  The exit status is 0 unless an end-of-file is
  1413. Xencountered.@refill
  1414. X
  1415. X@cindex parameters, marking readonly
  1416. X@findex readonly
  1417. X@item readonly [ @var{name}[=@var{value}]] @dots{}
  1418. XThe given @var{names} are marked readonly; these names cannot be changed
  1419. Xby subsequent assignment.@refill
  1420. X
  1421. X@findex rehash
  1422. X@item rehash [ -f ]
  1423. XThrow out the command hash table and start over.  If the @code{-f}
  1424. Xoption is given, rescan the command path immediately, instead of
  1425. Xrebuilding the hash table incrementally.@refill
  1426. X
  1427. X@cindex functions, returning from
  1428. X@findex return
  1429. X@item return [ @var{n} ]
  1430. XCauses a shell function or @code{.} script to return to the invoking
  1431. Xscript with the return status specified by @var{n}.  If @var{n} is
  1432. Xomitted then the return status is that of the last command
  1433. Xexecuted.@refill
  1434. X
  1435. X@noindent
  1436. XIf @code{return} was executed from a trap, whether set by the
  1437. X@code{trap} builtin or by defining a @code{TRAP@var{xxx}} function, the
  1438. Xeffect is different for zero and non-zero return status.  With zero
  1439. Xstatus (or after an implicit return at the end of the trap), the shell
  1440. Xwill return to whatever it was previously processing; with a non-zero
  1441. Xstatus, the shell will behave as interrupted except that the return
  1442. Xstatus of the trap is retained.  Note that the signal which caused the
  1443. Xtrap is passed as the first argument, so the statement @samp{return
  1444. X$[128+$1]} will return the same status as if the signal had not been
  1445. Xtrapped.@refill
  1446. X
  1447. X@cindex timed execution
  1448. X@cindex execution, timed
  1449. X@findex sched
  1450. X@item sched [+]@var{hh}:@var{mm} @var{command} @dots{}
  1451. X@itemx sched [ -@var{item} ]
  1452. XMake an entry in the scheduled list of commands to execute.  The time
  1453. Xmay be specified in either absolute or relative time.  With no
  1454. Xarguments, prints the list of scheduled commands.  With the argument
  1455. X@code{-@var{item}}, removes the given item from the list.@refill
  1456. X
  1457. X@cindex parameters, positional
  1458. X@cindex parameters, array
  1459. X@cindex array parameter, declaring
  1460. X@findex set
  1461. X@item set [ +-@var{options} ] [ +-o @var{option name} ] @dots{} [ -A [@var{name}] ] [ @var{arg} ] @dots{} 
  1462. XSet the options for the shell and/or set the positional parameters, or
  1463. Xdeclare an array.  @xref{Options}, for the meaning of the flags.  Flags
  1464. Xmay be specified by name using the @code{-o} option.  If the @code{-A}
  1465. Xflag is given, @var{name} is set to an array containing the given
  1466. X@var{arg}s; if no @var{name} is specified, all arrays are printed.
  1467. XOtherwise the positional parameters are set.  If no arguments are given,
  1468. Xthen the names and values of all parameters are printed on the standard
  1469. Xoutput.  If the only argument is @code{+}, the names of all parameters
  1470. Xare printed.@refill
  1471. X
  1472. X@cindex options, setting
  1473. X@findex setopt
  1474. X@item setopt [ -m ] [ +-@var{options} ] [ @var{name} @dots{} ]
  1475. XSet the options for the shell.  All options specified either with flags
  1476. Xor by name are set.  If no arguments are supplied, the names of all
  1477. Xoptions currently set are printed.  In option names, case is
  1478. Xinsignificant, and all underscore characters are ignored.  If the
  1479. X@code{-m} flag is given the arguments are taken as patterns (which
  1480. Xshould be quoted to preserve them from being interpreted as glob
  1481. Xpatterns), and all options with matching names are set.@refill
  1482. X
  1483. X@cindex parameters, positional
  1484. X@findex shift
  1485. X@item shift [ @var{n} ] [ @var{name} @dots{} ]
  1486. XThe positional parameters from @code{$@var{n}+1} @dots{} are renamed
  1487. X@code{$1}, where @var{n} is an arithmetic expression that defaults to 1.
  1488. XIf any @var{name}s are given then the arrays with these names are
  1489. Xshifted, instead of the positional parameters.@refill
  1490. X
  1491. X@findex source
  1492. X@item source
  1493. XSame as @samp{.}, except that the current directory is always searched
  1494. Xand is always searched first, before directories in @code{path}.@refill
  1495. X
  1496. X@cindex shell, suspending
  1497. X@findex suspend
  1498. X@item suspend [ -f ]
  1499. XSuspend the execution of the shell (send it a @code{SIGTSTP}) until it
  1500. Xreceives a @code{SIGCONT}.  If the @code{-f} option is not given,
  1501. Xcomplain if this is a login shell.@refill
  1502. X
  1503. X@findex test
  1504. X@item test @var{arg} @dots{}
  1505. X@itemx [ @var{arg} @dots{} ]
  1506. XLike the system version of @code{test}.  Added for compatibility; use
  1507. Xconditional expressions instead.@refill
  1508. X
  1509. X@cindex shell, timing
  1510. X@cindex timing the shell
  1511. X@findex times
  1512. X@item times
  1513. XPrint the accumulated user and system times for the shell and for
  1514. Xprocesses run from the shell.
  1515. X
  1516. X@cindex signals, trapping
  1517. X@cindex trapping signals
  1518. X@findex trap
  1519. X@item trap [ @var{arg} ] [ @var{sig} ] @dots{}
  1520. X@var{arg} is a command to be read and executed when the shell receives
  1521. X@var{sig}.  Each @var{sig} can be given as a number or as the name of a
  1522. Xsignal.  Inside the command, @code{$1} refers to the number of the
  1523. Xsignal that caused the trap.
  1524. XIf @var{arg} is @code{-}, then all traps @var{sig} are reset to
  1525. Xtheir default values.  If @var{arg} is the null string, then this signal
  1526. Xis ignored by the shell and by the commands it invokes.  If @var{sig} is
  1527. X@code{ZERR} then @var{arg} will be executed after each command with a
  1528. Xnonzero exit status.  If @var{sig} is @code{DEBUG} then @var{arg} will
  1529. Xbe executed after each command. If @var{sig} is @code{0} or @code{EXIT}
  1530. Xand the @code{trap} statement is executed inside the body of a function,
  1531. Xthen the command @var{arg} is executed after the function completes.  If
  1532. X@var{sig} is @code{0} or @code{EXIT} and the @code{trap} statement is
  1533. Xnot executed inside the body of a function, then the command @var{arg}
  1534. Xis executed when the shell terminates.  The @code{trap} command with no
  1535. Xarguments prints a list of commands associated with each signal.@refill
  1536. X
  1537. X@findex true
  1538. X@item true
  1539. XDo nothing and return an exit code of 0.
  1540. X
  1541. X@cindex tty, freezing
  1542. X@findex ttyctl
  1543. X@item ttyctl [ -fu ]
  1544. XThe @code{-f} option freezes the tty, and @code{-u} unfreezes it.  When
  1545. Xthe tty is frozen, no changes made to the tty settings by external
  1546. Xprograms will be honored by the shell, except for changes in the size of
  1547. Xthe screen; the shell will simply reset the
  1548. Xsettings to their previous values as soon as each command exits.  Thus,
  1549. X@code{stty} and similar programs have no effect when the tty is
  1550. Xfrozen.  Without options it reports whether the terminal is frozen or
  1551. Xnot.@refill
  1552. X
  1553. X@findex type
  1554. X@item type
  1555. XSame as @code{whence -v}.
  1556. X
  1557. X@cindex parameters, setting
  1558. X@findex typeset
  1559. X@item typeset [ +-LRZfilrtuxm [@var{n}]] [ @var{name}[=@var{value}]] @dots{}
  1560. XSet attributes and values for shell parameters.  When invoked inside a
  1561. Xfunction, a new parameter is created which will be unset when the
  1562. Xfunction completes.  The new parameter will not be exported unless
  1563. X@code{ALL_EXPORT} is set, in which case the parameter will be exported
  1564. Xprovided no parameter of that name already exists.  The following
  1565. Xattributes are valid:@refill
  1566. X
  1567. X@table @code
  1568. X@item -L
  1569. XLeft justify and remove leading blanks from @var{value}.  If @var{n} is
  1570. Xnonzero, it defines the width of the field; otherwise it is determined
  1571. Xby the width of the value of the first assignment.  When the parameter
  1572. Xis printed, it is filled on the right with blanks or truncated if
  1573. Xnecessary to fit the field.  Leading zeros are removed if the @code{-Z}
  1574. Xflag is also given.@refill
  1575. X
  1576. X@item -R
  1577. XRight justify and fill with leading blanks.  If @var{n} is nonzero it
  1578. Xdefines the width of the field; otherwise it is determined by the width
  1579. Xof the value of the first assignment.  When the parameter is printed,
  1580. Xthe field is left filled with blanks or truncated from the end.@refill
  1581. X
  1582. X@item -Z
  1583. XRight justify and fill with leading zeros if the first non-blank
  1584. Xcharacter is a digit and the @code{-L} flag has not been set.  If
  1585. X@var{n} is nonzero it defines the width of the field; otherwise it is
  1586. Xdetermined by the width of the value of the first assignment.@refill
  1587. X
  1588. X@item -f
  1589. XThe names refer to functions rather than parameters.  No assignments can
  1590. Xbe made, and the only other valid flags are @code{-t} and @code{-u}.
  1591. XThe flag @code{-t} turns on execution tracing for this function.  The
  1592. Xflag @code{-u} causes this function to be marked for autoloading.  The
  1593. X@code{fpath} parameter will be searched to find the function definition
  1594. Xwhen the function is first referenced.@refill
  1595. X
  1596. X@item -i
  1597. XUse an internal integer representation.  If @var{n} is nonzero it
  1598. Xdefines the output arithmetic base, otherwise it is determined by the
  1599. Xfirst assignment.@refill
  1600. X
  1601. X@item -l
  1602. XConvert to lower case.
  1603. X
  1604. X@item -r
  1605. XThe given @var{name}s are marked readonly.
  1606. X
  1607. X@item -t
  1608. XTags the named parameters.  Tags have no special meaning to the
  1609. Xshell.@refill
  1610. X
  1611. X@item -u
  1612. XConvert to upper case.
  1613. X
  1614. X@item -x
  1615. XMark for automatic export to the environment of subsequently executed
  1616. Xcommands.@refill
  1617. X@end table
  1618. X
  1619. X@noindent
  1620. XUsing @code{+} rather than @code{-} causes these flags to be turned off.
  1621. XIf no arguments are given but flags are specified, a list of named
  1622. Xparameters which have these flags set is printed.  Using @code{+}
  1623. Xinstead of @code{-} keeps their values from being printed.  If no
  1624. Xarguments or options are given, the names and attributes of all
  1625. Xparameters are printed.  If just the @code{-m} flag is given the
  1626. Xarguments are taken as patterns (which should be quoted), and all
  1627. Xparameters or functions (with the @code{-f} flag) with matching names
  1628. Xare printed.@refill
  1629. X
  1630. X@cindex resource limits
  1631. X@cindex limits, resource
  1632. X@findex ulimit
  1633. X@item ulimit [ -Hacdflmnopstv ] [ @var{limit} ]
  1634. XSet or display a resource limit.  When setting a limit it will apply to
  1635. Xthe children of the shell but not to the shell itself.
  1636. XThe value of limit can be a number in
  1637. Xthe unit specified below or the value @samp{unlimited}.  If the @code{-H}
  1638. Xflag is given use hard limits instead of soft limits.  See also
  1639. X@code{limit}.@refill
  1640. X
  1641. X@table @code
  1642. X@item -a
  1643. XLists all of the current resource limits.
  1644. X@item -c
  1645. XMaximum size of core dumps, in 512-byte blocks.
  1646. X@item -d
  1647. XMaximum size of the data segment, in Kbytes.
  1648. X@item -f
  1649. XMaximum size of individual files written, in 512-byte blocks.
  1650. X@item -l
  1651. XMaximum size of locked-in memory, in Kbytes.
  1652. X@item -m
  1653. XMaximum size of physical memory, in Kbytes.
  1654. X@item -n
  1655. XMaximum number of file descriptors.
  1656. X@item -o
  1657. XMaximum number of open files.
  1658. X@item -p
  1659. XMaximum number of processes.
  1660. X@item -s
  1661. XMaximum size of stack, in Kbytes.
  1662. X@item -t
  1663. XMaximum number of CPU seconds.
  1664. X@item -v
  1665. XMaximum size of virtual memory, in Kbytes.
  1666. X@end table
  1667. X
  1668. X@cindex umask
  1669. X@findex umask
  1670. X@item umask [ @var{mask} ]
  1671. XThe umask is set to @var{mask}.  @var{mask} can be either an octal
  1672. Xnumber or a symbolic value as described in @code{chmod(1)}.  If
  1673. X@var{mask} is omitted, the current value is printed.  Note that in the
  1674. Xsymbolic form the permissions you specify are those which are to be
  1675. Xallowed (not denied) to the users specified).@refill
  1676. X
  1677. X@cindex aliases, removing
  1678. X@findex unalias
  1679. X@item unalias [ -m ] @var{name} @dots{}
  1680. XThe alias definition, if any, for each @var{name} is removed.  With the
  1681. X@code{-m} flag, the arguments are taken as patterns (which should be
  1682. Xquoted), and all aliases with matching names are removed.@refill
  1683. X
  1684. X@cindex functions, removing
  1685. X@findex unfunction
  1686. X@item unfunction [ -m ] @var{name} @dots{}
  1687. XThe function definition, if any, for each @var{name} is removed.  With
  1688. Xthe @code{-m} flag, the arguments are taken as patterns (which should be
  1689. Xquoted), and all function with matching names are removed.@refill
  1690. X
  1691. X@findex unhash
  1692. X@item unhash [ -m ] @var{name} @dots{}
  1693. XThe entry in the command hash table, if any, for each @var{name} is
  1694. Xremoved.  With the @code{-m} flag, the arguments are taken as patterns
  1695. X(which should be quoted), and all entries for commands with matching
  1696. Xnames are removed.@refill
  1697. X
  1698. X@cindex limits, resource
  1699. X@cindex resource limits
  1700. X@findex unlimit
  1701. X@item unlimit [ -h ] @var{resource} @dots{}
  1702. XThe resource limit for each @var{resource} is set to the hard limit.  If
  1703. Xthe @code{-h} flag is given and the shell is running as root, the hard
  1704. Xresource limit for each @var{resource} is removed.@refill
  1705. X
  1706. X@cindex parameters, unsetting
  1707. X@findex unset
  1708. X@item unset [ -m ] @var{name} @dots{}
  1709. XEach named parameter is unset.  With the @code{-m} flag, the arguments
  1710. Xare taken as patterns (which should be quoted), and all parameters with
  1711. Xmatching names are unset.@refill
  1712. X
  1713. X@cindex options, unsetting
  1714. X@findex unsetopt
  1715. X@item unsetopt [ -m ]  [ +-@var{options} ] [ @var{name} @dots{} ]
  1716. XUnset the options for the shell.  All options specified either with
  1717. Xflags or by name are unset.  With the @code{-m} flag, the arguments are
  1718. Xtaken as patterns (which should be quoted), and all options with
  1719. Xmatching names are unset.@refill
  1720. X
  1721. X@cindex parameters, editting
  1722. X@cindex editting parameters
  1723. X@findex vared
  1724. X@item vared [ -c ] [ -p @var{prompt}] [ -r @var{rprompt} ] @var{name}
  1725. XThe value of the parameter @var{name} is loaded into the edit buffer,
  1726. Xand the line editor is invoked.  When the editor exits, @var{name} is
  1727. Xset to the string value returned by the editor.  If the @code{-c} flag
  1728. Xis given, the parameter is created if it doesn't already exist.  If the
  1729. X@code{-p} flag is given, @var{prompt} will be taken as the prompt to
  1730. Xdisplay at the left.  If the @code{-r} flag is given, @var{rprompt} will
  1731. Xbe taken as the prompt to display at the right.@refill
  1732. X
  1733. X@cindex jobs, waiting for
  1734. X@cindex waiting for jobs
  1735. X@findex wait
  1736. X@item wait [ @var{job} @dots{} ]
  1737. XWait for the specified jobs or processes.  If @var{job} is not given
  1738. Xthen all currently active child processes are waited for.  Each
  1739. X@var{job} can be either a job specification or the process-id of a job
  1740. Xin the job table.  The exit status from this command is that of the job
  1741. Xwaited for.@refill
  1742. X
  1743. X@findex whence
  1744. X@item whence [ -acpvm ] @var{name} @dots{}
  1745. XFor each name, indicate how it would be interpreted if used as a command
  1746. Xname.  The @code{-v} flag produces a more verbose report.  The @code{-p}
  1747. Xflag does a path search for @var{name} even if it is a shell function,
  1748. Xalias, or reserved word.  The @code{-c} flag prints the results in a
  1749. Xcsh-like format.  The @code{-a} flag does a search for all occurences of
  1750. X@var{name} throughout the command path.  With the @code{-m} flag, the
  1751. Xarguments are taken as patterns (which should be quoted), and the
  1752. Xinformation is displayed for each command matching one of these
  1753. Xpatterns.@refill
  1754. X
  1755. X@findex which
  1756. X@item which
  1757. XSame as @code{whence -c}.
  1758. X@end table
  1759. X
  1760. X@node Invocation, Wrapping Up, Shell Builtin Commands, Top
  1761. X@chapter Invocation
  1762. X@cindex invocation
  1763. X
  1764. X@noindent
  1765. X@code{zsh [ +-@var{options} ] [ +-o @var{option} ] @dots{}  [ -c @var{string} ] [ @var{arg} @dots{} ]}
  1766. X
  1767. X@pindex NO_RCS, use of
  1768. X@cindex files, startup
  1769. X@cindex startup files
  1770. X@noindent
  1771. XCommands are first read from @file{/etc/zshenv}.  If the @code{-f} flag
  1772. Xis given or if the @code{NO_RCS} option is set within
  1773. X@file{/etc/zshenv}, all other initialization files are skipped.
  1774. XOtherwise, commands are read from @file{$ZDOTDIR/.zshenv} (if
  1775. X@code{ZDOTDIR} is unset, @code{HOME} is used instead).  If the first
  1776. Xcharacter of argument zero passed to the shell is @code{-}, or if the
  1777. X@code{-l} flag is present, then the shell is assumed to be a login
  1778. Xshell, and commands are read from @file{/etc/zprofile} and then
  1779. X@file{$ZDOTDIR/.zprofile}.  Then, if the shell is interactive and the
  1780. X@code{NO_RCS} option is unset, commands are read from @file{/etc/zshrc}
  1781. Xand then @file{$ZDOTDIR/.zshrc}.  Finally, if the shell is a login
  1782. Xshell, @file{/etc/zlogin} and @file{$ZDOTDIR/.zlogin} are read.@refill
  1783. X
  1784. X@noindent
  1785. XIf the @code{-s} flag is not present and an argument is given,
  1786. Xthe first argument is taken to be the pathname of a script to execute.
  1787. XThe remaining arguments are assigned to the positional parameters.  The
  1788. Xfollowing flags are interpreted by the shell when invoked:@refill
  1789. X
  1790. X@cindex flags, shell
  1791. X@cindex shell flags
  1792. X@table @code
  1793. X@item -c @var{string}
  1794. XRead commands from @var{string}.
  1795. X
  1796. X@item -s
  1797. XRead command from the standard input.
  1798. X
  1799. X@item -i
  1800. XIf this flag is present or the shell input and output are attached to a
  1801. Xterminal, this shell is interactive.
  1802. X@end table
  1803. X
  1804. X@node Wrapping Up, Concept Index, Invocation, Top
  1805. X@chapter Wrapping Up
  1806. X
  1807. X@section See Also
  1808. X
  1809. X@noindent
  1810. Xsh(1), csh(1), tcsh(1), itcsh(1), rc(1), bash(1), ash(1), ksh(1),
  1811. Xclam(1), strftime(3).
  1812. X
  1813. X@section Files
  1814. X@cindex files used
  1815. X
  1816. X@noindent
  1817. X$ZDOTDIR/.zshenv@*
  1818. X@noindent
  1819. X$ZDOTDIR/.zprofile@*
  1820. X@noindent
  1821. X$ZDOTDIR/.zshrc@*
  1822. X@noindent
  1823. X$ZDOTDIR/.zlogin@*
  1824. X@noindent
  1825. X$ZDOTDIR/.zlogout@*
  1826. X@noindent
  1827. X/tmp/zsh*@*
  1828. X@noindent
  1829. X/etc/zshenv@*
  1830. X@noindent
  1831. X/etc/zprofile@*
  1832. X@noindent
  1833. X/etc/zshrc@*
  1834. X@noindent
  1835. X/etc/zlogin
  1836. X
  1837. X@section Author
  1838. X
  1839. X@noindent
  1840. XPaul Falstad (pf@@z-code.com).  Programmable completion was implemented
  1841. Xby Sven Wischnowsky (oberon@@cs.tu-berlin.de) and Peter Stephenson
  1842. X(pws@@s-a.amtp.liv.ac.uk).@refill
  1843. X
  1844. X@section Availability
  1845. X@cindex availability
  1846. X
  1847. X@noindent
  1848. XThe latest official release of zsh is available via anonymous ftp from
  1849. X@code{ftp.sterling.com}, in the directory @code{/zsh} and from
  1850. X@code{carlo.phys.uva.nl}, in the directory @code{/pub/bas/zsh}.@refill
  1851. X
  1852. X@section Undocumented Features
  1853. X@cindex undocumented features
  1854. X
  1855. X@noindent
  1856. XKnown only to the recipients of the zsh mailing list,
  1857. X@code{zsh-list@@sterling.com}.  If you run into problems, please
  1858. Xsend your questions and patches to the mailing list.  To subscribe to
  1859. Xzsh-list, send an email message with the body @samp{subscribe zsh-list}
  1860. Xto @code{Majordomo@@sterling.com}.@refill
  1861. X
  1862. X
  1863. X@node Concept Index, Variables Index, Wrapping Up, Top
  1864. X@unnumbered Concept Index
  1865. X
  1866. X@printindex cp
  1867. X
  1868. X@node Variables Index, Options Index, Concept Index, Top
  1869. X@unnumbered Variables Index
  1870. X
  1871. X@printindex vr
  1872. X
  1873. X@node Options Index, Functions Index, Variables Index, Top
  1874. X@unnumbered Options Index
  1875. X
  1876. X@printindex pg
  1877. X
  1878. X@node Functions Index, Editor Functions Index, Options Index, Top
  1879. X@unnumbered Functions Index
  1880. X
  1881. X@printindex fn
  1882. X
  1883. X@node Editor Functions Index, Keystroke Index, Functions Index, Top
  1884. X@unnumbered Editor Functions Index
  1885. X
  1886. X@printindex tp
  1887. X
  1888. X@node Keystroke Index,  , Editor Functions Index, Top
  1889. X@unnumbered Keystroke Index
  1890. X
  1891. X@printindex ky
  1892. X
  1893. X
  1894. X@setchapternewpage odd
  1895. X@contents
  1896. X@bye
  1897. X
  1898. X@c v0.1, July 8th 1992.  Added documentation for Rick's
  1899. X@c (pclink@@qld.tne.oz.au) four new glob qualifiers (a/m/c/L)
  1900. X@c v0.2, August 11th 1992.  Added documentation for the new PSVAR
  1901. X@c variable, the f E and I flags for the fc command, and the
  1902. X@c appendhistory and extendedhistory options.  Also corrected a typo in
  1903. X@c the description of the ${ := } modifier.  Now current to zsh2.3beta
  1904. X@c (patch level 28).
  1905. X@c v0.3, August 21 1992.  Unified to the zsh.1 (patchlevel 30) patches
  1906. X@c supplied by Hans Albertsson.  This meant rewriting most of the extra
  1907. X@c text I added in v0.1 and v0.2, in order to match Hans'.  Corrected
  1908. X@c some more typos ("is has" in several places). 
  1909. X@c       [ added to the archive sometime around here ]
  1910. X@c v0.4, November 1 1992.  Added up-line-or-search to complement
  1911. X@c down-line-or-search.  Moved information about availability and the
  1912. X@c mailing list to the end of the file, to match zsh.1.  Should now be
  1913. X@c current to patchlevel 65.
  1914. X@c v0.5, February 5 1993.  Has been kept mostly up-do-date by denizens
  1915. X@c of the mailing list.  Final clean-up to conform to the new release
  1916. X@c of zsh version 2.3 (man page dated 1 February 1993), and to the new
  1917. X@c Texinfo standards (but should remain compatible with old Texinfo).
  1918. XEventually I want to rewrite to use the new features of Texinfo v2.0
  1919. Xand above, but we'll have to wait for the rest of the world to catch
  1920. Xup first.  <sigh>
  1921. Xv0.6, June 20th 1993.  Now matches zsh.1 from zsh2.4 patchlevel 158.
  1922. XAlso fixed a few typographical niceties (blank lines between items,
  1923. Xadded some more refills, capitalized item descriptions).  Todo: more
  1924. Xcross-referencing, more indexing of new features, and separate vi
  1925. Xand emacs keystroke indices.
  1926. Xv0.7, September 29th 1993.  Now matches zsh.1 from zsh2.4 patchlevel
  1927. X162, as supplied with 2.4.264.  Also separated out multiple table
  1928. Xentries, compressed secondary tables, and used the new @kbd construct
  1929. Xwhere possible.
  1930. Xv0.8, December 30th 1993.  Now matches zsh.1 as supplied with zsh
  1931. X2.4.291.  Changed occurrences of @code{..} @var{..} into @code{..
  1932. X@var{..}} to make info version cleaner, removed extraneous @code in
  1933. X@item lines, escaped occurrences of '', other minor bugfixes.
  1934. Xv0.9. June 20th 1994.  Final (I hope) revision before 2.5 is released.
  1935. Xv1.0. June 20th 1994.  Add latest manpage additions and update zsh
  1936. Xversion numbers throughout the document. (by Bas)
  1937. END_OF_FILE
  1938.   if test 69910 -ne `wc -c <'zsh-2.5.0/doc/zsh.texi.C'`; then
  1939.     echo shar: \"'zsh-2.5.0/doc/zsh.texi.C'\" unpacked with wrong size!
  1940.   elif test -f 'zsh-2.5.0/doc/zsh.texi.A' && test -f 'zsh-2.5.0/doc/zsh.texi.B'; then
  1941.     echo shar: Combining  \"'zsh-2.5.0/doc/zsh.texi'\" \(190781 characters\)
  1942.     cat 'zsh-2.5.0/doc/zsh.texi.A' 'zsh-2.5.0/doc/zsh.texi.B' 'zsh-2.5.0/doc/zsh.texi.C' > 'zsh-2.5.0/doc/zsh.texi'
  1943.     if test 190781 -ne `wc -c <'zsh-2.5.0/doc/zsh.texi'`; then
  1944.       echo shar: \"'zsh-2.5.0/doc/zsh.texi'\" combined with wrong size!
  1945.     else
  1946.       rm zsh-2.5.0/doc/zsh.texi.A zsh-2.5.0/doc/zsh.texi.B zsh-2.5.0/doc/zsh.texi.C
  1947.     fi
  1948.   fi
  1949.   # end of 'zsh-2.5.0/doc/zsh.texi.C'
  1950. fi
  1951. if test -f 'zsh-2.5.0/src/config/bz.check' -a "${1}" != "-c" ; then 
  1952.   echo shar: Will not clobber existing file \"'zsh-2.5.0/src/config/bz.check'\"
  1953. else
  1954.   echo shar: Extracting \"'zsh-2.5.0/src/config/bz.check'\" \(2182 characters\)
  1955.   sed "s/^X//" >'zsh-2.5.0/src/config/bz.check' <<'END_OF_FILE'
  1956. X. ./config/bz.doksh
  1957. X
  1958. Xif test -z "$B_auto" -a -z "$B_justmake"
  1959. Xthen
  1960. X  if test -z "$B_query"
  1961. X  then
  1962. X    cat <<foo | $PAGER
  1963. X
  1964. X    buildzsh will probe your system for all kinds of features that
  1965. X    are useful to know when building zsh.  buildzsh will also
  1966. X    suggest some site-dependent things like where to install
  1967. X    the final zsh binary.
  1968. X
  1969. X    You can either:
  1970. X
  1971. X    * Let buildzsh do all the work for you.
  1972. X
  1973. X      This method is suggested either for the first time
  1974. X      zsh-builders who _hope_ that zsh will build ok -- or
  1975. X      for the experienced builders who _know_ that zsh will build ok.
  1976. X      This method can be selected by "buildzsh auto", this text
  1977. X      will then not be shown.
  1978. X        
  1979. X    * Try to answer the questions about the features and
  1980. X      to define yourself the site-dependent things.
  1981. X
  1982. X      This method requires both intimate knowledge about
  1983. X      your operating system and C compilation environment
  1984. X      (compiler, preprocessor, headers, libraries, linker)
  1985. X      and about your site-specific software installation
  1986. X      guidelines.  That is, most of the time you must be
  1987. X      a system administrator of sorts to use this option.
  1988. X      This method can be selected by "buildzsh query", this text
  1989. X      will then not be shown.
  1990. X
  1991. X      Note that some questions of the installation kind
  1992. X      (optimize or not, where the install the final executable binary)
  1993. X      can be more conveniently answered beforehand at the buildzsh
  1994. X      command line.  Try "buildzsh help" to find out how.
  1995. X      
  1996. X        At any point you can interrupt buildzsh by hitting the interrupt
  1997. X    key (normally ^C [ctrl+c]) and if your shell supports job control,
  1998. X    suspend buildzsh for a while (normally done with ^Z [ctrl+z]).
  1999. X
  2000. X    To summarize:                    Answer:
  2001. X
  2002. X    * this is your first time buildzing zsh        n
  2003. X    * you _know_ that building zsh will work    n
  2004. X    * you want to tweak various definitions        y
  2005. X
  2006. X[proceed with $PAGER_quit]
  2007. Xfoo
  2008. X    F_define=
  2009. X    F_using=yep
  2010. X    G_verb1_=Will
  2011. X    G_verb2_='want to answer'
  2012. X    G_verb3a_='will ask'
  2013. X    G_verb3b_=letting
  2014. X    _savedB_query_=$B_query
  2015. X    B_query=yep
  2016. X    set false _ 1 'the questions' 'buildzsh have all the fun'
  2017. X    . ./config/bz.ifdef
  2018. X    test -n "$_yea" && B_query=yep || B_query=$_savedB_query_
  2019. X  fi
  2020. Xelse
  2021. X  B_query=
  2022. Xfi
  2023. X
  2024. X. ./config/bz.sanity
  2025. END_OF_FILE
  2026.   if test 2182 -ne `wc -c <'zsh-2.5.0/src/config/bz.check'`; then
  2027.     echo shar: \"'zsh-2.5.0/src/config/bz.check'\" unpacked with wrong size!
  2028.   fi
  2029.   # end of 'zsh-2.5.0/src/config/bz.check'
  2030. fi
  2031. if test -f 'zsh-2.5.0/src/config/bz.makeprobe' -a "${1}" != "-c" ; then 
  2032.   echo shar: Will not clobber existing file \"'zsh-2.5.0/src/config/bz.makeprobe'\"
  2033. else
  2034.   echo shar: Extracting \"'zsh-2.5.0/src/config/bz.makeprobe'\" \(10865 characters\)
  2035.   sed "s/^X//" >'zsh-2.5.0/src/config/bz.makeprobe' <<'END_OF_FILE'
  2036. X# --- bz.makeprobe
  2037. X
  2038. X# --- make groks VPATH?
  2039. X
  2040. Xtest -z "$make_groks_VPATH_done" && . ./config/bz.makevpath
  2041. X
  2042. X# -- 
  2043. X
  2044. Xif test -z "$B_justmake"
  2045. Xthen
  2046. X
  2047. Xcat <<foo
  2048. X    probing for Makefile...
  2049. X
  2050. Xfoo
  2051. X
  2052. X# --- cc?
  2053. X
  2054. Xtest -z "$makecc_done" && . ./config/bz.makecc
  2055. X
  2056. X# --- CFLAGS
  2057. X
  2058. Xif test -z "$C_CFLAGS"
  2059. Xthen
  2060. X
  2061. XCFLAGS_D="$CFLAGS_D $C_CFLAGS_D"
  2062. X
  2063. XCFLAGS_X="$CFLAGS_X $C_CFLAGS_X"
  2064. X
  2065. XCFLAGS_W="$CFLAGS_W $C_CFLAGS_W"
  2066. X
  2067. Xif test -n "$B_debug"
  2068. Xthen
  2069. X  CFLAGS_g="`echo $CFLAGS_g $C_CFLAGS_g | sed 's/^ +$//'`"
  2070. X  test -z "$CFLAGS_g" && CFLAGS_g="$DEFAULT_C_CFLAGS_g"
  2071. Xfi
  2072. X
  2073. Xif test -n "$B_zshdebug"
  2074. Xthen
  2075. X  CFLAGS_z="$CFLAGS_z $C_CFLAGS_z"
  2076. X  test -z "$CFLAGS_z" && CFLAGS_z="$DEFAULT_C_CFLAGS_z"
  2077. Xfi
  2078. X
  2079. XD_HP='-D_XOPEN_SOURCE -D_HPUX_SOURCE'
  2080. X
  2081. Xif test -n "$B_gcc" -o -n "$LINUX" -o -n "$NEXT"
  2082. Xthen
  2083. X  # NeXT 3.* has POSIX headers but no POSIX libs, sheesh
  2084. X  # LINUX has no prototypes for non-ANSI stuff, sheesh
  2085. X  if test -n "$LINUX" -o -n "$NEXT"
  2086. X  then
  2087. X    CFLAGS_W="$GCC_BASE0_W"    # no -ansi or -Wmissing-prototypes
  2088. X  else
  2089. X    CFLAGS_W="$GCC_BASE1_W"
  2090. X  fi
  2091. X  DEFAULT_C_CFLAGS_O=-O2
  2092. X  test -n "$B_mediumgcc" && CFLAGS_W="$CFLAGS_W $GCC_MEDIUM_W"
  2093. X  test -n "$B_strictgcc" && CFLAGS_W="$CFLAGS_W $GCC_STRICT_W"
  2094. X  test -n "$NEXT" -o -n "$LINUX" && CFLAGS_X="$CFLAGS_X -pipe"
  2095. X  test -z "$LINUX" -a -z "$NEXT" && CFLAGS_X="$CFLAGS_X -fpcc-struct-return"
  2096. X  test Z"$host" = Z"i486"        && CFLAGS_M="$CFLAGS_M -m486"
  2097. X  # if we have gcc, never mind that the native cc might be mips
  2098. X  CC_MIPS_STYLE=
  2099. Xelif test -n "$APOLLO"
  2100. Xthen CFLAGS_W="$CFLAGS_W -A nansi"
  2101. Xelif test -n "$HPUX"
  2102. Xthen
  2103. X  CFLAGS_D="$CFLAGS_D $D_HP -D_POSIX_SOURCE"
  2104. X  if test -n "$C89"
  2105. X  then CFLAGS_W="$CFLAGS_W +w1"
  2106. X  else test Z"$HPUX" = Z"7.03" && CFLAGS_X="$CFLAGS_X -Wc,-Ns5000"
  2107. X  fi
  2108. X  C_LDFLAGS="$C_LDFLAGS -z"
  2109. Xelif test -n "$AIX"
  2110. Xthen test -n "$C89" && CFLAGS_D="$CFLAGS_D -D_ALL_SOURCE"
  2111. Xelif test -n "$HPOSF"
  2112. X# HPOSF must be tested before OSF1
  2113. Xthen
  2114. X  CFLAGS_D="$CFLAGS_D $D_HP -D_OSF_SOURCE"
  2115. X  CFLAGS_W="$CFLAGS_W -q lang_level:ansi"
  2116. Xelif test -n "$OSF1"            # NOTE: the -Olimit N 
  2117. Xthen CFLAGS_W="$CFLAGS_W -std1"    # is done later on
  2118. Xelif test -n "$NEWS"            # as it will be useful
  2119. Xthen CFLAGS_W="$CFLAGS_W -std"    # only iff optimization
  2120. Xelif test -n "$MIPS"            # will be used.
  2121. Xthen
  2122. X  CFLAGS_W="$CFLAGS_W -std1"
  2123. X  CFLAGS_X="$CFLAGS_X -Wf,-XNd5000 -Wf,-XNl4096"
  2124. Xelif test -n "$CONVEX"
  2125. Xthen
  2126. XCFLAGS_W="$CFLAGS_W -d arg_ptr_qual=w -d arg_ptr_ref=w -d bad_escape=w -d class_ignored=w -d const_not_init=w -d division_by_zero=w -d dollar_names=w -d escape_range_sequence=w -d float_suffix=w -d function_parameter=w -d hidden_arg=w -d hidden_extern=w -d hides_outer=w -d implicit_decl=w -d integer_overflow=w -d long_long_suffix=w -d no_arg_type=w -d no_external_declaration=w -d no_newline=w -d non_int_bit_field=w -d nothing_declared=w -d pp_argcount=w -d pp_argsended=w -d pp_badstr=w -d pp_badtp=w -d pp_badtp_cmdl=w -d pp_error_directive=w -d pp_extra=w -d pp_idexpected=w -d pp_line_range=w -d pp_macro_arg=w -d pp_macro_redefinition=w -d pp_macro_redefinition_cmdl=w -d pp_malformed_directive=w -d pp_old_dir=w -d pp_parse=w -d pp_undef=w -d pp_undef_cmdl=w -d pp_unrecognized_directive=w -d pp_unrecognized_pragma=w -d ptr_cvt_truncates=w -d qualified_cast=w -d record_fn_call=w -d record_fn_defn=w -d shift_too_large=w -d short_cvt_truncates=w -d strict_syntax=w -d unsigned_suffix"
  2127. Xelif test -n "$SOLARIS"
  2128. Xthen
  2129. X# -Xa would be nicer but it is strictish ANSI, while zsh
  2130. X# needs K&R, so -Xs (s=sun) it is
  2131. X# If you dream of -D_POSIX_SOURCE, quit dreaming.
  2132. X  DEFAULT_C_CFLAGS_O="$DEFAULT_C_CFLAGS_O -xO2"
  2133. X  CFLAGS_W="$CFLAGS_W -v -Xs"
  2134. Xelif test -n "$UNICOS"
  2135. Xthen CFLAGS_W="$CFLAGS_W -h stdc"
  2136. Xelif test -f ${headerdir}/ndir.h -a ! -f /usr/lib/libBSD.a
  2137. Xthen CFLAGS_W="$CFLAGS_W -Aa"
  2138. Xelif test -n "$IRIX"
  2139. Xthen
  2140. X  CFLAGS_W="$CFLAGS_W -prototypes -fullwarn"
  2141. X  if test -n "$IRIX5"
  2142. X  then CFLAGS_W="$CFLAGS_W -woff 799"
  2143. X  else CFLAGS_W="$CFLAGS_W -woff 2,183,262,269,270,286,287,302,303,309"    # IRIX 4
  2144. X  fi
  2145. Xfi
  2146. X
  2147. X# optimization by default on
  2148. XCFLAGS_O="`echo $CFLAGS_O $C_CFLAGS_O | sed 's/^ +$//'`"
  2149. Xtest -z "$CFLAGS_O" && CFLAGS_O="$DEFAULT_C_CFLAGS_O"
  2150. X
  2151. Xif test -n "$B_noopt"
  2152. Xthen
  2153. X  CFLAGS_O=
  2154. Xfi
  2155. X
  2156. Xfi
  2157. X
  2158. X# --- do -c and -o work simultaneously?
  2159. X
  2160. Xif test -z "$F_bld_eq_src"
  2161. Xthen
  2162. X
  2163. Xcc_groks_c_o=
  2164. Xcc_groks_c_o_done=
  2165. X
  2166. Xif test -z "$cc_groks_c_o_done"
  2167. Xthen
  2168. X
  2169. Xfor co in $CC_GROK_c_o
  2170. Xdo
  2171. X if test -n "`eval echo '$'$co`"
  2172. X then
  2173. X   cc_groks_c_o=yep
  2174. X   cc_groks_c_o_done=yep
  2175. X   break
  2176. X fi
  2177. Xdone
  2178. X
  2179. Xfi
  2180. X
  2181. Xif test -z "$cc_groks_c_o_done"
  2182. Xthen
  2183. X
  2184. Xfor co in $CC_LOSE_c_o
  2185. Xdo
  2186. X if test -n "`eval echo '$'$co`"
  2187. X then
  2188. X   cc_groks_c_o=
  2189. X   cc_groks_c_o_done=yep
  2190. X   break
  2191. X fi
  2192. Xdone
  2193. X
  2194. Xfi
  2195. X
  2196. Xif test -z "$cc_groks_c_o_done"
  2197. Xthen
  2198. X
  2199. X# well, we must really test for it, then, mustn't we?
  2200. X
  2201. Xtmpc=/tmp/_tmp$$.c
  2202. Xtmpo=/tmp/_tmp$$.o
  2203. X
  2204. Xtrap "rm -f $tmpc $tmpo;$TRAPN" $TRAPSIGS
  2205. X
  2206. Xecho 'int foo=42;' > $tmpc
  2207. X# this C program *should* not elicit any other errors than just
  2208. X# the complaint about simultaneous -c and -o
  2209. Xtest -n "`($CC -c -o $tmpo $tmpc 2>&1)`" && cc_groks_c_o=
  2210. X
  2211. Xrm -f $tmpc $tmpo
  2212. X
  2213. Xcc_groks_c_o_done=yep
  2214. X
  2215. Xfi
  2216. X
  2217. Xif test -z "$cc_groks_c_o"
  2218. Xthen
  2219. X  if test -n "$F_bld_eq_src"
  2220. X  then
  2221. X    CC_JUST_C=yep
  2222. X  else
  2223. X    CC_LOSES_c_O=yep
  2224. X  fi
  2225. Xfi
  2226. X
  2227. XG_verb1_=Does
  2228. XG_subj_=$CC
  2229. XG_verb2_=understand
  2230. Xset 'test -z "$cc_groks_c_o"' cc_groks_c_o 1 "-c and -o simultaneously"
  2231. X. ./config/bz.ifdef
  2232. X
  2233. Xfi
  2234. X
  2235. X# --- do -g and -O work simultaneously?
  2236. X
  2237. Xif test -z "$B_noopt" -a -n "$B_debug" -a -n "$CFLAGS_O"
  2238. Xthen
  2239. X
  2240. Xcc_groks_g_O=
  2241. Xcc_groks_g_O_done=
  2242. X
  2243. Xif test -z "$cc_groks_g_O_done"
  2244. Xthen
  2245. X
  2246. Xfor co in $CC_LOSE_g_O
  2247. Xdo
  2248. X if test -n "`eval echo '$'$co`"
  2249. X then
  2250. X   cc_groks_g_O=
  2251. X   cc_groks_g_O_done=yep
  2252. X   break
  2253. X fi
  2254. Xdone
  2255. X
  2256. Xfi
  2257. X
  2258. Xif test -z "$cc_groks_g_O_done"
  2259. Xthen
  2260. X
  2261. Xfor co in $CC_GROK_g_O
  2262. Xdo
  2263. X set Z `echo $co|tr -d "'" |tr ":" " "`
  2264. X if test -n "`eval echo '$'$1`"
  2265. X then
  2266. X   test -n "$3" && CFLAGS_g="$3"
  2267. X   test -n "$4" && CFLAGS_O="$4"
  2268. X   cc_groks_g_O=yep
  2269. X   cc_groks_g_O_done=yep
  2270. X   break
  2271. X fi
  2272. Xdone
  2273. X
  2274. Xfi
  2275. X
  2276. Xif test -z "$cc_groks_g_O_done"
  2277. Xthen
  2278. X
  2279. X# well, we must really test for it, then, mustn't we?
  2280. X
  2281. Xtmpc=/tmp/_tmp$$.c
  2282. Xtmpo=/tmp/_tmp$$.o
  2283. X
  2284. Xtrap "rm -f $tmpc $tmpo;$TRAPN" $TRAPSIGS
  2285. X
  2286. Xecho 'int foo=42;' > $tmpc
  2287. X# this C program *should* not elicit any other errors than just
  2288. X# the complaint about simultaneous -g and -O
  2289. Xtest -z "`($CC $CFLAGS_g $CFLAGS_O -o $tmpo -c $tmpc 2>&1)`" && cc_groks_g_O=yep
  2290. X
  2291. Xrm -f $tmpc $tmpo
  2292. X
  2293. Xcc_groks_g_O_done=yep
  2294. X
  2295. Xfi
  2296. X
  2297. XG_verb1_=Does
  2298. XG_subj_=$CC
  2299. XG_verb2_=understand
  2300. Xset 'test -n "$cc_groks_g_O"' cc_groks_g_O 1 "-g and -O simultaneously"
  2301. X. ./config/bz.ifdef
  2302. X
  2303. Xfi
  2304. X
  2305. X# ---
  2306. X
  2307. Xif test -n "$CFLAGS_O" -a -n "$CFLAGS_g" -a -z "$cc_groks_g_O"
  2308. Xthen
  2309. X  echo "    ($CC cannot simultaneously optimize (-O) and debug (-g),"
  2310. X  if test -n "$B_debug"
  2311. X  then
  2312. X    echo "    turning off optimization...)"
  2313. X    CFLAGS_O=
  2314. X  elif test -z "$B_noopt"
  2315. X  then
  2316. X    echo "    turning off debug...)"
  2317. X    CFLAGS_g=
  2318. X  fi
  2319. Xfi
  2320. X
  2321. X### Optimization complexity level
  2322. X# for MIPS style compilers
  2323. Xif test -n "$CFLAGS_O" -a -n "$CC_MIPS_STYLE" -a -z "`echo $CFLAGS_O|grep Olimit`"
  2324. Xthen
  2325. X  CFLAGS_O="$CFLAGS_O -Olimit 1000"
  2326. Xfi
  2327. X
  2328. Xif test -n "$B_query"
  2329. Xthen
  2330. X
  2331. Xset CFLAGS_O "$CFLAGS_O" "$CC optimizer flags (e.g. -O)"
  2332. X. ./config/bz.define
  2333. X
  2334. Xset CFLAGS_g "$CFLAGS_g" "$CC debug flags (e.g. -g)"
  2335. X. ./config/bz.define
  2336. X
  2337. Xset CFLAGS_X "$CFLAGS_X" "$CC additional flags (fancy -Defines, etc)"
  2338. X. ./config/bz.define
  2339. X
  2340. Xfi
  2341. X
  2342. X# the final joining of various CFLAGS_
  2343. X
  2344. X# non-optimizing CFLAGS
  2345. XCFLAGS_WO_O="`echo $CFLAGS_D $CFLAGS_W $CFLAGS_X $CFLAGS_g $CFLAGS_z $CFLAGS_M|sed 's/  */ /g'`"
  2346. X
  2347. XCFLAGS_W_O="`echo $CFLAGS_WO_O $CFLAGS_O|sed 's/  */ /g'`"
  2348. X
  2349. Xif test -z "$CFLAGS" -a -n "$C_CFLAGS"
  2350. Xthen
  2351. X  CFLAGS="$C_CFLAGS"
  2352. Xelse
  2353. X  CFLAGS="$CFLAGS_W_O"
  2354. Xfi
  2355. Xset CFLAGS "$CFLAGS" "$CC flags"
  2356. X. ./config/bz.define
  2357. X
  2358. X# LD
  2359. X
  2360. XLD="$CC"
  2361. X
  2362. Xtest -z "$LD" -a -n "$C_LD" && LD="$C_LD"
  2363. Xtest -z "$LD" && LD="$DEFAULT_C_LD"
  2364. Xset LD "$LD" "linker"
  2365. X. ./config/bz.define
  2366. X
  2367. X# LDFLAGS
  2368. X
  2369. XLDFLAGS="`echo $CFLAGS_X $CFLAGS_M $CFLAGS_O $CFLAGS_g|sed 's/  */ /g'`"
  2370. X
  2371. Xtest -n "$C_LDFLAGS" && LDFLAGS="$C_LDFLAGS"
  2372. Xset LDFLAGS "$LDFLAGS" "link flags"
  2373. X. ./config/bz.define
  2374. X
  2375. X# --- LIBS
  2376. X
  2377. Xif test -z "$LIBS"
  2378. Xthen
  2379. X
  2380. X  if test -n "$IRIX"
  2381. X  then
  2382. X    if grep '^\+' /etc/passwd >/dev/null 2>&1
  2383. X    then LIBS='-lcurses -lmalloc -lbsd -lsun'
  2384. X    else LIBS='-lcurses -lmalloc -lbsd'
  2385. X    fi
  2386. X  elif test -n "$SOLARIS"
  2387. X  then LIBS='-ltermcap -lnsl'
  2388. X  elif test -n "$BBN"
  2389. X  then LIBS='-ltermcap -lposix'
  2390. X  elif test -n "$OSF1" -o -n "$TITAN" -o -n "$HPUX"
  2391. X  then LIBS='-ltermcap'
  2392. X  elif test -n "$SEQUENTPTX"
  2393. X  then LIBS='-ltermlib -lX11 -lseq'
  2394. X  elif test -f /usr/lib/libcposix.a
  2395. X  then LIBS='-lcposix -ltermcap'
  2396. X  elif test -f /usr/lib/libBSD.a
  2397. X  then LIBS='-ltermcap -lBSD'
  2398. X  elif test -f /usr/lib/libtermcap.a -o -f /usr/ucblib/libtermcap.a
  2399. X  then
  2400. X    if test -n "$AIX"
  2401. X    then LIBS='-lcurses'    # -lbsd should not be needed
  2402. X    else LIBS='-ltermcap'
  2403. X    fi
  2404. X  fi
  2405. Xfi
  2406. X
  2407. Xtest -z "$LIBS" -a -n "$C_LIBS" && LIBS="$C_LIBS"
  2408. Xtest -z "$LIBS" && LIBS="$DEFAULT_C_LIBS"
  2409. Xset LIBS "$LIBS" "libraries to link with"
  2410. X. ./config/bz.define
  2411. X
  2412. X# -- modules
  2413. X
  2414. Xecho '    Working out modules (*.{[hco],pro})...'
  2415. X
  2416. Xmodules="/tmp/modules$$"
  2417. Xmodules_c="${modules}.c"
  2418. Xmodules_h="${modules}.h"
  2419. Xmodules_o="${modules}.o"
  2420. Xmodules_p="${modules}.p"
  2421. X
  2422. Xtrap "rm -f $modules $modules_c $modules_h $modules_o $modules_p;$TRAPN" $TRAPSIGS
  2423. X
  2424. X(exec >$modules
  2425. X# C source files and header files, one file per line,
  2426. X# between "cat <<foo" and "foo"-lines
  2427. Xcat <<foo
  2428. Xbuiltin.c
  2429. Xcond.c
  2430. Xexec.c
  2431. Xglob.c
  2432. Xhist.c
  2433. Xinit.c
  2434. Xjobs.c
  2435. Xlex.c
  2436. Xloop.c
  2437. Xmath.c
  2438. Xmem.c
  2439. Xparams.c
  2440. Xparse.c
  2441. Xsubst.c
  2442. Xtable.c
  2443. Xtext.c
  2444. Xutils.c
  2445. Xwatch.c
  2446. Xzle_bindings.c
  2447. Xzle_hist.c
  2448. Xzle_main.c
  2449. Xzle_misc.c
  2450. Xzle_move.c
  2451. Xzle_refresh.c
  2452. Xzle_tricky.c
  2453. Xzle_utils.c
  2454. Xzle_vi.c
  2455. Xzle_word.c
  2456. Xfuncs.h
  2457. Xzle.h
  2458. Xzsh.h
  2459. Xztype.h
  2460. Xfoo
  2461. X)
  2462. X
  2463. Xecho '    .c....'
  2464. Xegrep '\.c$' $modules > $modules_c
  2465. XSRC=`cat $modules_c|tr '\012' ' '`
  2466. X
  2467. X# as SRC but without .c 
  2468. XBSRC=`cat $modules_c|sed 's/\.c$//'|tr '\012' ' '`
  2469. X
  2470. Xecho '    .h....'
  2471. Xegrep '\.h$' $modules > $modules_h
  2472. XHEADER=`cat $modules_h | tr '\012' ' '`
  2473. X
  2474. Xtest -n "$make_groks_VPATH" && c_blddir= || c_blddir="$C_BLDDIR"
  2475. X
  2476. Xecho '    .pro....'
  2477. Xsed 's/\.c$/.pro/' < $modules_c | sed "s%^%$c_blddir%" > $modules_p
  2478. XPROTO=`cat $modules_p | tr '\012' ' '`
  2479. X
  2480. Xecho '    .o....'
  2481. Xsed 's/\.c$/.o/' < $modules_c | sed "s%^%$c_blddir%" > $modules_o
  2482. XOBJS=`cat $modules_o | tr '\012' ' '`
  2483. X
  2484. Xrm -f $modules $modules_c $modules_h $modules_o $modules_p
  2485. X
  2486. X{
  2487. X  echo
  2488. X  echo "    probed for Makefile..."
  2489. X  echo
  2490. X} >&2
  2491. X
  2492. Xfi
  2493. X
  2494. X# -- find out how to build the .c.o rule
  2495. X
  2496. Xccit='$(CC) $(CFLAGS) -c $(DFLAGS)'
  2497. Xccdotc='$<'
  2498. Xccseparate=
  2499. Xmakeprecd=
  2500. Xmakefflag=
  2501. Xccinc=
  2502. X
  2503. Xif test -z "$F_bld_eq_src"
  2504. Xthen
  2505. X  test -n "$C_SRCDIR" && ccinc=" -I$C_SRCDIR"
  2506. X  if test -z "$B_makeatbld"
  2507. X  then
  2508. X     makefflag="-f $MAKEFILE"
  2509. X     ccinc=" -I$C_BLDDIR"
  2510. X  else
  2511. X     makeprecmd="cd $C_BLDDIR && "
  2512. X     ccseparate=yep
  2513. X  fi
  2514. X  if test -n "$make_groks_VPATH"
  2515. X  then
  2516. X     if test -z "$B_makeatbld"
  2517. X     then
  2518. X       ccit="$ccit$ccinc -o ${C_BLDDIR}\$@ "
  2519. X     fi
  2520. X  else
  2521. X     if test -n "$B_makeatbld"
  2522. X     then
  2523. X       ccit="$ccit$ccinc"' -o `basename ${C_SRCDIR}\$@`'
  2524. X     else
  2525. X       ccseparate=yep
  2526. X     fi
  2527. X  fi
  2528. Xfi
  2529. X
  2530. X# all set
  2531. X
  2532. Xmake_probe_done=yep
  2533. X
  2534. X###
  2535. END_OF_FILE
  2536.   if test 10865 -ne `wc -c <'zsh-2.5.0/src/config/bz.makeprobe'`; then
  2537.     echo shar: \"'zsh-2.5.0/src/config/bz.makeprobe'\" unpacked with wrong size!
  2538.   fi
  2539.   # end of 'zsh-2.5.0/src/config/bz.makeprobe'
  2540. fi
  2541. echo shar: End of archive 4 \(of 18\).
  2542. cp /dev/null ark4isdone
  2543. MISSING=""
  2544. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
  2545.     if test ! -f ark${I}isdone ; then
  2546.     MISSING="${MISSING} ${I}"
  2547.     fi
  2548. done
  2549. if test "${MISSING}" = "" ; then
  2550.     echo You have unpacked all 18 archives.
  2551.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2552. else
  2553.     echo You still must unpack the following archives:
  2554.     echo "        " ${MISSING}
  2555. fi
  2556. exit 0
  2557. exit 0 # Just in case...
  2558.