Imported from ../bash-3.2.tar.gz.

This commit is contained in:
Jari Aalto 2006-10-10 14:15:34 +00:00
commit 0628567a28
182 changed files with 17647 additions and 9477 deletions

114
doc/FAQ
View file

@ -1,4 +1,4 @@
This is the Bash FAQ, version 3.32, for Bash version 3.1.
This is the Bash FAQ, version 3.34, for Bash version 3.2.
This document contains a set of frequently-asked questions concerning
Bash, the GNU Bourne-Again Shell. Bash is a freely-available command
@ -9,7 +9,7 @@ Another good source of basic information about shells is the collection
of FAQ articles periodically posted to comp.unix.shell.
Questions and comments concerning this document should be sent to
chet@po.cwru.edu.
chet.ramey@case.edu.
This document is available for anonymous FTP with the URL
@ -36,8 +36,8 @@ A10) What is the bash `posix mode'?
Section B: The latest version
B1) What's new in version 3.1?
B2) Are there any user-visible incompatibilities between bash-3.1 and
B1) What's new in version 3.2?
B2) Are there any user-visible incompatibilities between bash-3.2 and
bash-2.05b?
Section C: Differences from other Unix shells
@ -78,6 +78,7 @@ E10) Why does `cd //' leave $PWD as `//'?
E11) If I resize my xterm while another program is running, why doesn't bash
notice the change?
E12) Why don't negative offsets in substring expansion work like I expect?
E13) Why does filename completion misbehave if a colon appears in the filename?
Section F: Things to watch out for on certain Unix versions
@ -140,26 +141,26 @@ of Case Western Reserve University.
A2) What's the latest version?
The latest version is 3.1, first made available on 09 December, 2005.
The latest version is 3.2, first made available on 12 October, 2006.
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 3.1:
The following URLs tell how to get version 3.2:
ftp://ftp.gnu.org/pub/gnu/bash/bash-3.1.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-3.1.tar.gz
ftp://ftp.gnu.org/pub/gnu/bash/bash-3.2.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-3.2.tar.gz
Formatted versions of the documentation are available with the URLs:
ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-3.1.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-3.1.tar.gz
ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-3.2.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-3.2.tar.gz
Any patches for the current version are available with the URL:
ftp://ftp.cwru.edu/pub/bash/bash-3.1-patches/
ftp://ftp.cwru.edu/pub/bash/bash-3.2-patches/
A4) On what machines will bash run?
@ -192,7 +193,7 @@ http://www.cygwin.com/.
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
ports of bash-2.05b and bash-3.0 to the CYGWIN environment, and both
are available as part of their current release. Bash-3.1 is currently
are available as part of their current release. Bash-3.2 is currently
being tested and should be available soon.
Bash-2.05b and later versions should require no local Cygnus changes to
@ -216,7 +217,7 @@ Mark began to work with bash-2.05, but I don't know the current status.
Bash-3.0 compiles and runs with no modifications under Microsoft's Services
for Unix (SFU), once known as Interix. I do not anticipate any problems
with building bash-3.1.
with building bash-3.1 or bash-3.2.
A6) How can I build bash with gcc?
@ -385,12 +386,22 @@ They are also listed in a section in the Bash Reference Manual
Section B: The latest version
B1) What's new in version 3.1?
B1) What's new in version 3.2?
Bash-3.1 is the first maintenance release of the third major release of
Bash-3.2 is the second maintenance release of the third major release of
bash. It contains the following significant new features (see the manual
page for complete descriptions and the CHANGES and NEWS files in the
bash-3.1 distribution).
bash-3.2 distribution).
o Bash-3.2 now checks shell scripts for NUL characters rather than non-printing
characters when deciding whether or not a script is a binary file.
o Quoting the string argument to the [[ command's =~ (regexp) operator now
forces string matching, as with the other pattern-matching operators.
A short feature history dating from Bash-2.0:
Bash-3.1 contained the following new features:
o Bash-3.1 may now be configured and built in a mode that enforces strict
POSIX compliance.
@ -401,8 +412,6 @@ o The `+=' assignment operator, which appends to the value of a string or
o It is now possible to ignore case when matching in contexts other than
filename generation using the new `nocasematch' shell option.
A short feature history dating from Bash-2.0:
Bash-3.0 contained the following new features:
o Features to support the bash debugger have been implemented, and there
@ -640,10 +649,10 @@ 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-3.1 and
B2) Are there any user-visible incompatibilities between bash-3.2 and
bash-2.05b?
There are a few incompatibilities between version 2.05b and version 3.1.
There are a few incompatibilities between version 2.05b and version 3.2.
They are detailed in the file COMPAT in the bash distribution. That file
is not meant to be all-encompassing; send mail to bash-maintainers@gnu.org
if if you find something that's not mentioned there.
@ -697,7 +706,7 @@ Things bash has that sh does not:
read -e/-p/-a/-t/-n/-d/-s/-u,
readonly -a/-f/name=value, trap -l, set +o,
set -b/-m/-o option/-h/-p/-B/-C/-H/-P,
unset -f/-v, ulimit -m/-p/-u,
unset -f/-v, ulimit -i/-m/-p/-q/-u/-x,
type -a/-p/-t/-f/-P, suspend -f, kill -n,
test -o optname/s1 == s2/s1 < s2/s1 > s2/-nt/-ot/-ef/-O/-G/-S
bash reads ~/.bashrc for interactive shells, $ENV for non-interactive
@ -793,8 +802,8 @@ Things bash has or uses that ksh88 does not:
set -o braceexpand/-o histexpand/-o interactive-comments/
-o notify/-o physical/-o posix/-o hashall/-o onecmd/
-h/-B/-C/-b/-H/-P, set +o, suspend, trap -l, type,
typeset -a/-F/-p, ulimit -u, umask -S, alias -p, shopt,
disown, printf, complete, compgen
typeset -a/-F/-p, ulimit -i/-q/-u/-x, umask -S, alias -p,
shopt, disown, printf, complete, compgen
`!' csh-style history expansion
POSIX.2-style globbing character classes
POSIX.2-style globbing equivalence classes
@ -837,7 +846,7 @@ Implementation differences:
C3) Which new features in ksh-93 are not in bash, and which are?
New things in ksh-93 not in bash-3.0:
New things in ksh-93 not in bash-3.2:
associative arrays
floating point arithmetic and variables
math library functions
@ -863,7 +872,7 @@ New things in ksh-93 not in bash-3.0:
lexical scoping for local variables in `ksh' functions
no scoping for local variables in `POSIX' functions
New things in ksh-93 present in bash-3.0:
New things in ksh-93 present in bash-3.2:
[n]<&word- and [n]>&word- redirections (combination dup and close)
for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command
?:, ++, --, `expr1 , expr2' arithmetic operators
@ -1113,7 +1122,7 @@ will try to write on a pipe without a reader. In that case, bash
will print `Broken pipe' to stderr when ps is killed by a
SIGPIPE.
As of bash-3.1, bash will not report SIGPIPE errors by default. You
As of bash-3.1, bash does not report SIGPIPE errors by default. You
can build a version of bash that will report such errors.
E3) When I have terminal escape sequences in my prompt, why does bash
@ -1390,6 +1399,32 @@ expanded value of param is unset or null, and $param otherwise.
To use negative offsets that begin with a minus sign, separate the
minus sign and the colon with a space.
E13) Why does filename completion misbehave if a colon appears in the filename?
Filename completion (and word completion in general) may appear to behave
improperly if there is a colon in the word to be completed.
The colon is special to readline's word completion code: it is one of the
characters that breaks words for the completer. Readline uses these characters
in sort of the same way that bash uses $IFS: they break or separate the words
the completion code hands to the application-specific or default word
completion functions. The original intent was to make it easy to edit
colon-separated lists (such as $PATH in bash) in various applications using
readline for input.
This is complicated by the fact that some versions of the popular
`bash-completion' programmable completion package have problems with the
default completion behavior in the presence of colons.
The current set of completion word break characters is available in bash as
the value of the COMP_WORDBREAKS variable. Removing `:' from that value is
enough to make the colon not special to completion:
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
You can also quote the colon with a backslash to achieve the same result
temporarily.
Section F: Things to watch out for on certain Unix versions
F1) Why can't I use command line editing in my `cmdtool'?
@ -1575,6 +1610,9 @@ this. These variables can be set in your .inputrc or using the bash
The `set' commands between the single quotes may also be placed
in ~/.inputrc.
The script examples/scripts.noah/meta.bash encapsulates the bind
commands in a shell function.
G2) How do I write a function `x' to replace builtin command `x', but
still invoke the command from within the function?
@ -1748,13 +1786,9 @@ ftp.cwru.edu in the `pub/bash' directory.
Cameron Newham and Bill Rosenblatt have written a book on bash, published
by O'Reilly and Associates. The book is based on Bill Rosenblatt's Korn
Shell book. The title is ``Learning the Bash Shell'', and the ISBN number
is 1-56592-147-X. Look for it in fine bookstores near you. This book
covers bash-1.14, but has an appendix describing some of the new features
in bash-2.0.
A second edition of this book is available, published in January, 1998.
The ISBN number is 1-56592-347-2. Look for it in the same fine bookstores
or on the web.
of the third edition, published in March, 2005, is 0-596-00965-8. Look for
it in fine bookstores near you. This edition of the book has been updated
to cover bash-3.0.
The GNU Bash Reference Manual has been published as a printed book by
Network Theory Ltd (Paperback, ISBN: 0-9541617-7-7, Feb 2003). It covers
@ -1762,6 +1796,16 @@ bash-2.0 and is available from most online bookstores (see
http://www.network-theory.co.uk/bash/manual/ for details). The publisher
will donate $1 to the Free Software Foundation for each copy sold.
Arnold Robbins and Nelson Beebe have written ``Classic Shell Scripting'',
published by O'Reilly. The first edition, with ISBN number 0-596-00595-4,
was published in May, 2005.
Chris F. A. Johnson, a frequent contributor to comp.unix.shell and
gnu.bash.bug, has written ``Shell Scripting Recipes: A Problem-Solution
Approach,'' a new book on shell scripting, concentrating on features of
the POSIX standard helpful to shell script writers. The first edition from
Apress, with ISBN number 1-59059-471-1, was published in May, 2005.
H3) What's coming in future versions?
These are features I hope to include in a future version of bash.
@ -1786,9 +1830,9 @@ Some of the new ksh93 pattern matching operators, like backreferencing
H5) When will the next release appear?
The next version will appear sometime in 2006. Never make predictions.
The next version will appear sometime in 2007. Never make predictions.
This document is Copyright 1995-2005 by Chester Ramey.
This document is Copyright 1995-2006 by Chester Ramey.
Permission is hereby granted, without written agreement and
without license or royalty fees, to use, copy, and distribute

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
\"
.\"
.\" MAN PAGE COMMENTS to
.\"
.\" Chet Ramey
@ -6,12 +6,12 @@
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
.\" Last Change: Sat Aug 27 13:28:44 EDT 2005
.\" Last Change: Thu Sep 28 10:25:59 EDT 2006
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2005 Aug 27" "GNU Bash-3.1-beta1"
.TH BASH 1 "2006 September 28" "GNU Bash-3.2"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@ -62,8 +62,9 @@ also incorporates useful features from the \fIKorn\fP and \fIC\fP
shells (\fBksh\fP and \fBcsh\fP).
.PP
.B Bash
is intended to be a conformant implementation of the IEEE
POSIX Shell and Tools specification (IEEE Working Group 1003\.2).
is intended to be a conformant implementation of the
Shell and Utilities portion of the IEEE POSIX specification
(IEEE Standard 1003.1).
.B Bash
can be configured to be POSIX-conformant by default.
.SH OPTIONS
@ -223,7 +224,7 @@ This option is on by default if the shell is invoked as
.TP
.B \-\-posix
Change the behavior of \fBbash\fP where the default operation differs
from the POSIX 1003.2 standard to match the standard (\fIposix mode\fP).
from the POSIX standard to match the standard (\fIposix mode\fP).
.TP
.B \-\-restricted
The shell becomes restricted (see
@ -677,8 +678,8 @@ If the shell option
.B nocasematch
is enabled, the match is performed without regard to the case
of alphabetic characters.
The return value is 0 if the string matches or does not match
the pattern, respectively, and 1 otherwise.
The return value is 0 if the string matches (\fB==\fP) or does not match
(\fB!=\fP) the pattern, and 1 otherwise.
Any part of the pattern may be quoted to force it to be matched as a
string.
.if t .sp 0.5
@ -807,6 +808,12 @@ it against each \fIpattern\fP in turn, using the same matching rules
as for pathname expansion (see
.B Pathname Expansion
below).
The \fIword\fP is expanded using tilde
expansion, parameter and variable expansion, arithmetic substitution,
command substitution, process substitution and quote removal.
Each \fIpattern\fP examined is expanded using tilde
expansion, parameter and variable expansion, arithmetic substitution,
command substitution, and process substitution.
If the shell option
.B nocasematch
is enabled, the match is performed without regard to the case
@ -971,7 +978,7 @@ quotes (see
.B PARAMETERS
below).
.PP
Words of the form \fB$\fP'\fIstring\fP' are treated specially. The
Words of the form \fB$\fP\(aq\fIstring\fP\(aq are treated specially. The
word expands to \fIstring\fP, with backslash-escaped characters replaced
as specified by the ANSI C standard. Backslash escape sequences, if
present, are decoded as follows:
@ -1005,7 +1012,7 @@ vertical tab
.B \e\e
backslash
.TP
.B \e'
.B \e\(aq
single quote
.TP
.B \e\fInnn\fP
@ -1368,6 +1375,8 @@ subsequently reset.
.B COMP_WORDS
An array variable (see \fBArrays\fP below) consisting of the individual
words in the current command line.
The words are split on shell metacharacters as the shell parser would
separate them.
This variable is available only in shell functions invoked by the
programmable completion facilities (see \fBProgrammable Completion\fP
below).
@ -1686,7 +1695,8 @@ command history is not saved when an interactive shell exits.
.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
necessary, by removing the oldest entries,
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
@ -1839,7 +1849,7 @@ the current mailfile.
Example:
.RS
.PP
\fBMAILPATH\fP='/var/mail/bfox?"You have mail":~/shell\-mail?"$_ has mail!"'
\fBMAILPATH\fP=\(aq/var/mail/bfox?"You have mail":~/shell\-mail?"$_ has mail!"\(aq
.PP
.B Bash
supplies a default value for this variable, but the location of the user
@ -1973,7 +1983,7 @@ The value of \fIp\fP determines whether or not the fraction is
included.
.IP
If this variable is not set, \fBbash\fP acts as if it had the
value \fB$'\enreal\et%3lR\enuser\et%3lU\ensys\t%3lS'\fP.
value \fB$\(aq\enreal\et%3lR\enuser\et%3lU\ensys\t%3lS\(aq\fP.
If the value is null, no timing information is displayed.
A trailing newline is added when the format string is displayed.
.TP
@ -2525,17 +2535,12 @@ the pattern removal operation is applied to each member of the
array in turn, and the expansion is the resultant list.
.TP
${\fIparameter\fP\fB/\fP\fIpattern\fP\fB/\fP\fIstring\fP}
.PD 0
.TP
${\fIparameter\fP\fB//\fP\fIpattern\fP\fB/\fP\fIstring\fP}
.PD
The \fIpattern\fP is expanded to produce a pattern just as in
pathname expansion.
\fIParameter\fP is expanded and the longest match of \fIpattern\fP
against its value is replaced with \fIstring\fP.
In the first form, only the first match is replaced.
The second form causes all matches of \fIpattern\fP to be
replaced with \fIstring\fP.
If \Ipattern\fP begins with \fB/\fP, all matches of \fIpattern\fP are
replaced with \fIstring\fP. Normally only the first match is replaced.
If \fIpattern\fP begins with \fB#\fP, it must match at the beginning
of the expanded value of \fIparameter\fP.
If \fIpattern\fP begins with \fB%\fP, it must match at the end
@ -2702,7 +2707,7 @@ If the value of
.B IFS
is null, no word splitting occurs.
.PP
Explicit null arguments (\^\f3"\^"\fP or \^\f3'\^'\fP\^) are retained.
Explicit null arguments (\^\f3"\^"\fP or \^\f3\(aq\^\(aq\fP\^) are retained.
Unquoted implicit null arguments, resulting from the expansion of
parameters that have no values, are removed.
If a parameter with no value is expanded within double quotes, a
@ -2861,7 +2866,7 @@ and
.BR ] ,
\fIcharacter classes\fP can be specified using the syntax
\fB[:\fP\fIclass\fP\fB:]\fP, where \fIclass\fP is one of the
following classes defined in the POSIX.2 standard:
following classes defined in the POSIX standard:
.PP
.RS
.B
@ -2924,7 +2929,7 @@ Matches anything except one of the given patterns
After the preceding expansions, all unquoted occurrences of the
characters
.BR \e ,
.BR ' ,
.BR \(aq ,
and \^\f3"\fP\^ that did not result from one of the above
expansions are removed.
.SH REDIRECTION
@ -3417,6 +3422,10 @@ automatically have them defined with the
option to the
.B export
builtin.
A function definition may be deleted using the \fB\-f\fP option to
the
.B unset
builtin.
Note that shell functions and variables with the same name may result
in multiple identically-named entries in the environment passed to the
shell's children.
@ -4489,8 +4498,8 @@ backslash
.B \e"
literal "
.TP
.B \e'
literal '
.B \e\(aq
literal \(aq
.RE
.PD
.PP
@ -4538,7 +4547,7 @@ be used to indicate a macro definition.
Unquoted text is assumed to be a function name.
In the macro body, the backslash escapes described above are expanded.
Backslash will quote any other character in the macro text,
including " and '.
including " and \(aq.
.PP
.B Bash
allows the current readline key bindings to be displayed or modified
@ -6635,10 +6644,6 @@ backslash
the eight-bit character whose value is the octal value \fInnn\fP
(zero to three octal digits)
.TP
.B \e\fInnn\fP
the eight-bit character whose value is the octal value \fInnn\fP
(one to three octal digits)
.TP
.B \ex\fIHH\fP
the eight-bit character whose value is the hexadecimal value \fIHH\fP
(one or two hex digits)
@ -7314,7 +7319,7 @@ format specifications, each of which causes printing of the next successive
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 (except that \fB\ec\fP terminates output, backslashes in
\fB\e'\fP, \fB\e"\fP, and \fB\e?\fP are not removed, and octal escapes
\fB\e\(aq\fP, \fB\e"\fP, and \fB\e?\fP are not removed, and octal escapes
beginning with \fB\e0\fP may contain up to four digits),
and \fB%q\fP causes \fBprintf\fP to output the corresponding
\fIargument\fP in a format that can be reused as shell input.
@ -7712,7 +7717,7 @@ This option is disabled by default.
Change the behavior of
.B bash
where the default operation differs
from the POSIX 1003.2 standard to match the standard (\fIposix mode\fP).
from the POSIX standard to match the standard (\fIposix mode\fP).
.TP 8
.B privileged
Same as
@ -8031,7 +8036,7 @@ If set, the extended pattern matching features described above under
\fBPathname Expansion\fP are enabled.
.TP 8
.B extquote
If set, \fB$\fP'\fIstring\fP' and \fB$\fP"\fIstring\fP" quoting is
If set, \fB$\fP\(aq\fIstring\fP\(aq and \fB$\fP"\fIstring\fP" quoting is
performed within \fB${\fP\fIparameter\fP\fB}\fP expansions
enclosed in double quotes. This option is enabled by default.
.TP 8
@ -8400,8 +8405,8 @@ the command
is executed each time a shell function or a script executed with the
\fB.\fP or \fBsource\fP builtins finishes executing.
Signals ignored upon entry to the shell cannot be trapped or reset.
Trapped signals are reset to their original values in a child
process when it is created.
Trapped signals that are not being ignored are reset to their original
values in a child process when it is created.
The return status is false if any
.I sigspec
is invalid; otherwise
@ -8484,7 +8489,7 @@ option suppresses shell function lookup, as with the \fBcommand\fP builtin.
returns true if any of the arguments are found, false if
none are found.
.TP
\fBulimit\fP [\fB\-SHacdflmnpstuv\fP [\fIlimit\fP]]
\fBulimit\fP [\fB\-SHacdefilmnpqrstuvx\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 \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is
@ -8520,8 +8525,14 @@ The maximum size of core files created
.B \-d
The maximum size of a process's data segment
.TP
.B \-e
The maximum scheduling priority ("nice")
.TP
.B \-f
The maximum size of files created by the shell
The maximum size of files written by the shell and its children
.TP
.B \-i
The maximum number of pending signals
.TP
.B \-l
The maximum size that may be locked into memory
@ -8536,6 +8547,12 @@ allow this value to be set)
.B \-p
The pipe size in 512-byte blocks (this may not be set)
.TP
.B \-q
The maximum number of bytes in POSIX message queues
.TP
.B \-r
The maximum real-time scheduling priority
.TP
.B \-s
The maximum stack size
.TP
@ -8547,6 +8564,9 @@ The maximum number of processes available to a single user
.TP
.B \-v
The maximum amount of virtual memory available to the shell
.TP
.B \-x
The maximum number of file locks
.PD
.PP
If

File diff suppressed because it is too large Load diff

View file

@ -24,7 +24,7 @@ are preserved on all copies.
@quotation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
and with the Back-Cover Texts as in (a) below. A copy of the license is
@ -74,7 +74,7 @@ USA @*
@top Bash Features
This text is a brief description of the features that are present in
the Bash shell (version @value{VERSION}, @value{UPDATED})..
the Bash shell (version @value{VERSION}, @value{UPDATED}).
This is Edition @value{EDITION}, last updated @value{UPDATED},
of @cite{The GNU Bash Reference Manual},
@ -142,7 +142,8 @@ of Unix.
Bash is largely compatible with @code{sh} and incorporates useful
features from the Korn shell @code{ksh} and the C shell @code{csh}.
It is intended to be a conformant implementation of the @sc{ieee}
@sc{posix} Shell and Tools specification (@sc{ieee} Working Group 1003.2).
@sc{posix} Shell and Tools portion of the @sc{ieee} @sc{posix}
specification (@sc{ieee} Standard 1003.1).
It offers functional improvements over @code{sh} for both interactive and
programming use.
@ -217,7 +218,8 @@ These definitions are used throughout the remainder of this manual.
@item POSIX
@cindex POSIX
A family of open system standards based on Unix. Bash
is concerned with @sc{posix} 1003.2, the Shell and Tools Standard.
is primarily concerned with the Shell and Utilities portion of the
@sc{posix} 1003.1 standard.
@item blank
A space or tab character.
@ -307,7 +309,7 @@ of an event occurring in the system.
@item special builtin
@cindex special builtin
A shell builtin command that has been classified as special by the
@sc{posix} 1003.2 standard.
@sc{posix} standard.
@item token
@cindex token
@ -961,8 +963,8 @@ If the shell option @code{nocasematch}
(see the description of @code{shopt} in @ref{Bash Builtins})
is enabled, the match is performed without regard to the case
of alphabetic characters.
The return value is 0 if the string matches or does not match
the pattern, respectively, and 1 otherwise.
The return value is 0 if the string matches (@samp{==}) or does not
match (@samp{!=})the pattern, and 1 otherwise.
Any part of the pattern may be quoted to force it to be matched as a
string.
@ -1084,6 +1086,9 @@ name of a command.
Any redirections (@pxref{Redirections}) associated with the shell function
are performed when the function is executed.
A function definition may be deleted using the @option{-f} option to the
@code{unset} builtin (@pxref{Bourne Shell Builtins}).
The exit status of a function definition is zero unless a syntax error
occurs or a readonly function with the same name already exists.
When executed, the exit status of a function is the exit status of the
@ -1652,15 +1657,13 @@ the pattern removal operation is applied to each member of the
array in turn, and the expansion is the resultant list.
@item $@{@var{parameter}/@var{pattern}/@var{string}@}
@itemx $@{@var{parameter}//@var{pattern}/@var{string}@}
The @var{pattern} is expanded to produce a pattern just as in
filename expansion.
@var{Parameter} is expanded and the longest match of @var{pattern}
against its value is replaced with @var{string}.
In the first form, only the first match is replaced.
The second form causes all matches of @var{pattern} to be
replaced with @var{string}.
If @var{pattern} begins with @samp{/}, all matches of @var{pattern} are
replaced with @var{string}. Normally only the first match is replaced.
If @var{pattern} begins with @samp{#}, it must match at the beginning
of the expanded value of @var{parameter}.
If @var{pattern} begins with @samp{%}, it must match at the end
@ -1903,7 +1906,7 @@ force the use of the C locale by setting the @env{LC_COLLATE} or
Within @samp{[} and @samp{]}, @var{character classes} can be specified
using the syntax
@code{[:}@var{class}@code{:]}, where @var{class} is one of the
following classes defined in the @sc{posix} 1003.2 standard:
following classes defined in the @sc{posix} standard:
@example
alnum alpha ascii blank cntrl digit graph lower
print punct space upper word xdigit
@ -2588,7 +2591,7 @@ under another shell.
* The Set Builtin:: This builtin is so overloaded it
deserves its own section.
* Special Builtins:: Builtin commands classified specially by
POSIX.2.
POSIX.
@end menu
Builtin commands are contained within the shell itself.
@ -2598,7 +2601,7 @@ the command directly, without invoking another program.
Builtin commands are necessary to implement functionality impossible
or inconvenient to obtain with separate utilities.
This section briefly the builtins which Bash inherits from
This section briefly describes the builtins which Bash inherits from
the Bourne Shell, as well as the builtin commands which are unique
to or have been extended in Bash.
@ -2621,7 +2624,7 @@ builtins do not accept options.
@section Bourne Shell Builtins
The following shell builtin commands are inherited from the Bourne Shell.
These commands are implemented as specified by the @sc{posix} 1003.2 standard.
These commands are implemented as specified by the @sc{posix} standard.
@table @code
@item : @r{(a colon)}
@ -2809,7 +2812,7 @@ If @code{getopts} is silent, then a colon (@samp{:}) is placed in
@item hash
@btindex hash
@example
hash [-'r] [-p @var{filename}] [-dt] [@var{name}]
hash [-r] [-p @var{filename}] [-dt] [@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.
@ -3027,8 +3030,8 @@ each time a shell function or a script executed with the @code{.} or
@code{source} builtins finishes executing.
Signals ignored upon entry to the shell cannot be trapped or reset.
Trapped signals are reset to their original values in a child
process when it is created.
Trapped signals that are not being ignored are reset to their original
values in a child process when it is created.
The return status is zero unless a @var{sigspec} does not specify a
valid signal.
@ -3073,7 +3076,7 @@ The return status is zero unless a @var{name} is readonly.
This section describes builtin commands which are unique to
or have been extended in Bash.
Some of these commands are specified in the @sc{posix} 1003.2 standard.
Some of these commands are specified in the @sc{posix} standard.
@table @code
@ -3338,9 +3341,6 @@ backslash
@item \0@var{nnn}
the eight-bit character whose value is the octal value @var{nnn}
(zero to three octal digits)
@item \@var{nnn}
the eight-bit character whose value is the octal value @var{nnn}
(one to three octal digits)
@item \x@var{HH}
the eight-bit character whose value is the hexadecimal value @var{HH}
(one or two hex digits)
@ -3833,7 +3833,7 @@ builtin command.
@item ulimit
@btindex ulimit
@example
ulimit [-acdflmnpstuvSH] [@var{limit}]
ulimit [-acdefilmnpqrstuvxSH] [@var{limit}]
@end example
@code{ulimit} provides control over the resources available to processes
started by the shell, on systems that allow such control. If an
@ -3854,8 +3854,14 @@ The maximum size of core files created.
@item -d
The maximum size of a process's data segment.
@item -e
The maximum scheduling priority ("nice").
@item -f
The maximum size of files created by the shell.
The maximum size of files written by the shell and its children.
@item -i
The maximum number of pending signals.
@item -l
The maximum size that may be locked into memory.
@ -3869,6 +3875,12 @@ The maximum number of open file descriptors.
@item -p
The pipe buffer size.
@item -q
The maximum number of bytes in POSIX message queues.
@item -r
The maximum real-time scheduling priority.
@item -s
The maximum stack size.
@ -3881,6 +3893,9 @@ The maximum number of processes available to a single user.
@item -v
The maximum amount of virtual memory available to the process.
@item -x
The maximum number of file locks.
@end table
If @var{limit} is given, it is the new value of the specified resource;
@ -4045,7 +4060,7 @@ This option is disabled by default.
@item posix
Change the behavior of Bash where the default operation differs
from the @sc{posix} 1003.2 standard to match the standard
from the @sc{posix} standard to match the standard
(@pxref{Bash POSIX Mode}).
This is intended to make Bash behave as a strict superset of that
standard.
@ -4089,8 +4104,8 @@ shell will exit.
Print shell input lines as they are read.
@item -x
Print a trace of simple commands, \fBfor\fP commands, \fBcase\fP
commands, \fBselect\fP commands, and arithmetic \fBfor\fP commands
Print a trace of simple commands, @code{for} commands, @code{case}
commands, @code{select} commands, and arithmetic @code{for} commands
and their arguments or associated word lists after they are
expanded and before they are executed. The value of the @env{PS4}
variable is expanded and the resultant value is printed before
@ -4172,7 +4187,7 @@ The return status is always zero unless an invalid option is supplied.
@section Special Builtins
@cindex special builtin
For historical reasons, the @sc{posix} 1003.2 standard has classified
For historical reasons, the @sc{posix} standard has classified
several builtin commands as @emph{special}.
When Bash is executing in @sc{posix} mode, the special builtins
differ from other builtin commands in three respects:
@ -4414,6 +4429,8 @@ even if it is subsequently reset.
@item COMP_WORDS
An array variable consisting of the individual
words in the current command line.
The words are split on shell metacharacters as the shell parser would
separate them.
This variable is available only in shell functions invoked by the
programmable completion facilities (@pxref{Programmable Completion}).
@ -4525,7 +4542,8 @@ 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.
necessary, by removing the oldest entries,
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.
@ -4875,7 +4893,7 @@ invoked as @code{sh}.
@item --posix
Change the behavior of Bash where the default operation differs
from the @sc{posix} 1003.2 standard to match the standard. This
from the @sc{posix} standard to match the standard. This
is intended to make Bash behave as a strict superset of that
standard. @xref{Bash POSIX Mode}, for a description of the Bash
@sc{posix} mode.
@ -5888,7 +5906,7 @@ the shell spawned to execute the script.
Starting Bash with the @option{--posix} command-line option or executing
@samp{set -o posix} while Bash is running will cause Bash to conform more
closely to the @sc{posix} 1003.2 standard by changing the behavior to
closely to the @sc{posix} standard by changing the behavior to
match that specified by @sc{posix} in areas where the Bash default differs.
When invoked as @code{sh}, Bash enters @sc{posix} mode after reading the
@ -5921,13 +5939,13 @@ Reserved words appearing in a context where reserved words are recognized
do not undergo alias expansion.
@item
The @sc{posix} 1003.2 @env{PS1} and @env{PS2} expansions of @samp{!} to
The @sc{posix} @env{PS1} and @env{PS2} expansions of @samp{!} to
the history number and @samp{!!} to @samp{!} are enabled,
and parameter expansion is performed on the values of @env{PS1} and
@env{PS2} regardless of the setting of the @code{promptvars} option.
@item
The @sc{posix} 1003.2 startup files are executed (@env{$ENV}) rather than
The @sc{posix} startup files are executed (@env{$ENV}) rather than
the normal Bash files.
@item
@ -5969,13 +5987,13 @@ may not start with a digit. Declaring a function with an invalid name
causes a fatal syntax error in non-interactive shells.
@item
@sc{posix} 1003.2 special builtins are found before shell functions
@sc{posix} special builtins are found before shell functions
during command lookup.
@item
If a @sc{posix} 1003.2 special builtin returns an error status, a
If a @sc{posix} special builtin returns an error status, a
non-interactive shell exits. The fatal errors are those listed in
the POSIX.2 standard, and include things like passing incorrect options,
the POSIX standard, and include things like passing incorrect options,
redirection errors, variable assignment errors for assignments preceding
the command name, and so on.
@ -6003,7 +6021,7 @@ variable in a @code{for} statement or the selection variable in a
Process substitution is not available.
@item
Assignment statements preceding @sc{posix} 1003.2 special builtins
Assignment statements preceding @sc{posix} special builtins
persist in the shell environment after the builtin completes.
@item
@ -6013,7 +6031,7 @@ special builtin command had been executed.
@item
The @code{export} and @code{readonly} builtin commands display their
output in the format required by @sc{posix} 1003.2.
output in the format required by @sc{posix}.
@item
The @code{trap} builtin displays signal names without the leading
@ -6092,7 +6110,7 @@ escape characters are converted.
@end enumerate
There is other @sc{posix} 1003.2 behavior that Bash does not implement by
There is other @sc{posix} behavior that Bash does not implement by
default even when in @sc{posix} mode.
Specifically:
@ -6915,7 +6933,7 @@ Please send all reports concerning this manual to
Bash implements essentially the same grammar, parameter and
variable expansion, redirection, and quoting as the Bourne Shell.
Bash uses the @sc{posix} 1003.2 standard as the specification of
Bash uses the @sc{posix} standard as the specification of
how these features are to be implemented. There are some
differences between the traditional Bourne shell and Bash; this
section quickly details the differences of significance. A
@ -7079,7 +7097,7 @@ not all words (@pxref{Word Splitting}).
This closes a longstanding shell security hole.
@item
Bash implements the full set of @sc{posix} 1003.2 filename expansion operators,
Bash implements the full set of @sc{posix} filename expansion operators,
including @var{character classes}, @var{equivalence classes}, and
@var{collating symbols} (@pxref{Filename Expansion}).
@ -7364,8 +7382,8 @@ with a @samp{-}.
@item
The SVR4.2 shell exits a script if any builtin fails; Bash exits
a script only if one of the @sc{posix} 1003.2 special builtins fails, and
only for certain failures, as enumerated in the @sc{posix} 1003.2 standard.
a script only if one of the @sc{posix} special builtins fails, and
only for certain failures, as enumerated in the @sc{posix} standard.
@item
The SVR4.2 shell behaves differently when invoked as @code{jsh}

File diff suppressed because it is too large Load diff

View file

@ -1,10 +1,10 @@
@ignore
Copyright (C) 1988-2005 Free Software Foundation, Inc.
Copyright (C) 1988-2006 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Mon Sep 5 11:47:04 EDT 2005
@set LASTCHANGE Thu Sep 28 10:25:45 EDT 2006
@set EDITION 3.1-beta1
@set VERSION 3.1-beta1
@set UPDATED 5 September 2005
@set UPDATED-MONTH September 2005
@set EDITION 3.2
@set VERSION 3.2
@set UPDATED 28 September 2006
@set UPDATED-MONTH September 2006