mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-12 22:50:49 +02:00
commit bash-20051222 snapshot
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
This is the Bash FAQ, version 3.32, for Bash version 3.1.
|
||||
This is the Bash FAQ, version 3.33, for Bash version 3.1.
|
||||
|
||||
This document contains a set of frequently-asked questions concerning
|
||||
Bash, the GNU Bourne-Again Shell. Bash is a freely-available command
|
||||
@@ -697,7 +697,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 +793,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
|
||||
@@ -1575,6 +1575,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 +1751,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 +1761,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.
|
||||
|
||||
+19
-12
@@ -6,12 +6,12 @@
|
||||
.\" Case Western Reserve University
|
||||
.\" chet@po.cwru.edu
|
||||
.\"
|
||||
.\" Last Change: Sat Aug 27 13:28:44 EDT 2005
|
||||
.\" Last Change: Wed Dec 28 19:58:45 EST 2005
|
||||
.\"
|
||||
.\" bash_builtins, strip all but Built-Ins section
|
||||
.if \n(zZ=1 .ig zZ
|
||||
.if \n(zY=1 .ig zY
|
||||
.TH BASH 1 "2005 Dec 10" "GNU Bash-3.1"
|
||||
.TH BASH 1 "2005 Dec 28" "GNU Bash-3.1"
|
||||
.\"
|
||||
.\" There's some problem with having a `@'
|
||||
.\" in a tagged paragraph with the BSD man macros.
|
||||
@@ -677,8 +677,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 +807,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 substituion,
|
||||
command substitution, process substitution and quote removal.
|
||||
Each \fIpattern\fP examined is expanded using tilde
|
||||
expansion, parameter and variable expansion, arithmetic substituion,
|
||||
command substitution, and process substitution.
|
||||
If the shell option
|
||||
.B nocasematch
|
||||
is enabled, the match is performed without regard to the case
|
||||
@@ -2525,17 +2531,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
|
||||
@@ -8484,7 +8485,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\-SHacdfilmnpqstuvx\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,6 +8521,9 @@ 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
|
||||
.TP
|
||||
@@ -8542,6 +8546,9 @@ The pipe size in 512-byte blocks (this may not be set)
|
||||
.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
|
||||
|
||||
+17
-5
@@ -6,12 +6,12 @@
|
||||
.\" Case Western Reserve University
|
||||
.\" chet@po.cwru.edu
|
||||
.\"
|
||||
.\" Last Change: Sat Aug 27 13:28:44 EDT 2005
|
||||
.\" Last Change: Mon Dec 19 09:04:39 EST 2005
|
||||
.\"
|
||||
.\" 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"
|
||||
.TH BASH 1 "2005 Dec 19" "GNU Bash-3.1"
|
||||
.\"
|
||||
.\" There's some problem with having a `@'
|
||||
.\" in a tagged paragraph with the BSD man macros.
|
||||
@@ -677,8 +677,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 +807,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 substituion,
|
||||
command substitution, process substitution and quote removal.
|
||||
Each \fIpattern\fP examined is expanded using tilde
|
||||
expansion, parameter and variable expansion, arithmetic substituion,
|
||||
command substitution, and process substitution.
|
||||
If the shell option
|
||||
.B nocasematch
|
||||
is enabled, the match is performed without regard to the case
|
||||
@@ -8484,7 +8490,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\-SHacdfilmnpqstuvx\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,6 +8526,9 @@ 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
|
||||
.TP
|
||||
@@ -8542,6 +8551,9 @@ The pipe size in 512-byte blocks (this may not be set)
|
||||
.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
|
||||
|
||||
+14
-10
@@ -961,8 +961,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.
|
||||
|
||||
@@ -1652,15 +1652,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
|
||||
@@ -2598,7 +2596,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.
|
||||
|
||||
@@ -3833,7 +3831,7 @@ builtin command.
|
||||
@item ulimit
|
||||
@btindex ulimit
|
||||
@example
|
||||
ulimit [-acdfilmnpqstuvxSH] [@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,6 +3852,9 @@ 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.
|
||||
|
||||
@@ -3875,6 +3876,9 @@ 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.
|
||||
|
||||
@@ -4098,8 +4102,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
|
||||
|
||||
+20
-7
@@ -961,8 +961,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.
|
||||
|
||||
@@ -1652,15 +1652,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
|
||||
@@ -3833,7 +3831,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,9 +3852,15 @@ 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.
|
||||
|
||||
@item -i
|
||||
The maximum number of pending signals.
|
||||
|
||||
@item -l
|
||||
The maximum size that may be locked into memory.
|
||||
|
||||
@@ -3869,6 +3873,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 +3891,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;
|
||||
|
||||
Binary file not shown.
+2
-2
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 1988-2005 Free Software Foundation, Inc.
|
||||
@end ignore
|
||||
|
||||
@set LASTCHANGE Sat Dec 10 19:58:23 EST 2005
|
||||
@set LASTCHANGE Fri Dec 30 10:50:51 EST 2005
|
||||
|
||||
@set EDITION 3.1
|
||||
@set VERSION 3.1
|
||||
@set UPDATED 10 December 2005
|
||||
@set UPDATED 30 December 2005
|
||||
@set UPDATED-MONTH December 2005
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 1988-2005 Free Software Foundation, Inc.
|
||||
@end ignore
|
||||
|
||||
@set LASTCHANGE Mon Sep 5 11:47:04 EDT 2005
|
||||
@set LASTCHANGE Wed Dec 28 19:59:13 EST 2005
|
||||
|
||||
@set EDITION 3.1
|
||||
@set VERSION 3.1
|
||||
@set UPDATED 5 September 2005
|
||||
@set UPDATED-MONTH September 2005
|
||||
@set UPDATED 28 December 2005
|
||||
@set UPDATED-MONTH December 2005
|
||||
|
||||
Reference in New Issue
Block a user