blob: 5c678e9f62386867792d6d1ec32d167ed0764121 [file] [log] [blame]
Jari Aaltobb706242000-03-17 21:46:59 +00001This is the Bash FAQ, version 3.7, for Bash version 2.04.
Jari Aaltoccc6cda1996-12-23 17:02:34 +00002
3This document contains a set of frequently-asked questions concerning
4Bash, the GNU Bourne-Again Shell. Bash is a freely-available command
5interpreter with advanced features for both interactive use and shell
6programming.
7
8Another good source of basic information about shells is the collection
9of FAQ articles periodically posted to comp.unix.shell.
10
11Questions and comments concerning this document should be sent to
12chet@po.cwru.edu.
13
14This document is available for anonymous FTP with the URL
15
Jari Aaltocce855b1998-04-17 19:52:44 +000016ftp://ftp.cwru.edu/pub/bash/FAQ
Jari Aaltoccc6cda1996-12-23 17:02:34 +000017
Jari Aaltobb706242000-03-17 21:46:59 +000018The Bash home page is http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html
19
Jari Aaltoccc6cda1996-12-23 17:02:34 +000020----------
21Contents:
22
23Section A: The Basics
24
Jari Aaltob72432f1999-02-19 17:11:39 +000025A1) What is it?
26A2) What's the latest version?
27A3) Where can I get it?
28A4) On what machines will bash run?
29A5) Will bash run on operating systems other than Unix?
30A6) How can I build bash with gcc?
31A7) How can I make bash my login shell?
32A8) I just changed my login shell to bash, and now I can't FTP into my
33 machine. Why not?
34A9) What's the `POSIX 1003.2 standard'?
35A10) What is the bash `posix mode'?
Jari Aaltoccc6cda1996-12-23 17:02:34 +000036
37Section B: The latest version
38
Jari Aaltobb706242000-03-17 21:46:59 +000039B1) What's new in version 2.04?
40B2) Are there any user-visible incompatibilities between bash-2.04 and
Jari Aaltoccc6cda1996-12-23 17:02:34 +000041 bash-1.14.7?
42
43Section C: Differences from other Unix shells
44
Jari Aaltob72432f1999-02-19 17:11:39 +000045C1) How does bash differ from sh, the Bourne shell?
46C2) How does bash differ from the Korn shell, version ksh88?
47C3) Which new features in ksh-93 are not in bash, and which are?
Jari Aaltoccc6cda1996-12-23 17:02:34 +000048
49Section D: Why does bash do some things differently than other Unix shells?
50
Jari Aaltob72432f1999-02-19 17:11:39 +000051D1) Why does bash run a different version of `command' than
Jari Aaltoccc6cda1996-12-23 17:02:34 +000052 `which command' says it will?
Jari Aaltob72432f1999-02-19 17:11:39 +000053D2) Why doesn't bash treat brace expansions exactly like csh?
54D3) Why doesn't bash have csh variable modifiers?
55D4) How can I make my csh aliases work when I convert to bash?
56D5) How can I pipe standard output and standard error from one command to
Jari Aaltoccc6cda1996-12-23 17:02:34 +000057 another, like csh does with `|&'?
Jari Aaltob72432f1999-02-19 17:11:39 +000058D6) Now that I've converted from ksh to bash, are there equivalents to
Jari Aaltoccc6cda1996-12-23 17:02:34 +000059 ksh features like autoloaded functions and the `whence' command?
60
Jari Aaltobb706242000-03-17 21:46:59 +000061Section E: Why does bash do certain things the way it does?
Jari Aaltoccc6cda1996-12-23 17:02:34 +000062
Jari Aaltob72432f1999-02-19 17:11:39 +000063E1) Why is the bash builtin `test' slightly different from /bin/test?
64E2) Why does bash sometimes say `Broken pipe'?
Jari Aaltobb706242000-03-17 21:46:59 +000065E3) When I have terminal escape sequences in my prompt, why does bash
Jari Aaltoccc6cda1996-12-23 17:02:34 +000066 wrap lines at the wrong column?
Jari Aaltobb706242000-03-17 21:46:59 +000067E4) If I pipe the output of a command into `read variable', why doesn't
Jari Aaltoccc6cda1996-12-23 17:02:34 +000068 the output show up in $variable when the read command finishes?
Jari Aaltobb706242000-03-17 21:46:59 +000069E5) I have a bunch of shell scripts that use backslash-escaped characters
Jari Aaltoccc6cda1996-12-23 17:02:34 +000070 in arguments to `echo'. Bash doesn't interpret these characters. Why
71 not, and how can I make it understand them?
Jari Aaltobb706242000-03-17 21:46:59 +000072E6) Why doesn't a while or for loop get suspended when I type ^Z?
Jari Aaltoccc6cda1996-12-23 17:02:34 +000073
74Section F: Things to watch out for on certain Unix versions
75
Jari Aaltob72432f1999-02-19 17:11:39 +000076F1) Why can't I use command line editing in my `cmdtool'?
77F2) I built bash on Solaris 2. Why do globbing expansions and filename
Jari Aaltoccc6cda1996-12-23 17:02:34 +000078 completion chop off the first few characters of each filename?
Jari Aaltob72432f1999-02-19 17:11:39 +000079F3) Why does bash dump core after I interrupt username completion or
Jari Aaltoccc6cda1996-12-23 17:02:34 +000080 `~user' tilde expansion on a machine running NIS?
Jari Aaltob72432f1999-02-19 17:11:39 +000081F4) I'm running SVR4.2. Why is the line erased every time I type `@'?
82F5) Why does bash report syntax errors when my C News scripts use a
Jari Aaltoccc6cda1996-12-23 17:02:34 +000083 redirection before a subshell command?
Jari Aaltobb706242000-03-17 21:46:59 +000084F6) Why can't I use vi-mode editing on Red Hat Linux 6.1?
Jari Aaltoccc6cda1996-12-23 17:02:34 +000085
Jari Aaltobb706242000-03-17 21:46:59 +000086Section G: How can I get bash to do certain common things?
Jari Aaltoccc6cda1996-12-23 17:02:34 +000087
Jari Aaltobb706242000-03-17 21:46:59 +000088G1) How can I get bash to read and display eight-bit characters?
89G2) How do I write a function `x' to replace builtin command `x', but
90 still invoke the command from within the function?
91G3) How can I find the value of a shell variable whose name is the value
92 of another shell variable?
93G4) How can I make the bash `time' reserved word print timing output that
94 looks like the output from my system's /usr/bin/time?
95G5) How do I get the current directory into my prompt?
96G6) How can I rename "*.foo" to "*.bar"?
97G7) How can I translate a filename from uppercase to lowercase?
98G8) How can I write a filename expansion (globbing) pattern that will match
99 all files in the current directory except "." and ".."?
100
101Section H: Where do I go from here?
102
103H1) How do I report bugs in bash, and where should I look for fixes and
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000104 advice?
Jari Aaltobb706242000-03-17 21:46:59 +0000105H2) What kind of bash documentation is there?
106H3) What's coming in future versions?
107H4) What's on the bash `wish list'?
108H5) When will the next release appear?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000109
110----------
111Section A: The Basics
112
Jari Aaltob72432f1999-02-19 17:11:39 +0000113A1) What is it?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000114
115Bash is a Unix command interpreter (shell). It is an implementation of
116the Posix 1003.2 shell standard, and resembles the Korn and System V
117shells.
118
119Bash contains a number of enhancements over those shells, both
120for interactive use and shell programming. Features geared
121toward interactive use include command line editing, command
122history, job control, aliases, and prompt expansion. Programming
123features include additional variable expansions, shell
124arithmetic, and a number of variables and options to control
125shell behavior.
126
127Bash was originally written by Brian Fox of the Free Software
128Foundation. The current developer and maintainer is Chet Ramey
129of Case Western Reserve University.
130
Jari Aaltob72432f1999-02-19 17:11:39 +0000131A2) What's the latest version?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000132
Jari Aaltobb706242000-03-17 21:46:59 +0000133The latest version is 2.04, first made available on Friday, 17 March 2000.
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000134
Jari Aaltob72432f1999-02-19 17:11:39 +0000135A3) Where can I get it?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000136
137Bash is the GNU project's shell, and so is available from the
Jari Aaltob72432f1999-02-19 17:11:39 +0000138master GNU archive site, ftp.gnu.org, and its mirrors. The
Jari Aaltocce855b1998-04-17 19:52:44 +0000139latest version is also available for FTP from ftp.cwru.edu.
Jari Aaltobb706242000-03-17 21:46:59 +0000140The following URLs tell how to get version 2.04:
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000141
Jari Aaltobb706242000-03-17 21:46:59 +0000142ftp://ftp.gnu.org/pub/gnu/bash/bash-2.04.tar.gz
143ftp://ftp.cwru.edu/pub/bash/bash-2.04.tar.gz
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000144
145Formatted versions of the documentation are available with the URLs:
146
Jari Aaltobb706242000-03-17 21:46:59 +0000147ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-2.04.tar.gz
148ftp://ftp.cwru.edu/pub/bash/bash-doc-2.04.tar.gz
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000149
Jari Aaltob72432f1999-02-19 17:11:39 +0000150A4) On what machines will bash run?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000151
152Bash has been ported to nearly every version of UNIX. All you
153should have to do to build it on a machine for which a port
154exists is to type `configure' and then `make'. The build process
155will attempt to discover the version of UNIX you have and tailor
156itself accordingly, using a script created by GNU autoconf.
157
158More information appears in the file `INSTALL' in the distribution.
159
Jari Aaltob72432f1999-02-19 17:11:39 +0000160A5) Will bash run on operating systems other than Unix?
Jari Aaltod166f041997-06-05 14:59:13 +0000161
162Configuration specifics for Unix-like systems such as QNX and
Jari Aaltobb706242000-03-17 21:46:59 +0000163LynxOS are included in the distribution. Bash-2.04 should
Jari Aaltobc4cd231998-07-23 14:37:54 +0000164compile and run on Minix 2.0 (patches were contributed), but I
165don't believe anyone has built bash-2.x on earlier Minix versions
166yet.
Jari Aaltod166f041997-06-05 14:59:13 +0000167
168Bash has been ported to versions of Windows implementing the Win32
169programming interface. This includes Windows 95 and Windows NT.
Jari Aaltobb706242000-03-17 21:46:59 +0000170The port was done by Cygnus Solutions as part of their CYGWIN
Jari Aaltod166f041997-06-05 14:59:13 +0000171project. For more information about the project, look at the URL
172
Jari Aaltobb706242000-03-17 21:46:59 +0000173http:/sourceware.cygnus.com/cygwin
Jari Aaltod166f041997-06-05 14:59:13 +0000174
Jari Aaltob72432f1999-02-19 17:11:39 +0000175Cygnus originally ported bash-1.14.7, and that port was part of their
Jari Aaltobb706242000-03-17 21:46:59 +0000176early GNU-Win32 (the original name) releases. Cygnus has also done a
177port of bash-2.02.1 to the CYGWIN environment, and it is available as
178part of their current release. (They may have upgraded by now.)
Jari Aaltocce855b1998-04-17 19:52:44 +0000179
Jari Aaltobb706242000-03-17 21:46:59 +0000180Bash-2.04 should require no local Cygnus changes to build and run under
181CYGWIN.
Jari Aaltocce855b1998-04-17 19:52:44 +0000182
183The Cygnus port works only on Intel machines. There is a port of bash
184(I don't know which version) to the alpha/NT environment available from
185
186ftp://ftp.gnustep.org//pub/win32/bash-alpha-nt-1.01.tar.gz
187
Jari Aaltob72432f1999-02-19 17:11:39 +0000188Softway Systems has ported bash-2.01 to their Interix (nee OpenNT)
Jari Aaltobc4cd231998-07-23 14:37:54 +0000189system, a Unix subsystem for NT that replaces the Microsoft POSIX
190subsystem. Check out http://www.interix.com for more information.
Jari Aaltob72432f1999-02-19 17:11:39 +0000191Some support for Interix has been incorporated into bash, beginning
192with Bash-2.03. It should be easier to build bash on Interix now,
193but Interix users should fetch
194
195ftp://ftp.interix.com/pub/tw/unsup/bash.diffs.tar.gz
196
197and read the README.OpenNT file in that archive. It will detail the
Jari Aaltobb706242000-03-17 21:46:59 +0000198arguments `configure' needs to build on Interix. A configure cache
Jari Aaltob72432f1999-02-19 17:11:39 +0000199file for Interix is in the bash distribution in cross-build/opennt.cache;
200copy that to `config.cache' before starting configure.
Jari Aaltod166f041997-06-05 14:59:13 +0000201
202D. J. Delorie has ported bash-1.14.7 to run under MS-DOS, as part of
203the DJGPP project. For more information on the project, see
204
205http://www.delorie.com/djgpp/
206
207I picked up a binary of bash-1.14.7 that is purported to work with
208the DJGPP V2 environment from
209
210ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147b.zip
211
212The corresponding source is
213
214ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147s.zip
215
Jari Aaltobb706242000-03-17 21:46:59 +0000216Mark Elbrecht <snowball3@bigfoot.com> has sent me notice that bash-2.03
217has become available for DJGPP V2. The files are available as:
218
219ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203b.zip binary
220ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203d.zip documentation
221ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203s.zip source
222
223Mark has begun to work with bash-2.04.
224
Jari Aaltocce855b1998-04-17 19:52:44 +0000225Ports of bash-1.12 and bash-2.0 are available for OS/2 from
Jari Aaltod166f041997-06-05 14:59:13 +0000226
Jari Aaltocce855b1998-04-17 19:52:44 +0000227ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash_112.zip
228ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash-2.0(253).zip
Jari Aaltod166f041997-06-05 14:59:13 +0000229
Jari Aaltocce855b1998-04-17 19:52:44 +0000230I haven't looked at either, but the second appears to be a binary-only
231distribution. Beware.
Jari Aaltod166f041997-06-05 14:59:13 +0000232
Jari Aaltobb706242000-03-17 21:46:59 +0000233I have received word that Bash (I'm not sure which version, but I
234believe that it's at least bash-2.02.1) is the standard shell on
235BeOS.
236
Jari Aaltob72432f1999-02-19 17:11:39 +0000237A6) How can I build bash with gcc?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000238
239Bash configures to use gcc by default if it is available. Read the
240file INSTALL in the distribution for more information.
241
Jari Aaltob72432f1999-02-19 17:11:39 +0000242A7) How can I make bash my login shell?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000243
244Some machines let you use `chsh' to change your login shell. Other
Jari Aaltocce855b1998-04-17 19:52:44 +0000245systems use `passwd -s' or `passwd -e'. If one of these works for
246you, that's all you need. Note that many systems require the full
247pathname to a shell to appear in /etc/shells before you can make it
248your login shell. For this, you may need the assistance of your
249friendly local system administrator.
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000250
251If you cannot do this, you can still use bash as your login shell, but
252you need to perform some tricks. The basic idea is to add a command
253to your login shell's startup file to replace your login shell with
254bash.
255
256For example, if your login shell is csh or tcsh, and you have installed
257bash in /usr/gnu/bin/bash, add the following line to ~/.login:
258
259 if ( -f /usr/gnu/bin/bash ) exec /usr/gnu/bin/bash --login
260
261(the `--login' tells bash that it is a login shell).
262
263It's not a good idea to put this command into ~/.cshrc, because every
264csh you run without the `-f' option, even ones started to run csh scripts,
265reads that file. If you must put the command in ~/.cshrc, use something
266like
267
268 if ( $?prompt ) exec /usr/gnu/bin/bash --login
269
270to ensure that bash is exec'd only when the csh is interactive.
271
Jari Aaltod166f041997-06-05 14:59:13 +0000272If your login shell is sh or ksh, you have to do two things.
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000273
Jari Aaltod166f041997-06-05 14:59:13 +0000274First, create an empty file in your home directory named `.bash_profile'.
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000275The existence of this file will prevent the exec'd bash from trying to
276read ~/.profile, and re-execing itself over and over again. ~/.bash_profile
Jari Aaltod166f041997-06-05 14:59:13 +0000277is the first file bash tries to read initialization commands from when
278it is invoked as a login shell.
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000279
Jari Aaltod166f041997-06-05 14:59:13 +0000280Next, add a line similar to the above to ~/.profile:
281
282 [ -f /usr/gnu/bin/bash ] && exec /usr/gnu/bin/bash --login
283
284This will cause login shells to replace themselves with bash running as
285a login shell. Once you have this working, you can copy your initialization
286code from ~/.profile to ~/.bash_profile.
287
Jari Aaltobb706242000-03-17 21:46:59 +0000288I have received word that the recipe supplied above is insufficient for
289machines running CDE. CDE has a maze of twisty little startup files, all
290slightly different.
291
292If you cannot change your login shell in the password file to bash, you
293will have to (apparently) live with CDE using the shell in the password
294file to run its startup scripts. If you have changed your shell to bash,
295there is code in the CDE startup files (on Solaris, at least) to do the
296right thing.
297
298`dtterm' claims to use $SHELL as the default program to start, so if you
299can change $SHELL in the CDE startup files, you should be able to use bash
300in your terminal windows.
301
302Setting DTSOURCEPROFILE in ~/.dtprofile will cause the `Xsession' program
303to read your login shell's startup files. You may be able to use bash for
304the rest of the CDE programs by setting SHELL to bash in ~/.dtprofile as
305well, but I have not tried this.
306
307You can use the above `exec' recipe to start bash when not logging in with
308CDE by testing the value of the DT variable:
309
310 if [ -n "$DT" ]; then
311 [ -f /usr/gnu/bin/bash ] && exec /usr/gnu/bin/bash --login
312 fi
313
314
Jari Aaltob72432f1999-02-19 17:11:39 +0000315A8) I just changed my login shell to bash, and now I can't FTP into my
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000316 machine. Why not?
317
318You must add the full pathname to bash to the file /etc/shells. As
319noted in the answer to the previous question, many systems require
320this before you can make bash your login shell.
321
322Most versions of ftpd use this file to prohibit `special' users
323such as `uucp' and `news' from using FTP.
324
Jari Aaltob72432f1999-02-19 17:11:39 +0000325A9) What's the `POSIX 1003.2 standard'?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000326
327POSIX is a name originally coined by Richard Stallman for a
328family of open system standards based on UNIX. There are a
329number of aspects of UNIX under consideration for
330standardization, from the basic system services at the system
331call and C library level to applications and tools to system
332administration and management. Each area of standardization is
333assigned to a working group in the 1003 series.
334
335The POSIX Shell and Utilities standard has been developed by IEEE
336Working Group 1003.2 (POSIX.2). It concentrates on the command
337interpreter interface and utility programs commonly executed from
338the command line or by other programs. An initial version of the
339standard has been approved and published by the IEEE, and work is
340currently underway to update it.
341
342Bash is concerned with the aspects of the shell's behavior
343defined by POSIX.2. The shell command language has of course
344been standardized, including the basic flow control and program
345execution constructs, I/O redirection and pipelining, argument
346handling, variable expansion, and quoting.
347
348The `special' builtins, which must be implemented as part of the
349shell to provide the desired functionality, are specified as
350being part of the shell; examples of these are `eval' and
351`export'. Other utilities appear in the sections of POSIX.2 not
352devoted to the shell which are commonly (and in some cases must
353be) implemented as builtin commands, such as `read' and `test'.
354POSIX.2 also specifies aspects of the shell's interactive
355behavior as part of the UPE, including job control and command
356line editing. Only vi-style line editing commands have been
357standardized; emacs editing commands were left out due to
358objections.
359
Jari Aaltob72432f1999-02-19 17:11:39 +0000360A10) What is the bash `posix mode'?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000361
362Although bash is an implementation of the POSIX.2 shell
363specification, there are areas where the bash default behavior
364differs from that spec. The bash `posix mode' changes the bash
365behavior in these areas so that it obeys the spec more closely.
366
367Posix mode is entered by starting bash with the --posix option or
368executing `set -o posix' after bash is running.
369
370The specific aspects of bash which change when posix mode is
371active are listed in the file CWRU/POSIX.NOTES in the bash
372distribution. They are also listed in a section in the Bash
373Reference Manual.
374
375Section B: The latest version
376
Jari Aaltobb706242000-03-17 21:46:59 +0000377B1) What's new in version 2.04?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000378
Jari Aaltobb706242000-03-17 21:46:59 +0000379Bash-2.04 contains the following new features (see the manual page for
380complete descriptions and the CHANGES and NEWS files in the bash-2.04
381distribution):
382
383o Programmable word completion with the new `complete' and `compgen' builtins;
384 examples are provided in examples/complete/complete-examples
385o `history' has a new `-d' option to delete a history entry
386o `bind' has a new `-x' option to bind key sequences to shell commands
387o The prompt expansion code has new `\j' and `\l' escape sequences
388o The `no_empty_command_completion' shell option, if enabled, inhibits
389 command completion when TAB is typed on an empty line
390o `help' has a new `-s' option to print a usage synopsis
391o New arithmetic operators: var++, var--, ++var, --var, expr1,expr2 (comma)
392o New ksh93-style arithmetic for command:
393 for ((expr1 ; expr2; expr3 )); do list; done
394o `read' has new options: `-t', `-n', `-d', `-s'
395o The redirection code handles several filenames specially: /dev/fd/N,
396 /dev/stdin, /dev/stdout, /dev/stderr
397o The redirection code now recognizes /dev/tcp/HOST/PORT and
398 /dev/udp/HOST/PORT and tries to open a TCP or UDP socket, respectively,
399 to the specified port on the specified host
400o The ${!prefix*} expansion has been implemented
401o A new FUNCNAME variable, which expands to the name of a currently-executing
402 function
403o The GROUPS variable is no longer readonly
404o A new shopt `xpg_echo' variable, to control the behavior of echo with
405 respect to backslash-escape sequences at runtime
406o The NON_INTERACTIVE_LOGIN_SHELLS #define has returned
407
408The version of Readline released with Bash-2.04, Readline-4.1, has several
409new features as well:
410
411o Parentheses matching is always compiled into readline, and controllable
412 with the new `blink-matching-paren' variable
413o The history-search-forward and history-search-backward functions now leave
414 point at the end of the line when the search string is empty, like
415 reverse-search-history, and forward-search-history
416o A new function for applications: rl_on_new_line_with_prompt()
417o New variables for applications: rl_already_prompted, and rl_gnu_readline_p
418
419
420A short feature history dating from bash-2.0:
421
422Bash-2.03 had very few new features, in keeping with the convention
Jari Aaltob72432f1999-02-19 17:11:39 +0000423that odd-numbered releases provide mainly bug fixes. A number of new
424features were added to Readline, mostly at the request of the Cygnus
425folks.
426
Jari Aaltobb706242000-03-17 21:46:59 +0000427A new shopt option, `restricted_shell', so that startup files can test
Jari Aaltob72432f1999-02-19 17:11:39 +0000428 whether or not the shell was started in restricted mode
Jari Aaltobb706242000-03-17 21:46:59 +0000429Filename generation is now performed on the words between ( and ) in
Jari Aaltob72432f1999-02-19 17:11:39 +0000430 compound array assignments (this is really a bug fix)
431OLDPWD is now auto-exported, as POSIX.2 requires
432ENV and BASH_ENV are read-only variables in a restricted shell
433Bash may now be linked against an already-installed Readline library,
434 as long as the Readline library is version 4 or newer
435All shells begun with the `--login' option will source the login shell
436 startup files, even if the shell is not interactive
437
Jari Aaltobb706242000-03-17 21:46:59 +0000438There were lots of changes to the version of the Readline library released
Jari Aaltob72432f1999-02-19 17:11:39 +0000439along with Bash-2.03. For a complete list of the changes, read the file
440CHANGES in the Bash-2.03 distribution.
441
442Bash-2.02 contained the following new features:
Jari Aaltocce855b1998-04-17 19:52:44 +0000443
444a new version of malloc (based on the old GNU malloc code in previous
445 bash versions) that is more page-oriented, more conservative
446 with memory usage, does not `orphan' large blocks when they
447 are freed, is usable on 64-bit machines, and has allocation
448 checking turned on unconditionally
449POSIX.2-style globbing character classes ([:alpha:], [:alnum:], etc.)
450POSIX.2-style globbing equivalence classes
451POSIX.2-style globbing collating symbols
452the ksh [[...]] extended conditional command
453the ksh egrep-style extended pattern matching operators
454a new `printf' builtin
455the ksh-like $(<filename) command substitution, which is equivalent to
456 $(cat filename)
457new tilde prefixes that expand to directories from the directory stack
458new `**' arithmetic operator to do exponentiation
459case-insensitive globbing (filename expansion)
460menu completion a la tcsh
461`magic-space' history expansion function like tcsh
462the readline inputrc `language' has a new file inclusion directive ($include)
463
464Bash-2.01 contained only a few new features:
Jari Aaltod166f041997-06-05 14:59:13 +0000465
466new `GROUPS' builtin array variable containing the user's group list
467new bindable readline commands: history-and-alias-expand-line and
468 alias-expand-line
469
Jari Aaltocce855b1998-04-17 19:52:44 +0000470Bash-2.0 contained extensive changes and new features from bash-1.14.7.
Jari Aaltod166f041997-06-05 14:59:13 +0000471Here's a short list:
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000472
473new `time' reserved word to time pipelines, shell builtins, and
474 shell functions
475one-dimensional arrays with a new compound assignment statement,
476 appropriate expansion constructs and modifications to some
477 of the builtins (read, declare, etc.) to use them
478new quoting syntaxes for ANSI-C string expansion and locale-specific
479 string translation
480new expansions to do substring extraction, pattern replacement, and
481 indirect variable expansion
482new builtins: `disown' and `shopt'
483new variables: HISTIGNORE, SHELLOPTS, PIPESTATUS, DIRSTACK, GLOBIGNORE,
484 MACHTYPE, BASH_VERSINFO
485special handling of many unused or redundant variables removed
486 (e.g., $notify, $glob_dot_filenames, $no_exit_on_failed_exec)
487dynamic loading of new builtin commands; many loadable examples provided
488new prompt expansions: \a, \e, \n, \H, \T, \@, \v, \V
489history and aliases available in shell scripts
490new readline variables: enable-keypad, mark-directories, input-meta,
491 visible-stats, disable-completion, comment-begin
492new readline commands to manipulate the mark and operate on the region
493new readline emacs mode commands and bindings for ksh-88 compatibility
494updated and extended builtins
495new DEBUG trap
496expanded (and now documented) restricted shell mode
497
498implementation stuff:
499autoconf-based configuration
500nearly all of the bugs reported since version 1.14 have been fixed
501most builtins converted to use builtin `getopt' for consistency
502most builtins use -p option to display output in a reusable form
503 (for consistency)
504grammar tighter and smaller (66 reduce-reduce conflicts gone)
505lots of code now smaller and faster
506test suite greatly expanded
507
Jari Aaltobb706242000-03-17 21:46:59 +0000508B2) Are there any user-visible incompatibilities between bash-2.04 and
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000509 bash-1.14.7?
510
Jari Aaltobb706242000-03-17 21:46:59 +0000511There are a few incompatibilities between version 1.14.7 and version 2.04.
512They are detailed in the file COMPAT in the bash-2.04 distribution.
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000513
514Section C: Differences from other Unix shells
515
Jari Aaltob72432f1999-02-19 17:11:39 +0000516C1) How does bash differ from sh, the Bourne shell?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000517
518This is a non-comprehensive list of features that differentiate bash
519from the SVR4.2 shell. The bash manual page explains these more
520completely.
521
522Things bash has that sh does not:
523 long invocation options
524 `!' reserved word to invert pipeline return value
525 `time' reserved word to time pipelines and shell builtins
526 the `function' reserved word
Jari Aaltobb706242000-03-17 21:46:59 +0000527 the `select' compound command and reserved word
528 arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000529 new $'...' and $"..." quoting
530 the $(...) form of command substitution
Jari Aaltobc4cd231998-07-23 14:37:54 +0000531 the $(<filename) form of command substitution, equivalent to
532 $(cat filename)
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000533 the ${#param} parameter value length operator
534 the ${!param} indirect parameter expansion operator
Jari Aaltobb706242000-03-17 21:46:59 +0000535 the ${!param*} prefix expansion operator
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000536 the ${param:length[:offset]} parameter substring operator
537 the ${param/pat[/string]} parameter pattern substitution operator
538 expansions to perform substring removal (${p%[%]w}, ${p#[#]w})
539 expansion of positional parameters beyond $9 with ${num}
540 variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, REPLY,
541 TIMEFORMAT, PPID, PWD, OLDPWD, SHLVL, RANDOM, SECONDS,
542 LINENO, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE, HOSTNAME,
543 ENV, PS3, PS4, DIRSTACK, PIPESTATUS, HISTSIZE, HISTFILE,
Jari Aaltobc4cd231998-07-23 14:37:54 +0000544 HISTFILESIZE, HISTCONTROL, HISTIGNORE, GLOBIGNORE, GROUPS,
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000545 PROMPT_COMMAND, FCEDIT, FIGNORE, IGNOREEOF, INPUTRC,
Jari Aaltobb706242000-03-17 21:46:59 +0000546 SHELLOPTS, OPTERR, HOSTFILE, TMOUT, FUNCNAME, histchars,
547 auto_resume
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000548 DEBUG trap
549 variable arrays with new compound assignment syntax
550 redirections: <>, &>, >|
551 prompt string special char translation and variable expansion
Jari Aaltobb706242000-03-17 21:46:59 +0000552 auto-export of variables in initial environment
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000553 command search finds functions before builtins
554 bash return builtin will exit a file sourced with `.'
555 builtins: cd -/-L/-P, exec -l/-c/-a, echo -e/-E, hash -p.
Jari Aaltobb706242000-03-17 21:46:59 +0000556 export -n/-f/-p/name=value, pwd -L/-P,
557 read -e/-p/-a/-t/-n/-d/-s,
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000558 readonly -a/-f/name=value, trap -l, set +o,
559 set -b/-m/-o option/-h/-p/-B/-C/-H/-P,
560 unset -f/-v, ulimit -m/-p/-u,
561 type -a/-p/-t, suspend -f, kill -n,
562 test -o optname/s1 == s2/s1 < s2/s1 > s2/-nt/-ot/-ef/-O/-G/-S
563 bash reads ~/.bashrc for interactive shells, $ENV for non-interactive
564 bash restricted shell mode is more extensive
565 bash allows functions and variables with the same name
566 brace expansion
567 tilde expansion
568 arithmetic expansion with $((...)) and `let' builtin
Jari Aaltobc4cd231998-07-23 14:37:54 +0000569 the `[[...]]' extended conditional command
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000570 process substitution
571 aliases and alias/unalias builtins
572 local variables in functions and `local' builtin
Jari Aaltobb706242000-03-17 21:46:59 +0000573 readline and command-line editing with programmable completion
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000574 command history and history/fc builtins
575 csh-like history expansion
Jari Aaltobb706242000-03-17 21:46:59 +0000576 other new bash builtins: bind, command, compgen, complete, builtin,
577 declare/typeset, dirs, enable, fc, help,
578 history, logout, popd, pushd, disown, shopt,
579 printf
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000580 exported functions
581 filename generation when using output redirection (command >a*)
Jari Aaltobc4cd231998-07-23 14:37:54 +0000582 POSIX.2-style globbing character classes
583 POSIX.2-style globbing equivalence classes
584 POSIX.2-style globbing collating symbols
585 egrep-like extended pattern matching operators
586 case-insensitive pattern matching and globbing
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000587 variable assignments preceding commands affect only that command,
588 even for builtins and functions
589 posix mode
Jari Aaltobb706242000-03-17 21:46:59 +0000590 redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr,
591 /dev/tcp/host/port, /dev/udp/host/port
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000592
593Things sh has that bash does not:
594 uses variable SHACCT to do shell accounting
595 includes `stop' builtin (bash can use alias stop='kill -s STOP')
596 `newgrp' builtin
597 turns on job control if called as `jsh'
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000598 $TIMEOUT (like bash $TMOUT)
599 `^' is a synonym for `|'
600 new SVR4.2 sh builtins: mldmode, priv
601
602Implementation differences:
603 redirection to/from compound commands causes sh to create a subshell
604 bash does not allow unbalanced quotes; sh silently inserts them at EOF
605 bash does not mess with signal 11
606 sh sets (euid, egid) to (uid, gid) if -p not supplied and uid < 100
607 bash splits only the results of expansions on IFS, using POSIX.2
608 field splitting rules; sh splits all words on IFS
609 sh does not allow MAILCHECK to be unset (?)
610 sh does not allow traps on SIGALRM or SIGCHLD
611 bash allows multiple option arguments when invoked (e.g. -x -v);
612 sh allows only a single option argument (`sh -x -v' attempts
Jari Aaltod166f041997-06-05 14:59:13 +0000613 to open a file named `-v', and, on SunOS 4.1.4, dumps core.
Jari Aaltob72432f1999-02-19 17:11:39 +0000614 On Solaris 2.4 and earlier versions, sh goes into an infinite
615 loop.)
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000616 sh exits a script if any builtin fails; bash exits only if one of
617 the POSIX.2 `special' builtins fails
618
Jari Aaltob72432f1999-02-19 17:11:39 +0000619C2) How does bash differ from the Korn shell, version ksh88?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000620
621Things bash has or uses that ksh88 does not:
622 long invocation options
623 `!' reserved word
Jari Aaltobb706242000-03-17 21:46:59 +0000624 arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000625 posix mode and posix conformance
626 command hashing
627 tilde expansion for assignment statements that look like $PATH
628 process substitution with named pipes if /dev/fd is not available
629 the ${!param} indirect parameter expansion operator
Jari Aaltobb706242000-03-17 21:46:59 +0000630 the ${!param*} prefix expansion operator
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000631 the ${param:length[:offset]} parameter substring operator
632 the ${param/pat[/string]} parameter pattern substitution operator
633 variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, SHLVL,
634 TIMEFORMAT, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE,
635 HISTFILESIZE, HISTIGNORE, HISTCONTROL, PROMPT_COMMAND,
636 IGNOREEOF, FIGNORE, INPUTRC, HOSTFILE, DIRSTACK,
637 PIPESTATUS, HOSTNAME, OPTERR, SHELLOPTS, GLOBIGNORE,
Jari Aaltobb706242000-03-17 21:46:59 +0000638 GROUPS, FUNCNAME, histchars, auto_resume
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000639 prompt expansion with backslash escapes and command substitution
640 redirection: &> (stdout and stderr)
Jari Aaltobb706242000-03-17 21:46:59 +0000641 more extensive and extensible editing and programmable completion
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000642 builtins: bind, builtin, command, declare, dirs, echo -e/-E, enable,
643 exec -l/-c/-a, fc -s, export -n/-f/-p, hash, help, history,
644 jobs -x/-r/-s, kill -s/-n/-l, local, logout, popd, pushd,
Jari Aaltobb706242000-03-17 21:46:59 +0000645 read -e/-p/-a/-t/-n/-d/-s, readonly -a/-n/-f/-p,
646 set -o braceexpand/-o histexpand/-o interactive-comments/
647 -o notify/-o physical/-o posix/-o hashall/-o onecmd/
648 -h/-B/-C/-b/-H/-P, set +o, suspend, trap -l, type,
649 typeset -a/-F/-p, ulimit -u, umask -S, alias -p, shopt,
650 disown, printf, complete, compgen
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000651 `!' csh-style history expansion
Jari Aaltobc4cd231998-07-23 14:37:54 +0000652 POSIX.2-style globbing character classes
653 POSIX.2-style globbing equivalence classes
654 POSIX.2-style globbing collating symbols
655 egrep-like extended pattern matching operators
656 case-insensitive pattern matching and globbing
657 `**' arithmetic operator to do exponentiation
Jari Aaltobb706242000-03-17 21:46:59 +0000658 redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000659
660Things ksh88 has or uses that bash does not:
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000661 tracked aliases
Jari Aaltobb706242000-03-17 21:46:59 +0000662 variables: ERRNO, FPATH, EDITOR, VISUAL
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000663 co-processes (|&, >&p, <&p)
664 weirdly-scoped functions
665 typeset +f to list all function names without definitions
666 text of command history kept in a file, not memory
667 builtins: alias -x, cd old new, fc -e -, newgrp, print,
668 read -p/-s/-u/var?prompt, set -A/-o gmacs/
669 -o bgnice/-o markdirs/-o nolog/-o trackall/-o viraw/-s,
670 typeset -H/-L/-R/-A/-ft/-fu/-fx/-l/-u/-t, whence
671
672Implementation differences:
673 ksh runs last command of a pipeline in parent shell context
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000674 bash has brace expansion by default (ksh88 compile-time option)
675 bash has fixed startup file for all interactive shells; ksh reads $ENV
676 bash has exported functions
677 bash command search finds functions before builtins
678
Jari Aaltob72432f1999-02-19 17:11:39 +0000679C3) Which new features in ksh-93 are not in bash, and which are?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000680
Jari Aaltobb706242000-03-17 21:46:59 +0000681New things in ksh-93 not in bash-2.04:
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000682 associative arrays
683 floating point arithmetic
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000684 math library functions
685 ${!name[sub]} name of subscript for associative array
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000686 `.' is allowed in variable names to create a hierarchical namespace
687 more extensive compound assignment syntax
688 discipline functions
689 `sleep' and `getconf' builtins (bash has loadable versions)
690 typeset -n and `nameref' variables
691 KEYBD trap
Jari Aaltobb706242000-03-17 21:46:59 +0000692 variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, .sh.version,
693 .sh.name, .sh.subscript, .sh.value, HISTEDIT
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000694 backreferences in pattern matching
Jari Aaltobb706242000-03-17 21:46:59 +0000695 print -f (bash uses printf)
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000696 `fc' has been renamed to `hist'
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000697 `.' can execute shell functions
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000698
Jari Aaltobb706242000-03-17 21:46:59 +0000699New things in ksh-93 present in bash-2.04:
700 for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command
701 ?:, ++, --, `expr1 , expr2' arithmetic operators
702 expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]},
703 ${!param*}
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000704 compound array assignment
705 the `!' reserved word
706 loadable builtins -- but ksh uses `builtin' while bash uses `enable'
707 `command', `builtin', `disown' builtins
708 new $'...' and $"..." quoting
709 FIGNORE (but bash uses GLOBIGNORE), HISTCMD
710 set -o notify/-C
711 changes to kill builtin
712 read -A (bash uses read -a)
Jari Aaltobb706242000-03-17 21:46:59 +0000713 read -t/-d
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000714 trap -p
715 exec -c/-a
716 `.' restores the positional parameters when it completes
717 POSIX.2 `test'
718 umask -S
719 unalias -a
720 command and arithmetic substitution performed on PS1, PS4, and ENV
721 command name completion
Jari Aaltod166f041997-06-05 14:59:13 +0000722 ENV processed only for interactive shells
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000723
724Section D: Why does bash do some things differently than other Unix shells?
725
Jari Aaltob72432f1999-02-19 17:11:39 +0000726D1) Why does bash run a different version of `command' than
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000727 `which command' says it will?
728
Jari Aaltob72432f1999-02-19 17:11:39 +0000729On many systems, `which' is actually a csh script that assumes
730you're running csh. In tcsh, `which' and its cousin `where'
731are builtins. On other Unix systems, `which' is a perl script
732that uses the PATH environment variable.
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000733
Jari Aaltob72432f1999-02-19 17:11:39 +0000734The csh script version reads the csh startup files from your
735home directory and uses those to determine which `command' will
736be invoked. Since bash doesn't use any of those startup files,
737there's a good chance that your bash environment differs from
738your csh environment. The bash `type' builtin does everything
739`which' does, and will report correct results for the running
740shell. If you're really wedded to the name `which', try adding
741the following function definition to your .bashrc:
742
743 which()
744 {
Jari Aaltobb706242000-03-17 21:46:59 +0000745 builtin type "$@"
Jari Aaltob72432f1999-02-19 17:11:39 +0000746 }
747
748If you're moving from tcsh and would like to bring `where' along
749as well, use this function:
750
751 where()
752 {
753 builtin type -a "$@"
754 }
755
756D2) Why doesn't bash treat brace expansions exactly like csh?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000757
758The only difference between bash and csh brace expansion is that
759bash requires a brace expression to contain at least one unquoted
760comma if it is to be expanded. Any brace-surrounded word not
761containing an unquoted comma is left unchanged by the brace
762expansion code. This affords the greatest degree of sh
763compatibility.
764
765Bash, ksh, zsh, and pd-ksh all implement brace expansion this way.
766
Jari Aaltob72432f1999-02-19 17:11:39 +0000767D3) Why doesn't bash have csh variable modifiers?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000768
769Posix has specified a more powerful, albeit somewhat more cryptic,
770mechanism cribbed from ksh, and bash implements it.
771
772${parameter%word}
773 Remove smallest suffix pattern. The WORD is expanded to produce
774 a pattern. It then expands to the value of PARAMETER, with the
775 smallest portion of the suffix matched by the pattern deleted.
776
777 x=file.c
778 echo ${x%.c}.o
779 -->file.o
780
781${parameter%%word}
782
783 Remove largest suffix pattern. The WORD is expanded to produce
784 a pattern. It then expands to the value of PARAMETER, with the
785 largest portion of the suffix matched by the pattern deleted.
786
787 x=posix/src/std
788 echo ${x%%/*}
789 -->posix
790
791${parameter#word}
792 Remove smallest prefix pattern. The WORD is expanded to produce
793 a pattern. It then expands to the value of PARAMETER, with the
794 smallest portion of the prefix matched by the pattern deleted.
795
796 x=$HOME/src/cmd
797 echo ${x#$HOME}
798 -->/src/cmd
799
800${parameter##word}
801 Remove largest prefix pattern. The WORD is expanded to produce
802 a pattern. It then expands to the value of PARAMETER, with the
803 largest portion of the prefix matched by the pattern deleted.
804
805 x=/one/two/three
806 echo ${x##*/}
807 -->three
808
809
810Given
811 a=/a/b/c/d
812 b=b.xxx
813
814 csh bash result
815 --- ---- ------
816 $a:h ${a%/*} /a/b/c
817 $a:t ${a##*/} d
818 $b:r ${b%.*} b
819 $b:e ${b##*.} xxx
820
821
Jari Aaltob72432f1999-02-19 17:11:39 +0000822D4) How can I make my csh aliases work when I convert to bash?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000823
824Bash uses a different syntax to support aliases than csh does.
825The details can be found in the documentation. We have provided
826a shell script which does most of the work of conversion for you;
827this script can be found in ./examples/misc/alias-conv.sh. Here is
828how you use it:
829
830Start csh in the normal way for you. (e.g., `csh')
831
832Pipe the output of `alias' through `alias-conv.sh', saving the
833results into `bash_aliases':
834
835 alias | alias-conv.sh >bash_aliases
836
837Edit `bash_aliases', carefully reading through any created
838functions. You will need to change the names of some csh specific
839variables to the bash equivalents. The script converts $cwd to
840$PWD, $term to $TERM, $home to $HOME, $user to $USER, and $prompt
841to $PS1. You may also have to add quotes to avoid unwanted
842expansion.
843
844For example, the csh alias:
845
846 alias cd 'cd \!*; echo $cwd'
847
848is converted to the bash function:
849
850 cd () { command cd "$@"; echo $PWD ; }
851
852The only thing that needs to be done is to quote $PWD:
853
854 cd () { command cd "$@"; echo "$PWD" ; }
855
856Merge the edited file into your ~/.bashrc.
857
858There is an additional, more ambitious, script in
859examples/misc/cshtobash that attempts to convert your entire csh
860environment to its bash equivalent. This script can be run as
861simply `cshtobash' to convert your normal interactive
862environment, or as `cshtobash ~/.login' to convert your login
863environment.
864
Jari Aaltob72432f1999-02-19 17:11:39 +0000865D5) How can I pipe standard output and standard error from one command to
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000866 another, like csh does with `|&'?
867
868Use
869 command 2>&1 | command2
870
871The key is to remember that piping is performed before redirection, so
872file descriptor 1 points to the pipe when it is duplicated onto file
873descriptor 2.
874
Jari Aaltob72432f1999-02-19 17:11:39 +0000875D6) Now that I've converted from ksh to bash, are there equivalents to
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000876 ksh features like autoloaded functions and the `whence' command?
877
Jari Aaltobb706242000-03-17 21:46:59 +0000878There are features in ksh-88 and ksh-93 that do not have direct bash
879equivalents. Most, however, can be emulated with very little trouble.
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000880
881ksh-88 feature Bash equivalent
882-------------- ---------------
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000883compiled-in aliases set up aliases in .bashrc; some ksh aliases are
884 bash builtins (hash, history, type)
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000885coprocesses named pipe pairs (one for read, one for write)
886typeset +f declare -F
887cd, print, whence function substitutes in examples/functions/kshenv
888autoloaded functions examples/functions/autoload is the same as typeset -fu
889read var?prompt read -p prompt var
890
Jari Aaltobb706242000-03-17 21:46:59 +0000891ksh-93 feature Bash equivalent
892-------------- ---------------
893sleep, getconf Bash has loadable versions in examples/loadables
894${.sh.version} $BASH_VERSION
895print -f printf
896hist alias fc=hist
897$HISTEDIT $FCEDIT
898
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000899Section E: How can I get bash to do certain things, and why does bash do
900 things the way it does?
901
Jari Aaltob72432f1999-02-19 17:11:39 +0000902E1) Why is the bash builtin `test' slightly different from /bin/test?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000903
904The specific example used here is [ ! x -o x ], which is false.
905
906Bash's builtin `test' implements the Posix.2 spec, which can be
907summarized as follows (the wording is due to David Korn):
908
909Here is the set of rules for processing test arguments.
910
911 0 Args: False
912 1 Arg: True iff argument is not null.
913 2 Args: If first arg is !, True iff second argument is null.
914 If first argument is unary, then true if unary test is true
915 Otherwise error.
916 3 Args: If second argument is a binary operator, do binary test of $1 $3
917 If first argument is !, negate two argument test of $2 $3
918 If first argument is `(' and third argument is `)', do the
919 one-argument test of the second argument.
920 Otherwise error.
921 4 Args: If first argument is !, negate three argument test of $2 $3 $4.
922 Otherwise unspecified
923 5 or more Args: unspecified. (Historical shells would use their
924 current algorithm).
925
926The operators -a and -o are considered binary operators for the purpose
927of the 3 Arg case.
928
929As you can see, the test becomes (not (x or x)), which is false.
930
Jari Aaltob72432f1999-02-19 17:11:39 +0000931E2) Why does bash sometimes say `Broken pipe'?
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000932
933If a sequence of commands appears in a pipeline, and one of the
934reading commands finishes before the writer has finished, the
935writer receives a SIGPIPE signal. Many other shells special-case
936SIGPIPE as an exit status in the pipeline and do not report it.
937For example, in:
938
939 ps -aux | head
940
941`head' can finish before `ps' writes all of its output, and ps
942will try to write on a pipe without a reader. In that case, bash
943will print `Broken pipe' to stderr when ps is killed by a
944SIGPIPE.
945
Jari Aaltob72432f1999-02-19 17:11:39 +0000946You can build a version of bash that will not report SIGPIPE errors
947by uncommenting the definition of DONT_REPORT_SIGPIPE in the file
948config-top.h.
949
Jari Aaltobb706242000-03-17 21:46:59 +0000950E3) When I have terminal escape sequences in my prompt, why does bash
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000951 wrap lines at the wrong column?
952
953Readline, the line editing library that bash uses, does not know
954that the terminal escape sequences do not take up space on the
955screen. The redisplay code assumes, unless told otherwise, that
956each character in the prompt is a `printable' character that
957takes up one character position on the screen.
958
959You can use the bash prompt expansion facility (see the PROMPTING
960section in the manual page) to tell readline that sequences of
961characters in the prompt strings take up no screen space.
962
963Use the \[ escape to begin a sequence of non-printing characters,
964and the \] escape to signal the end of such a sequence.
965
Jari Aaltobb706242000-03-17 21:46:59 +0000966E4) If I pipe the output of a command into `read variable', why doesn't
Jari Aaltoccc6cda1996-12-23 17:02:34 +0000967 the output show up in $variable when the read command finishes?
968
969This has to do with the parent-child relationship between Unix
970processes.
971
972Each element of a pipeline runs in a separate process, a child of
973the shell running the pipeline. A subprocess cannot affect its
974parent's environment. When the `read' command sets the variable
975to the input, that variable is set only in the subshell, not the
976parent shell. When the subshell exits, the value of the variable
977is lost.
978
979Many pipelines that end with `read variable' can be converted
980into command substitutions, which will capture the output of
981a specified command. The output can then be assigned to a
982variable:
983
984 grep ^gnu /usr/lib/news/active | wc -l | read ngroup
985
986can be converted into
987
988 ngroup=$(grep ^gnu /usr/lib/news/active | wc -l)
989
990This does not, unfortunately, work to split the text among
991multiple variables, as read does when given multiple variable
992arguments. If you need to do this, you can either use the
993command substitution above to read the output into a variable
994and chop up the variable using the bash pattern removal
995expansion operators or use some variant of the following
996approach.
997
998Say /usr/local/bin/ipaddr is the following shell script:
999
1000#! /bin/sh
1001host `hostname` | awk '/address/ {print $NF}'
1002
1003Instead of using
1004
1005 /usr/local/bin/ipaddr | read A B C D
1006
1007to break the local machine's IP address into separate octets, use
1008
1009 OIFS="$IFS"
1010 IFS=.
1011 set -- $(/usr/local/bin/ipaddr)
1012 IFS="$OIFS"
1013 A="$1" B="$2" C="$3" D="$4"
1014
1015Beware, however, that this will change the shell's positional
1016parameters. If you need them, you should save them before doing
1017this.
1018
1019This is the general approach -- in most cases you will not need to
1020set $IFS to a different value.
1021
Jari Aaltobb706242000-03-17 21:46:59 +00001022E5) I have a bunch of shell scripts that use backslash-escaped characters
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001023 in arguments to `echo'. Bash doesn't interpret these characters. Why
1024 not, and how can I make it understand them?
1025
1026This is the behavior of echo on most Unix System V machines.
1027
Jari Aaltobb706242000-03-17 21:46:59 +00001028The bash builtin `echo' is modeled after the 9th Edition
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001029Research Unix version of `echo'. It does not interpret
1030backslash-escaped characters in its argument strings by default;
1031it requires the use of the -e option to enable the
1032interpretation. The System V echo provides no way to disable the
1033special characters; the bash echo has a -E option to disable
1034them.
1035
1036There is a configuration option that will make bash behave like
1037the System V echo and interpret things like `\t' by default. Run
1038configure with the --enable-usg-echo-default option to turn this
1039on. Be aware that this will cause some of the tests run when you
1040type `make tests' to fail.
1041
Jari Aaltobb706242000-03-17 21:46:59 +00001042There is a shell option, `xpg_echo', settable with `shopt' that will
1043change the behavior of echo at runtime. Enabling this option turns
1044on expansion of backslash-escape sequences.
1045
1046E6) Why doesn't a while or for loop get suspended when I type ^Z?
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001047
1048This is a consequence of how job control works on Unix. The only
1049thing that can be suspended is the process group. This is a single
1050command or pipeline of commands that the shell forks and executes.
1051
1052When you run a while or for loop, the only thing that the shell forks
1053and executes are any commands in the while loop test and commands in
1054the loop bodies. These, therefore, are the only things that can be
1055suspended when you type ^Z.
1056
1057If you want to be able to stop the entire loop, you need to put it
1058within parentheses, which will force the loop into a subshell that
1059may be stopped (and subsequently restarted) as a single unit.
1060
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001061Section F: Things to watch out for on certain Unix versions
1062
Jari Aaltob72432f1999-02-19 17:11:39 +00001063F1) Why can't I use command line editing in my `cmdtool'?
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001064
1065The problem is `cmdtool' and bash fighting over the input. When
1066scrolling is enabled in a cmdtool window, cmdtool puts the tty in
1067`raw mode' to permit command-line editing using the mouse for
1068applications that cannot do it themselves. As a result, bash and
1069cmdtool each try to read keyboard input immediately, with neither
1070getting enough of it to be useful.
1071
1072This mode also causes cmdtool to not implement many of the
1073terminal functions and control sequences appearing in the
1074`sun-cmd' termcap entry. For a more complete explanation, see
1075that file examples/suncmd.termcap in the bash distribution.
1076
1077`xterm' is a better choice, and gets along with bash much more
1078smoothly.
1079
1080If you must use cmdtool, you can use the termcap description in
1081examples/suncmd.termcap. Set the TERMCAP variable to the terminal
1082description contained in that file, i.e.
1083
1084TERMCAP='Mu|sun-cmd:am:bs:km:pt:li#34:co#80:cl=^L:ce=\E[K:cd=\E[J:rs=\E[s:'
1085
1086Then export TERMCAP and start a new cmdtool window from that shell.
1087The bash command-line editing should behave better in the new
1088cmdtool. If this works, you can put the assignment to TERMCAP
1089in your bashrc file.
1090
Jari Aaltob72432f1999-02-19 17:11:39 +00001091F2) I built bash on Solaris 2. Why do globbing expansions and filename
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001092 completion chop off the first few characters of each filename?
1093
1094This is the consequence of building bash on SunOS 5 and linking
1095with the libraries in /usr/ucblib, but using the definitions
1096and structures from files in /usr/include.
1097
1098The actual conflict is between the dirent structure in
1099/usr/include/dirent.h and the struct returned by the version of
1100`readdir' in libucb.a (a 4.3-BSD style `struct direct').
1101
1102Make sure you've got /usr/ccs/bin ahead of /usr/ucb in your $PATH
1103when configuring and building bash. This will ensure that you
1104use /usr/ccs/bin/cc or acc instead of /usr/ucb/cc and that you
1105link with libc before libucb.
1106
1107If you have installed the Sun C compiler, you may also need to
1108put /usr/ccs/bin and /opt/SUNWspro/bin into your $PATH before
1109/usr/ucb.
1110
Jari Aaltob72432f1999-02-19 17:11:39 +00001111F3) Why does bash dump core after I interrupt username completion or
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001112 `~user' tilde expansion on a machine running NIS?
1113
1114This is a famous and long-standing bug in the SunOS YP (sorry, NIS)
1115client library, which is part of libc.
1116
1117The YP library code keeps static state -- a pointer into the data
1118returned from the server. When YP initializes itself (setpwent),
1119it looks at this pointer and calls free on it if it's non-null.
1120So far, so good.
1121
1122If one of the YP functions is interrupted during getpwent (the
1123exact function is interpretwithsave()), and returns NULL, the
1124pointer is freed without being reset to NULL, and the function
1125returns. The next time getpwent is called, it sees that this
1126pointer is non-null, calls free, and the bash free() blows up
1127because it's being asked to free freed memory.
1128
1129The traditional Unix mallocs allow memory to be freed multiple
1130times; that's probably why this has never been fixed. You can
1131run configure with the `--without-gnu-malloc' option to use
1132the C library malloc and avoid the problem.
1133
Jari Aaltob72432f1999-02-19 17:11:39 +00001134F4) I'm running SVR4.2. Why is the line erased every time I type `@'?
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001135
1136The `@' character is the default `line kill' character in most
1137versions of System V, including SVR4.2. You can change this
1138character to whatever you want using `stty'. For example, to
1139change the line kill character to control-u, type
1140
1141 stty kill ^U
1142
1143where the `^' and `U' can be two separate characters.
1144
Jari Aaltob72432f1999-02-19 17:11:39 +00001145F5) Why does bash report syntax errors when my C News scripts use a
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001146 redirection before a subshell command?
1147
1148The actual command in question is something like
1149
1150 < file ( command )
1151
1152According to the grammar given in the POSIX.2 standard, this construct
1153is, in fact, a syntax error. Redirections may only precede `simple
1154commands'. A subshell construct such as the above is one of the shell's
1155`compound commands'. A redirection may only follow a compound command.
1156
Jari Aaltobb706242000-03-17 21:46:59 +00001157This affects the mechanical transformation of commands that use `cat'
1158to pipe a file into a command (a favorite Useless-Use-Of-Cat topic on
1159comp.unix.shell). While most commands of the form
1160
1161 cat file | command
1162
1163can be converted to `< file command', shell control structures such as
1164loops and subshells require `command < file'.
1165
1166The file CWRU/sh-redir-hack in the bash-2.04 distribution is an
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001167(unofficial) patch to parse.y that will modify the grammar to
1168support this construct. It will not apply with `patch'; you must
1169modify parse.y by hand. Note that if you apply this, you must
1170recompile with -DREDIRECTION_HACK. This introduces a large
1171number of reduce/reduce conflicts into the shell grammar.
1172
Jari Aaltobb706242000-03-17 21:46:59 +00001173F6) Why can't I use vi-mode editing on Red Hat Linux 6.1?
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001174
Jari Aaltobb706242000-03-17 21:46:59 +00001175The short answer is that Red Hat screwed up.
1176
1177The long answer is that they shipped an /etc/inputrc that only works
1178for emacs mode editing, and then screwed all the vi users by setting
1179INPUTRC to /etc/inputrc in /etc/profile.
1180
1181The short fix is to do one of the following: remove or rename
1182/etc/inputrc, set INPUTRC=~/.inputrc in ~/.bashrc (or .bash_profile,
1183but make sure you export it if you do), remove the assignment to
1184INPUTRC from /etc/profile, add
1185
1186 set keymap emacs
1187
1188to the beginning of /etc/inputrc, or bracket the key bindings in
1189/etc/inputrc with these lines
1190
1191 $if mode=emacs
1192 [...]
1193 $endif
1194
1195Section G: How can I get bash to do certain common things?
1196
1197G1) How can I get bash to read and display eight-bit characters?
1198
1199This is a process requiring several steps.
1200
1201First, you must ensure that the `physical' data path is a full eight
1202bits. For xterms, for example, the `vt100' resources `eightBitInput'
1203and `eightBitOutput' should be set to `true'.
1204
1205Once you have set up an eight-bit path, you must tell the kernel and
1206tty driver to leave the eighth bit of characters alone when processing
1207keyboard input. Use `stty' to do this:
1208
1209 stty cs8 -istrip -parenb
1210
1211For old BSD-style systems, you can use
1212
1213 stty pass8
1214
1215You may also need
1216
1217 stty even odd
1218
1219Finally, you need to tell readline that you will be inputting and
1220displaying eight-bit characters. You use readline variables to do
1221this. These variables can be set in your .inputrc or using the bash
1222`bind' builtin. Here's an example using `bind':
1223
1224 bash$ bind 'set convert-meta off'
1225 bash$ bind 'set meta-flag on'
1226 bash$ bind 'set output-meta on'
1227
1228The `set' commands between the single quotes may also be placed
1229in ~/.inputrc.
1230
1231G2) How do I write a function `x' to replace builtin command `x', but
1232 still invoke the command from within the function?
1233
1234This is why the `command' and `builtin' builtins exist. The
1235`command' builtin executes the command supplied as its first
1236argument, skipping over any function defined with that name. The
1237`builtin' builtin executes the builtin command given as its first
1238argument directly.
1239
1240For example, to write a function to replace `cd' that writes the
1241hostname and current directory to an xterm title bar, use
1242something like the following:
1243
1244 cd()
1245 {
1246 builtin cd "$@" && xtitle "$HOST: $PWD"
1247 }
1248
1249This could also be written using `command' instead of `builtin';
1250the version above is marginally more efficient.
1251
1252G3) How can I find the value of a shell variable whose name is the value
1253 of another shell variable?
1254
1255Versions of Bash newer than Bash-2.0 support this directly. You can use
1256
1257 ${!var}
1258
1259For example, the following sequence of commands will echo `z':
1260
1261 var1=var2
1262 var2=z
1263 echo ${!var1}
1264
1265For sh compatibility, use the `eval' builtin. The important
1266thing to remember is that `eval' expands the arguments you give
1267it again, so you need to quote the parts of the arguments that
1268you want `eval' to act on.
1269
1270For example, this expression prints the value of the last positional
1271parameter:
1272
1273 eval echo \"\$\{$#\}\"
1274
1275The expansion of the quoted portions of this expression will be
1276deferred until `eval' runs, while the `$#' will be expanded
1277before `eval' is executed. In versions of bash later than bash-2.0,
1278
1279 echo ${!#}
1280
1281does the same thing.
1282
1283G4) How can I make the bash `time' reserved word print timing output that
1284 looks like the output from my system's /usr/bin/time?
1285
1286The bash command timing code looks for a variable `TIMEFORMAT' and
1287uses its value as a format string to decide how to display the
1288timing statistics.
1289
1290The value of TIMEFORMAT is a string with `%' escapes expanded in a
1291fashion similar in spirit to printf(3). The manual page explains
1292the meanings of the escape sequences in the format string.
1293
1294If TIMEFORMAT is not set, bash acts as if the following assignment had
1295been performed:
1296
1297 TIMEFORMAT=$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'
1298
1299The POSIX.2 default time format (used by `time -p command') is
1300
1301 TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S'
1302
1303The BSD /usr/bin/time format can be emulated with:
1304
1305 TIMEFORMAT=$'\t%1R real\t%1U user\t%1S sys'
1306
1307The System V /usr/bin/time format can be emulated with:
1308
1309 TIMEFORMAT=$'\nreal\t%1R\nuser\t%1U\nsys\t%1S'
1310
1311The ksh format can be emulated with:
1312
1313 TIMEFORMAT=$'\nreal\t%2lR\nuser\t%2lU\nsys\t%2lS'
1314
1315G5) How do I get the current directory into my prompt?
1316
1317Bash provides a number of backslash-escape sequences which are expanded
1318when the prompt string (PS1 or PS2) is displayed. The full list is in
1319the manual page.
1320
1321The \w expansion gives the full pathname of the current directory, with
1322a tilde (`~') substituted for the current value of $HOME. The \W
1323expansion gives the basename of the current directory. To put the full
1324pathname of the current directory into the path without any tilde
1325subsitution, use $PWD. Here are some examples:
1326
1327 PS1='\w$ ' # current directory with tilde
1328 PS1='\W$ ' # basename of current directory
1329 PS1='$PWD$ ' # full pathname of current directory
1330
1331The single quotes are important in the final example to prevent $PWD from
1332being expanded when the assignment to PS1 is performed.
1333
1334G6) How can I rename "*.foo" to "*.bar"?
1335
1336Use the pattern removal functionality described in D3. The following `for'
1337loop will do the trick:
1338
1339 for f in *.foo; do
1340 mv $f ${f%foo}bar
1341 done
1342
1343G7) How can I translate a filename from uppercase to lowercase?
1344
1345The script examples/functions/lowercase, originally written by John DuBois,
1346will do the trick. The converse is left as an exercise.
1347
1348G8) How can I write a filename expansion (globbing) pattern that will match
1349 all files in the current directory except "." and ".."?
1350
1351You must have set the `extglob' shell option using `shopt -s extglob' to use
1352this:
1353
1354 echo .!(.|) *
1355
1356A solution that works without extended globbing is given in the Unix Shell
1357FAQ, posted periodically to comp.unix.shell.
1358
1359Section H: Where do I go from here?
1360
1361H1) How do I report bugs in bash, and where should I look for fixes and
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001362 advice?
1363
1364Use the `bashbug' script to report bugs. It is built and
1365installed at the same time as bash. It provides a standard
1366template for reporting a problem and automatically includes
1367information about your configuration and build environment.
1368
Jari Aaltob72432f1999-02-19 17:11:39 +00001369`bashbug' sends its reports to bug-bash@gnu.org, which
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001370is a large mailing list gatewayed to the usenet newsgroup gnu.bash.bug.
1371
1372Bug fixes, answers to questions, and announcements of new releases
1373are all posted to gnu.bash.bug. Discussions concerning bash features
1374and problems also take place there.
1375
1376To reach the bash maintainers directly, send mail to
Jari Aaltob72432f1999-02-19 17:11:39 +00001377bash-maintainers@gnu.org.
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001378
Jari Aaltobb706242000-03-17 21:46:59 +00001379H2) What kind of bash documentation is there?
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001380
1381First, look in the doc directory in the bash distribution. It should
1382contain at least the following files:
1383
1384bash.1 an extensive, thorough Unix-style manual page
1385builtins.1 a manual page covering just bash builtin commands
Jari Aaltob72432f1999-02-19 17:11:39 +00001386bashref.texi a reference manual in GNU tex`info format
1387bashref.info an info version of the reference manual
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001388FAQ this file
1389article.ms text of an article written for The Linux Journal
1390readline.3 a man page describing readline
1391
Jari Aaltob72432f1999-02-19 17:11:39 +00001392Postscript, HTML, and ASCII files created from the above source are
1393available in the documentation distribution.
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001394
1395There is additional documentation available for anonymous FTP from host
Jari Aaltocce855b1998-04-17 19:52:44 +00001396ftp.cwru.edu in the `pub/bash' directory.
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001397
1398Cameron Newham and Bill Rosenblatt have written a book on bash, published
1399by O'Reilly and Associates. The book is based on Bill Rosenblatt's Korn
Jari Aaltod166f041997-06-05 14:59:13 +00001400Shell book. The title is ``Learning the Bash Shell'', and the ISBN number
1401is 1-56592-147-X. Look for it in fine bookstores near you. This book
1402covers bash-1.14, but has an appendix describing some of the new features
Jari Aaltocce855b1998-04-17 19:52:44 +00001403in bash-2.0.
1404
Jari Aaltobc4cd231998-07-23 14:37:54 +00001405A second edition of this book is available, published in January, 1998.
Jari Aaltocce855b1998-04-17 19:52:44 +00001406The ISBN number is 1-56592-347-2. Look for it in the same fine bookstores
1407or on the web.
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001408
Jari Aaltobb706242000-03-17 21:46:59 +00001409H3) What's coming in future versions?
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001410
1411These are features I plan to include in a future version of bash.
1412
Jari Aaltobb706242000-03-17 21:46:59 +00001413a bash debugger (a minimally-tested version is included with bash-2.04)
1414associative arrays
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001415
Jari Aaltobb706242000-03-17 21:46:59 +00001416H4) What's on the bash `wish list' for future versions?
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001417
1418These are features that may or may not appear in a future version of bash.
1419
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001420breaking some of the shell functionality into embeddable libraries
Jari Aaltobb706242000-03-17 21:46:59 +00001421a module system like zsh's, using dynamic loading like builtins
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001422better internationalization using GNU `gettext'
1423an option to use external files for the long `help' text
Jari Aaltocce855b1998-04-17 19:52:44 +00001424date-stamped command history
Jari Aaltobb706242000-03-17 21:46:59 +00001425a bash programmer's guide with a chapter on creating loadable builtins
1426a better loadable interface to perl with access to the shell builtins and
1427 variables (contributions gratefully accepted)
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001428
Jari Aaltobb706242000-03-17 21:46:59 +00001429H5) When will the next release appear?
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001430
Jari Aaltobb706242000-03-17 21:46:59 +00001431The next version will appear sometime in 2000 or 2001. Never make
Jari Aaltocce855b1998-04-17 19:52:44 +00001432predictions.
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001433
1434
Jari Aaltobb706242000-03-17 21:46:59 +00001435This document is Copyright 1995-2000 by Chester Ramey.
Jari Aaltoccc6cda1996-12-23 17:02:34 +00001436
1437Permission is hereby granted, without written agreement and
1438without license or royalty fees, to use, copy, and distribute
1439this document for any purpose, provided that the above copyright
1440notice appears in all copies of this document and that the
1441contents of this document remain unaltered.