aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>2001-11-13 17:56:06 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:54 +0000
commitf73dda092b33638d2d5e9c35375f687a607b5403 (patch)
treef21584e70a444d6a1ecba0fb5e2cf79e8cce91db /doc
parent28ef6c316f1aff914bb95ac09787a3c83c1815fd (diff)
downloadandroid_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.tar.gz
android_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.tar.bz2
android_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.zip
Imported from ../bash-2.05a.tar.gz.
Diffstat (limited to 'doc')
-rw-r--r--doc/FAQ231
-rw-r--r--doc/Makefile.in101
-rw-r--r--doc/bash.11023
-rw-r--r--doc/bashref.info622
-rw-r--r--doc/bashref.texi295
-rw-r--r--doc/builtins.17
6 files changed, 1336 insertions, 943 deletions
diff --git a/doc/FAQ b/doc/FAQ
index 1fafa6d..2a4c752 100644
--- a/doc/FAQ
+++ b/doc/FAQ
@@ -1,4 +1,4 @@
-This is the Bash FAQ, version 3.11, for Bash version 2.05.
+This is the Bash FAQ, version 3.17, for Bash version 2.05a.
This document contains a set of frequently-asked questions concerning
Bash, the GNU Bourne-Again Shell. Bash is a freely-available command
@@ -36,8 +36,8 @@ A10) What is the bash `posix mode'?
Section B: The latest version
-B1) What's new in version 2.05?
-B2) Are there any user-visible incompatibilities between bash-2.05 and
+B1) What's new in version 2.05a?
+B2) Are there any user-visible incompatibilities between bash-2.05a and
bash-1.14.7?
Section C: Differences from other Unix shells
@@ -134,22 +134,23 @@ of Case Western Reserve University.
A2) What's the latest version?
-The latest version is 2.05, first made available on Monday, 9 April 2001.
+The latest version is 2.05a, first made available on Thursday, 15
+November, 2001.
A3) Where can I get it?
Bash is the GNU project's shell, and so is available from the
master GNU archive site, ftp.gnu.org, and its mirrors. The
latest version is also available for FTP from ftp.cwru.edu.
-The following URLs tell how to get version 2.05:
+The following URLs tell how to get version 2.05a:
-ftp://ftp.gnu.org/pub/gnu/bash/bash-2.05.tar.gz
-ftp://ftp.cwru.edu/pub/bash/bash-2.05.tar.gz
+ftp://ftp.gnu.org/pub/gnu/bash/bash-2.05a.tar.gz
+ftp://ftp.cwru.edu/pub/bash/bash-2.05a.tar.gz
Formatted versions of the documentation are available with the URLs:
-ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-2.05.tar.gz
-ftp://ftp.cwru.edu/pub/bash/bash-doc-2.05.tar.gz
+ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-2.05a.tar.gz
+ftp://ftp.cwru.edu/pub/bash/bash-doc-2.05a.tar.gz
A4) On what machines will bash run?
@@ -161,13 +162,17 @@ itself accordingly, using a script created by GNU autoconf.
More information appears in the file `INSTALL' in the distribution.
+The Bash web page (http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html)
+explains how to obtain binary versions of bash for most of the major
+commercial Unix systems.
+
A5) Will bash run on operating systems other than Unix?
Configuration specifics for Unix-like systems such as QNX and
-LynxOS are included in the distribution. Bash-2.05 should
-compile and run on Minix 2.0 (patches were contributed), but I
-don't believe anyone has built bash-2.x on earlier Minix versions
-yet.
+LynxOS are included in the distribution. Bash-2.05 and later
+versions should compile and run on Minix 2.0 (patches were
+contributed), but I don't believe anyone has built bash-2.x on
+earlier Minix versions yet.
Bash has been ported to versions of Windows implementing the Win32
programming interface. This includes Windows 95 and Windows NT.
@@ -179,10 +184,10 @@ http://sourceware.cygnus.com/cygwin
Cygnus originally ported bash-1.14.7, and that port was part of their
early GNU-Win32 (the original name) releases. Cygnus has also done a
-port of bash-2.04 to the CYGWIN environment, and it is available as
+port of bash-2.05 to the CYGWIN environment, and it is available as
part of their current release.
-Bash-2.05 should require no local Cygnus changes to build and run under
+Bash-2.05a should require no local Cygnus changes to build and run under
CYGWIN.
The Cygnus port works only on Intel machines. There is a port of bash
@@ -190,30 +195,21 @@ The Cygnus port works only on Intel machines. There is a port of bash
ftp://ftp.gnustep.org//pub/win32/bash-alpha-nt-1.01.tar.gz
-DJ Delorie has a port of bash-1.14.7 which runs under MS-DOS, as part
+DJ Delorie has a port of bash-2.x which runs under MS-DOS, as part
of the DJGPP project. For more information on the project, see
http://www.delorie.com/djgpp/
I have been told that the original DJGPP port was done by Daisuke Aoyama.
-I picked up a binary of bash-1.14.7 that is purported to work with
-the DJGPP V2 environment from
-
-ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147b.zip
-
-The corresponding source is
-
-ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147s.zip
-
-Mark Elbrecht <snowball3@bigfoot.com> has sent me notice that bash-2.03
-has become available for DJGPP V2. The files are available as:
+Mark Elbrecht <snowball3@bigfoot.com> has sent me notice that bash-2.04
+is available for DJGPP V2. The files are available as:
-ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203b.zip binary
-ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203d.zip documentation
-ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203s.zip source
+ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204b.zip binary
+ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204d.zip documentation
+ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204s.zip source
-Mark has begun to work with bash-2.04.
+Mark has begun to work with bash-2.05, but I don't know the status.
Ports of bash-1.12 and bash-2.0 are available for OS/2 from
@@ -285,8 +281,9 @@ slightly different.
If you cannot change your login shell in the password file to bash, you
will have to (apparently) live with CDE using the shell in the password
file to run its startup scripts. If you have changed your shell to bash,
-there is code in the CDE startup files (on Solaris, at least) to do the
-right thing.
+there is code in the CDE startup files (on Solaris, at least) that attempts
+to do the right thing. It is, however, often broken, and may require that
+you use the $BASH_ENV trick described below.
`dtterm' claims to use $SHELL as the default program to start, so if you
can change $SHELL in the CDE startup files, you should be able to use bash
@@ -304,6 +301,16 @@ CDE by testing the value of the DT variable:
[ -f /usr/gnu/bin/bash ] && exec /usr/gnu/bin/bash --login
fi
+If CDE starts its shells non-interactively during login, the login shell
+startup files (~/.profile, ~/.bash_profile) will not be sourced at login.
+To get around this problem, append a line similar to the following to your
+~/.dtprofile:
+
+ BASH_ENV=${HOME}/.bash_profile ; export BASH_ENV
+
+and add the following line to the beginning of ~/.bash_profile:
+
+ unset BASH_ENV
A8) I just changed my login shell to bash, and now I can't FTP into my
machine. Why not?
@@ -350,6 +357,12 @@ line editing. Only vi-style line editing commands have been
standardized; emacs editing commands were left out due to
objections.
+The Open Group has made an older version of its Single Unix
+Specification (version 2), which is very similar to POSIX.2,
+available on the web at
+
+http://www.opengroup.org/onlinepubs/007908799/
+
A10) What is the bash `posix mode'?
Although bash is an implementation of the POSIX.2 shell
@@ -367,12 +380,48 @@ Reference Manual.
Section B: The latest version
-B1) What's new in version 2.05?
+B1) What's new in version 2.05a?
+
+The raison d'etre for bash-2.05a is to make an intermediate release
+containing principally bug fixes (some very good work was done and
+contributed after bash-2.05 was released) available before I start to
+work on the major new features to be available in the next release
+(bash-2.06 or bash-3.0 or whatever I tag it). As such, there are
+only a few relatively minor new features.
-Bash-2.05 contains the following new features (see the manual page for
-complete descriptions and the CHANGES and NEWS files in the bash-2.05
+Bash-2.05a contains the following new features (see the manual page for
+complete descriptions and the CHANGES and NEWS files in the bash-2.05a
distribution):
+o The `printf' builtin has undergone major work
+
+o There is a new read-only `shopt' option: login_shell, which is set by
+ login shells and unset otherwise
+
+o New `\A' prompt string escape sequence; expanding to time in 24-hour
+ HH:MM format
+
+o New `-A group/-g' option to complete and compgen; goes group name
+ completion
+
+o New [+-]O invocation option to set and unset `shopt' options at startup
+
+o ksh-like `ERR' trap
+
+o `for' loops now allow empty word lists after the `in' reserved word
+
+o new `hard' and `soft' arguments for the `ulimit' builtin
+
+o Readline can be configured to place the user at the same point on the line
+ when retrieving commands from the history list
+
+o Readline can be configured to skip `hidden' files (filenames with a leading
+ `.' on Unix) when performing completion
+
+A short feature history dating from bash-2.0:
+
+Bash-2.05 introduced the following new features:
+
o This version has once again reverted to using locales and strcoll(3) when
processing pattern matching bracket expressions, as POSIX requires.
o Added a new `--init-file' invocation argument as a synonym for `--rcfile',
@@ -396,8 +445,6 @@ o When `set' is called without options, it prints function defintions in a
`declare -p' as well. This only happens when the shell is not in POSIX
mode, since POSIX.2 forbids this behavior.
-A short feature history dating from bash-2.0:
-
Bash-2.04 introduced the following new features:
o Programmable word completion with the new `complete' and `compgen' builtins;
@@ -523,11 +570,13 @@ grammar tighter and smaller (66 reduce-reduce conflicts gone)
lots of code now smaller and faster
test suite greatly expanded
-B2) Are there any user-visible incompatibilities between bash-2.05 and
+B2) Are there any user-visible incompatibilities between bash-2.05a and
bash-1.14.7?
-There are a few incompatibilities between version 1.14.7 and version 2.05.
-They are detailed in the file COMPAT in the bash-2.05 distribution.
+There are a few incompatibilities between version 1.14.7 and version 2.05a.
+They are detailed in the file COMPAT in the bash-2.05a distribution. That
+file is not meant to be all-encompassing; send mail to bash-maintainers@gnu.org
+if you find something that's not mentioned there.
Section C: Differences from other Unix shells
@@ -539,6 +588,7 @@ completely.
Things bash has that sh does not:
long invocation options
+ [+-]O invocation option
`!' reserved word to invert pipeline return value
`time' reserved word to time pipelines and shell builtins
the `function' reserved word
@@ -564,13 +614,14 @@ Things bash has that sh does not:
SHELLOPTS, OPTERR, HOSTFILE, TMOUT, FUNCNAME, histchars,
auto_resume
DEBUG trap
+ ERR trap
variable arrays with new compound assignment syntax
redirections: <>, &>, >|
prompt string special char translation and variable expansion
auto-export of variables in initial environment
command search finds functions before builtins
bash return builtin will exit a file sourced with `.'
- builtins: cd -/-L/-P, exec -l/-c/-a, echo -e/-E, hash -p.
+ builtins: cd -/-L/-P, exec -l/-c/-a, echo -e/-E, hash -p/-t.
export -n/-f/-p/name=value, pwd -L/-P,
read -e/-p/-a/-t/-n/-d/-s,
readonly -a/-f/name=value, trap -l, set +o,
@@ -638,6 +689,7 @@ C2) How does bash differ from the Korn shell, version ksh88?
Things bash has or uses that ksh88 does not:
long invocation options
+ [-+]O invocation option
`!' reserved word
arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
posix mode and posix conformance
@@ -674,11 +726,11 @@ Things bash has or uses that ksh88 does not:
case-insensitive pattern matching and globbing
`**' arithmetic operator to do exponentiation
redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr
+ arrays of unlimited size
Things ksh88 has or uses that bash does not:
- tracked aliases
+ tracked aliases (alias -t)
variables: ERRNO, FPATH, EDITOR, VISUAL
- trap on ERR
co-processes (|&, >&p, <&p)
weirdly-scoped functions
typeset +f to list all function names without definitions
@@ -686,7 +738,10 @@ Things ksh88 has or uses that bash does not:
builtins: alias -x, cd old new, fc -e -, newgrp, print,
read -p/-s/-u/var?prompt, set -A/-o gmacs/
-o bgnice/-o markdirs/-o nolog/-o trackall/-o viraw/-s,
- typeset -H/-L/-R/-A/-ft/-fu/-fx/-l/-u/-t, whence
+ typeset -H/-L/-R/-Z/-A/-ft/-fu/-fx/-l/-u/-t, whence
+ using environment to pass attributes of exported variables
+ arithmetic evaluation done on arguments to some builtins
+ reads .profile from $PWD when invoked as login shell
Implementation differences:
ksh runs last command of a pipeline in parent shell context
@@ -694,12 +749,14 @@ Implementation differences:
bash has fixed startup file for all interactive shells; ksh reads $ENV
bash has exported functions
bash command search finds functions before builtins
+ bash waits for all commands in pipeline to exit before returning status
+ emacs-mode editing has some slightly different key bindings
C3) Which new features in ksh-93 are not in bash, and which are?
-New things in ksh-93 not in bash-2.05:
+New things in ksh-93 not in bash-2.05a:
associative arrays
- floating point arithmetic
+ floating point arithmetic and variables
math library functions
${!name[sub]} name of subscript for associative array
`.' is allowed in variable names to create a hierarchical namespace
@@ -709,13 +766,24 @@ New things in ksh-93 not in bash-2.05:
typeset -n and `nameref' variables
KEYBD trap
variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, .sh.version,
- .sh.name, .sh.subscript, .sh.value, HISTEDIT
- backreferences in pattern matching
+ .sh.name, .sh.subscript, .sh.value, .sh.match, HISTEDIT
+ backreferences in pattern matching (\N)
+ `&' operator in pattern lists for matching
print -f (bash uses printf)
`fc' has been renamed to `hist'
`.' can execute shell functions
-
-New things in ksh-93 present in bash-2.04:
+ exit statuses between 0 and 255
+ set -o pipefail
+ `+=' variable assignment operator
+ TMOUT is default timeout for `read' and `select'
+ <&N- and >&N- redirections (combination dup and close)
+ FPATH and PATH mixing
+ getopts -a
+ -I invocation option
+ DEBUG trap now executed before each simple command, instead of after
+ printf %H, %P, %T, %Z modifiers, output base for %d
+
+New things in ksh-93 present in bash-2.05a:
for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command
?:, ++, --, `expr1 , expr2' arithmetic operators
expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]},
@@ -1041,6 +1109,16 @@ this.
This is the general approach -- in most cases you will not need to
set $IFS to a different value.
+Some other user-supplied alternatives include:
+
+read A B C D << HERE
+ $(IFS=.; echo $(/usr/local/bin/ipaddr))
+HERE
+
+and, where process substitution is available,
+
+read A B C D < <(IFS=.; echo $(/usr/local/bin/ipaddr))
+
E5) I have a bunch of shell scripts that use backslash-escaped characters
in arguments to `echo'. Bash doesn't interpret these characters. Why
not, and how can I make it understand them?
@@ -1057,7 +1135,7 @@ them.
There is a configuration option that will make bash behave like
the System V echo and interpret things like `\t' by default. Run
-configure with the --enable-usg-echo-default option to turn this
+configure with the --enable-xpg-echo-default option to turn this
on. Be aware that this will cause some of the tests run when you
type `make tests' to fail.
@@ -1101,11 +1179,12 @@ bash:
( cd $d && ${MAKE} ${MFLAGS} clean )
done
-This is a syntax error. If the reserved word `in' is present, a word must
-follow it before the semicolon or newline. The language in the manual page
-referring to the list of words being empty refers to the list after it is
-expanded. There must be at least one word following the `in' when the
-construct is parsed.
+In versions of bash before bash-2.05a, this was a syntax error. If the
+reserved word `in' was present, a word must follow it before the semicolon
+or newline. The language in the manual page referring to the list of words
+being empty referred to the list after it is expanded. These versions of
+bash required that there be at least one word following the `in' when the
+construct was parsed.
The idiomatic Makefile solution is something like:
@@ -1116,11 +1195,9 @@ subdirs-clean:
( cd $$d && ${MAKE} ${MFLAGS} clean ) \
done
-
-The POSIX.2 interpretation committee has considered this issue and declared
-that the bash implemenation is correct, according to the standard:
-
-http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-169.html
+The latest drafts of the updated POSIX standard have changed this: the
+word list is no longer required. Bash versions 2.05a and later accept
+the new syntax.
E8) Why does the arithmetic evaluation code complain about `08'?
@@ -1143,11 +1220,12 @@ honoring the current locale setting when processing ranges within pattern
matching bracket expressions ([A-Z]). This is what POSIX.2 and SUSv2/XPG5
specify.
-The behavior of the matcher in bash-2.05 depends on the current LC_COLLATE
-setting. Setting this variable to `C' or `POSIX' will result in the
-traditional behavior ([A-Z] matches all uppercase ASCII characters).
-Many other locales, including the en_US locale (the default on many US
-versions of Linux) collate the upper and lower case letters like this:
+The behavior of the matcher in bash-2.05 and later versions depends on the
+current LC_COLLATE setting. Setting this variable to `C' or `POSIX' will
+result in the traditional behavior ([A-Z] matches all uppercase ASCII
+characters). Many other locales, including the en_US locale (the default
+on many US versions of Linux) collate the upper and lower case letters like
+this:
AaBb...Zz
@@ -1279,7 +1357,7 @@ comp.unix.shell). While most commands of the form
can be converted to `< file command', shell control structures such as
loops and subshells require `command < file'.
-The file CWRU/sh-redir-hack in the bash-2.05 distribution is an
+The file CWRU/sh-redir-hack in the bash-2.05a distribution is an
(unofficial) patch to parse.y that will modify the grammar to
support this construct. It will not apply with `patch'; you must
modify parse.y by hand. Note that if you apply this, you must
@@ -1396,6 +1474,9 @@ before `eval' is executed. In versions of bash later than bash-2.0,
does the same thing.
+This is not the same thing as ksh93 `nameref' variables, though the syntax
+is similar. I may add namerefs in a future bash version.
+
G4) How can I make the bash `time' reserved word print timing output that
looks like the output from my system's /usr/bin/time?
@@ -1524,14 +1605,14 @@ or on the web.
H3) What's coming in future versions?
-These are features I plan to include in a future version of bash.
+These are features I hope to include in a future version of bash.
-a bash debugger (a minimally-tested version is included with bash-2.05)
+a better bash debugger (a minimally-tested version is included with bash-2.05a)
associative arrays
changes to the DEBUG trap to be compatible with ksh93 (which runs the
trap before each simple command, instead of after each one like previous
versions)
-an implementation of the ksh-like ERR trap
+co-processes, but with a new-style syntax that looks like function declaration
H4) What's on the bash `wish list' for future versions?
@@ -1545,11 +1626,15 @@ date-stamped command history
a bash programmer's guide with a chapter on creating loadable builtins
a better loadable interface to perl with access to the shell builtins and
variables (contributions gratefully accepted)
+ksh93-like `nameref' variables
+ksh93-like `+=' variable assignment operator
+ksh93-like `xx.yy' variables (including some of the .sh.* variables) and
+ associated disipline functions
+Some of the new ksh93 pattern matching operators, like backreferencing
H5) When will the next release appear?
-The next version will appear sometime in 2001 or 2002. Never make
-predictions.
+The next version will appear sometime in 2002. Never make predictions.
This document is Copyright 1995-2001 by Chester Ramey.
diff --git a/doc/Makefile.in b/doc/Makefile.in
index ab46f0c..f7231c7 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -32,13 +32,16 @@ infodir = @infodir@
# set this to a directory name to have the HTML files installed
htmldir = @htmldir@
+# Support an alternate destination root directory for package building
+DESTDIR =
+
mandir = @mandir@
manpfx = man
-man1ext = 1
-man1dir = $(mandir)/$(manpfx)$(man1ext)
-man3ext = 3
-man3dir = $(mandir)/$(manpfx)$(man3ext)
+man1ext = .1
+man1dir = $(mandir)/$(manpfx)1
+man3ext = .3
+man3dir = $(mandir)/$(manpfx)3
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -167,34 +170,6 @@ article.ps: article.ms
$(MAN2HTML): ${topdir}/support/man2html.c
-( cd ${BUILD_DIR}/support ; ${MAKE} ${MFLAGS} man2html)
-CREATED_FAQ = faq.news faq.news2 faq.mail faq.version
-
-faq: ${CREATED_FAQ}
-
-faq.version: FAQ.version FAQ
- sh mkfaqvers FAQ.version > $@
-
-faq.headers.mail: FAQ.headers.mail FAQ
- sh mkfaqvers FAQ.headers.mail > $@
-
-faq.headers.news: FAQ.headers.news FAQ
- sh mkfaqvers FAQ.headers.news > $@
-
-faq.headers.news2: FAQ.headers.news2 FAQ
- sh mkfaqvers FAQ.headers.news2 > $@
-
-faq.news: FAQ faq.headers.news faq.version
- $(RM) $@
- cat faq.headers.news faq.version FAQ > $@
-
-faq.news2: FAQ faq.headers.news2 faq.version
- $(RM) $@
- cat faq.headers.news2 faq.version FAQ > $@
-
-faq.mail: FAQ faq.headers.mail faq.version
- $(RM) $@
- cat faq.headers.mail faq.version FAQ > $@
-
clean:
$(RM) *.aux *.bak *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps \
*.pgs *.bt *.bts *.rw *.rws *.fns *.kys *.tps *.vrs *.o
@@ -209,37 +184,65 @@ maintainer-clean: clean
$(RM) Makefile
installdirs:
- -test -d $(man1dir) || $(SHELL) ${MKDIRS} $(man1dir)
- -test -d $(infodir) || $(SHELL) ${MKDIRS} $(infodir)
- -if [ -n "$(htmldir)" ]; then \
- test -d $(htmldir) || $(SHELL) ${MKDIRS} $(htmldir) ; \
+ -test -d $(man1dir) || $(SHELL) ${MKDIRS} $(DESTDIR)$(man1dir)
+ -test -d $(infodir) || $(SHELL) ${MKDIRS} $(DESTDIR)$(infodir)
+ -if test -n "$(htmldir)" ; then \
+ test -d $(htmldir) || $(SHELL) ${MKDIRS} $(DESTDIR)$(htmldir) ; \
fi
install: info installdirs
- -$(INSTALL_DATA) $(srcdir)/bash.1 $(man1dir)/bash.${man1ext}
- -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(man1dir)/bashbug.${man1ext}
+ -$(INSTALL_DATA) $(srcdir)/bash.1 $(DESTDIR)$(man1dir)/bash${man1ext}
+ -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext}
# uncomment the next line to install the builtins man page
-# $(INSTALL_DATA) $(srcdir)/builtins.1 $(man1dir)/bash_builtins.${man1ext}
- -$(INSTALL_DATA) $(srcdir)/bashref.info $(infodir)/bash.info
+# -$(INSTALL_DATA) $(srcdir)/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
+ -$(INSTALL_DATA) $(srcdir)/bashref.info $(DESTDIR)$(infodir)/bash.info
# run install-info if it is present to update the info directory
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
- install-info --dir-file=$(infodir)/dir $(infodir)/bash.info; \
+ install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/bash.info; \
else true; fi
# if htmldir is set, install the html files into that directory
- -if [ -n "${htmldir}" ]; then \
- $(INSTALL_DATA) $(srcdir)/bash.html $(htmldir) ; \
- $(INSTALL_DATA) $(srcdir)/bashref.html $(htmldir) ; \
+ -if test -n "${htmldir}" ; then \
+ $(INSTALL_DATA) $(srcdir)/bash.html $(DESTDIR)$(htmldir) ; \
+ $(INSTALL_DATA) $(srcdir)/bashref.html $(DESTDIR)$(htmldir) ; \
fi
uninstall:
- -$(RM) $(man1dir)/bash.${man1ext} $(man1dir)/bashbug.${man1ext}
- $(RM) $(infodir)/bash.info
- -if [ -n "$(htmldir)" ]; then \
- $(RM) $(htmldir)/bash.html ; \
- $(RM) $(htmldir)/bashref.html ; \
+ -$(RM) $(DESTDIR)$(man1dir)/bash${man1ext} $(DESTDIR)$(man1dir)/bashbug${man1ext}
+ $(RM) $(DESTDIR)$(infodir)/bash.info
+ -if test -n "$(htmldir)" ; then \
+ $(RM) $(DESTDIR)$(htmldir)/bash.html ; \
+ $(RM) $(DESTDIR)$(htmldir)/bashref.html ; \
fi
# for use by chet
+CREATED_FAQ = faq.news faq.news2 faq.mail faq.version
+
+faq: ${CREATED_FAQ}
+
+faq.version: FAQ.version FAQ
+ sh mkfaqvers FAQ.version > $@
+
+faq.headers.mail: FAQ.headers.mail FAQ
+ sh mkfaqvers FAQ.headers.mail > $@
+
+faq.headers.news: FAQ.headers.news FAQ
+ sh mkfaqvers FAQ.headers.news > $@
+
+faq.headers.news2: FAQ.headers.news2 FAQ
+ sh mkfaqvers FAQ.headers.news2 > $@
+
+faq.news: FAQ faq.headers.news faq.version
+ $(RM) $@
+ cat faq.headers.news faq.version FAQ > $@
+
+faq.news2: FAQ faq.headers.news2 faq.version
+ $(RM) $@
+ cat faq.headers.news2 faq.version FAQ > $@
+
+faq.mail: FAQ faq.headers.mail faq.version
+ $(RM) $@
+ cat faq.headers.mail faq.version FAQ > $@
+
inst: bashref.texi
$(SHELL) ./mkinstall
cmp -s INSTALL ../INSTALL || mv INSTALL ../INSTALL
diff --git a/doc/bash.1 b/doc/bash.1
index 8809816..b3e9372 100644
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -6,12 +6,12 @@
.\" Case Western Reserve University
.\" chet@ins.CWRU.Edu
.\"
-.\" Last Change: Mon Mar 5 10:19:14 EST 2001
+.\" Last Change: Tue Nov 13 12:55:51 EST 2001
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
-.TH BASH 1 "2001 Mar 5" "GNU Bash-2.05"
+.TH BASH 1 "2001 November 13" "GNU Bash-2.05a"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -113,6 +113,19 @@ are subject to language translation when the current locale
is not \fBC\fP or \fBPOSIX\fP.
This implies the \fB\-n\fP option; no commands will be executed.
.TP
+.B [\-+]O [\fIshopt_option\fP]
+\fIshopt_option\fP is one of the shell options accepted by the
+\fBshopt\fP builtin (see
+.SM
+.B SHELL BUILTIN COMMANDS
+below).
+If \fIshopt_option\fP is present, \fB\-O\fP sets the value of that option;
+\fB+O\fP unsets it.
+If \fIshopt_option\fP is not supplied, the names and values of the shell
+options accepted by \fBshopt\fP are printed on the standard output.
+If the invocation option is \fB+O\fP, the output is displayed in a format
+that may be reused as input.
+.TP
.B \-\-
A
.B \-\-
@@ -226,6 +239,11 @@ reads and executes commands from this file, then exits.
\fBBash\fP's exit status is the exit status of the last command
executed in the script.
If no commands are executed, the exit status is 0.
+An attempt is first made to open the file in the current directory, and,
+if no file is found, then the shell searches the directories in
+.SM
+.B PATH
+for the script.
.SH INVOCATION
A \fIlogin shell\fP is one whose first character of argument zero is a
.BR \- ,
@@ -390,8 +408,10 @@ or allow them to be specified.
.PP
If the shell is started with the effective user (group) id not equal to the
real user (group) id, and the \fB\-p\fP option is not supplied, no startup
-files are read, shell functions are not inherited from the environment,
-the \fBSHELLOPTS\fP variable, if it appears in the environment, is ignored,
+files are read, shell functions are not inherited from the environment, the
+.SM
+.B SHELLOPTS
+variable, if it appears in the environment, is ignored,
and the effective user id is set to the real user id.
If the \fB\-p\fP option is supplied at invocation, the startup behavior is
the same, but the effective user id is not reset.
@@ -460,8 +480,8 @@ command:
A \fIsimple command\fP is a sequence of optional variable assignments
followed by \fBblank\fP-separated words and redirections, and
terminated by a \fIcontrol operator\fP. The first word
-specifies the command to be executed. The remaining words are
-passed as arguments to the invoked command.
+specifies the command to be executed, and is passed as argument zero.
+The remaining words are passed as arguments to the invoked command.
.PP
The return value of a \fIsimple command\fP is its exit status, or
128+\fIn\^\fP if the command is terminated by signal
@@ -479,7 +499,7 @@ The format for a pipeline is:
.PP
The standard output of
.I command
-is connected to the standard input of
+is connected via a pipe to the standard input of
.IR command2 .
This connection is performed before any redirections specified by the
command (see
@@ -595,6 +615,10 @@ after the command completes. The return status is the exit status of
This is known as a \fIgroup command\fP.
The return status is the exit status of
\fIlist\fP.
+Note that unlike the metacharacters \fB(\fP and \fB\)\fP, \fB{\fP and
+\fB}\fP are \fIreserved words\fP and must occur where a reserved
+word is permitted to be recognized. Since they do not cause a word
+break, they must be separated from \fIlist\fP by whitespace.
.TP
((\fIexpression\fP))
The \fIexpression\fP is evaluated according to the rules described
@@ -657,7 +681,6 @@ or
.I expression2
is true.
.PD
-.RE
.LP
The \fB&&\fP and
.if t \fB\(bv\(bv\fP
@@ -665,6 +688,7 @@ The \fB&&\fP and
operators do not execute \fIexpression2\fP if the value of
\fIexpression1\fP is sufficient to determine the return value of
the entire conditional expression.
+.RE
.TP
\fBfor\fP \fIname\fP [ \fBin\fP \fIword\fP ] ; \fBdo\fP \fIlist\fP ; \fBdone\fP
The list of words following \fBin\fP is expanded, generating a list
@@ -716,8 +740,6 @@ The
.I list
is executed after each selection until a
.B break
-or
-.B return
command is executed.
The exit status of
.B select
@@ -901,12 +923,12 @@ backslash
single quote
.TP
.B \e\fInnn\fP
-the character whose ASCII code is the octal value \fInnn\fP
+the eight-bit character whose value is the octal value \fInnn\fP
(one to three digits)
.TP
-.B \ex\fInnn\fP
-the character whose ASCII code is the hexadecimal value \fInnn\fP
-(one to three digits)
+.B \ex\fIHH\fP
+the eight-bit character whose value is the hexadecimal value \fIHH\fP
+(one or two hex digits)
.PD
.RE
.LP
@@ -931,6 +953,14 @@ For the shell's purposes, a
.I variable
is a parameter denoted by a
.IR name .
+A variable has a \fIvalue\fP and zero or more \fIattributes\fP.
+Attributes are assigned using the
+.B declare
+builtin command (see
+.B declare
+below in
+.SM
+.BR "SHELL BUILTIN COMMANDS" ).
.PP
A parameter is set if it has been assigned a value. The null string is
a valid value. Once a variable is set, it may be unset only by using
@@ -960,12 +990,7 @@ removal (see
.B EXPANSION
below). If the variable has its
.B integer
-attribute set (see
-.B declare
-below in
-.SM
-.BR "SHELL BUILTIN COMMANDS" )
-then
+attribute set, then
.I value
is subject to arithmetic expansion even if the $((...)) expansion is
not used (see
@@ -975,6 +1000,14 @@ Word splitting is not performed, with the exception
of \fB"$@"\fP as explained below under
.BR "Special Parameters" .
Pathname expansion is not performed.
+Assignment statements may also appear as arguments to the
+.BR declare ,
+.BR typeset ,
+.BR export ,
+.BR readonly ,
+and
+.B local
+builtin commands.
.SS Positional Parameters
.PP
A
@@ -1092,53 +1125,10 @@ The following variables are set by the shell:
.PP
.PD 0
.TP
-.B PPID
-The process ID of the shell's parent. This variable is readonly.
-.TP
-.B PWD
-The current working directory as set by the
-.B cd
-command.
-.TP
-.B OLDPWD
-The previous working directory as set by the
-.B cd
-command.
-.TP
-.B REPLY
-Set to the line of input read by the
-.B read
-builtin command when no arguments are supplied.
-.TP
-.B UID
-Expands to the user ID of the current user, initialized at shell startup.
-This variable is readonly.
-.TP
-.B EUID
-Expands to the effective user ID of the current user, initialized at
-shell startup. This variable is readonly.
-.TP
-.B GROUPS
-An array variable containing the list of groups of which the current
-user is a member.
-Assignments to
-.SM
-.B GROUPS
-have no effect and return an error status.
-If
-.SM
-.B GROUPS
-is unset, it loses its special properties, even if it is
-subsequently reset.
-.TP
.B BASH
Expands to the full file name used to invoke this instance of
.BR bash .
.TP
-.B BASH_VERSION
-Expands to a string describing the version of this instance of
-.BR bash .
-.TP
.B BASH_VERSINFO
A readonly array variable whose members hold version information for
this instance of
@@ -1168,48 +1158,88 @@ The value of \fBMACHTYPE\fP.
.PD
.RE
.TP
-.B SHLVL
-Incremented by one each time an instance of
-.B bash
-is started.
+.B BASH_VERSION
+Expands to a string describing the version of this instance of
+.BR bash .
.TP
-.B RANDOM
-Each time this parameter is referenced, a random integer between
-0 and 32767 is
-generated. The sequence of random numbers may be initialized by assigning
-a value to
-.SM
-.BR RANDOM .
+.B COMP_CWORD
+An index into \fB${COMP_WORDS}\fP of the word containing the current
+cursor position.
+This variable is available only in shell functions invoked by the
+programmable completion facilities (see \fBProgrammable Completion\fP
+below).
+.TP
+.B COMP_LINE
+The current command line.
+This variable is available only in shell functions and external
+commands invoked by the
+programmable completion facilities (see \fBProgrammable Completion\fP
+below).
+.TP
+.B COMP_POINT
+The index of the current cursor position relative to the beginning of
+the current command.
+If the current cursor position is at the end of the current command,
+the value of this variable is equal to \fB${#COMP_LINE}\fP.
+This variable is available only in shell functions and external
+commands invoked by the
+programmable completion facilities (see \fBProgrammable Completion\fP
+below).
+.TP
+.B COMP_WORDS
+An array variable (see \fBArrays\fP below) consisting of the individual
+words in the current command line.
+This variable is available only in shell functions invoked by the
+programmable completion facilities (see \fBProgrammable Completion\fP
+below).
+.TP
+.B DIRSTACK
+An array variable (see
+.B Arrays
+below) containing the current contents of the directory stack.
+Directories appear in the stack in the order they are displayed by the
+.B dirs
+builtin.
+Assigning to members of this array variable may be used to modify
+directories already in the stack, but the
+.B pushd
+and
+.B popd
+builtins must be used to add and remove directories.
+Assignment to this variable will not change the current directory.
If
.SM
-.B RANDOM
+.B DIRSTACK
is unset, it loses its special properties, even if it is
subsequently reset.
.TP
-.B SECONDS
-Each time this parameter is
-referenced, the number of seconds since shell invocation is returned. If a
-value is assigned to
+.B EUID
+Expands to the effective user ID of the current user, initialized at
+shell startup. This variable is readonly.
+.TP
+.B FUNCNAME
+The name of any currently-executing shell function.
+This variable exists only when a shell function is executing.
+Assignments to
.SM
-.BR SECONDS ,
-the value returned upon subsequent
-references is
-the number of seconds since the assignment plus the value assigned.
+.B FUNCNAME
+have no effect and return an error status.
If
.SM
-.B SECONDS
+.B FUNCNAME
is unset, it loses its special properties, even if it is
subsequently reset.
.TP
-.B LINENO
-Each time this parameter is referenced, the shell substitutes
-a decimal number representing the current sequential line number
-(starting with 1) within a script or function. When not in a
-script or function, the value substituted is not guaranteed to
-be meaningful.
+.B GROUPS
+An array variable containing the list of groups of which the current
+user is a member.
+Assignments to
+.SM
+.B GROUPS
+have no effect and return an error status.
If
.SM
-.B LINENO
+.B GROUPS
is unset, it loses its special properties, even if it is
subsequently reset.
.TP
@@ -1222,45 +1252,39 @@ If
is unset, it loses its special properties, even if it is
subsequently reset.
.TP
-.B FUNCNAME
-The name of any currently-executing shell function.
-This variable exists only when a shell function is executing.
-Assignments to
-.SM
-.B FUNCNAME
-have no effect and return an error status.
-If
-.SM
-.B FUNCNAME
-is unset, it loses its special properties, even if it is
-subsequently reset.
+.B HOSTNAME
+Automatically set to the name of the current host.
.TP
-.B DIRSTACK
-An array variable (see
-.B Arrays
-below) containing the current contents of the directory stack.
-Directories appear in the stack in the order they are displayed by the
-.B dirs
-builtin.
-Assigning to members of this array variable may be used to modify
-directories already in the stack, but the
-.B pushd
-and
-.B popd
-builtins must be used to add and remove directories.
-Assignment to this variable will not change the current directory.
+.B HOSTTYPE
+Automatically set to a string that uniquely
+describes the type of machine on which
+.B bash
+is executing.
+The default is system-dependent.
+.TP
+.B LINENO
+Each time this parameter is referenced, the shell substitutes
+a decimal number representing the current sequential line number
+(starting with 1) within a script or function. When not in a
+script or function, the value substituted is not guaranteed to
+be meaningful.
If
.SM
-.B DIRSTACK
+.B LINENO
is unset, it loses its special properties, even if it is
subsequently reset.
.TP
-.B PIPESTATUS
-An array variable (see
-.B Arrays
-below) containing a list of exit status values from the processes
-in the most-recently-executed foreground pipeline (which may
-contain only a single command).
+.B MACHTYPE
+Automatically set to a string that fully describes the system
+type on which
+.B bash
+is executing, in the standard GNU \fIcpu-company-system\fP format.
+The default is system-dependent.
+.TP
+.B OLDPWD
+The previous working directory as set by the
+.B cd
+command.
.TP
.B OPTARG
The value of the last option argument processed by the
@@ -1278,16 +1302,6 @@ builtin command (see
.B SHELL BUILTIN COMMANDS
below).
.TP
-.B HOSTNAME
-Automatically set to the name of the current host.
-.TP
-.B HOSTTYPE
-Automatically set to a string that uniquely
-describes the type of machine on which
-.B bash
-is executing.
-The default is system-dependent.
-.TP
.B OSTYPE
Automatically set to a string that
describes the operating system on which
@@ -1295,12 +1309,53 @@ describes the operating system on which
is executing.
The default is system-dependent.
.TP
-.B MACHTYPE
-Automatically set to a string that fully describes the system
-type on which
-.B bash
-is executing, in the standard GNU \fIcpu-company-system\fP format.
-The default is system-dependent.
+.B PIPESTATUS
+An array variable (see
+.B Arrays
+below) containing a list of exit status values from the processes
+in the most-recently-executed foreground pipeline (which may
+contain only a single command).
+.TP
+.B PPID
+The process ID of the shell's parent. This variable is readonly.
+.TP
+.B PWD
+The current working directory as set by the
+.B cd
+command.
+.TP
+.B RANDOM
+Each time this parameter is referenced, a random integer between
+0 and 32767 is
+generated. The sequence of random numbers may be initialized by assigning
+a value to
+.SM
+.BR RANDOM .
+If
+.SM
+.B RANDOM
+is unset, it loses its special properties, even if it is
+subsequently reset.
+.TP
+.B REPLY
+Set to the line of input read by the
+.B read
+builtin command when no arguments are supplied.
+.TP
+.B SECONDS
+Each time this parameter is
+referenced, the number of seconds since shell invocation is returned. If a
+value is assigned to
+.SM
+.BR SECONDS ,
+the value returned upon subsequent
+references is
+the number of seconds since the assignment plus the value assigned.
+If
+.SM
+.B SECONDS
+is unset, it loses its special properties, even if it is
+subsequently reset.
.TP
.B SHELLOPTS
A colon-separated list of enabled shell options. Each word in
@@ -1323,36 +1378,14 @@ starts up, each shell option in the list will be enabled before
reading any startup files.
This variable is read-only.
.TP
-.B COMP_WORDS
-An array variable (see \fBArrays\fP below) consisting of the individual
-words in the current command line.
-This variable is available only in shell functions invoked by the
-programmable completion facilities (see \fBProgrammable Completion\fP
-below).
-.TP
-.B COMP_CWORD
-An index into \fB${COMP_WORDS}\fP of the word containing the current
-cursor position.
-This variable is available only in shell functions invoked by the
-programmable completion facilities (see \fBProgrammable Completion\fP
-below).
-.TP
-.B COMP_LINE
-The current command line.
-This variable is available only in shell functions and external
-commands invoked by the
-programmable completion facilities (see \fBProgrammable Completion\fP
-below).
+.B SHLVL
+Incremented by one each time an instance of
+.B bash
+is started.
.TP
-.B COMP_POINT
-The index of the current cursor position relative to the beginning of
-the current command.
-If the current cursor position is at the end of the current command,
-the value of this variable is equal to \fB${#COMP_LINE}\fP.
-This variable is available only in shell functions and external
-commands invoked by the
-programmable completion facilities (see \fBProgrammable Completion\fP
-below).
+.B UID
+Expands to the user ID of the current user, initialized at shell startup.
+This variable is readonly.
.PD
.PP
The following variables are used by the shell. In some cases,
@@ -1362,33 +1395,19 @@ below.
.PP
.PD 0
.TP
-.B IFS
-The
-.I Internal Field Separator
-that is used
-for word splitting after expansion and to
-split lines into words with the
-.B read
-builtin command. The default value is
-``<space><tab><newline>''.
-.TP
-.B PATH
-The search path for commands. It
-is a colon-separated list of directories in which
-the shell looks for commands (see
+.B BASH_ENV
+If this parameter is set when \fBbash\fP is executing a shell script,
+its value is interpreted as a filename containing commands to
+initialize the shell, as in
+.IR ~/.bashrc .
+The value of
.SM
-.B COMMAND EXECUTION
-below). The default path is system-dependent,
-and is set by the administrator who installs
-.BR bash .
-A common value is
-.if t \f(CW/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.\fP.
-.if n ``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.''.
-.TP
-.B HOME
-The home directory of the current user; the default argument for the
-\fBcd\fP builtin command.
-The value of this variable is also used when performing tilde expansion.
+.B BASH_ENV
+is subjected to parameter expansion, command substitution, and arithmetic
+expansion before being interpreted as a file name.
+.SM
+.B PATH
+is not used to search for the resultant file name.
.TP
.B CDPATH
The search path for the
@@ -1400,19 +1419,193 @@ for destination directories specified by the
command.
A sample value is ``.:~:/usr''.
.TP
-.B BASH_ENV
-If this parameter is set when \fBbash\fP is executing a shell script,
-its value is interpreted as a filename containing commands to
-initialize the shell, as in
-.IR ~/.bashrc .
-The value of
+.B COLUMNS
+Used by the \fBselect\fP builtin command to determine the terminal width
+when printing selection lists. Automatically set upon receipt of a SIGWINCH.
+.TP
+.B COMPREPLY
+An array variable from which \fBbash\fP reads the possible completions
+generated by a shell function invoked by the programmable completion
+facility (see \fBProgrammable Completion\fP below).
+.TP
+.B FCEDIT
+The default editor for the
+.B fc
+builtin command.
+.TP
+.B FIGNORE
+A colon-separated list of suffixes to ignore when performing
+filename completion (see
.SM
-.B BASH_ENV
-is subjected to parameter expansion, command substitution, and arithmetic
-expansion before being interpreted as a file name.
+.B READLINE
+below).
+A filename whose suffix matches one of the entries in
.SM
-.B PATH
-is not used to search for the resultant file name.
+.B FIGNORE
+is excluded from the list of matched filenames.
+A sample value is ``.o:~''.
+.TP
+.B GLOBIGNORE
+A colon-separated list of patterns defining the set of filenames to
+be ignored by pathname expansion.
+If a filename matched by a pathname expansion pattern also matches one
+of the patterns in
+.SM
+.BR GLOBIGNORE ,
+it is removed from the list of matches.
+.TP
+.B HISTCONTROL
+If set to a value of
+.IR ignorespace ,
+lines which begin with a
+.B space
+character are not entered on the history list.
+If set to a value of
+.IR ignoredups ,
+lines matching the last history line are not entered.
+A value of
+.I ignoreboth
+combines the two options.
+If unset, or if set to any other value than those above,
+all lines read
+by the parser are saved on the history list, subject to the value
+of
+.BR HISTIGNORE .
+This variable's function is superseded by
+.BR HISTIGNORE .
+The second and subsequent lines of a multi-line compound command are
+not tested, and are added to the history regardless of the value of
+.BR HISTCONTROL .
+.TP
+.B HISTFILE
+The name of the file in which command history is saved (see
+.SM
+.B HISTORY
+below). The default value is \fI~/.bash_history\fP. If unset, the
+command history is not saved when an interactive shell exits.
+.TP
+.B HISTFILESIZE
+The maximum number of lines contained in the history file. When this
+variable is assigned a value, the history file is truncated, if
+necessary, to contain no more than that number of lines. The default
+value is 500. The history file is also truncated to this size after
+writing it when an interactive shell exits.
+.TP
+.B HISTIGNORE
+A colon-separated list of patterns used to decide which command lines
+should be saved on the history list. Each pattern is anchored at the
+beginning of the line and must match the complete line (no implicit
+`\fB*\fP' is appended). Each pattern is tested against the line
+after the checks specified by
+.B HISTCONTROL
+are applied.
+In addition to the normal shell pattern matching characters, `\fB&\fP'
+matches the previous history line. `\fB&\fP' may be escaped using a
+backslash; the backslash is removed before attempting a match.
+The second and subsequent lines of a multi-line compound command are
+not tested, and are added to the history regardless of the value of
+.BR HISTIGNORE .
+.TP
+.B HISTSIZE
+The number of commands to remember in the command history (see
+.SM
+.B HISTORY
+below). The default value is 500.
+.TP
+.B HOME
+The home directory of the current user; the default argument for the
+\fBcd\fP builtin command.
+The value of this variable is also used when performing tilde expansion.
+.TP
+.B HOSTFILE
+Contains the name of a file in the same format as
+.FN /etc/hosts
+that should be read when the shell needs to complete a
+hostname.
+The list of possible hostname completions may be changed while the
+shell is running;
+the next time hostname completion is attempted after the
+value is changed,
+.B bash
+adds the contents of the new file to the existing list.
+If
+.SM
+.B HOSTFILE
+is set, but has no value, \fBbash\fP attempts to read
+.FN /etc/hosts
+to obtain the list of possible hostname completions.
+When
+.SM
+.B HOSTFILE
+is unset, the hostname list is cleared.
+.TP
+.B IFS
+The
+.I Internal Field Separator
+that is used
+for word splitting after expansion and to
+split lines into words with the
+.B read
+builtin command. The default value is
+``<space><tab><newline>''.
+.TP
+.B IGNOREEOF
+Controls the
+action of an interactive shell on receipt of an
+.SM
+.B EOF
+character as the sole input. If set, the value is the number of
+consecutive
+.SM
+.B EOF
+characters which must be
+typed as the first characters on an input line before
+.B bash
+exits. If the variable exists but does not have a numeric value, or
+has no value, the default value is 10. If it does not exist,
+.SM
+.B EOF
+signifies the end of input to the shell.
+.TP
+.B INPUTRC
+The filename for the
+.B readline
+startup file, overriding the default of
+.FN ~/.inputrc
+(see
+.SM
+.B READLINE
+below).
+.TP
+.B LANG
+Used to determine the locale category for any category not specifically
+selected with a variable starting with \fBLC_\fP.
+.TP
+.B LC_ALL
+This variable overrides the value of \fBLANG\fP and any other
+\fBLC_\fP variable specifying a locale category.
+.TP
+.B LC_COLLATE
+This variable determines the collation order used when sorting the
+results of pathname expansion, and determines the behavior of range
+expressions, equivalence classes, and collating sequences within
+pathname expansion and pattern matching.
+.TP
+.B LC_CTYPE
+This variable determines the interpretation of characters and the
+behavior of character classes within pathname expansion and pattern
+matching.
+.TP
+.B LC_MESSAGES
+This variable determines the locale used to translate double-quoted
+strings preceded by a \fB$\fP.
+.TP
+.B LC_NUMERIC
+This variable determines the locale category used for number formatting.
+.TP
+.B LINES
+Used by the \fBselect\fP builtin command to determine the column length
+for printing selection lists. Automatically set upon receipt of a SIGWINCH.
.TP
.B MAIL
If this parameter is set to a file name and the
@@ -1447,6 +1640,47 @@ supplies a default value for this variable, but the location of the user
mail files that it uses is system dependent (e.g., /var/mail/\fB$USER\fP).
.RE
.TP
+.B OPTERR
+If set to the value 1,
+.B bash
+displays error messages generated by the
+.B getopts
+builtin command (see
+.SM
+.B SHELL BUILTIN COMMANDS
+below).
+.SM
+.B OPTERR
+is initialized to 1 each time the shell is invoked or a shell
+script is executed.
+.TP
+.B PATH
+The search path for commands. It
+is a colon-separated list of directories in which
+the shell looks for commands (see
+.SM
+.B COMMAND EXECUTION
+below). The default path is system-dependent,
+and is set by the administrator who installs
+.BR bash .
+A common value is
+.if t \f(CW/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.\fP.
+.if n ``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.''.
+.TP
+.B POSIXLY_CORRECT
+If this variable is in the environment when \fBbash\fP starts, the shell
+enters \fIposix mode\fP before reading the startup files, as if the
+.B \-\-posix
+invocation option had been supplied. If it is set while the shell is
+running, \fBbash\fP enables \fIposix mode\fP, as if the command
+.if t \f(CWset -o posix\fP
+.if n \fIset -o posix\fP
+had been executed.
+.TP
+.B PROMPT_COMMAND
+If set, the value is executed as a command prior to issuing each primary
+prompt.
+.TP
.B PS1
The value of this parameter is expanded (see
.SM
@@ -1526,96 +1760,6 @@ value \fB$'\enreal\et%3lR\enuser\et%3lU\ensys\t%3lS'\fP.
If the value is null, no timing information is displayed.
A trailing newline is added when the format string is displayed.
.TP
-.B HISTSIZE
-The number of commands to remember in the command history (see
-.SM
-.B HISTORY
-below). The default value is 500.
-.TP
-.B HISTFILE
-The name of the file in which command history is saved (see
-.SM
-.B HISTORY
-below). The default value is \fI~/.bash_history\fP. If unset, the
-command history is not saved when an interactive shell exits.
-.TP
-.B HISTFILESIZE
-The maximum number of lines contained in the history file. When this
-variable is assigned a value, the history file is truncated, if
-necessary, to contain no more than that number of lines. The default
-value is 500. The history file is also truncated to this size after
-writing it when an interactive shell exits.
-.TP
-.B OPTERR
-If set to the value 1,
-.B bash
-displays error messages generated by the
-.B getopts
-builtin command (see
-.SM
-.B SHELL BUILTIN COMMANDS
-below).
-.SM
-.B OPTERR
-is initialized to 1 each time the shell is invoked or a shell
-script is executed.
-.TP
-.B LANG
-Used to determine the locale category for any category not specifically
-selected with a variable starting with \fBLC_\fP.
-.TP
-.B LC_ALL
-This variable overrides the value of \fBLANG\fP and any other
-\fBLC_\fP variable specifying a locale category.
-.TP
-.B LC_COLLATE
-This variable determines the collation order used when sorting the
-results of pathname expansion, and determines the behavior of range
-expressions, equivalence classes, and collating sequences within
-pathname expansion and pattern matching.
-.TP
-.B LC_CTYPE
-This variable determines the interpretation of characters and the
-behavior of character classes within pathname expansion and pattern
-matching.
-.TP
-.B LC_MESSAGES
-This variable determines the locale used to translate double-quoted
-strings preceded by a \fB$\fP.
-.TP
-.B LC_NUMERIC
-This variable determines the locale category used for number formatting.
-.TP
-.B LINES
-Used by the \fBselect\fP builtin command to determine the column length
-for printing selection lists. Automatically set upon receipt of a SIGWINCH.
-.TP
-.B COLUMNS
-Used by the \fBselect\fP builtin command to determine the terminal width
-when printing selection lists. Automatically set upon receipt of a SIGWINCH.
-.TP
-.B PROMPT_COMMAND
-If set, the value is executed as a command prior to issuing each primary
-prompt.
-.TP
-.B IGNOREEOF
-Controls the
-action of an interactive shell on receipt of an
-.SM
-.B EOF
-character as the sole input. If set, the value is the number of
-consecutive
-.SM
-.B EOF
-characters which must be
-typed as the first characters on an input line before
-.B bash
-exits. If the variable exists but does not have a numeric value, or
-has no value, the default value is 10. If it does not exist,
-.SM
-.B EOF
-signifies the end of input to the shell.
-.TP
.B TMOUT
If set to a value greater than zero, the value is interpreted as the
number of seconds to wait for input after issuing the primary prompt.
@@ -1623,121 +1767,6 @@ number of seconds to wait for input after issuing the primary prompt.
terminates after waiting for that number of seconds if input does
not arrive.
.TP
-.B FCEDIT
-The default editor for the
-.B fc
-builtin command.
-.TP
-.B FIGNORE
-A colon-separated list of suffixes to ignore when performing
-filename completion (see
-.SM
-.B READLINE
-below).
-A filename whose suffix matches one of the entries in
-.SM
-.B FIGNORE
-is excluded from the list of matched filenames.
-A sample value is ``.o:~''.
-.TP
-.B GLOBIGNORE
-A colon-separated list of patterns defining the set of filenames to
-be ignored by pathname expansion.
-If a filename matched by a pathname expansion pattern also matches one
-of the patterns in
-.SM
-.BR GLOBIGNORE ,
-it is removed from the list of matches.
-.TP
-.B INPUTRC
-The filename for the
-.B readline
-startup file, overriding the default of
-.FN ~/.inputrc
-(see
-.SM
-.B READLINE
-below).
-.TP
-.B HISTCONTROL
-If set to a value of
-.IR ignorespace ,
-lines which begin with a
-.B space
-character are not entered on the history list.
-If set to a value of
-.IR ignoredups ,
-lines matching the last history line are not entered.
-A value of
-.I ignoreboth
-combines the two options.
-If unset, or if set to any other value than those above,
-all lines read
-by the parser are saved on the history list, subject to the value
-of
-.BR HISTIGNORE .
-This variable's function is superseded by
-.BR HISTIGNORE .
-The second and subsequent lines of a multi-line compound command are
-not tested, and are added to the history regardless of the value of
-.BR HISTCONTROL .
-.TP
-.B HISTIGNORE
-A colon-separated list of patterns used to decide which command lines
-should be saved on the history list. Each pattern is anchored at the
-beginning of the line and must match the complete line (no implicit
-`\fB*\fP' is appended). Each pattern is tested against the line
-after the checks specified by
-.B HISTCONTROL
-are applied.
-In addition to the normal shell pattern matching characters, `\fB&\fP'
-matches the previous history line. `\fB&\fP' may be escaped using a
-backslash; the backslash is removed before attempting a match.
-The second and subsequent lines of a multi-line compound command are
-not tested, and are added to the history regardless of the value of
-.BR HISTIGNORE .
-.TP
-.B histchars
-The two or three characters which control history expansion
-and tokenization (see
-.SM
-.B HISTORY EXPANSION
-below). The first character is the \fIhistory expansion\fP character,
-the character which signals the start of a history
-expansion, normally `\fB!\fP'.
-The second character is the \fIquick substitution\fP
-character, which is used as shorthand for re-running the previous
-command entered, substituting one string for another in the command.
-The default is `\fB^\fP'.
-The optional third character is the character
-which indicates that the remainder of the line is a comment when found
-as the first character of a word, normally `\fB#\fP'. The history
-comment character causes history substitution to be skipped for the
-remaining words on the line. It does not necessarily cause the shell
-parser to treat the rest of the line as a comment.
-.TP
-.B HOSTFILE
-Contains the name of a file in the same format as
-.FN /etc/hosts
-that should be read when the shell needs to complete a
-hostname.
-The list of possible hostname completions may be changed while the
-shell is running;
-the next time hostname completion is attempted after the
-value is changed,
-.B bash
-adds the contents of the new file to the existing list.
-If
-.SM
-.B HOSTFILE
-is set, but has no value, \fBbash\fP attempts to read
-.FN /etc/hosts
-to obtain the list of possible hostname completions.
-When
-.SM
-.B HOSTFILE
-is unset, the hostname list is cleared.
-.TP
.B auto_resume
This variable controls how the shell interacts with the user and
job control. If this variable is set, single word simple
@@ -1767,10 +1796,24 @@ analogous to the
.B %
job identifier.
.TP
-.B COMPREPLY
-An array variable from which \fBbash\fP reads the possible completions
-generated by a shell function invoked by the programmable completion
-facility (see \fBProgrammable Completion\fP below).
+.B histchars
+The two or three characters which control history expansion
+and tokenization (see
+.SM
+.B HISTORY EXPANSION
+below). The first character is the \fIhistory expansion\fP character,
+the character which signals the start of a history
+expansion, normally `\fB!\fP'.
+The second character is the \fIquick substitution\fP
+character, which is used as shorthand for re-running the previous
+command entered, substituting one string for another in the command.
+The default is `\fB^\fP'.
+The optional third character is the character
+which indicates that the remainder of the line is a comment when found
+as the first character of a word, normally `\fB#\fP'. The history
+comment character causes history substitution to be skipped for the
+remaining words on the line. It does not necessarily cause the shell
+parser to treat the rest of the line as a comment.
.PD
.SS Arrays
.B Bash
@@ -2686,13 +2729,13 @@ File descriptor 2 is duplicated.
.TP
.B /dev/tcp/\fIhost\fP/\fIport\fP
If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP
-is an integer port number, \fBbash\fP attempts to open a TCP connection
-to the corresponding socket.
+is an integer port number or service name, \fBbash\fP attempts to open
+a TCP connection to the corresponding socket.
.TP
.B /dev/udp/\fIhost\fP/\fIport\fP
If \fIhost\fP is a valid hostname or Internet address, and \fIport\fP
-is an integer port number, \fBbash\fP attempts to open a UDP connection
-to the corresponding socket.
+is an integer port number or service name, \fBbash\fP attempts to open
+a UDP connection to the corresponding socket.
.PD
.RE
.PP
@@ -2811,7 +2854,7 @@ The format of here-documents is as follows:
.PP
.nf
\fB<<\fP[\fB\-\fP]\fIword\fP
- \fIhere\-document\fP
+ \fIhere-document\fP
\fIdelimiter\fP
.fi
.RE
@@ -3139,7 +3182,7 @@ is a decimal number between 2 and 64 representing the arithmetic
base, and \fIn\fP is a number in that base.
If \fIbase#\fP is omitted, then base 10 is used.
The digits greater than 9 are represented by the lowercase letters,
-the uppercase letters, _, and @, in that order.
+the uppercase letters, @, and _, in that order.
If \fIbase\fP is less than or equal to 36, lowercase and uppercase
letters may be used interchangably to represent numbers between 10
and 35.
@@ -3454,6 +3497,11 @@ that the shell inherited from its parent at invocation. Builtin
commands that are invoked as part of a pipeline are also executed in a
subshell environment. Changes made to the subshell environment
cannot affect the shell's execution environment.
+.PP
+If a command is followed by a \fB&\fP and job control is not active, the
+default standard input for the command is the empty file \fI/dev/null\fP.
+Otherwise, the invoked command inherits the file descriptors of the calling
+shell as modified by redirections.
.SH ENVIRONMENT
When a program is invoked it is given an array of strings
called the
@@ -3579,7 +3627,7 @@ and
The shell exits by default upon receipt of a
.SM
.BR SIGHUP .
-Before exiting, it resends the
+Before exiting, an interactive shell resends the
.SM
.B SIGHUP
to all jobs, running or stopped.
@@ -3768,6 +3816,10 @@ builtin command
is enabled,
.B bash
reports such changes immediately.
+Any trap on
+.SM
+.B SIGCHLD
+is executed for each child that exits.
.PP
If an attempt to exit
.B bash
@@ -3834,6 +3886,9 @@ the current time in 12-hour HH:MM:SS format
.B \e@
the current time in 12-hour am/pm format
.TP
+.B \eA
+the current time in 24-hour HH:MM format
+.TP
.B \eu
the username of the current user
.TP
@@ -3841,7 +3896,7 @@ the username of the current user
the version of \fBbash\fP (e.g., 2.00)
.TP
.B \eV
-the release of \fBbash\fP, version + patchlevel (e.g., 2.00.0)
+the release of \fBbash\fP, version + patchelvel (e.g., 2.00.0)
.TP
.B \ew
the current working directory
@@ -4123,12 +4178,12 @@ horizontal tab
vertical tab
.TP
.B \e\fInnn\fP
-the character whose ASCII code is the octal value \fInnn\fP
+the eight-bit character whose value is the octal value \fInnn\fP
(one to three digits)
.TP
-.B \ex\fInnn\fP
-the character whose ASCII code is the hexadecimal value \fInnn\fP
-(one to three digits)
+.B \ex\fIHH\fP
+the eight-bit character whose value is the hexadecimal value \fIHH\fP
+(one or two hex digits)
.RE
.PD
.PP
@@ -4230,6 +4285,11 @@ arrow keys.
If set to \fBon\fP, tilde expansion is performed when readline
attempts word completion.
.TP
+.B history-preserve-point
+If set to \fBon\fP, the history code attempts to place point at the
+same location on each history line retrived with \fBprevious-history\fP
+or \fBnext-history\fP.
+.TP
.B horizontal\-scroll\-mode (Off)
When set to \fBOn\fP, makes readline use a single line for display,
scrolling the input horizontally on a single screen line when it
@@ -4268,6 +4328,12 @@ appended.
If set to \fBOn\fP, history lines that have been modified are displayed
with a preceding asterisk (\fB*\fP).
.TP
+.B match\-hidden\-files (On)
+This variable, when set to \fBOn\fP, causes readline to match files whose
+names begin with a `.' (hidden files) when performing filename
+completion, unless the leading `.' is
+supplied by the user in the filename to be completed.
+.TP
.B output\-meta (Off)
If set to \fBOn\fP, readline will display characters with the
eighth bit set directly rather than as a meta-prefixed escape
@@ -4393,6 +4459,10 @@ the search and execute that command.
For instance, a \fInewline\fP will terminate the search and accept
the line, thereby executing the command from the history list.
.PP
+Readline remembers the last incremental search string. If two
+Control-Rs are typed without any intervening characters defining a
+new search string, any remembered search string is used.
+.PP
Non-incremental searches read the entire search string before starting
to search for matching history lines. The search string may be
typed by the user or be part of the contents of the current line.
@@ -4566,7 +4636,7 @@ save the deleted text on the kill ring.
.B forward\-backward\-delete\-char
Delete the character under the cursor, unless the cursor is at the
end of the line, in which case the character behind the cursor is
-deleted. By default, this is not bound to a key.
+deleted.
.TP
.B quoted\-insert (C\-q, C\-v)
Add the next character typed to the line verbatim. This is
@@ -4588,6 +4658,8 @@ Negative arguments have no effect.
.B transpose\-words (M\-t)
Drag the word before point past the word after point,
moving point over that word as well.
+If point is at the end of the line, this transposes
+the last two words on the line.
.TP
.B upcase\-word (M\-u)
Uppercase the current (or following) word. With a negative argument,
@@ -4707,7 +4779,7 @@ with a single match from the list of possible completions.
Repeated execution of \fBmenu\-complete\fP steps through the list
of possible completions, inserting each match in turn.
At the end of the list of completions, the bell is rung
-(subject to the setting of \Bbell\-style\fP)
+(subject to the setting of \fBbell\-style\fP)
and the original text is restored.
An argument of \fIn\fP moves \fIn\fP positions forward in the list
of matches; a negative argument may be used to move backward
@@ -5672,7 +5744,7 @@ The return value is true unless an invalid option is supplied, or no
matches were generated.
.TP
.PD 0
-\fBcomplete\fP [\fB\-abcdefjkvu\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP]
+\fBcomplete\fP [\fB\-abcdefgjkvu\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP]
.br
[\fB\-X\fP \fIfilterpat\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP] \fIname\fP [\fIname ...\fP]
.TP
@@ -5754,6 +5826,9 @@ File names. May also be specified as \fB\-f\fP.
.B function
Names of shell functions.
.TP 8
+.B group
+Group names. May also be specified as \fB\-g\fP.
+.TP 8
.B helptopic
Help topics as accepted by the \fBhelp\fP builtin.
.TP 8
@@ -6058,12 +6133,12 @@ vertical tab
backslash
.TP
.B \e\fInnn\fP
-the character whose ASCII code is the octal value \fInnn\fP
+the eight-bit character whose value is the octal value \fInnn\fP
(one to three digits)
.TP
-.B \ex\fInnn\fP
-the character whose ASCII code is the hexadecimal value \fInnn\fP
-(one to three digits)
+.B \ex\fIHH\fP
+the eight-bit character whose value is the hexadecimal value \fIHH\fP
+(one or two hex digits)
.PD
.RE
.TP
@@ -6392,6 +6467,7 @@ If a required argument is not found, and
is not silent,
a question mark (\^\fB?\fP\^) is placed in
.IR name ,
+.SM
.B OPTARG
is unset, and a diagnostic message is printed.
If
@@ -6408,7 +6484,7 @@ returns true if an option, specified or unspecified, is found.
It returns false if the end of options is encountered or an
error occurs.
.TP
-\fBhash\fP [\fB\-r\fP] [\fB\-p\fP \fIfilename\fP] [\fIname\fP]
+\fBhash\fP [\fB\-r\fP] [\fB\-p\fP \fIfilename\fP] [\fB\-t\fP] [\fIname\fP]
For each
.IR name ,
the full file name of the command is determined by searching
@@ -6423,8 +6499,13 @@ is used as the full file name of the command.
The
.B \-r
option causes the shell to forget all
-remembered locations. If no arguments are given, information
-about remembered commands is printed.
+remembered locations.
+If the
+.B \-t
+option is supplied, the full pathname to which each \fIname\fP corresponds
+is printed. If multiple \fIname\fP arguments are supplied with \fB\-t\fP,
+the \fIname\fP is printed before the hashed full pathname.
+If no arguments are given, information about remembered commands is printed.
The return status is true unless a
.I name
is not found or an invalid option is supplied.
@@ -6713,9 +6794,9 @@ plain characters, which are simply copied to standard output, character
escape sequences, which are converted and copied to the standard output, and
format specifications, each of which causes printing of the next successive
\fIargument\fP.
-In addition to the standard \fIprintf\fP(1) formats, %b causes
+In addition to the standard \fIprintf\fP(1) formats, \fB%b\fP causes
\fBprintf\fP to expand backslash escape sequences in the corresponding
-\fIargument\fP, and %q causes \fBprintf\fP to output the corresponding
+\fIargument\fP, and \fB%q\fP causes \fBprintf\fP to output the corresponding
\fIargument\fP in a format that can be reused as shell input.
.sp 1
The \fIformat\fP is reused as necessary to consume all of the \fIarguments\fP.
@@ -6842,7 +6923,7 @@ above) is used to obtain the line.
waiting for a complete line of input.
.TP
.B \-p \fIprompt\fP
-Display \fIprompt\fP, without a
+Display \fIprompt\fP on standard error, without a
trailing newline, before attempting to read any input. The prompt
is displayed only if input is coming from a terminal.
.TP
@@ -6964,6 +7045,7 @@ or
list, or if the command's return value is
being inverted via
.BR ! .
+A trap on \fBERR\fP, if set, is executed before the shell exits.
.TP 8
.B \-f
Disable pathname expansion.
@@ -7057,6 +7139,8 @@ Same as
.B noglob
Same as
.BR \-f .
+.B nolog
+Currently ignored.
.TP 8
.B notify
Same as
@@ -7400,6 +7484,13 @@ If set, and the
option is enabled, multi-line commands are saved to the history with
embedded newlines rather than using semicolon separators where possible.
.TP 8
+.B login_shell
+The shell sets this option if it is started as a login shell (see
+.SM
+.B "INVOCATION"
+above).
+The value may not be changed.
+.TP 8
.B mailwarn
If set, and a file that \fBbash\fP is checking for mail has been
accessed since the last time it was checked, the message ``The mail in
@@ -7620,7 +7711,8 @@ is
.B EXIT
(0) the command
.I arg
-is executed on exit from the shell. If a
+is executed on exit from the shell.
+If a
.I sigspec
is
.SM
@@ -7631,6 +7723,31 @@ is executed after every \fIsimple command\fP (see
.SM
.B SHELL GRAMMAR
above).
+If a
+.I sigspec
+is
+.SM
+.BR ERR ,
+the command
+.I arg
+is executed whenever a simple command has a non\-zero exit status.
+The
+.SM
+.BR ERR
+trap is not executed if the failed command is part of an
+.I until
+or
+.I while
+loop,
+part of an
+.I if
+statement, part of a
+.B &&
+or
+.B \(bv\(bv
+list, or if the command's return value is
+being inverted via
+.BR ! .
The
.B \-l
option causes the shell to print a list of signal names and
@@ -7707,17 +7824,22 @@ none are found.
.TP
\fBulimit\fP [\fB\-SHacdflmnpstuv\fP [\fIlimit\fP]]
Provides control over the resources available to the shell and to
-processes started by it, on systems that allow such control. The
-value of
-.I limit
-can be a number in the unit specified for the resource, or the
-value
-.BR unlimited .
+processes started by it, on systems that allow such control.
The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is
set for the given resource. A hard limit cannot be increased once it
is set; a soft limit may be increased up to the value of the hard limit.
If neither \fB\-H\fP nor \fB\-S\fP is specified, both the soft and hard
limits are set.
+The value of
+.I limit
+can be a number in the unit specified for the resource
+or one of the special values
+.BR hard ,
+.BR soft ,
+or
+.BR unlimited ,
+which stand for the current hard limit, the current soft limit, and
+no limit, respectively.
If
.I limit
is omitted, the current value of the soft limit of the resource is
@@ -7781,10 +7903,9 @@ and
.B \-n
and
.BR \-u ,
-which are unscaled values. The return status is 0
-unless an invalid option is encountered, a non-numeric argument
-other than \fBunlimited\fP is supplied as \fIlimit\fP, or an
-error occurs while setting a new limit.
+which are unscaled values.
+The return status is 0 unless an invalid option or argument is supplied,
+or an error occurs while setting a new limit.
.RE
.TP
\fBumask\fP [\fB\-p\fP] [\fB\-S\fP] [\fImode\fP]
diff --git a/doc/bashref.info b/doc/bashref.info
index f4ee48a..b1995a7 100644
--- a/doc/bashref.info
+++ b/doc/bashref.info
@@ -9,11 +9,11 @@ END-INFO-DIR-ENTRY
This text is a brief description of the features that are present in
the Bash shell.
-This is Edition 2.5, last updated 28 Mar 2001,
+This is Edition 2.5a, last updated 13 November 2001,
of `The GNU Bash Reference Manual',
-for `Bash', Version 2.05.
+for `Bash', Version 2.05a.
-Copyright (C) 1991-1999 Free Software Foundation, Inc.
+Copyright (C) 1991-2001 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -38,8 +38,8 @@ Bash Features
This text is a brief description of the features that are present in
the Bash shell.
- This is Edition 2.5, last updated 28 Mar 2001, of `The GNU Bash
-Reference Manual', for `Bash', Version 2.05.
+ This is Edition 2.5a, last updated 13 November 2001, of `The GNU
+Bash Reference Manual', for `Bash', Version 2.05a.
Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc.
@@ -202,7 +202,8 @@ Definitions
one of the following: `||', `&&', `&', `;', `;;', `|', `(', or `)'.
`exit status'
- The value returned by a command to its caller.
+ The value returned by a command to its caller. The value is
+ restricted to eight bits, so the maximum value is 255.
`field'
A unit of text that is the result of one of the shell expansions.
@@ -474,12 +475,12 @@ present, are decoded as follows:
single quote
`\NNN'
- the character whose `ASCII' code is the octal value NNN (one to
+ the eight-bit character whose value is the octal value NNN (one to
three digits)
-`\xNNN'
- the character whose `ASCII' code is the hexadecimal value NNN (one
- to three digits)
+`\xHH'
+ the eight-bit character whose value is the hexadecimal value HH
+ (one or two hex digits)
The expanded result is single-quoted, as if the dollar sign had not
been present.
@@ -500,6 +501,8 @@ shell variable. Others create the name of the message catalog from the
value of the `TEXTDOMAIN' shell variable, possibly adding a suffix of
`.mo'. If you use the `TEXTDOMAIN' variable, you may need to set the
`TEXTDOMAINDIR' variable to the location of the message catalog files.
+Still others use both variables in this fashion:
+`TEXTDOMAINDIR'/`LC_MESSAGES'/LC_MESSAGES/`TEXTDOMAIN'.mo.

File: bashref.info, Node: Comments, Prev: Quoting, Up: Shell Syntax
@@ -567,9 +570,9 @@ Pipelines
The format for a pipeline is
[`time' [`-p']] [`!'] COMMAND1 [`|' COMMAND2 ...]
-The output of each command in the pipeline is connected to the input of
-the next command. That is, each command reads the previous command's
-output.
+The output of each command in the pipeline is connected via a pipe to
+the input of the next command. That is, each command reads the
+previous command's output.
The reserved word `time' causes timing statistics to be printed for
the pipeline once it finishes. The statistics currently consist of
@@ -770,9 +773,8 @@ Conditional Constructs
command completes. Any other value read causes NAME to be set to
null. The line read is saved in the variable `REPLY'.
- The COMMANDS are executed after each selection until a `break' or
- `return' command is executed, at which point the `select' command
- completes.
+ The COMMANDS are executed after each selection until a `break'
+ command is executed, at which point the `select' command completes.
Here is an example that allows the user to pick a filename from the
current directory, and displays the name and index of the file
@@ -912,7 +914,7 @@ the function call. When a function completes, the values of the
positional parameters and the special parameter `#' are restored to the
values they had prior to the function's execution. If a numeric
argument is given to `return', that is the function's return status;
-otherwise the functions's return status is the exit status of the last
+otherwise the function's return status is the exit status of the last
command executed before the `return'.
Variables local to the function may be declared with the `local'
@@ -935,7 +937,10 @@ Shell Parameters
A PARAMETER is an entity that stores values. It can be a `name', a
number, or one of the special characters listed below. For the shell's
-purposes, a VARIABLE is a parameter denoted by a `name'.
+purposes, a VARIABLE is a parameter denoted by a `name'. A variable
+has a VALUE and zero or more ATTRIBUTES. Attributes are assigned using
+the `declare' builtin command (see the description of the `declare'
+builtin in *Note Bash Builtins::).
A parameter is set if it has been assigned a value. The null string
is a valid value. Once a variable is set, it may be unset only by using
@@ -947,12 +952,13 @@ the `unset' builtin command.
If VALUE is not given, the variable is assigned the null string. All
VALUEs undergo tilde expansion, parameter and variable expansion,
command substitution, arithmetic expansion, and quote removal (detailed
-below). If the variable has its `integer' attribute set (see the
-description of the `declare' builtin in *Note Bash Builtins::), then
-VALUE is subject to arithmetic expansion even if the `$((...))'
-expansion is not used (*note Arithmetic Expansion::). Word splitting
-is not performed, with the exception of `"$@"' as explained below.
-Filename expansion is not performed.
+below). If the variable has its `integer' attribute set, then VALUE is
+subject to arithmetic expansion even if the `$((...))' expansion is not
+used (*note Arithmetic Expansion::). Word splitting is not performed,
+with the exception of `"$@"' as explained below. Filename expansion is
+not performed. Assignment statements may also appear as arguments to
+the `declare', `typeset', `export', `readonly', and `local' builtin
+commands.

