Imported from ../bash-2.03.tar.gz.
[platform/upstream/bash.git] / doc / FAQ
1 This is the Bash FAQ, version 3.0, for Bash version 2.03.
2
3 This document contains a set of frequently-asked questions concerning
4 Bash, the GNU Bourne-Again Shell.  Bash is a freely-available command
5 interpreter with advanced features for both interactive use and shell
6 programming.
7
8 Another good source of basic information about shells is the collection
9 of FAQ articles periodically posted to comp.unix.shell.
10
11 Questions and comments concerning this document should be sent to
12 chet@po.cwru.edu.
13
14 This document is available for anonymous FTP with the URL
15
16 ftp://ftp.cwru.edu/pub/bash/FAQ
17
18 ----------
19 Contents:
20
21 Section A:  The Basics
22
23 A1) What is it?
24 A2) What's the latest version?
25 A3) Where can I get it?
26 A4) On what machines will bash run?
27 A5) Will bash run on operating systems other than Unix?
28 A6) How can I build bash with gcc?
29 A7) How can I make bash my login shell?
30 A8) I just changed my login shell to bash, and now I can't FTP into my
31     machine.  Why not?
32 A9) What's the `POSIX 1003.2 standard'?
33 A10) What is the bash `posix mode'?
34
35 Section B:  The latest version
36
37 B1) What's new in version 2.03?
38 B2) Are there any user-visible incompatibilities between bash-2.03 and
39     bash-1.14.7?
40
41 Section C:  Differences from other Unix shells
42
43 C1) How does bash differ from sh, the Bourne shell?
44 C2) How does bash differ from the Korn shell, version ksh88?
45 C3) Which new features in ksh-93 are not in bash, and which are?
46
47 Section D:  Why does bash do some things differently than other Unix shells?
48
49 D1) Why does bash run a different version of `command' than
50     `which command' says it will?
51 D2) Why doesn't bash treat brace expansions exactly like csh?
52 D3) Why doesn't bash have csh variable modifiers?
53 D4) How can I make my csh aliases work when I convert to bash?
54 D5) How can I pipe standard output and standard error from one command to
55     another, like csh does with `|&'?
56 D6) Now that I've converted from ksh to bash, are there equivalents to
57     ksh features like autoloaded functions and the `whence' command?
58
59 Section E:  How can I get bash to do certain things, and why does bash do
60             things the way it does?
61
62 E1) Why is the bash builtin `test' slightly different from /bin/test?
63 E2) Why does bash sometimes say `Broken pipe'?
64 E3) How can I get bash to read and display eight-bit characters?
65 E4) How do I write a function `x' to replace builtin command `x', but
66     still invoke the command from within the function?
67 E5) When I have terminal escape sequences in my prompt, why does bash
68     wrap lines at the wrong column?
69 E6) How can I find the value of a shell variable whose name is the value
70     of another shell variable?
71 E7) If I pipe the output of a command into `read variable', why doesn't
72     the output show up in $variable when the read command finishes?
73 E8) I have a bunch of shell scripts that use backslash-escaped characters
74     in arguments to `echo'.  Bash doesn't interpret these characters.  Why
75     not, and how can I make it understand them?
76 E9) Why doesn't a while or for loop get suspended when I type ^Z?
77 E10) How can I make the bash `time' reserved word print timing output that
78      looks like the output from my system's /usr/bin/time?
79
80 Section F:  Things to watch out for on certain Unix versions
81
82 F1) Why can't I use command line editing in my `cmdtool'?
83 F2) I built bash on Solaris 2.  Why do globbing expansions and filename
84     completion chop off the first few characters of each filename?
85 F3) Why does bash dump core after I interrupt username completion or
86     `~user' tilde expansion on a machine running NIS?
87 F4) I'm running SVR4.2.  Why is the line erased every time I type `@'?
88 F5) Why does bash report syntax errors when my C News scripts use a
89     redirection before a subshell command?
90
91 Section G:  Where do I go from here?
92
93 G1) How do I report bugs in bash, and where should I look for fixes and
94     advice?
95 G2) What kind of bash documentation is there?
96 G3) What's coming in future versions?
97 G4) What's on the bash `wish list'?
98 G5) When will the next release appear?
99
100 ----------
101 Section A:  The Basics
102
103 A1)  What is it?
104
105 Bash is a Unix command interpreter (shell).  It is an implementation of
106 the Posix 1003.2 shell standard, and resembles the Korn and System V
107 shells.
108
109 Bash contains a number of enhancements over those shells, both
110 for interactive use and shell programming.  Features geared
111 toward interactive use include command line editing, command
112 history, job control, aliases, and prompt expansion.  Programming
113 features include additional variable expansions, shell
114 arithmetic, and a number of variables and options to control
115 shell behavior.
116
117 Bash was originally written by Brian Fox of the Free Software
118 Foundation.  The current developer and maintainer is Chet Ramey
119 of Case Western Reserve University.
120
121 A2)  What's the latest version?
122
123 The latest version is 2.03, first made available on Friday, 19 Feburary 1999.
124
125 A3)  Where can I get it?
126
127 Bash is the GNU project's shell, and so is available from the
128 master GNU archive site, ftp.gnu.org, and its mirrors.  The
129 latest version is also available for FTP from ftp.cwru.edu.
130 The following URLs tell how to get version 2.03:
131
132 ftp://ftp.gnu.org/pub/gnu/bash-2.03.tar.gz
133 ftp://ftp.cwru.edu/pub/bash/bash-2.03.tar.gz
134
135 Formatted versions of the documentation are available with the URLs:
136
137 ftp://ftp.gnu.org/pub/gnu/bash-doc-2.03.tar.gz
138 ftp://ftp.cwru.edu/pub/bash/bash-doc-2.03.tar.gz
139
140 A4)  On what machines will bash run?
141
142 Bash has been ported to nearly every version of UNIX.  All you
143 should have to do to build it on a machine for which a port
144 exists is to type `configure' and then `make'.  The build process
145 will attempt to discover the version of UNIX you have and tailor
146 itself accordingly, using a script created by GNU autoconf.
147
148 More information appears in the file `INSTALL' in the distribution.
149
150 A5) Will bash run on operating systems other than Unix?
151
152 Configuration specifics for Unix-like systems such as QNX and
153 LynxOS are included in the distribution.  Bash-2.03 should 
154 compile and run on Minix 2.0 (patches were contributed), but I
155 don't believe anyone has built bash-2.x on earlier Minix versions
156 yet.
157
158 Bash has been ported to versions of Windows implementing the Win32
159 programming interface.  This includes Windows 95 and Windows NT.
160 The port was done by Cygnus Solutions as part of their GNU-Win32
161 project.  For more information about the project, look at the URL
162
163 http://www.cygnus.com/misc/gnu-win32
164
165 Cygnus originally ported bash-1.14.7, and that port was part of their
166 early GNU-Win32 releases.  Cygnus has also done a port of bash-2.01 to the
167 GNU-Win32 environment, and it is available as part of their current
168 release.  (They may have upgraded by now.)
169
170 Bash-2.03 should require no local Cygnus changes to build and run under
171 GNU-WIN32.
172
173 The Cygnus port works only on Intel machines.  There is a port of bash
174 (I don't know which version) to the alpha/NT environment available from
175
176 ftp://ftp.gnustep.org//pub/win32/bash-alpha-nt-1.01.tar.gz
177
178 Softway Systems has ported bash-2.01 to their Interix (nee OpenNT)
179 system, a Unix subsystem for NT that replaces the Microsoft POSIX
180 subsystem.  Check out http://www.interix.com for more information.
181 Some support for Interix has been incorporated into bash, beginning
182 with Bash-2.03.  It should be easier to build bash on Interix now,
183 but Interix users should fetch
184
185 ftp://ftp.interix.com/pub/tw/unsup/bash.diffs.tar.gz
186
187 and read the README.OpenNT file in that archive.  It will detail the
188 arguments configure needs to build on Interix.  A configure cache
189 file for Interix is in the bash distribution in cross-build/opennt.cache;
190 copy that to `config.cache' before starting configure.
191
192 D. J. Delorie has ported bash-1.14.7 to run under MS-DOS, as part of
193 the DJGPP project.  For more information on the project, see
194
195 http://www.delorie.com/djgpp/
196
197 I picked up a binary of bash-1.14.7 that is purported to work with
198 the DJGPP V2 environment from
199
200 ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147b.zip
201
202 The corresponding source is
203
204 ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147s.zip
205
206 Ports of bash-1.12 and bash-2.0 are available for OS/2 from
207
208 ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash_112.zip
209 ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash-2.0(253).zip
210
211 I haven't looked at either, but the second appears to be a binary-only
212 distribution.  Beware.
213
214 A6) How can I build bash with gcc? 
215
216 Bash configures to use gcc by default if it is available.  Read the
217 file INSTALL in the distribution for more information.
218
219 A7)  How can I make bash my login shell?
220
221 Some machines let you use `chsh' to change your login shell.  Other
222 systems use `passwd -s' or `passwd -e'.  If one of these works for
223 you, that's all you need.  Note that many systems require the full
224 pathname to a shell to appear in /etc/shells before you can make it
225 your login shell.  For this, you may need the assistance of your
226 friendly local system administrator. 
227
228 If you cannot do this, you can still use bash as your login shell, but
229 you need to perform some tricks.  The basic idea is to add a command
230 to your login shell's startup file to replace your login shell with
231 bash.
232
233 For example, if your login shell is csh or tcsh, and you have installed
234 bash in /usr/gnu/bin/bash, add the following line to ~/.login:
235
236         if ( -f /usr/gnu/bin/bash ) exec /usr/gnu/bin/bash --login
237
238 (the `--login' tells bash that it is a login shell).
239
240 It's not a good idea to put this command into ~/.cshrc, because every
241 csh you run without the `-f' option, even ones started to run csh scripts,
242 reads that file.  If you must put the command in ~/.cshrc, use something
243 like
244
245         if ( $?prompt ) exec /usr/gnu/bin/bash --login
246
247 to ensure that bash is exec'd only when the csh is interactive.
248
249 If your login shell is sh or ksh, you have to do two things.
250
251 First, create an empty file in your home directory named `.bash_profile'.
252 The existence of this file will prevent the exec'd bash from trying to
253 read ~/.profile, and re-execing itself over and over again.  ~/.bash_profile
254 is the first file bash tries to read initialization commands from when
255 it is invoked as a login shell.
256
257 Next, add a line similar to the above to ~/.profile:
258
259         [ -f /usr/gnu/bin/bash ] && exec /usr/gnu/bin/bash --login
260
261 This will cause login shells to replace themselves with bash running as
262 a login shell.  Once you have this working, you can copy your initialization
263 code from ~/.profile to ~/.bash_profile.
264
265 A8) I just changed my login shell to bash, and now I can't FTP into my
266    machine.  Why not?
267
268 You must add the full pathname to bash to the file /etc/shells.  As
269 noted in the answer to the previous question, many systems require
270 this before you can make bash your login shell. 
271
272 Most versions of ftpd use this file to prohibit `special' users
273 such as `uucp' and `news' from using FTP. 
274
275 A9)  What's the `POSIX 1003.2 standard'?
276
277 POSIX is a name originally coined by Richard Stallman for a
278 family of open system standards based on UNIX.  There are a
279 number of aspects of UNIX under consideration for
280 standardization, from the basic system services at the system
281 call and C library level to applications and tools to system
282 administration and management.  Each area of standardization is
283 assigned to a working group in the 1003 series. 
284
285 The POSIX Shell and Utilities standard has been developed by IEEE
286 Working Group 1003.2 (POSIX.2).  It concentrates on the command
287 interpreter interface and utility programs commonly executed from
288 the command line or by other programs.  An initial version of the
289 standard has been approved and published by the IEEE, and work is
290 currently underway to update it. 
291
292 Bash is concerned with the aspects of the shell's behavior
293 defined by POSIX.2.  The shell command language has of course
294 been standardized, including the basic flow control and program
295 execution constructs, I/O redirection and pipelining, argument
296 handling, variable expansion, and quoting. 
297
298 The `special' builtins, which must be implemented as part of the
299 shell to provide the desired functionality, are specified as
300 being part of the shell; examples of these are `eval' and
301 `export'.  Other utilities appear in the sections of POSIX.2 not
302 devoted to the shell which are commonly (and in some cases must
303 be) implemented as builtin commands, such as `read' and `test'. 
304 POSIX.2 also specifies aspects of the shell's interactive
305 behavior as part of the UPE, including job control and command
306 line editing.  Only vi-style line editing commands have been
307 standardized; emacs editing commands were left out due to
308 objections.
309
310 A10)  What is the bash `posix mode'?
311
312 Although bash is an implementation of the POSIX.2 shell
313 specification, there are areas where the bash default behavior
314 differs from that spec.  The bash `posix mode' changes the bash
315 behavior in these areas so that it obeys the spec more closely. 
316
317 Posix mode is entered by starting bash with the --posix option or
318 executing `set -o posix' after bash is running.
319
320 The specific aspects of bash which change when posix mode is
321 active are listed in the file CWRU/POSIX.NOTES in the bash
322 distribution.  They are also listed in a section in the Bash
323 Reference Manual.
324
325 Section B:  The latest version
326
327 B1) What's new in version 2.03?
328
329 Bash-2.03 has a very few new features, in keeping with the convention
330 that odd-numbered releases provide mainly bug fixes.  A number of new
331 features were added to Readline, mostly at the request of the Cygnus
332 folks.
333
334 a new shopt option, `restricted_shell', so that startup files can test
335         whether or not the shell was started in restricted mode
336 filename generation is now performed on the words between ( and ) in
337         compound array assignments (this is really a bug fix)
338 OLDPWD is now auto-exported, as POSIX.2 requires
339 ENV and BASH_ENV are read-only variables in a restricted shell
340 Bash may now be linked against an already-installed Readline library,
341         as long as the Readline library is version 4 or newer
342 All shells begun with the `--login' option will source the login shell
343         startup files, even if the shell is not interactive
344
345 There are lots of changes to the version of the Readline library released
346 along with Bash-2.03.  For a complete list of the changes, read the file
347 CHANGES in the Bash-2.03 distribution.
348
349 Bash-2.02 contained the following new features:
350
351 a new version of malloc (based on the old GNU malloc code in previous
352         bash versions) that is more page-oriented, more conservative
353         with memory usage, does not `orphan' large blocks when they
354         are freed, is usable on 64-bit machines, and has allocation
355         checking turned on unconditionally
356 POSIX.2-style globbing character classes ([:alpha:], [:alnum:], etc.)
357 POSIX.2-style globbing equivalence classes
358 POSIX.2-style globbing collating symbols
359 the ksh [[...]] extended conditional command
360 the ksh egrep-style extended pattern matching operators
361 a new `printf' builtin
362 the ksh-like $(<filename) command substitution, which is equivalent to
363         $(cat filename)
364 new tilde prefixes that expand to directories from the directory stack
365 new `**' arithmetic operator to do exponentiation
366 case-insensitive globbing (filename expansion)
367 menu completion a la tcsh
368 `magic-space' history expansion function like tcsh
369 the readline inputrc `language' has a new file inclusion directive ($include)
370
371 Bash-2.01 contained only a few new features:
372
373 new `GROUPS' builtin array variable containing the user's group list
374 new bindable readline commands: history-and-alias-expand-line and
375         alias-expand-line
376
377 Bash-2.0 contained extensive changes and new features from bash-1.14.7.
378 Here's a short list:
379
380 new `time' reserved word to time pipelines, shell builtins, and
381         shell functions
382 one-dimensional arrays with a new compound assignment statement,
383         appropriate expansion constructs and modifications to some
384         of the builtins (read, declare, etc.) to use them
385 new quoting syntaxes for ANSI-C string expansion and locale-specific
386         string translation
387 new expansions to do substring extraction, pattern replacement, and
388         indirect variable expansion
389 new builtins: `disown' and `shopt'
390 new variables: HISTIGNORE, SHELLOPTS, PIPESTATUS, DIRSTACK, GLOBIGNORE,
391                MACHTYPE, BASH_VERSINFO
392 special handling of many unused or redundant variables removed
393         (e.g., $notify, $glob_dot_filenames, $no_exit_on_failed_exec)
394 dynamic loading of new builtin commands; many loadable examples provided
395 new prompt expansions: \a, \e, \n, \H, \T, \@, \v, \V
396 history and aliases available in shell scripts
397 new readline variables: enable-keypad, mark-directories, input-meta,
398         visible-stats, disable-completion, comment-begin
399 new readline commands to manipulate the mark and operate on the region
400 new readline emacs mode commands and bindings for ksh-88 compatibility
401 updated and extended builtins
402 new DEBUG trap
403 expanded (and now documented) restricted shell mode
404
405 implementation stuff:   
406 autoconf-based configuration
407 nearly all of the bugs reported since version 1.14 have been fixed
408 most builtins converted to use builtin `getopt' for consistency
409 most builtins use -p option to display output in a reusable form
410         (for consistency)
411 grammar tighter and smaller (66 reduce-reduce conflicts gone)
412 lots of code now smaller and faster
413 test suite greatly expanded
414
415 B2) Are there any user-visible incompatibilities between bash-2.03 and
416     bash-1.14.7?
417
418 There are a few incompatibilities between version 1.14.7 and version 2.03.
419 They are detailed in the file COMPAT in the bash-2.03 distribution.
420
421 Section C:  Differences from other Unix shells
422
423 C1) How does bash differ from sh, the Bourne shell?
424
425 This is a non-comprehensive list of features that differentiate bash
426 from the SVR4.2 shell.  The bash manual page explains these more
427 completely.
428
429 Things bash has that sh does not:
430         long invocation options
431         `!' reserved word to invert pipeline return value
432         `time' reserved word to time pipelines and shell builtins
433         the `function' reserved word
434         the select compound command and reserved word
435         new $'...' and $"..." quoting
436         the $(...) form of command substitution
437         the $(<filename) form of command substitution, equivalent to
438                 $(cat filename)
439         the ${#param} parameter value length operator
440         the ${!param} indirect parameter expansion operator
441         the ${param:length[:offset]} parameter substring operator
442         the ${param/pat[/string]} parameter pattern substitution operator
443         expansions to perform substring removal (${p%[%]w}, ${p#[#]w})
444         expansion of positional parameters beyond $9 with ${num}
445         variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, REPLY,
446                    TIMEFORMAT, PPID, PWD, OLDPWD, SHLVL, RANDOM, SECONDS,
447                    LINENO, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE, HOSTNAME,
448                    ENV, PS3, PS4, DIRSTACK, PIPESTATUS, HISTSIZE, HISTFILE,
449                    HISTFILESIZE, HISTCONTROL, HISTIGNORE, GLOBIGNORE, GROUPS,
450                    PROMPT_COMMAND, FCEDIT, FIGNORE, IGNOREEOF, INPUTRC,
451                    SHELLOPTS, OPTERR, HOSTFILE, TMOUT, histchars, auto_resume
452         DEBUG trap
453         variable arrays with new compound assignment syntax
454         redirections: <>, &>, >|
455         prompt string special char translation and variable expansion
456         auto-export of modified values of variables in initial environment
457         command search finds functions before builtins
458         bash return builtin will exit a file sourced with `.'
459         builtins: cd -/-L/-P, exec -l/-c/-a, echo -e/-E, hash -p.
460                   export -n/-f/-p/name=value, pwd -L/-P, read -e/-p/-a,
461                   readonly -a/-f/name=value, trap -l, set +o,
462                   set -b/-m/-o option/-h/-p/-B/-C/-H/-P,
463                   unset -f/-v, ulimit -m/-p/-u,
464                   type -a/-p/-t, suspend -f, kill -n,
465                   test -o optname/s1 == s2/s1 < s2/s1 > s2/-nt/-ot/-ef/-O/-G/-S
466         bash reads ~/.bashrc for interactive shells, $ENV for non-interactive
467         bash restricted shell mode is more extensive
468         bash allows functions and variables with the same name
469         brace expansion
470         tilde expansion
471         arithmetic expansion with $((...)) and `let' builtin
472         the `[[...]]' extended conditional command
473         process substitution
474         aliases and alias/unalias builtins
475         local variables in functions and `local' builtin
476         readline and command-line editing
477         command history and history/fc builtins
478         csh-like history expansion
479         other new bash builtins: bind, command, builtin, declare/typeset,
480                                  dirs, enable, fc, help, history, logout,
481                                  popd, pushd, disown, shopt, printf
482         exported functions
483         filename generation when using output redirection (command >a*)
484         POSIX.2-style globbing character classes
485         POSIX.2-style globbing equivalence classes
486         POSIX.2-style globbing collating symbols
487         egrep-like extended pattern matching operators
488         case-insensitive pattern matching and globbing
489         variable assignments preceding commands affect only that command,
490                 even for builtins and functions
491         posix mode
492
493 Things sh has that bash does not:
494         uses variable SHACCT to do shell accounting
495         includes `stop' builtin (bash can use alias stop='kill -s STOP')
496         `newgrp' builtin
497         turns on job control if called as `jsh'
498         $TIMEOUT (like bash $TMOUT)
499         `^' is a synonym for `|'
500         new SVR4.2 sh builtins: mldmode, priv
501
502 Implementation differences:
503         redirection to/from compound commands causes sh to create a subshell
504         bash does not allow unbalanced quotes; sh silently inserts them at EOF
505         bash does not mess with signal 11
506         sh sets (euid, egid) to (uid, gid) if -p not supplied and uid < 100
507         bash splits only the results of expansions on IFS, using POSIX.2
508                 field splitting rules; sh splits all words on IFS
509         sh does not allow MAILCHECK to be unset (?)
510         sh does not allow traps on SIGALRM or SIGCHLD
511         bash allows multiple option arguments when invoked (e.g. -x -v);
512                 sh allows only a single option argument (`sh -x -v' attempts
513                 to open a file named `-v', and, on SunOS 4.1.4, dumps core.
514                 On Solaris 2.4 and earlier versions, sh goes into an infinite
515                 loop.)
516         sh exits a script if any builtin fails; bash exits only if one of
517                 the POSIX.2 `special' builtins fails
518
519 C2)  How does bash differ from the Korn shell, version ksh88?
520
521 Things bash has or uses that ksh88 does not:
522         long invocation options
523         `!' reserved word
524         posix mode and posix conformance
525         command hashing
526         tilde expansion for assignment statements that look like $PATH
527         process substitution with named pipes if /dev/fd is not available
528         the ${!param} indirect parameter expansion operator
529         the ${param:length[:offset]} parameter substring operator
530         the ${param/pat[/string]} parameter pattern substitution operator
531         variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, SHLVL,
532                    TIMEFORMAT, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE,
533                    HISTFILESIZE, HISTIGNORE, HISTCONTROL, PROMPT_COMMAND,
534                    IGNOREEOF, FIGNORE, INPUTRC, HOSTFILE, DIRSTACK,
535                    PIPESTATUS, HOSTNAME, OPTERR, SHELLOPTS, GLOBIGNORE,
536                    GROUPS, histchars, auto_resume
537         prompt expansion with backslash escapes and command substitution
538         redirection: &> (stdout and stderr)
539         more extensive and extensible editing and completion
540         builtins: bind, builtin, command, declare, dirs, echo -e/-E, enable,
541                   exec -l/-c/-a, fc -s, export -n/-f/-p, hash, help, history,
542                   jobs -x/-r/-s, kill -s/-n/-l, local, logout, popd, pushd,
543                   read -e/-p/-a, readonly -a/-n/-f/-p, set -o braceexpand/
544                   -o histexpand/-o interactive-comments/-o notify/-o physical/
545                   -o posix/-o hashall/-o onecmd/-h/-B/-C/-b/-H/-P, set +o,
546                   suspend, trap -l, type, typeset -a/-F/-p, ulimit -u,
547                   umask -S, alias -p, shopt, disown, printf
548         `!' csh-style history expansion
549         POSIX.2-style globbing character classes
550         POSIX.2-style globbing equivalence classes
551         POSIX.2-style globbing collating symbols
552         egrep-like extended pattern matching operators
553         case-insensitive pattern matching and globbing
554         `**' arithmetic operator to do exponentiation
555
556 Things ksh88 has or uses that bash does not:
557         tracked aliases
558         variables: ERRNO, FPATH, COLUMNS, LINES, EDITOR, VISUAL
559         co-processes (|&, >&p, <&p)
560         weirdly-scoped functions
561         typeset +f to list all function names without definitions
562         text of command history kept in a file, not memory
563         builtins: alias -x, cd old new, fc -e -, newgrp, print,
564                   read -p/-s/-u/var?prompt, set -A/-o gmacs/
565                   -o bgnice/-o markdirs/-o nolog/-o trackall/-o viraw/-s,
566                   typeset -H/-L/-R/-A/-ft/-fu/-fx/-l/-u/-t, whence
567
568 Implementation differences:
569         ksh runs last command of a pipeline in parent shell context
570         bash has brace expansion by default (ksh88 compile-time option)
571         bash has fixed startup file for all interactive shells; ksh reads $ENV
572         bash has exported functions
573         bash command search finds functions before builtins
574
575 C3)  Which new features in ksh-93 are not in bash, and which are?
576
577 New things in ksh-93 not in bash-2.03:
578         associative arrays
579         floating point arithmetic
580         ++, --, comma arithmetic operators
581         math library functions
582         ${!name[sub]} name of subscript for associative array
583         ${!prefix*} and {!prefix@} variable name prefix expansions
584         `.' is allowed in variable names to create a hierarchical namespace
585         more extensive compound assignment syntax
586         discipline functions
587         `sleep' and `getconf' builtins (bash has loadable versions)
588         typeset -n and `nameref' variables
589         KEYBD trap
590         variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, HISTEDIT,
591                    .sh.version, .sh.name, .sh.subscript, .sh.value
592         backreferences in pattern matching
593         print -f (bash has a loadable version of print and the printf builtin)
594         `fc' has been renamed to `hist'
595         read -t/-d
596         `.' can execute shell functions
597
598 New things in ksh-93 present in bash-2.03:
599         ?: arithmetic operator
600         expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]}
601         compound array assignment
602         the `!' reserved word
603         loadable builtins -- but ksh uses `builtin' while bash uses `enable'
604         `command', `builtin', `disown' builtins
605         new $'...' and $"..." quoting
606         FIGNORE (but bash uses GLOBIGNORE), HISTCMD
607         set -o notify/-C
608         changes to kill builtin
609         read -A (bash uses read -a)
610         trap -p
611         exec -c/-a
612         `.' restores the positional parameters when it completes
613         POSIX.2 `test'
614         umask -S
615         unalias -a
616         command and arithmetic substitution performed on PS1, PS4, and ENV
617         command name completion
618         ENV processed only for interactive shells
619
620 Section D:  Why does bash do some things differently than other Unix shells?
621
622 D1) Why does bash run a different version of `command' than
623     `which command' says it will?
624
625 On many systems, `which' is actually a csh script that assumes
626 you're running csh.  In tcsh, `which' and its cousin `where'
627 are builtins.  On other Unix systems, `which' is a perl script
628 that uses the PATH environment variable.
629
630 The csh script version reads the csh startup files from your
631 home directory and uses those to determine which `command' will
632 be invoked.  Since bash doesn't use any of those startup files,
633 there's a good chance that your bash environment differs from
634 your csh environment.  The bash `type' builtin does everything
635 `which' does, and will report correct results for the running
636 shell.  If you're really wedded to the name `which', try adding
637 the following function definition to your .bashrc:
638
639         which()
640         {
641                 builtin type -p "$@"
642         }
643
644 If you're moving from tcsh and would like to bring `where' along
645 as well, use this function:
646
647         where()
648         {
649                 builtin type -a "$@"
650         }
651
652 D2) Why doesn't bash treat brace expansions exactly like csh?
653
654 The only difference between bash and csh brace expansion is that
655 bash requires a brace expression to contain at least one unquoted
656 comma if it is to be expanded.  Any brace-surrounded word not
657 containing an unquoted comma is left unchanged by the brace
658 expansion code.  This affords the greatest degree of sh
659 compatibility. 
660
661 Bash, ksh, zsh, and pd-ksh all implement brace expansion this way. 
662
663 D3) Why doesn't bash have csh variable modifiers?
664
665 Posix has specified a more powerful, albeit somewhat more cryptic,
666 mechanism cribbed from ksh, and bash implements it.
667
668 ${parameter%word}
669         Remove smallest suffix pattern.  The WORD is expanded to produce
670         a pattern.  It then expands to the value of PARAMETER, with the
671         smallest portion of the suffix matched by the pattern deleted.
672
673         x=file.c
674         echo ${x%.c}.o
675         -->file.o
676
677 ${parameter%%word}
678
679         Remove largest suffix pattern.  The WORD is expanded to produce
680         a pattern.  It then expands to the value of PARAMETER, with the
681         largest portion of the suffix matched by the pattern deleted.
682
683         x=posix/src/std
684         echo ${x%%/*}
685         -->posix
686
687 ${parameter#word}
688         Remove smallest prefix pattern.  The WORD is expanded to produce
689         a pattern.  It then expands to the value of PARAMETER, with the
690         smallest portion of the prefix matched by the pattern deleted.
691
692         x=$HOME/src/cmd
693         echo ${x#$HOME}
694         -->/src/cmd
695
696 ${parameter##word}
697         Remove largest prefix pattern.  The WORD is expanded to produce
698         a pattern.  It then expands to the value of PARAMETER, with the
699         largest portion of the prefix matched by the pattern deleted.
700
701         x=/one/two/three
702         echo ${x##*/}
703         -->three
704
705
706 Given
707         a=/a/b/c/d
708         b=b.xxx
709
710         csh                     bash            result
711         ---                     ----            ------
712         $a:h                    ${a%/*}            /a/b/c
713         $a:t                    ${a##*/}           d
714         $b:r                    ${b%.*}            b
715         $b:e                    ${b##*.}           xxx
716
717
718 D4) How can I make my csh aliases work when I convert to bash?
719
720 Bash uses a different syntax to support aliases than csh does. 
721 The details can be found in the documentation.  We have provided
722 a shell script which does most of the work of conversion for you;
723 this script can be found in ./examples/misc/alias-conv.sh.  Here is
724 how you use it:
725   
726 Start csh in the normal way for you.  (e.g., `csh')
727   
728 Pipe the output of `alias' through `alias-conv.sh', saving the
729 results into `bash_aliases':
730   
731         alias | alias-conv.sh >bash_aliases
732   
733 Edit `bash_aliases', carefully reading through any created
734 functions.  You will need to change the names of some csh specific
735 variables to the bash equivalents.  The script converts $cwd to
736 $PWD, $term to $TERM, $home to $HOME, $user to $USER, and $prompt
737 to $PS1.  You may also have to add quotes to avoid unwanted
738 expansion.
739
740 For example, the csh alias:
741   
742         alias cd 'cd \!*; echo $cwd'
743   
744 is converted to the bash function:
745
746         cd () { command cd "$@"; echo $PWD ; }
747
748 The only thing that needs to be done is to quote $PWD:
749   
750         cd () { command cd "$@"; echo "$PWD" ; }
751   
752 Merge the edited file into your ~/.bashrc.
753
754 There is an additional, more ambitious, script in
755 examples/misc/cshtobash that attempts to convert your entire csh
756 environment to its bash equivalent.  This script can be run as
757 simply `cshtobash' to convert your normal interactive
758 environment, or as `cshtobash ~/.login' to convert your login
759 environment. 
760
761 D5) How can I pipe standard output and standard error from one command to
762     another, like csh does with `|&'?
763
764 Use
765         command 2>&1 | command2
766
767 The key is to remember that piping is performed before redirection, so
768 file descriptor 1 points to the pipe when it is duplicated onto file
769 descriptor 2.
770
771 D6) Now that I've converted from ksh to bash, are there equivalents to
772     ksh features like autoloaded functions and the `whence' command?
773
774 There are features in ksh-88 that do not have direct bash equivalents.
775 Most, however, can be emulated with very little trouble.
776
777 ksh-88 feature          Bash equivalent
778 --------------          ---------------
779 compiled-in aliases     set up aliases in .bashrc; some ksh aliases are
780                         bash builtins (hash, history, type)
781 coprocesses             named pipe pairs (one for read, one for write)
782 typeset +f              declare -F
783 cd, print, whence       function substitutes in examples/functions/kshenv
784 autoloaded functions    examples/functions/autoload is the same as typeset -fu
785 read var?prompt         read -p prompt var
786
787 Section E:  How can I get bash to do certain things, and why does bash do
788             things the way it does?
789
790 E1) Why is the bash builtin `test' slightly different from /bin/test?
791
792 The specific example used here is [ ! x -o x ], which is false.
793
794 Bash's builtin `test' implements the Posix.2 spec, which can be
795 summarized as follows (the wording is due to David Korn):
796    
797 Here is the set of rules for processing test arguments.
798   
799     0 Args: False
800     1 Arg:  True iff argument is not null.
801     2 Args: If first arg is !, True iff second argument is null.
802             If first argument is unary, then true if unary test is true
803             Otherwise error.
804     3 Args: If second argument is a binary operator, do binary test of $1 $3
805             If first argument is !, negate two argument test of $2 $3
806             If first argument is `(' and third argument is `)', do the
807             one-argument test of the second argument.
808             Otherwise error.
809     4 Args: If first argument is !, negate three argument test of $2 $3 $4.
810             Otherwise unspecified
811     5 or more Args: unspecified.  (Historical shells would use their
812     current algorithm).
813    
814 The operators -a and -o are considered binary operators for the purpose
815 of the 3 Arg case.
816    
817 As you can see, the test becomes (not (x or x)), which is false.
818
819 E2) Why does bash sometimes say `Broken pipe'?
820
821 If a sequence of commands appears in a pipeline, and one of the
822 reading commands finishes before the writer has finished, the
823 writer receives a SIGPIPE signal.  Many other shells special-case
824 SIGPIPE as an exit status in the pipeline and do not report it. 
825 For example, in:
826   
827       ps -aux | head
828   
829 `head' can finish before `ps' writes all of its output, and ps
830 will try to write on a pipe without a reader.  In that case, bash
831 will print `Broken pipe' to stderr when ps is killed by a
832 SIGPIPE. 
833
834 You can build a version of bash that will not report SIGPIPE errors
835 by uncommenting the definition of DONT_REPORT_SIGPIPE in the file
836 config-top.h.
837
838 E3) How can I get bash to read and display eight-bit characters?
839
840 This is a process requiring several steps.
841
842 First, you must ensure that the `physical' data path is a full eight
843 bits.  For xterms, for example, the `vt100' resources `eightBitInput'
844 and `eightBitOutput' should be set to `true'.
845
846 Once you have set up an eight-bit path, you must tell the kernel and
847 tty driver to leave the eighth bit of characters alone when processing
848 keyboard input.  Use `stty' to do this:
849
850         stty cs8 -istrip -parenb
851
852 For old BSD-style systems, you can use
853
854         stty pass8
855
856 You may also need
857
858         stty even odd
859
860 Finally, you need to tell readline that you will be inputting and
861 displaying eight-bit characters.  You use readline variables to do
862 this.  These variables can be set in your .inputrc or using the bash
863 `bind' builtin.  Here's an example using `bind':
864
865         bash$ bind 'set convert-meta off'
866         bash$ bind 'set meta-flag on'
867         bash$ bind 'set output-meta on'
868
869 The `set' commands between the single quotes may also be placed
870 in ~/.inputrc.
871
872 E4) How do I write a function `x' to replace builtin command `x', but
873     still invoke the command from within the function?
874
875 This is why the `command' and `builtin' builtins exist.  The
876 `command' builtin executes the command supplied as its first
877 argument, skipping over any function defined with that name.  The
878 `builtin' builtin executes the builtin command given as its first
879 argument directly. 
880
881 For example, to write a function to replace `cd' that writes the
882 hostname and current directory to an xterm title bar, use
883 something like the following:
884
885         cd()
886         {
887                 builtin cd "$@" && xtitle "$HOST: $PWD"
888         }
889
890 This could also be written using `command' instead of `builtin';
891 the version above is marginally more efficient. 
892
893 E5) When I have terminal escape sequences in my prompt, why does bash
894     wrap lines at the wrong column?
895
896 Readline, the line editing library that bash uses, does not know
897 that the terminal escape sequences do not take up space on the
898 screen.  The redisplay code assumes, unless told otherwise, that
899 each character in the prompt is a `printable' character that
900 takes up one character position on the screen. 
901
902 You can use the bash prompt expansion facility (see the PROMPTING
903 section in the manual page) to tell readline that sequences of
904 characters in the prompt strings take up no screen space. 
905
906 Use the \[ escape to begin a sequence of non-printing characters,
907 and the \] escape to signal the end of such a sequence. 
908
909 E6) How can I find the value of a shell variable whose name is the value
910     of another shell variable?
911
912 Versions of Bash newer than Bash-2.0 support this directly.  You can use 
913
914         ${!var}
915
916 For example, the following sequence of commands will echo `z':
917
918         var1=var2
919         var2=z
920         echo ${!var1}
921
922 For sh compatibility, use the `eval' builtin.  The important
923 thing to remember is that `eval' expands the arguments you give
924 it again, so you need to quote the parts of the arguments that
925 you want `eval' to act on. 
926
927 For example, this expression prints the value of the last positional
928 parameter:
929
930         eval echo \"\$\{$#\}\"
931
932 The expansion of the quoted portions of this expression will be
933 deferred until `eval' runs, while the `$#' will be expanded
934 before `eval' is executed.  In versions of bash later than bash-2.0,
935
936         echo ${!#}
937
938 does the same thing.
939
940 E7) If I pipe the output of a command into `read variable', why doesn't
941     the output show up in $variable when the read command finishes?
942
943 This has to do with the parent-child relationship between Unix
944 processes. 
945
946 Each element of a pipeline runs in a separate process, a child of
947 the shell running the pipeline.  A subprocess cannot affect its
948 parent's environment.  When the `read' command sets the variable
949 to the input, that variable is set only in the subshell, not the
950 parent shell.  When the subshell exits, the value of the variable
951 is lost. 
952
953 Many pipelines that end with `read variable' can be converted
954 into command substitutions, which will capture the output of
955 a specified command.  The output can then be assigned to a
956 variable:
957
958         grep ^gnu /usr/lib/news/active | wc -l | read ngroup
959
960 can be converted into
961
962         ngroup=$(grep ^gnu /usr/lib/news/active | wc -l)
963
964 This does not, unfortunately, work to split the text among
965 multiple variables, as read does when given multiple variable
966 arguments.  If you need to do this, you can either use the
967 command substitution above to read the output into a variable
968 and chop up the variable using the bash pattern removal
969 expansion operators or use some variant of the following
970 approach.
971
972 Say /usr/local/bin/ipaddr is the following shell script:
973
974 #! /bin/sh
975 host `hostname` | awk '/address/ {print $NF}'
976
977 Instead of using
978
979         /usr/local/bin/ipaddr | read A B C D
980
981 to break the local machine's IP address into separate octets, use
982
983         OIFS="$IFS"
984         IFS=.
985         set -- $(/usr/local/bin/ipaddr)
986         IFS="$OIFS"
987         A="$1" B="$2" C="$3" D="$4"
988
989 Beware, however, that this will change the shell's positional
990 parameters.  If you need them, you should save them before doing
991 this.
992
993 This is the general approach -- in most cases you will not need to
994 set $IFS to a different value.
995
996 E8) I have a bunch of shell scripts that use backslash-escaped characters
997     in arguments to `echo'.  Bash doesn't interpret these characters.  Why
998     not, and how can I make it understand them?
999
1000 This is the behavior of echo on most Unix System V machines.
1001
1002 The bash builtin `echo' is modelled after the 9th Edition
1003 Research Unix version of `echo'.  It does not interpret
1004 backslash-escaped characters in its argument strings by default;
1005 it requires the use of the -e option to enable the
1006 interpretation.  The System V echo provides no way to disable the
1007 special characters; the bash echo has a -E option to disable
1008 them. 
1009
1010 There is a configuration option that will make bash behave like
1011 the System V echo and interpret things like `\t' by default.  Run
1012 configure with the --enable-usg-echo-default option to turn this
1013 on.  Be aware that this will cause some of the tests run when you
1014 type `make tests' to fail.
1015
1016 E9) Why doesn't a while or for loop get suspended when I type ^Z?
1017
1018 This is a consequence of how job control works on Unix.  The only
1019 thing that can be suspended is the process group.  This is a single
1020 command or pipeline of commands that the shell forks and executes.
1021
1022 When you run a while or for loop, the only thing that the shell forks
1023 and executes are any commands in the while loop test and commands in
1024 the loop bodies.  These, therefore, are the only things that can be
1025 suspended when you type ^Z.
1026
1027 If you want to be able to stop the entire loop, you need to put it
1028 within parentheses, which will force the loop into a subshell that
1029 may be stopped (and subsequently restarted) as a single unit.
1030
1031 E10) How can I make the bash `time' reserved word print timing output that
1032      looks like the output from my system's /usr/bin/time?
1033
1034 The bash command timing code looks for a variable `TIMEFORMAT' and
1035 uses its value as a format string to decide how to display the
1036 timing statistics.
1037
1038 The value of TIMEFORMAT is a string with `%' escapes expanded in a
1039 fashion similar in spirit to printf(3).  The manual page explains
1040 the meanings of the escape sequences in the format string.
1041
1042 If TIMEFORMAT is not set, bash acts as if the following assignment had
1043 been performed:
1044
1045         TIMEFORMAT=$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'
1046
1047 The POSIX.2 default time format (used by `time -p command') is
1048
1049         TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S'
1050
1051 The BSD /usr/bin/time format can be emulated with:
1052
1053         TIMEFORMAT=$'\t%1R real\t%1U user\t%1S sys'
1054
1055 The System V /usr/bin/time format can be emulated with:
1056
1057         TIMEFORMAT=$'\nreal\t%1R\nuser\t%1U\nsys\t%1S'
1058
1059 The ksh format can be emulated with:
1060
1061         TIMEFORMAT=$'\nreal\t%2lR\nuser\t%2lU\nsys\t%2lS'
1062
1063 Section F:  Things to watch out for on certain Unix versions
1064
1065 F1) Why can't I use command line editing in my `cmdtool'?
1066
1067 The problem is `cmdtool' and bash fighting over the input.  When
1068 scrolling is enabled in a cmdtool window, cmdtool puts the tty in
1069 `raw mode' to permit command-line editing using the mouse for
1070 applications that cannot do it themselves.  As a result, bash and
1071 cmdtool each try to read keyboard input immediately, with neither
1072 getting enough of it to be useful.
1073
1074 This mode also causes cmdtool to not implement many of the
1075 terminal functions and control sequences appearing in the
1076 `sun-cmd' termcap entry.  For a more complete explanation, see
1077 that file examples/suncmd.termcap in the bash distribution. 
1078
1079 `xterm' is a better choice, and gets along with bash much more
1080 smoothly.
1081
1082 If you must use cmdtool, you can use the termcap description in
1083 examples/suncmd.termcap.  Set the TERMCAP variable to the terminal
1084 description contained in that file, i.e.
1085
1086 TERMCAP='Mu|sun-cmd:am:bs:km:pt:li#34:co#80:cl=^L:ce=\E[K:cd=\E[J:rs=\E[s:'
1087
1088 Then export TERMCAP and start a new cmdtool window from that shell.
1089 The bash command-line editing should behave better in the new
1090 cmdtool.  If this works, you can put the assignment to TERMCAP
1091 in your bashrc file.
1092
1093 F2) I built bash on Solaris 2.  Why do globbing expansions and filename
1094     completion chop off the first few characters of each filename?
1095
1096 This is the consequence of building bash on SunOS 5 and linking
1097 with the libraries in /usr/ucblib, but using the definitions
1098 and structures from files in /usr/include. 
1099
1100 The actual conflict is between the dirent structure in
1101 /usr/include/dirent.h and the struct returned by the version of
1102 `readdir' in libucb.a (a 4.3-BSD style `struct direct'). 
1103
1104 Make sure you've got /usr/ccs/bin ahead of /usr/ucb in your $PATH
1105 when configuring and building bash.  This will ensure that you
1106 use /usr/ccs/bin/cc or acc instead of /usr/ucb/cc and that you
1107 link with libc before libucb. 
1108
1109 If you have installed the Sun C compiler, you may also need to
1110 put /usr/ccs/bin and /opt/SUNWspro/bin into your $PATH before
1111 /usr/ucb.
1112
1113 F3) Why does bash dump core after I interrupt username completion or
1114     `~user' tilde expansion on a machine running NIS?
1115
1116 This is a famous and long-standing bug in the SunOS YP (sorry, NIS)
1117 client library, which is part of libc.
1118
1119 The YP library code keeps static state -- a pointer into the data
1120 returned from the server.  When YP initializes itself (setpwent),
1121 it looks at this pointer and calls free on it if it's non-null. 
1122 So far, so good. 
1123
1124 If one of the YP functions is interrupted during getpwent (the
1125 exact function is interpretwithsave()), and returns NULL, the
1126 pointer is freed without being reset to NULL, and the function
1127 returns.  The next time getpwent is called, it sees that this
1128 pointer is non-null, calls free, and the bash free() blows up
1129 because it's being asked to free freed memory. 
1130
1131 The traditional Unix mallocs allow memory to be freed multiple
1132 times; that's probably why this has never been fixed.  You can
1133 run configure with the `--without-gnu-malloc' option to use
1134 the C library malloc and avoid the problem.
1135
1136 F4) I'm running SVR4.2.  Why is the line erased every time I type `@'?
1137
1138 The `@' character is the default `line kill' character in most
1139 versions of System V, including SVR4.2.  You can change this
1140 character to whatever you want using `stty'.  For example, to
1141 change the line kill character to control-u, type
1142
1143         stty kill ^U
1144
1145 where the `^' and `U' can be two separate characters.
1146
1147 F5) Why does bash report syntax errors when my C News scripts use a
1148     redirection before a subshell command?
1149
1150 The actual command in question is something like
1151
1152         < file ( command )
1153
1154 According to the grammar given in the POSIX.2 standard, this construct
1155 is, in fact, a syntax error.  Redirections may only precede `simple
1156 commands'.  A subshell construct such as the above is one of the shell's
1157 `compound commands'.  A redirection may only follow a compound command.
1158
1159 The file CWRU/sh-redir-hack in the bash-2.03 distribution is an
1160 (unofficial) patch to parse.y that will modify the grammar to
1161 support this construct.  It will not apply with `patch'; you must
1162 modify parse.y by hand.  Note that if you apply this, you must
1163 recompile with -DREDIRECTION_HACK.  This introduces a large
1164 number of reduce/reduce conflicts into the shell grammar. 
1165
1166 Section G:  Where do I go from here?
1167
1168 G1) How do I report bugs in bash, and where should I look for fixes and
1169     advice?
1170
1171 Use the `bashbug' script to report bugs.  It is built and
1172 installed at the same time as bash.  It provides a standard
1173 template for reporting a problem and automatically includes
1174 information about your configuration and build environment. 
1175
1176 `bashbug' sends its reports to bug-bash@gnu.org, which
1177 is a large mailing list gatewayed to the usenet newsgroup gnu.bash.bug. 
1178
1179 Bug fixes, answers to questions, and announcements of new releases
1180 are all posted to gnu.bash.bug.  Discussions concerning bash features
1181 and problems also take place there.
1182
1183 To reach the bash maintainers directly, send mail to
1184 bash-maintainers@gnu.org.
1185
1186 G2) What kind of bash documentation is there?
1187
1188 First, look in the doc directory in the bash distribution.  It should
1189 contain at least the following files:
1190
1191 bash.1          an extensive, thorough Unix-style manual page
1192 builtins.1      a manual page covering just bash builtin commands
1193 bashref.texi    a reference manual in GNU tex`info format
1194 bashref.info    an info version of the reference manual
1195 FAQ             this file
1196 article.ms      text of an article written for The Linux Journal
1197 readline.3      a man page describing readline
1198
1199 Postscript, HTML, and ASCII files created from the above source are
1200 available in the documentation distribution.
1201
1202 There is additional documentation available for anonymous FTP from host
1203 ftp.cwru.edu in the `pub/bash' directory.
1204
1205 Cameron Newham and Bill Rosenblatt have written a book on bash, published
1206 by O'Reilly and Associates.  The book is based on Bill Rosenblatt's Korn
1207 Shell book.  The title is ``Learning the Bash Shell'', and the ISBN number
1208 is 1-56592-147-X.  Look for it in fine bookstores near you.  This book
1209 covers bash-1.14, but has an appendix describing some of the new features
1210 in bash-2.0.  
1211
1212 A second edition of this book is available, published in January, 1998.
1213 The ISBN number is 1-56592-347-2.  Look for it in the same fine bookstores
1214 or on the web.
1215
1216 G3) What's coming in future versions?
1217
1218 These are features I plan to include in a future version of bash.
1219
1220 a bash debugger (a minimally-tested version is included with bash-2.02)
1221 Programmable completion a la zsh/tcsh
1222
1223 G4) What's on the bash `wish list' for future versions?
1224
1225 These are features that may or may not appear in a future version of bash.
1226
1227 associative arrays (not really all that hard)
1228 breaking some of the shell functionality into embeddable libraries
1229 better internationalization using GNU `gettext'
1230 an option to use external files for the long `help' text
1231 timeouts for the `read' builtin
1232 the ksh-93 ${!prefix*} and ${!prefix@} operators
1233 arithmetic ++ and -- prefix and postfix operators
1234 date-stamped command history
1235 a way to bind readline editing key sequences to shell commands
1236 a mechanism to open network connections and assign them to file descriptors
1237         using redirection (like ksh /dev/{tcp,udp})
1238
1239 G5) When will the next release appear?
1240
1241 The next version will appear sometime in 1999.  Never make
1242 predictions. 
1243
1244
1245 This document is Copyright 1995-1999 by Chester Ramey.
1246
1247 Permission is hereby granted, without written agreement and
1248 without license or royalty fees, to use, copy, and distribute
1249 this document for any purpose, provided that the above copyright
1250 notice appears in all copies of this document and that the
1251 contents of this document remain unaltered.