File: bashref.info, Node: Positional Parameters, Next: Special Parameters, Up: Shell Parameters
@@ -1621,13 +1627,13 @@ redirections, as described in the following table:
`/dev/tcp/HOST/PORT'
If HOST is a valid hostname or Internet address, and PORT is an
- integer port number, Bash attempts to open a TCP connection to the
- corresponding socket.
+ integer port number or service name, Bash attempts to open a TCP
+ connection to the corresponding socket.
`/dev/udp/HOST/PORT'
If HOST is a valid hostname or Internet address, and PORT is an
- integer port number, Bash attempts to open a UDP connection to the
- corresponding socket.
+ integer port number or service name, Bash attempts to open a UDP
+ connection to the corresponding socket.
A failure to open or create a file causes the redirection to fail.
@@ -1927,6 +1933,11 @@ are invoked as part of a pipeline are also executed in a subshell
environment. Changes made to the subshell environment cannot affect
the shell's execution environment.
+ If a command is followed by a `&' and job control is not active, the
+default standard input for the command is the empty file `/dev/null'.
+Otherwise, the invoked command inherits the file descriptors of the
+calling shell as modified by redirections.
+

File: bashref.info, Node: Environment, Next: Exit Status, Prev: Command Execution Environment, Up: Executing Commands
@@ -2014,10 +2025,10 @@ keyboard-generated job control signals `SIGTTIN', `SIGTTOU', and
`SIGTSTP'.
The shell exits by default upon receipt of a `SIGHUP'. Before
-exiting, it resends the `SIGHUP' to all jobs, running or stopped.
-Stopped jobs are sent `SIGCONT' to ensure that they receive the
-`SIGHUP'. To prevent the shell from sending the `SIGHUP' signal to a
-particular job, it should be removed from the jobs table with the
+exiting, an interactive shell resends the `SIGHUP' to all jobs, running
+or stopped. Stopped jobs are sent `SIGCONT' to ensure that they receive
+the `SIGHUP'. To prevent the shell from sending the `SIGHUP' signal to
+a particular job, it should be removed from the jobs table with the
`disown' builtin (*note Job Control Builtins::) or marked to not
receive `SIGHUP' using `disown -h'.
@@ -2043,11 +2054,15 @@ Shell Scripts
a file is used as the first non-option argument when invoking Bash, and
neither the `-c' nor `-s' option is supplied (*note Invoking Bash::),
Bash reads and executes commands from the file, then exits. This mode
-of operation creates a non-interactive shell. When Bash runs a shell
-script, it sets the special parameter `0' to the name of the file,
-rather than the name of the shell, and the positional parameters are
-set to the remaining arguments, if any are given. If no additional
-arguments are supplied, the positional parameters are unset.
+of operation creates a non-interactive shell. The shell first searches
+for the file in the current directory, and looks in the directories in
+`$PATH' if not found there.
+
+ When Bash runs a shell script, it sets the special parameter `0' to
+the name of the file, rather than the name of the shell, and the
+positional parameters are set to the remaining arguments, if any are
+given. If no additional arguments are supplied, the positional
+parameters are unset.
A shell script may be made executable by using the `chmod' command
to turn on the execute bit. When Bash finds such a file while
@@ -2253,14 +2268,17 @@ standard.
character found.
`hash'
- hash [-r] [-p FILENAME] [NAME]
+ hash [-r] [-p FILENAME] [-t] [NAME]
Remember the full pathnames of commands specified as NAME
arguments, so they need not be searched for on subsequent
invocations. The commands are found by searching through the
directories listed in `$PATH'. The `-p' option inhibits the path
search, and FILENAME is used as the location of NAME. The `-r'
- option causes the shell to forget all remembered locations. If no
- arguments are given, information about remembered commands is
+ option causes the shell to forget all remembered locations. If
+ the `-t' option is supplied, the full pathname to which each NAME
+ corresponds is printed. If multiple NAME arguments are supplied
+ with `-t' the NAME is printed before the hashed full pathname. If
+ no arguments are given, information about remembered commands is
printed. The return status is zero unless a NAME is not found or
an invalid option is supplied.
@@ -2294,8 +2312,8 @@ standard.
terminate execution of a script being executed with the `.' (or
`source') builtin, returning either N or the exit status of the
last command executed within the script as the exit status of the
- script. The return status is false if `return' is used outside a
- function and not during the execution of a script by `.' or
+ script. The return status is non-zero if `return' is used outside
+ a function and not during the execution of a script by `.' or
`source'.
`shift'
@@ -2394,9 +2412,13 @@ standard.
name such as `SIGINT' (with or without the `SIG' prefix) or a
signal number. If a SIGSPEC is `0' or `EXIT', ARG is executed
when the shell exits. If a SIGSPEC is `DEBUG', the command ARG is
- executed after every simple command. The `-l' option causes the
- shell to print a list of signal names and their corresponding
- numbers.
+ executed after every simple command. If a SIGSPEC is `ERR', the
+ command ARG is executed whenever a simple command has a non-zero
+ exit status. The `ERR' trap is not executed if the failed command
+ is part of an `until' or `while' loop, part of an `if' statement,
+ part of a `&&' or `||' list, or if the command's return status is
+ being inverted using `!'. The `-l' option causes the shell to
+ print a list of signal names and their corresponding numbers.
Signals ignored upon entry to the shell cannot be trapped or reset.
Trapped signals are reset to their original values in a child
@@ -2634,13 +2656,13 @@ POSIX 1003.2 standard.
backslash
`\NNN'
- the character whose `ASCII' code is the octal value NNN (one
- to three digits)
-
- `\xNNN'
- the character whose `ASCII' code is the hexadecimal value NNN
+ the eight-bit character whose value is the octal value NNN
(one to three digits)
+ `\xHH'
+ the eight-bit character whose value is the hexadecimal value
+ HH (one or two hex digits)
+
`enable'
enable [-n] [-p] [-f FILENAME] [-ads] [NAME ...]
Enable and disable builtin shell commands. Disabling a builtin
@@ -2891,6 +2913,10 @@ POSIX 1003.2 standard.
commands are saved to the history with embedded newlines
rather than using semicolon separators where possible.
+ `login_shell'
+ The shell sets this option if it is started as a login shell
+ (*note Invoking Bash::). The value may not be changed.
+
`mailwarn'
If set, and a file that Bash is checking for mail has been
accessed since the last time it was checked, the message
@@ -3024,18 +3050,19 @@ POSIX 1003.2 standard.
`-v'
The maximum amount of virtual memory available to the process.
- If LIMIT is given, it is the new value of the specified resource.
- Otherwise, the current value of the soft limit for the specified
- resource is printed, unless the `-H' option is supplied. When
- setting new limits, if neither `-H' nor `-S' is supplied, both the
- hard and soft limits are set. If no option is given, then `-f' is
- assumed. Values are in 1024-byte increments, except for `-t',
- which is in seconds, `-p', which is in units of 512-byte blocks,
- and `-n' and `-u', which are unscaled values.
+ If LIMIT is given, it is the new value of the specified resource;
+ the special LIMIT values `hard', `soft', and `unlimited' stand for
+ the current hard limit, the current soft limit, and no limit,
+ respectively. Otherwise, the current value of the soft limit for
+ the specified resource is printed, unless the `-H' option is
+ supplied. When setting new limits, if neither `-H' nor `-S' is
+ supplied, both the hard and soft limits are set. If no option is
+ given, then `-f' is assumed. Values are in 1024-byte increments,
+ except for `-t', which is in seconds, `-p', which is in units of
+ 512-byte blocks, and `-n' and `-u', which are unscaled values.
- The return status is zero unless an invalid option is supplied, a
- non-numeric argument other than `unlimited' is supplied as a
- LIMIT, or an error occurs while setting a new limit.
+ The return status is zero unless an invalid option or argument is
+ supplied, or an error occurs while setting a new limit.
`unalias'
unalias [-a] [NAME ... ]
@@ -3075,7 +3102,8 @@ The Set Builtin
Commands::) exits with a non-zero status, unless the command
that fails is part of an `until' or `while' loop, part of an
`if' statement, part of a `&&' or `||' list, or if the
- command's return status is being inverted using `!'.
+ command's return status is being inverted using `!'. A trap
+ on `ERR', if set, is executed before the shell exits.
`-f'
Disable file name generation (globbing).
@@ -3142,6 +3170,9 @@ The Set Builtin
`noglob'
Same as `-f'.
+ `nolog'
+ Currently ignored.
+
`notify'
Same as `-b'.
@@ -3401,11 +3432,10 @@ Variables::).
`BASH_VERSINFO[5]'
The value of `MACHTYPE'.
-`COMP_WORDS'
- An array variable consisting of the individual words in the
- current command line. This variable is available only in shell
- functions invoked by the programmable completion facilities (*note
- Programmable Completion::).
+`COLUMNS'
+ Used by the `select' builtin command to determine the terminal
+ width when printing selection lists. Automatically set upon
+ receipt of a `SIGWINCH'.
`COMP_CWORD'
An index into `${COMP_WORDS}' of the word containing the current
@@ -3426,6 +3456,12 @@ Variables::).
functions and external commands invoked by the programmable
completion facilities (*note Programmable Completion::).
+`COMP_WORDS'
+ An array variable consisting of the individual words in the
+ current command line. This variable is available only in shell
+ functions invoked by the programmable completion facilities (*note
+ Programmable Completion::).
+
`COMPREPLY'
An array variable from which Bash reads the possible completions
generated by a shell function invoked by the programmable
@@ -3455,6 +3491,13 @@ Variables::).
entries in `FIGNORE' is excluded from the list of matched file
names. A sample value is `.o:~'
+`FUNCNAME'
+ The name of any currently-executing shell function. This variable
+ exists only when a shell function is executing. Assignments to
+ `FUNCNAME' have no effect and return an error status. If
+ `FUNCNAME' is unset, it loses its special properties, even if it
+ is subsequently reset.
+
`GLOBIGNORE'
A colon-separated list of patterns defining the set of filenames to
be ignored by filename expansion. If a filename matched by a
@@ -3487,13 +3530,6 @@ Variables::).
command. If `HISTCMD' is unset, it loses its special properties,
even if it is subsequently reset.
-`FUNCNAME'
- The name of any currently-executing shell function. This variable
- exists only when a shell function is executing. Assignments to
- `FUNCNAME' have no effect and return an error status. If
- `FUNCNAME' is unset, it loses its special properties, even if it
- is subsequently reset.
-
`HISTCONTROL'
A value of `ignorespace' means to not enter lines which begin with
a space or tab into the history list. A value of `ignoredups'
@@ -3504,6 +3540,17 @@ Variables::).
compound command are not tested, and are added to the history
regardless of the value of `HISTCONTROL'.
+`HISTFILE'
+ The name of the file to which the command history is saved. The
+ default value is `~/.bash_history'.
+
+`HISTFILESIZE'
+ The maximum number of lines contained in the history file. When
+ this variable is assigned a value, the history file is truncated,
+ if necessary, to contain no more than that number of lines. The
+ history file is also truncated to this size after writing it when
+ an interactive shell exits. The default value is 500.
+
`HISTIGNORE'
A colon-separated list of patterns used to decide which command
lines should be saved on the history list. Each pattern is
@@ -3523,21 +3570,10 @@ Variables::).
separating them with a colon, provides the functionality of
`ignoreboth'.
-`HISTFILE'
- The name of the file to which the command history is saved. The
- default value is `~/.bash_history'.
-
`HISTSIZE'
The maximum number of commands to remember on the history list.
The default value is 500.
-`HISTFILESIZE'
- The maximum number of lines contained in the history file. When
- this variable is assigned a value, the history file is truncated,
- if necessary, to contain no more than that number of lines. The
- history file is also truncated to this size after writing it when
- an interactive shell exits. The default value is 500.
-
`HOSTFILE'
Contains the name of a file in the same format as `/etc/hosts' that
should be read when the shell needs to complete a hostname. The
@@ -3597,20 +3633,15 @@ Variables::).
This variable determines the locale category used for number
formatting.
+`LINENO'
+ The line number in the script or shell function currently
+ executing.
+
`LINES'
Used by the `select' builtin command to determine the column length
for printing selection lists. Automatically set upon receipt of a
`SIGWINCH'.
-`COLUMNS'
- Used by the `select' builtin command to determine the terminal
- width when printing selection lists. Automatically set upon
- receipt of a `SIGWINCH'.
-
-`LINENO'
- The line number in the script or shell function currently
- executing.
-
`MACHTYPE'
A string that fully describes the system type on which Bash is
executing, in the standard GNU CPU-COMPANY-SYSTEM format.
@@ -3638,6 +3669,16 @@ Variables::).
status values from the processes in the most-recently-executed
foreground pipeline (which may contain only a single command).
+`POSIXLY_CORRECT'
+ If this variable is in the environment when `bash' starts, the
+ shell enters POSIX mode (*note Bash POSIX Mode::) before reading
+ the startup files, as if the `--posix' invocation option had been
+ supplied. If it is set while the shell is running, `bash' enables
+ POSIX mode, as if the command
+ `set -o posix'
+
+ had been executed.
+
`PPID'
The process ID of the shell's parent process. This variable is
readonly.
@@ -3767,9 +3808,9 @@ File: bashref.info, Node: Invoking Bash, Next: Bash Startup Files, Up: Bash F
Invoking Bash
=============
- bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o OPTION] [ARGUMENT ...]
- bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o OPTION] -c STRING [ARGUMENT ...]
- bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o OPTION] [ARGUMENT ...]
+ bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o OPTION] [-O SHOPT_OPTION] [ARGUMENT ...]
+ bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o OPTION] [-O SHOPT_OPTION] -c STRING [ARGUMENT ...]
+ bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o OPTION] [-O SHOPT_OPTION] [ARGUMENT ...]
In addition to the single-character shell command-line options
(*note The Set Builtin::), there are several multi-character options
@@ -3860,11 +3901,23 @@ invocation which are not available with the `set' builtin.
(*note Locale Translation::). This implies the `-n' option; no
commands will be executed.
+`[-+]O [SHOPT_OPTION]'
+ SHOPT_OPTION is one of the shell options accepted by the `shopt'
+ builtin (*note Shell Builtin Commands::). If SHOPT_OPTION is
+ present, `-O' sets the value of that option; `+O' unsets it. If
+ SHOPT_OPTION is not supplied, the names and values of the shell
+ options accepted by `shopt' are printed on the standard output.
+ If the invocation option is `+O', the output is displayed in a
+ format that may be reused as input.
+
`--'
A `--' signals the end of options and disables further option
processing. Any arguments after the `--' are treated as filenames
and arguments.
+ A _login_ shell is one whose first character of argument zero is
+`-', or one invoked with the `--login' option.
+
An _interactive_ shell is one started without non-option arguments,
unless `-s' is specified, without specifying the `-c' option, and whose
input and output are both connected to terminals (as determined by
@@ -4332,8 +4385,8 @@ leading `0x' or `0X' denotes hexadecimal. Otherwise, numbers take the
form [BASE`#']N, where BASE is a decimal number between 2 and 64
representing the arithmetic base, and N is a number in that base. If
BASE`#' is omitted, then base 10 is used. The digits greater than 9
-are represented by the lowercase letters, the uppercase letters, `_',
-and `@', in that order. If BASE is less than or equal to 36, lowercase
+are represented by the lowercase letters, the uppercase letters, `@',
+and `_', in that order. If BASE is less than or equal to 36, lowercase
and uppercase letters may be used interchangably to represent numbers
between 10 and 35.
@@ -4615,6 +4668,9 @@ which can appear in the prompt variables:
`\@'
The time, in 12-hour am/pm format.
+`\A'
+ The time, in 24-hour HH:MM format.
+
`\u'
The username of the current user.
@@ -4821,6 +4877,9 @@ that specified by POSIX in areas where the Bash default differs.
30. When the `set' builtin is invoked without options, it does not
display shell function names and definitions.
+ 31. When the `set' builtin is invoked without options, it displays
+ variable values without quotes, unless they contain shell
+ metacharacters, even if the result contains nonprinting characters.
There is other POSIX 1003.2 behavior that Bash does not implement.
Specifically:
@@ -4928,8 +4987,9 @@ equivalent to `bg %1'
The shell learns immediately whenever a job changes state.
Normally, Bash waits until it is about to print a prompt before
reporting changes in a job's status so as to not interrupt any other
-output. If the the `-b' option to the `set' builtin is enabled, Bash
-reports such changes immediately (*note The Set Builtin::).
+output. If the `-b' option to the `set' builtin is enabled, Bash
+reports such changes immediately (*note The Set Builtin::). Any trap
+on `SIGCHLD' is executed for each child process that exits.
If an attempt to exit Bash is while jobs are stopped, the shell
prints a message warning that there are stopped jobs. The `jobs'
@@ -5260,7 +5320,7 @@ available to be yanked back later, when you are typing another line.
as those used by `M-f'.
`M-<DEL>'
- Kill from the cursor the start of the previous word, or, if between
+ Kill from the cursor the start of the current word, or, if between
words, to the start of the previous word. Word boundaries are the
same as those used by `M-b'.
@@ -5334,6 +5394,10 @@ the search and accept the line, thereby executing the command from the
history list. A movement command will terminate the search, make the
last line found the current line, and begin editing.
+ Readline remembers the last incremental search string. If two
+`C-r's are typed without any intervening characters defining a new
+search string, any remembered search string is used.
+
Non-incremental searches read the entire search string before
starting to search for matching history lines. The search string may be
typed by the user or be part of the contents of the current line.
@@ -5451,6 +5515,10 @@ Variable Settings
If set to `on', tilde expansion is performed when Readline
attempts word completion. The default is `off'.
+ If set to `on', the history code attempts to place point at
+ the same location on each history line retrived with
+ `previous-history' or `next-history'.
+
`horizontal-scroll-mode'
This variable can be set to either `on' or `off'. Setting it
to `on' means that the text of the lines being edited will
@@ -5490,6 +5558,13 @@ Variable Settings
asterisk (`*') at the start of history lines which have been
modified. This variable is `off' by default.
+ `match-hidden-files'
+ This variable, when set to `on', causes Readline to match
+ files whose names begin with a `.' (hidden files) when
+ performing filename completion, unless the leading `.' is
+ supplied by the user in the filename to be completed. This
+ variable is `on' by default.
+
`output-meta'
If set to `on', Readline will display characters with the
eighth bit set directly rather than as a meta-prefixed escape
@@ -5614,13 +5689,13 @@ Key Bindings
vertical tab
`\NNN'
- the character whose ASCII code is the octal value NNN (one to
- three digits)
-
- `\xNNN'
- the character whose ASCII code is the hexadecimal value NNN
+ the eight-bit character whose value is the octal value NNN
(one to three digits)
+ `\xHH'
+ the eight-bit character whose value is the hexadecimal value
+ HH (one or two hex digits)
+
When entering the text of a macro, single or double quotes must be
used to indicate a macro definition. Unquoted text is assumed to
be a function name. In the macro body, the backslash escapes
@@ -5964,7 +6039,8 @@ Commands For Changing Text
`transpose-words (M-t)'
Drag the word before point past the word after point, moving point
- past that word as well.
+ past that word as well. If the insertion point is at the end of
+ the line, this transposes the last two words on the line.
`upcase-word (M-u)'
Uppercase the current (or following) word. With a negative
@@ -6431,7 +6507,7 @@ completion facilities.
no matches were generated.
`complete'
- `complete [-abcdefjkvu] [-o COMP-OPTION] [-A ACTION] [-G GLOBPAT] [-W WORDLIST]
+ `complete [-abcdefgjkvu] [-o COMP-OPTION] [-A ACTION] [-G GLOBPAT] [-W WORDLIST]
[-P PREFIX] [-S SUFFIX] [-X FILTERPAT] [-F FUNCTION]
[-C COMMAND] NAME [NAME ...]'
`complete -pr [NAME ...]'
@@ -6512,6 +6588,9 @@ completion facilities.
`function'
Names of shell functions.
+ `group'
+ Group names. May also be specified as `-g'.
+
`helptopic'
Help topics as accepted by the `help' builtin (*note
Bash Builtins::).
@@ -7033,15 +7112,7 @@ considered for the next release.
The file `configure.in' is used to create `configure' by a program
called Autoconf. You only need `configure.in' if you want to change it
or regenerate `configure' using a newer version of Autoconf. If you do
-this, make sure you are using Autoconf version 2.10 or newer.
-
- If you need to change `configure.in' or regenerate `configure', you
-will need to create two files: `_distribution' and `_patchlevel'.
-`_distribution' should contain the major and minor version numbers of
-the Bash distribution, for example `2.01'. `_patchlevel' should
-contain the patch level of the Bash distribution, `0' for example. The
-script `support/mkconffiles' has been provided to automate the creation
-of these files.
+this, make sure you are using Autoconf version 2.50 or newer.
You can remove the program binaries and object files from the source
code directory by typing `make clean'. To also remove the files that
@@ -7110,7 +7181,9 @@ Installation Names
By default, `make install' will install into `/usr/local/bin',
`/usr/local/man', etc. You can specify an installation prefix other
-than `/usr/local' by giving `configure' the option `--prefix=PATH'.
+than `/usr/local' by giving `configure' the option `--prefix=PATH', or
+by specifying a value for the `DESTDIR' `make' variable when running
+`make install'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
@@ -7125,12 +7198,12 @@ Specifying the System Type
==========================
There may be some features `configure' can not figure out
-automatically, but needs to determine by the type of host Bash will run
+automatically, but need to determine by the type of host Bash will run
on. Usually `configure' can figure that out, but if it prints a
message saying it can not guess the host type, give it the
`--host=TYPE' option. `TYPE' can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
-`CPU-COMPANY-SYSTEM' (e.g., `sparc-sun-sunos4.1.2').
+`CPU-COMPANY-SYSTEM' (e.g., `i386-unknown-freebsd4.2').
See the file `support/config.sub' for the possible values of each
field.
@@ -7216,21 +7289,22 @@ that the Bash `configure' recognizes.
be supplied if your system has an inadequate or incomplete termcap
database.
-`--with-glibc-malloc'
- Use the GNU libc version of `malloc' in `lib/malloc/gmalloc.c'.
- This is not the version of `malloc' that appears in glibc version
- 2, but a modified version of the `malloc' from glibc version 1.
- This is somewhat slower than the default `malloc', but wastes less
- space on a per-allocation basis, and will return memory to the
- operating system under certain circumstances.
-
`--with-gnu-malloc'
A synonym for `--with-bash-malloc'.
-`--with-installed-readline'
+`--with-installed-readline[=PREFIX]'
Define this to make Bash link with a locally-installed version of
Readline rather than the version in `lib/readline'. This works
- only with Readline 4.1 and later versions.
+ only with Readline 4.2 and later versions. If PREFIX is `yes' or
+ not supplied, `configure' uses the values of the make variables
+ `includedir' and `libdir', which are subdirectories of `prefix' by
+ default, to find the installed version of Readline if it is not in
+ the standard system include and library directories. If PREFIX is
+ `no', Bash links with the version in `lib/readline'. If PREFIX is
+ set to any other value, `configure' treats it as a directory
+ pathname and looks for the installed version of Readline in
+ subdirectories of that directory (include files in
+ PREFIX/`include' and the library in PREFIX/`lib').
`--with-purify'
Define this to use the Purify memory allocation checker from
@@ -7243,6 +7317,12 @@ that the Bash `configure' recognizes.
There are several `--enable-' options that alter how Bash is
compiled and linked, rather than changing run-time features.
+`--enable-largefile'
+ Enable support for large files
+ (http://www.sas.com/standards/large_file/x_open.20Mar96.html) if
+ the operating system requires special compiler options to build
+ programs which can access large files.
+
`--enable-profiling'
This builds a Bash binary that produces profiling information to be
processed by `gprof' each time it is executed.
@@ -7621,7 +7701,9 @@ included in SVR4.2 as the baseline reference.
Builtins::).
* Bash includes the `shopt' builtin, for finer control of shell
- optional capabilities (*note Bash Builtins::).
+ optional capabilities (*note Bash Builtins::), and allows these
+ options to be set and unset at shell invocation (*note Invoking
+ Bash::).
* Bash has much more optional behavior controllable with the `set'
builtin (*note The Set Builtin::).
@@ -7635,6 +7717,12 @@ included in SVR4.2 as the baseline reference.
specified with a `DEBUG' trap are executed after every simple
command. The `DEBUG' trap is not inherited by shell functions.
+ The `trap' builtin (*note Bourne Shell Builtins::) allows an `ERR'
+ pseudo-signal specification, similar to `EXIT' and `DEBUG'.
+ Commands specified with an `ERR' trap are executed after a simple
+ command fails, with a few exceptions. The `ERR' trap is not
+ inherited by shell functions.
+
* The Bash `type' builtin is more extensive and gives more
information about the names it finds (*note Bash Builtins::).
@@ -7858,6 +7946,7 @@ Parameter and Variable Index
* HISTFILE: Bash Variables.
* HISTFILESIZE: Bash Variables.
* HISTIGNORE: Bash Variables.
+* history-preserve-point: Readline Init File Syntax.
* HISTSIZE: Bash Variables.
* HOME: Bourne Shell Variables.
* horizontal-scroll-mode: Readline Init File Syntax.
@@ -7874,7 +7963,8 @@ Parameter and Variable Index
* LC_ALL: Bash Variables.
* LC_COLLATE: Bash Variables.
* LC_CTYPE: Bash Variables.
-* LC_MESSAGES: Bash Variables.
+* LC_MESSAGES <1>: Bash Variables.
+* LC_MESSAGES: Locale Translation.
* LC_NUMERIC: Bash Variables.
* LINENO: Bash Variables.
* LINES: Bash Variables.
@@ -7883,6 +7973,7 @@ Parameter and Variable Index
* MAILCHECK: Bash Variables.
* MAILPATH: Bourne Shell Variables.
* mark-modified-lines: Readline Init File Syntax.
+* match-hidden-files: Readline Init File Syntax.
* meta-flag: Readline Init File Syntax.
* OLDPWD: Bash Variables.
* OPTARG: Bourne Shell Variables.
@@ -7892,6 +7983,7 @@ Parameter and Variable Index
* output-meta: Readline Init File Syntax.
* PATH: Bourne Shell Variables.
* PIPESTATUS: Bash Variables.
+* POSIXLY_CORRECT: Bash Variables.
* PPID: Bash Variables.
* PROMPT_COMMAND: Bash Variables.
* PS1: Bourne Shell Variables.
@@ -7905,6 +7997,8 @@ Parameter and Variable Index
* SHELLOPTS: Bash Variables.
* SHLVL: Bash Variables.
* show-all-if-ambiguous: Readline Init File Syntax.
+* TEXTDOMAIN: Locale Translation.
+* TEXTDOMAINDIR: Locale Translation.
* TIMEFORMAT: Bash Variables.
* TMOUT: Bash Variables.
* UID: Bash Variables.
@@ -8031,8 +8125,8 @@ Concept Index
* evaluation, arithmetic: Shell Arithmetic.
* event designators: Event Designators.
* execution environment: Command Execution Environment.
-* exit status <1>: Definitions.
-* exit status: Exit Status.
+* exit status <1>: Exit Status.
+* exit status: Definitions.
* expansion: Shell Expansions.
* expansion, arithmetic: Arithmetic Expansion.
* expansion, brace: Brace Expansion.
@@ -8056,17 +8150,20 @@ Concept Index
* initialization file, readline: Readline Init File.
* installation: Basic Installation.
* interaction, readline: Readline Interaction.
-* interactive shell <1>: Interactive Shells.
-* interactive shell: Invoking Bash.
+* interactive shell <1>: Invoking Bash.
+* interactive shell: Interactive Shells.
+* internationalization: Locale Translation.
* job: Definitions.
-* job control <1>: Definitions.
-* job control: Job Control Basics.
+* job control <1>: Job Control Basics.
+* job control: Definitions.
* kill ring: Readline Killing Commands.
* killing text: Readline Killing Commands.
* localization: Locale Translation.
+* login shell: Invoking Bash.
* matching, pattern: Pattern Matching.
* metacharacter: Definitions.
* name: Definitions.
+* native languages: Locale Translation.
* notation, readline: Readline Bare Essentials.
* operator, shell: Definitions.
* parameter expansion: Shell Parameter Expansion.
@@ -8097,12 +8194,13 @@ Concept Index
* shell, interactive: Interactive Shells.
* signal: Definitions.
* signal handling: Signals.
-* special builtin <1>: Definitions.
-* special builtin: Special Builtins.
+* special builtin <1>: Special Builtins.
+* special builtin: Definitions.
* startup files: Bash Startup Files.
* suspending jobs: Job Control Basics.
* tilde expansion: Tilde Expansion.
* token: Definitions.
+* translation, native languages: Locale Translation.
* variable, shell: Shell Parameters.
* variables, readline: Readline Init File Syntax.
* word: Definitions.
@@ -8112,126 +8210,126 @@ Concept Index

Tag Table:
-Node: Top1157
-Node: Introduction3286
-Node: What is Bash?3511
-Node: What is a shell?4612
-Node: Definitions6846
-Node: Basic Shell Features9512
-Node: Shell Syntax10736
-Node: Shell Operation11760
-Node: Quoting13045
-Node: Escape Character14304
-Node: Single Quotes14776
-Node: Double Quotes15111
-Node: ANSI-C Quoting16012
-Node: Locale Translation16915
-Node: Comments17690
-Node: Shell Commands18295
-Node: Simple Commands19176
-Node: Pipelines19797
-Node: Lists21322
-Node: Looping Constructs22835
-Node: Conditional Constructs25279
-Node: Command Grouping31220
-Node: Shell Functions32597
-Node: Shell Parameters35134
-Node: Positional Parameters36459
-Node: Special Parameters37350
-Node: Shell Expansions40008
-Node: Brace Expansion41928
-Node: Tilde Expansion43597
-Node: Shell Parameter Expansion45928
-Node: Command Substitution52728
-Node: Arithmetic Expansion54050
-Node: Process Substitution54894
-Node: Word Splitting55931
-Node: Filename Expansion57383
-Node: Pattern Matching59341
-Node: Quote Removal62472
-Node: Redirections62758
-Node: Executing Commands69629
-Node: Simple Command Expansion70296
-Node: Command Search and Execution72217
-Node: Command Execution Environment74214
-Node: Environment76667
-Node: Exit Status78318
-Node: Signals79513
-Node: Shell Scripts81405
-Node: Shell Builtin Commands83788
-Node: Bourne Shell Builtins85218
-Node: Bash Builtins100145
-Node: The Set Builtin124177
-Node: Special Builtins131034
-Node: Shell Variables132006
-Node: Bourne Shell Variables132442
-Node: Bash Variables134221
-Node: Bash Features149565
-Node: Invoking Bash150447
-Node: Bash Startup Files155232
-Node: Interactive Shells160102
-Node: What is an Interactive Shell?160504
-Node: Is this Shell Interactive?161139
-Node: Interactive Shell Behavior161945
-Node: Bash Conditional Expressions165212
-Node: Shell Arithmetic168506
-Node: Aliases170937
-Node: Arrays173440
-Node: The Directory Stack176460
-Node: Directory Stack Builtins177166
-Node: Printing a Prompt180044
-Node: The Restricted Shell182414
-Node: Bash POSIX Mode183892
-Node: Job Control189520
-Node: Job Control Basics189986
-Node: Job Control Builtins194200
-Node: Job Control Variables198495
-Node: Command Line Editing199644
-Node: Introduction and Notation200642
-Node: Readline Interaction202259
-Node: Readline Bare Essentials203445
-Node: Readline Movement Commands205225
-Node: Readline Killing Commands206181
-Node: Readline Arguments208090
-Node: Searching209125
-Node: Readline Init File211115
-Node: Readline Init File Syntax212169
-Node: Conditional Init Constructs222372
-Node: Sample Init File224896
-Node: Bindable Readline Commands228065
-Node: Commands For Moving229264
-Node: Commands For History230112
-Node: Commands For Text233000
-Node: Commands For Killing234933
-Node: Numeric Arguments236883
-Node: Commands For Completion238010
-Node: Keyboard Macros241590
-Node: Miscellaneous Commands242148
-Node: Readline vi Mode246510
-Node: Programmable Completion247419
-Node: Programmable Completion Builtins252467
-Node: Using History Interactively259374
-Node: Bash History Facilities260053
-Node: Bash History Builtins262613
-Node: History Interaction266179
-Node: Event Designators268730
-Node: Word Designators269657
-Node: Modifiers271286
-Node: Installing Bash272603
-Node: Basic Installation273745
-Node: Compilers and Options276863
-Node: Compiling For Multiple Architectures277597
-Node: Installation Names279254
-Node: Specifying the System Type279977
-Node: Sharing Defaults280684
-Node: Operation Controls281349
-Node: Optional Features282300
-Node: Reporting Bugs289705
-Node: Major Differences From The Bourne Shell290802
-Node: Builtin Index304814
-Node: Reserved Word Index308405
-Node: Variable Index309881
-Node: Function Index315667
-Node: Concept Index320157
+Node: Top1164
+Node: Introduction3300
+Node: What is Bash?3525
+Node: What is a shell?4626
+Node: Definitions6860
+Node: Basic Shell Features9600
+Node: Shell Syntax10824
+Node: Shell Operation11848
+Node: Quoting13133
+Node: Escape Character14392
+Node: Single Quotes14864
+Node: Double Quotes15199
+Node: ANSI-C Quoting16100
+Node: Locale Translation17009
+Node: Comments17892
+Node: Shell Commands18497
+Node: Simple Commands19378
+Node: Pipelines19999
+Node: Lists21535
+Node: Looping Constructs23048
+Node: Conditional Constructs25492
+Node: Command Grouping31416
+Node: Shell Functions32793
+Node: Shell Parameters35329
+Node: Positional Parameters36903
+Node: Special Parameters37794
+Node: Shell Expansions40452
+Node: Brace Expansion42372
+Node: Tilde Expansion44041
+Node: Shell Parameter Expansion46372
+Node: Command Substitution53172
+Node: Arithmetic Expansion54494
+Node: Process Substitution55338
+Node: Word Splitting56375
+Node: Filename Expansion57827
+Node: Pattern Matching59785
+Node: Quote Removal62916
+Node: Redirections63202
+Node: Executing Commands70105
+Node: Simple Command Expansion70772
+Node: Command Search and Execution72693
+Node: Command Execution Environment74690
+Node: Environment77397
+Node: Exit Status79048
+Node: Signals80243
+Node: Shell Scripts82154
+Node: Shell Builtin Commands84665
+Node: Bourne Shell Builtins86095
+Node: Bash Builtins101581
+Node: The Set Builtin125866
+Node: Special Builtins132847
+Node: Shell Variables133819
+Node: Bourne Shell Variables134255
+Node: Bash Variables136034
+Node: Bash Features151763
+Node: Invoking Bash152645
+Node: Bash Startup Files158078
+Node: Interactive Shells162948
+Node: What is an Interactive Shell?163350
+Node: Is this Shell Interactive?163985
+Node: Interactive Shell Behavior164791
+Node: Bash Conditional Expressions168058
+Node: Shell Arithmetic171352
+Node: Aliases173783
+Node: Arrays176286
+Node: The Directory Stack179306
+Node: Directory Stack Builtins180012
+Node: Printing a Prompt182890
+Node: The Restricted Shell185306
+Node: Bash POSIX Mode186784
+Node: Job Control192616
+Node: Job Control Basics193082
+Node: Job Control Builtins197362
+Node: Job Control Variables201657
+Node: Command Line Editing202806
+Node: Introduction and Notation203804
+Node: Readline Interaction205421
+Node: Readline Bare Essentials206607
+Node: Readline Movement Commands208387
+Node: Readline Killing Commands209343
+Node: Readline Arguments211251
+Node: Searching212286
+Node: Readline Init File214463
+Node: Readline Init File Syntax215517
+Node: Conditional Init Constructs226248
+Node: Sample Init File228772
+Node: Bindable Readline Commands231941
+Node: Commands For Moving233140
+Node: Commands For History233988
+Node: Commands For Text236876
+Node: Commands For Killing238913
+Node: Numeric Arguments240863
+Node: Commands For Completion241990
+Node: Keyboard Macros245570
+Node: Miscellaneous Commands246128
+Node: Readline vi Mode250490
+Node: Programmable Completion251399
+Node: Programmable Completion Builtins256447
+Node: Using History Interactively263433
+Node: Bash History Facilities264112
+Node: Bash History Builtins266672
+Node: History Interaction270238
+Node: Event Designators272789
+Node: Word Designators273716
+Node: Modifiers275345
+Node: Installing Bash276662
+Node: Basic Installation277804
+Node: Compilers and Options280489
+Node: Compiling For Multiple Architectures281223
+Node: Installation Names282880
+Node: Specifying the System Type283691
+Node: Sharing Defaults284400
+Node: Operation Controls285065
+Node: Optional Features286016
+Node: Reporting Bugs293871
+Node: Major Differences From The Bourne Shell294968
+Node: Builtin Index309390
+Node: Reserved Word Index312981
+Node: Variable Index314457
+Node: Function Index320619
+Node: Concept Index325109

End Tag Table
diff --git a/doc/bashref.texi b/doc/bashref.texi
index ea3702f..337a2b6 100644
--- a/doc/bashref.texi
+++ b/doc/bashref.texi
@@ -5,13 +5,13 @@
@c %**end of header
@ignore
-Last Change: Wed Mar 28 14:48:38 EST 2001
+Last Change: Tue Nov 13 12:48:51 EST 2001
@end ignore
-@set EDITION 2.5
-@set VERSION 2.05
-@set UPDATED 28 Mar 2001
-@set UPDATE-MONTH Mar 2001
+@set EDITION 2.5a
+@set VERSION 2.05a
+@set UPDATED 13 November 2001
+@set UPDATE-MONTH November 2001
@iftex
@finalout
@@ -36,7 +36,7 @@ This is Edition @value{EDITION}, last updated @value{UPDATED},
of @cite{The GNU Bash Reference Manual},
for @code{Bash}, Version @value{VERSION}.
-Copyright (C) 1991-1999 Free Software Foundation, Inc.
+Copyright (C) 1991-2001 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -267,7 +267,8 @@ or one of the following:
@item exit status
@cindex exit status
-The value returned by a command to its caller.
+The value returned by a command to its caller. The value is restricted
+to eight bits, so the maximum value is 255.
@item field
@cindex field
@@ -542,11 +543,11 @@ backslash
@item \'
single quote
@item \@var{nnn}
-the character whose @code{ASCII} code is the octal value @var{nnn}
-(one to three digits)
-@item \x@var{nnn}
-the character whose @code{ASCII} code is the hexadecimal value @var{nnn}
+the eight-bit character whose value is the octal value @var{nnn}
(one to three digits)
+@item \x@var{HH}
+the eight-bit character whose value is the hexadecimal value @var{HH}
+(one or two hex digits)
@end table
@noindent
@@ -556,6 +557,9 @@ been present.
@node Locale Translation
@subsubsection Locale-Specific Translation
@cindex localization
+@cindex internationalization
+@cindex native languages
+@cindex translation, native languages
A double-quoted string preceded by a dollar sign (@samp{$}) will cause
the string to be translated according to the current locale.
@@ -564,12 +568,17 @@ is ignored.
If the string is translated and replaced, the replacement is
double-quoted.
+@vindex LC_MESSAGES
+@vindex TEXTDOMAIN
+@vindex TEXTDOMAINDIR
Some systems use the message catalog selected by the @env{LC_MESSAGES}
shell variable. Others create the name of the message catalog from the
value of the @env{TEXTDOMAIN} shell variable, possibly adding a
suffix of @samp{.mo}. If you use the @env{TEXTDOMAIN} variable, you
may need to set the @env{TEXTDOMAINDIR} variable to the location of
-the message catalog files.
+the message catalog files. Still others use both variables in this
+fashion:
+@env{TEXTDOMAINDIR}/@env{LC_MESSAGES}/LC_MESSAGES/@env{TEXTDOMAIN}.mo.
@node Comments
@subsection Comments
@@ -640,9 +649,9 @@ The format for a pipeline is
@end example
@noindent
-The output of each command in the pipeline is connected to the input of
-the next command. That is, each command reads the previous command's
-output.
+The output of each command in the pipeline is connected via a pipe
+to the input of the next command.
+That is, each command reads the previous command's output.
The reserved word @code{time} causes timing statistics
to be printed for the pipeline once it finishes.
@@ -891,7 +900,7 @@ Any other value read causes @var{name} to be set to null.
The line read is saved in the variable @env{REPLY}.
The @var{commands} are executed after each selection until a
-@code{break} or @code{return} command is executed, at which
+@code{break} command is executed, at which
point the @code{select} command completes.
Here is an example that allows the user to pick a filename from the
@@ -1063,7 +1072,7 @@ call. When a function completes, the values of the
positional parameters and the special parameter @samp{#}
are restored to the values they had prior to the function's
execution. If a numeric argument is given to @code{return},
-that is the function's return status; otherwise the functions's
+that is the function's return status; otherwise the function's
return status is the exit status of the last command executed
before the @code{return}.
@@ -1090,6 +1099,9 @@ It can be a @code{name}, a number, or one of the special characters
listed below.
For the shell's purposes, a @var{variable} is a parameter denoted by a
@code{name}.
+A variable has a @var{value} and zero or more @var{attributes}.
+Attributes are assigned using the @code{declare} builtin command
+(see the description of the @code{declare} builtin in @ref{Bash Builtins}).
A parameter is set if it has been assigned a value. The null string is
a valid value. Once a variable is set, it may be unset only by using
@@ -1105,13 +1117,15 @@ is not given, the variable is assigned the null string. All
@var{value}s undergo tilde expansion, parameter and variable expansion,
command substitution, arithmetic expansion, and quote
removal (detailed below). If the variable has its @code{integer}
-attribute set (see the description of the @code{declare} builtin in
-@ref{Bash Builtins}), then @var{value}
+attribute set, then @var{value}
is subject to arithmetic expansion even if the @code{$((@dots{}))}
expansion is not used (@pxref{Arithmetic Expansion}).
Word splitting is not performed, with the exception
of @code{"$@@"} as explained below.
Filename expansion is not performed.
+Assignment statements may also appear as arguments to the
+@code{declare}, @code{typeset}, @code{export}, @code{readonly},
+and @code{local} builtin commands.
@node Positional Parameters
@subsection Positional Parameters
@@ -1870,13 +1884,13 @@ File descriptor 2 is duplicated.
@item /dev/tcp/@var{host}/@var{port}
If @var{host} is a valid hostname or Internet address, and @var{port}
-is an integer port number, Bash attempts to open a TCP connection
-to the corresponding socket.
+is an integer port number or service name, Bash attempts to open a TCP
+connection to the corresponding socket.
@item /dev/udp/@var{host}/@var{port}
If @var{host} is a valid hostname or Internet address, and @var{port}
-is an integer port number, Bash attempts to open a UDP connection
-to the corresponding socket.
+is an integer port number or service name, Bash attempts to open a UDP
+connection to the corresponding socket.
@end table
@@ -2230,6 +2244,11 @@ commands that are invoked as part of a pipeline are also executed
in a subshell environment. Changes made to the subshell environment
cannot affect the shell's execution environment.
+If a command is followed by a @samp{&} and job control is not active, the
+default standard input for the command is the empty file @file{/dev/null}.
+Otherwise, the invoked command inherits the file descriptors of the calling
+shell as modified by redirections.
+
@node Environment
@subsection Environment
@cindex environment
@@ -2319,8 +2338,8 @@ command substitution ignore the keyboard-generated job control signals
@code{SIGTTIN}, @code{SIGTTOU}, and @code{SIGTSTP}.
The shell exits by default upon receipt of a @code{SIGHUP}.
-Before exiting, it resends the @code{SIGHUP} to all jobs, running
-or stopped.
+Before exiting, an interactive shell resends the @code{SIGHUP} to
+all jobs, running or stopped.
Stopped jobs are sent @code{SIGCONT} to ensure that they receive
the @code{SIGHUP}.
To prevent the shell from sending the @code{SIGHUP} signal to a
@@ -2351,7 +2370,11 @@ a file is used as the first non-option argument when invoking Bash,
and neither the @option{-c} nor @option{-s} option is supplied
(@pxref{Invoking Bash}),
Bash reads and executes commands from the file, then exits. This
-mode of operation creates a non-interactive shell. When Bash runs
+mode of operation creates a non-interactive shell. The shell first
+searches for the file in the current directory, and looks in the
+directories in @env{$PATH} if not found there.
+
+When Bash runs
a shell script, it sets the special parameter @code{0} to the name
of the file, rather than the name of the shell, and the positional
parameters are set to the remaining arguments, if any are given.
@@ -2614,7 +2637,7 @@ If @code{getopts} is silent, then a colon (@samp{:}) is placed in
@item hash
@btindex hash
@example
-hash [-r] [-p @var{filename}] [@var{name}]
+hash [-r] [-p @var{filename}] [-t] [@var{name}]
@end example
Remember the full pathnames of commands specified as @var{name} arguments,
so they need not be searched for on subsequent invocations.
@@ -2623,6 +2646,10 @@ The commands are found by searching through the directories listed in
The @option{-p} option inhibits the path search, and @var{filename} is
used as the location of @var{name}.
The @option{-r} option causes the shell to forget all remembered locations.
+If the @option{-t} option is supplied, the full pathname to which each
+@var{name} corresponds is printed. If multiple @var{name} arguments are
+supplied with @option{-t} the @var{name} is printed before the hashed
+full pathname.
If no arguments are given, information about remembered commands is printed.
The return status is zero unless a @var{name} is not found or an invalid
option is supplied.
@@ -2671,7 +2698,7 @@ This may also be used to terminate execution of a script being executed
with the @code{.} (or @code{source}) builtin, returning either @var{n} or
the exit status of the last command executed within the script as the exit
status of the script.
-The return status is false if @code{return} is used outside a function
+The return status is non-zero if @code{return} is used outside a function
and not during the execution of a script by @code{.} or @code{source}.
@item shift
@@ -2795,6 +2822,12 @@ If a @var{sigspec}
is @code{0} or @code{EXIT}, @var{arg} is executed when the shell exits.
If a @var{sigspec} is @code{DEBUG}, the command @var{arg} is executed
after every simple command.
+If a @var{sigspec} is @code{ERR}, the command @var{arg}
+is executed whenever a simple command has a non-zero exit status.
+The @code{ERR} trap is not executed if the failed command is part of an
+@code{until} or @code{while} loop, part of an @code{if} statement,
+part of a @code{&&} or @code{||} list, or if the command's return
+status is being inverted using @code{!}.
The @option{-l} option causes the shell to print a list of signal names
and their corresponding numbers.
@@ -3074,11 +3107,11 @@ vertical tab
@item \\
backslash
@item \@var{nnn}
-the character whose @code{ASCII} code is the octal value @var{nnn}
-(one to three digits)
-@item \x@var{nnn}
-the character whose @code{ASCII} code is the hexadecimal value @var{nnn}
+the eight-bit character whose value is the octal value @var{nnn}
(one to three digits)
+@item \x@var{HH}
+the eight-bit character whose value is the hexadecimal value @var{HH}
+(one or two hex digits)
@end table
@item enable
@@ -3377,6 +3410,11 @@ If enabled, and the @code{cmdhist}
option is enabled, multi-line commands are saved to the history with
embedded newlines rather than using semicolon separators where possible.
+@item login_shell
+The shell sets this option if it is started as a login shell
+(@pxref{Invoking Bash}).
+The value may not be changed.
+
@item mailwarn
If set, and a file that Bash is checking for mail has been
accessed since the last time it was checked, the message
@@ -3531,7 +3569,10 @@ The maximum amount of virtual memory available to the process.
@end table
-If @var{limit} is given, it is the new value of the specified resource.
+If @var{limit} is given, it is the new value of the specified resource;
+the special @var{limit} values @code{hard}, @code{soft}, and
+@code{unlimited} stand for the current hard limit, the current soft limit,
+and no limit, respectively.
Otherwise, the current value of the soft limit for the specified resource
is printed, unless the @option{-H} option is supplied.
When setting new limits, if neither @option{-H} nor @option{-S} is supplied,
@@ -3541,9 +3582,8 @@ increments, except for @option{-t}, which is in seconds, @option{-p},
which is in units of 512-byte blocks, and @option{-n} and @option{-u}, which
are unscaled values.
-The return status is zero unless an invalid option is supplied, a
-non-numeric argument other than @code{unlimited} is supplied as a
-@var{limit}, or an error occurs while setting a new limit.
+The return status is zero unless an invalid option or argument is supplied,
+or an error occurs while setting a new limit.
@item unalias
@btindex unalias
@@ -3591,6 +3631,7 @@ with a non-zero status, unless the command that fails is part of an
@code{until} or @code{while} loop, part of an @code{if} statement,
part of a @code{&&} or @code{||} list, or if the command's return
status is being inverted using @code{!}.
+A trap on @code{ERR}, if set, is executed before the shell exits.
@item -f
Disable file name generation (globbing).
@@ -3657,6 +3698,9 @@ Same as @code{-n}.
@item noglob
Same as @code{-f}.
+@item nolog
+Currently ignored.
+
@item notify
Same as @code{-b}.
@@ -3927,11 +3971,10 @@ The value of @env{MACHTYPE}.
@end table
-@item COMP_WORDS
-An array variable consisting of the individual
-words in the current command line.
-This variable is available only in shell functions invoked by the
-programmable completion facilities (@pxref{Programmable Completion}).
+@item COLUMNS
+Used by the @code{select} builtin command to determine the terminal width
+when printing selection lists. Automatically set upon receipt of a
+@code{SIGWINCH}.
@item COMP_CWORD
An index into @env{$@{COMP_WORDS@}} of the word containing the current
@@ -3954,6 +3997,12 @@ This variable is available only in shell functions and external
commands invoked by the
programmable completion facilities (@pxref{Programmable Completion}).
+@item COMP_WORDS
+An array variable consisting of the individual
+words in the current command line.
+This variable is available only in shell functions invoked by the
+programmable completion facilities (@pxref{Programmable Completion}).
+
@item COMPREPLY
An array variable from which Bash reads the possible completions
generated by a shell function invoked by the programmable completion
@@ -3986,6 +4035,13 @@ A file name whose suffix matches one of the entries in
is excluded from the list of matched file names. A sample
value is @samp{.o:~}
+@item FUNCNAME
+The name of any currently-executing shell function.
+This variable exists only when a shell function is executing.
+Assignments to @env{FUNCNAME} have no effect and return an error status.
+If @env{FUNCNAME} is unset, it loses its special properties, even if
+it is subsequently reset.
+
@item GLOBIGNORE
A colon-separated list of patterns defining the set of filenames to
be ignored by filename expansion.
@@ -4019,13 +4075,6 @@ The history number, or index in the history list, of the current
command. If @env{HISTCMD} is unset, it loses its special properties,
even if it is subsequently reset.
-@item FUNCNAME
-The name of any currently-executing shell function.
-This variable exists only when a shell function is executing.
-Assignments to @env{FUNCNAME} have no effect and return an error status.
-If @env{FUNCNAME} is unset, it loses its special properties, even if
-it is subsequently reset.
-
@item HISTCONTROL
A value of @samp{ignorespace} means to not enter lines which
begin with a space or tab into the history list.
@@ -4038,6 +4087,18 @@ The second and subsequent lines of a multi-line compound command are
not tested, and are added to the history regardless of the value of
@env{HISTCONTROL}.
+@item HISTFILE
+The name of the file to which the command history is saved. The
+default value is @file{~/.bash_history}.
+
+@item HISTFILESIZE
+The maximum number of lines contained in the history file. When this
+variable is assigned a value, the history file is truncated, if
+necessary, to contain no more than that number of lines.
+The history file is also truncated to this size after
+writing it when an interactive shell exits.
+The default value is 500.
+
@item HISTIGNORE
A colon-separated list of patterns used to decide which command
lines should be saved on the history list. Each pattern is
@@ -4058,22 +4119,10 @@ pattern of @samp{[ ]*} is identical to @code{ignorespace}.
Combining these two patterns, separating them with a colon,
provides the functionality of @code{ignoreboth}.
-@item HISTFILE
-The name of the file to which the command history is saved. The
-default value is @file{~/.bash_history}.
-
@item HISTSIZE
The maximum number of commands to remember on the history list.
The default value is 500.
-@item HISTFILESIZE
-The maximum number of lines contained in the history file. When this
-variable is assigned a value, the history file is truncated, if
-necessary, to contain no more than that number of lines.
-The history file is also truncated to this size after
-writing it when an interactive shell exits.
-The default value is 500.
-
@item HOSTFILE
Contains the name of a file in the same format as @file{/etc/hosts} that
should be read when the shell needs to complete a hostname.
@@ -4133,19 +4182,14 @@ strings preceded by a @samp{$} (@pxref{Locale Translation}).
@item LC_NUMERIC
This variable determines the locale category used for number formatting.
+@item LINENO
+The line number in the script or shell function currently executing.
+
@item LINES
Used by the @code{select} builtin command to determine the column length
for printing selection lists. Automatically set upon receipt of a
@code{SIGWINCH}.
-@item COLUMNS
-Used by the @code{select} builtin command to determine the terminal width
-when printing selection lists. Automatically set upon receipt of a
-@code{SIGWINCH}.
-
-@item LINENO
-The line number in the script or shell function currently executing.
-
@item MACHTYPE
A string that fully describes the system type on which Bash
is executing, in the standard @sc{gnu} @var{cpu-company-system} format.
@@ -4174,6 +4218,18 @@ containing a list of exit status values from the processes
in the most-recently-executed foreground pipeline (which may
contain only a single command).
+@item POSIXLY_CORRECT
+If this variable is in the environment when @code{bash} starts, the shell
+enters @sc{posix} mode (@pxref{Bash POSIX Mode}) before reading the
+startup files, as if the @option{--posix} invocation option had been supplied.
+If it is set while the shell is running, @code{bash} enables @sc{posix} mode,
+as if the command
+@example
+@code{set -o posix}
+@end example
+@noindent
+had been executed.
+
@item PPID
The process @sc{id} of the shell's parent process. This variable
is readonly.
@@ -4310,9 +4366,9 @@ This section describes features unique to Bash.
@section Invoking Bash
@example
-bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o @var{option}] [@var{argument} @dots{}]
-bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o @var{option}] -c @var{string} [@var{argument} @dots{}]
-bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o @var{option}] [@var{argument} @dots{}]
+bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o @var{option}] [-O @var{shopt_option}] [@var{argument} @dots{}]
+bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o @var{option}] [-O @var{shopt_option}] -c @var{string} [@var{argument} @dots{}]
+bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o @var{option}] [-O @var{shopt_option}] [@var{argument} @dots{}]
@end example
In addition to the single-character shell command-line options
@@ -4414,6 +4470,16 @@ are subject to language translation when the current locale
is not @code{C} or @code{POSIX} (@pxref{Locale Translation}).
This implies the @option{-n} option; no commands will be executed.
+@item [-+]O [@var{shopt_option}]
+@var{shopt_option} is one of the shell options accepted by the
+@code{shopt} builtin (@pxref{Shell Builtin Commands}).
+If @var{shopt_option} is present, @option{-O} sets the value of that option;
+@option{+O} unsets it.
+If @var{shopt_option} is not supplied, the names and values of the shell
+options accepted by @code{shopt} are printed on the standard output.
+If the invocation option is @option{+O}, the output is displayed in a format
+that may be reused as input.
+
@item --
A @code{--} signals the end of options and disables further option
processing.
@@ -4421,6 +4487,10 @@ Any arguments after the @code{--} are treated as filenames and arguments.
@end table
+@cindex login shell
+A @emph{login} shell is one whose first character of argument zero is
+@samp{-}, or one invoked with the @option{--login} option.
+
@cindex interactive shell
An @emph{interactive} shell is one started without non-option arguments,
unless @option{-s} is specified,
@@ -4930,7 +5000,7 @@ is a decimal number between 2 and 64 representing the arithmetic
base, and @var{n} is a number in that base. If @var{base}@code{#} is
omitted, then base 10 is used.
The digits greater than 9 are represented by the lowercase letters,
-the uppercase letters, @samp{_}, and @samp{@@}, in that order.
+the uppercase letters, @samp{@@}, and @samp{_}, in that order.
If @var{base} is less than or equal to 36, lowercase and uppercase
letters may be used interchangably to represent numbers between 10
and 35.
@@ -5065,7 +5135,7 @@ Referencing an array variable without a subscript is equivalent to
referencing element zero.
The @code{unset} builtin is used to destroy arrays.
-@code{unset} @var{name[subscript]}
+@code{unset} @var{name}[@var{subscript}]
destroys the array element at index @var{subscript}.
@code{unset} @var{name}, where @var{name} is an array, removes the
entire array. A subscript of @samp{*} or @samp{@@} also removes the
@@ -5230,6 +5300,8 @@ The time, in 24-hour HH:MM:SS format.
The time, in 12-hour HH:MM:SS format.
@item \@@
The time, in 12-hour am/pm format.
+@item \A
+The time, in 24-hour HH:MM format.
@item \u
The username of the current user.
@item \v
@@ -5462,6 +5534,10 @@ Alias expansion is always enabled, even in non-interactive shells.
When the @code{set} builtin is invoked without options, it does not display
shell function names and definitions.
+@item
+When the @code{set} builtin is invoked without options, it displays
+variable values without quotes, unless they contain shell metacharacters,
+even if the result contains nonprinting characters.
@end enumerate
There is other @sc{posix} 1003.2 behavior that Bash does not implement.
@@ -5585,9 +5661,11 @@ job 1 in the background, equivalent to @samp{bg %1}
The shell learns immediately whenever a job changes state.
Normally, Bash waits until it is about to print a prompt
before reporting changes in a job's status so as to not interrupt
-any other output. If the
-the @option{-b} option to the @code{set} builtin is enabled,
+any other output.
+If the @option{-b} option to the @code{set} builtin is enabled,
Bash reports such changes immediately (@pxref{The Set Builtin}).
+Any trap on @code{SIGCHLD} is executed for each child process
+that exits.
If an attempt to exit Bash is while jobs are stopped, the
shell prints a message warning that there are stopped jobs.
@@ -5867,18 +5945,9 @@ The file @file{configure.in} is used to create @code{configure}
by a program called Autoconf. You only need
@file{configure.in} if you want to change it or regenerate
@code{configure} using a newer version of Autoconf. If
-you do this, make sure you are using Autoconf version 2.10 or
+you do this, make sure you are using Autoconf version 2.50 or
newer.
-If you need to change @file{configure.in} or regenerate
-@code{configure}, you will need to create two files:
-@file{_distribution} and @file{_patchlevel}. @file{_distribution}
-should contain the major and minor version numbers of the Bash
-distribution, for example @samp{2.01}. @file{_patchlevel} should
-contain the patch level of the Bash distribution, @samp{0} for
-example. The script @file{support/mkconffiles} has been provided
-to automate the creation of these files.
-
You can remove the program binaries and object files from the
source code directory by typing @samp{make clean}. To also remove the
files that @code{configure} created (so you can compile Bash for
@@ -5947,7 +6016,9 @@ directories for other architectures.
By default, @samp{make install} will install into
@file{/usr/local/bin}, @file{/usr/local/man}, etc. You can
specify an installation prefix other than @file{/usr/local} by
-giving @code{configure} the option @option{--prefix=@var{PATH}}.
+giving @code{configure} the option @option{--prefix=@var{PATH}},
+or by specifying a value for the @code{DESTDIR} @samp{make}
+variable when running @samp{make install}.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files.
@@ -5960,13 +6031,13 @@ Documentation and other data files will still use the regular prefix.
@section Specifying the System Type
There may be some features @code{configure} can not figure out
-automatically, but needs to determine by the type of host Bash
+automatically, but need to determine by the type of host Bash
will run on. Usually @code{configure} can figure that
out, but if it prints a message saying it can not guess the host
type, give it the @option{--host=TYPE} option. @samp{TYPE} can
either be a short name for the system type, such as @samp{sun4},
or a canonical name with three fields: @samp{CPU-COMPANY-SYSTEM}
-(e.g., @samp{sparc-sun-sunos4.1.2}).
+(e.g., @samp{i386-unknown-freebsd4.2}).
See the file @file{support/config.sub} for the possible
values of each field.
@@ -6052,22 +6123,24 @@ Use the curses library instead of the termcap library. This should
be supplied if your system has an inadequate or incomplete termcap
database.
-@item --with-glibc-malloc
-Use the @sc{gnu} libc version of @code{malloc} in
-@file{lib/malloc/gmalloc.c}. This is not the version of @code{malloc}
-that appears in glibc version 2, but a modified version of the
-@code{malloc} from glibc version 1. This is somewhat slower than the
-default @code{malloc}, but wastes less space on a per-allocation
-basis, and will return memory to the operating system under
-certain circumstances.
-
@item --with-gnu-malloc
A synonym for @code{--with-bash-malloc}.
-@item --with-installed-readline
+@item --with-installed-readline[=@var{PREFIX}]
Define this to make Bash link with a locally-installed version of Readline
rather than the version in @file{lib/readline}. This works only with
-Readline 4.1 and later versions.
+Readline 4.2 and later versions. If @var{PREFIX} is @code{yes} or not
+supplied, @code{configure} uses the values of the make variables
+@code{includedir} and @code{libdir}, which are subdirectories of @code{prefix}
+by default, to find the installed version of Readline if it is not in
+the standard system include and library directories.
+If @var{PREFIX} is @code{no}, Bash links with the version in
+@file{lib/readline}.
+If @var{PREFIX} is set to any other value, @code{configure} treats it as
+a directory pathname and looks for
+the installed version of Readline in subdirectories of that directory
+(include files in @var{PREFIX}/@code{include} and the library in
+@var{PREFIX}/@code{lib}).
@item --with-purify
Define this to use the Purify memory allocation checker from Rational
@@ -6082,6 +6155,11 @@ There are several @option{--enable-} options that alter how Bash is
compiled and linked, rather than changing run-time features.
@table @code
+@item --enable-largefile
+Enable support for @uref{http://www.sas.com/standards/large_file/x_open.20Mar96.html,
+large files} if the operating system requires special compiler options
+to build programs which can access large files.
+
@item --enable-profiling
This builds a Bash binary that produces profiling information to be
processed by @code{gprof} each time it is executed.
@@ -6533,7 +6611,8 @@ executed with the @code{.} or @code{source} builtins
@item
Bash includes the @code{shopt} builtin, for finer control of shell
-optional capabilities (@pxref{Bash Builtins}).
+optional capabilities (@pxref{Bash Builtins}), and allows these options
+to be set and unset at shell invocation (@pxref{Invoking Bash}).
@item
Bash has much more optional behavior controllable with the @code{set}
@@ -6545,11 +6624,17 @@ is slightly different, as it implements the @sc{posix} algorithm,
which specifies the behavior based on the number of arguments.
@item
-The @code{trap} builtin (@pxref{Bourne Shell Builtins})
-allows a @code{DEBUG} pseudo-signal specification,
-similar to @code{EXIT}. Commands specified with a @code{DEBUG} trap are
-executed after every simple command. The @code{DEBUG} trap is not
-inherited by shell functions.
+The @code{trap} builtin (@pxref{Bourne Shell Builtins}) allows a
+@code{DEBUG} pseudo-signal specification, similar to @code{EXIT}.
+Commands specified with a @code{DEBUG} trap are executed after every
+simple command.
+The @code{DEBUG} trap is not inherited by shell functions.
+
+The @code{trap} builtin (@pxref{Bourne Shell Builtins}) allows an
+@code{ERR} pseudo-signal specification, similar to @code{EXIT} and @code{DEBUG}.
+Commands specified with an @code{ERR} trap are executed after a simple
+command fails, with a few exceptions.
+The @code{ERR} trap is not inherited by shell functions.
@item
The Bash @code{type} builtin is more extensive and gives more information
diff --git a/doc/builtins.1 b/doc/builtins.1
index bd9a1f8..3c342b7 100644
--- a/doc/builtins.1
+++ b/doc/builtins.1
@@ -1,11 +1,12 @@
.\" This is a hack to force bash builtins into the whatis database
.\" and to get the list of builtins to come up with the man command.
-.TH BASH_BUILTINS 1 "1996 Mar 20" GNU
+.TH BASH_BUILTINS 1 "2001 October 29" "GNU Bash-2.05a"
.SH NAME
-bash, :, ., alias, bg, bind, break, builtin, case, cd, command,
+bash, :, ., [, alias, bg, bind, break, builtin, case, cd, command, compgen,
+complete,
continue, declare, dirs, disown, echo, enable, eval, exec, exit,
export, fc, fg, for, getopts, hash, help, history, if, jobs, kill,
-let, local, logout, popd, pushd, pwd, read, readonly, return, set,
+let, local, logout, popd, printf, pushd, pwd, read, readonly, return, set,
shift, shopt, source, suspend, test, times, trap, type, typeset,
ulimit, umask, unalias, unset, until, wait, while \- bash built-in commands, see \fBbash\fR(1)
.SH BASH BUILTIN COMMANDS