commit bash-20100609 snapshot

This commit is contained in:
Chet Ramey
2011-12-12 22:00:38 -05:00
parent 220537f23e
commit 67362c6091
55 changed files with 4923 additions and 4423 deletions
+7
View File
@@ -360,6 +360,13 @@ compat40 set
of the entire list to be aborted (in versions before bash-4.0,
interrupting one command in a list caused the next to be executed)
compat41 set
- interrupting a command list such as "a ; b ; c" causes the execution
of the entire list to be aborted (in versions before bash-4.0,
interrupting one command in a list caused the next to be executed)
- when in posix mode, single quotes in the `word' portion of a
double-quoted parameter expansion define a new quoting context and
are treated specially
-------------------------------------------------------------------------------
Copying and distribution of this file, with or without modification,
+2 -1
View File
@@ -357,7 +357,8 @@ compat40 set
- the < and > operators to the [[ command do not consider the current
locale when comparing strings
- interrupting a command list such as "a ; b ; c" causes the execution
of the entire list to be aborted
of the entire list to be aborted (in versions before bash-4.0,
interrupting one command in a list caused the next to be executed)
-------------------------------------------------------------------------------
+35
View File
@@ -10046,6 +10046,9 @@ builtins/hash.def
at all, even with the -p option. Inconsistency pointed out by
Jan Schampera <jan.schampera@web.de>
builtins/shopt.def
- add `compat41' option in preparation for bash-4.2
6/6
---
lib/readline/vi_mode.c
@@ -10075,3 +10078,35 @@ builtins/cd.def
doc/{bash.1,bashref.texi}
- document new `cd -e' option
6/12
----
arrayfunc.c
- change array_value_internal to treat negative subscripts to indexed
arrays, offset from array_max_index(x) + 1, so foo[-1] is the last
element of $foo
subst.c
- Change verify_substring_values to allow negative length specifications
when using string variables or array members. Negative lengths
mean to return characters from OFFSET until (${#var} - N) for
{var:offset:-N}. Feature requested by Richard Neill
<rn214@hermes.cam.ac.uk>
doc/{bash.1,bashref.texi}
- document new behavior of negative subscripts to indexed arrays
- document new behavior of negative LENGTH in substring expansion
configure.in
- change version to bash-4.2-devel
variables.c
- make sure initialize_shell_variables calls sv_xtracefd if
BASH_XTRACEFD is inherited in the shell environment. Fixes but
reported by <jsunx1@bellsouth.net>
6/13
----
lib/readline/complete.c
- change get_y_or_n to always return 1 when in callback mode, so we
don't do a blocking read. Have to wait until readline-7.0 to add
a state, since that will change public interface
+34
View File
@@ -10046,6 +10046,9 @@ builtins/hash.def
at all, even with the -p option. Inconsistency pointed out by
Jan Schampera <jan.schampera@web.de>
builtins/shopt.def
- add `compat41' option in preparation for bash-4.2
6/6
---
lib/readline/vi_mode.c
@@ -10069,3 +10072,34 @@ execute_cmd.c
display width of select list elements in presence of multibyte
characters. Bug reported by Bernd Eggink <monoped@sudrala.de>
builtins/cd.def
- add posix-mandated -e option; currently ignored in most circumstances
doc/{bash.1,bashref.texi}
- document new `cd -e' option
6/12
----
arrayfunc.c
- change array_value_internal to treat negative subscripts to indexed
arrays, offset from array_max_index(x) + 1, so foo[-1] is the last
element of $foo
subst.c
- Change verify_substring_values to allow negative length specifications
when using string variables or array members. Negative lengths
mean to return characters from OFFSET until (${#var} - N) for
{var:offset:-N}. Feature requested by Richard Neill
<rn214@hermes.cam.ac.uk>
doc/{bash.1,bashref.texi}
- document new behavior of negative subscripts to indexed arrays
- document new behavior of negative LENGTH in substring expansion
configure.in
- change version to bash-4.2-devel
variables.c
- make sure initialize_shell_variables calls sv_xtracefd if
BASH_XTRACEFD is inherited in the shell environment. Fixes but
reported by <jsunx1@bellsouth.net>
+1 -1
View File
@@ -565,7 +565,7 @@ strip: $(Program) .made
lint:
${MAKE} ${MFLAGS} CFLAGS='${GCC_LINT_FLAGS}' .made
version.h: $(SOURCES) config.h Makefile
version.h: $(SOURCES) config.h Makefile patchlevel.h
$(SHELL) $(SUPPORT_SRC)mkversion.sh -b -S ${topdir} -s $(RELSTATUS) -d $(Version) -o newversion.h \
&& mv newversion.h version.h
+2 -1
View File
@@ -214,7 +214,8 @@ SHLIB_SOURCE = ${SH_LIBSRC}/clktck.c ${SH_LIBSRC}/getcwd.c \
${SH_LIBSRC}/casemod.c ${SH_LIBSRC}/uconvert.c \
${SH_LIBSRC}/ufuncs.c ${SH_LIBSRC}/dprintf.c \
${SH_LIBSRC}/input_avail.c ${SH_LIBSRC}/mbscasecmp.c \
${SH_LIBSRC}/fnxform.c ${SH_LIBSRC}/unicode.c
${SH_LIBSRC}/fnxform.c ${SH_LIBSRC}/unicode.c \
${SH_LIBSRC}/wcswidth.c
SHLIB_LIB = -lsh
SHLIB_LIBNAME = libsh.a
+21 -11
View File
@@ -843,6 +843,21 @@ array_variable_part (s, subp, lenp)
return (var == 0 || invisible_p (var)) ? (SHELL_VAR *)0 : var;
}
#define INDEX_ERROR() \
do \
{ \
if (var) \
err_badarraysub (var->name); \
else \
{ \
t[-1] = '\0'; \
err_badarraysub (s); \
t[-1] = '['; /* ] */\
} \
return ((char *)NULL); \
} \
while (0)
/* Return a string containing the elements in the array and subscript
described by S. If the subscript is * or @, obeys quoting rules akin
to the expansion of $* and $@ including double quoting. If RTYPE
@@ -920,16 +935,11 @@ array_value_internal (s, quoted, allow_all, rtype, indp)
ind = array_expand_index (t, len);
if (ind < 0)
{
index_error:
if (var)
err_badarraysub (var->name);
else
{
t[-1] = '\0';
err_badarraysub (s);
t[-1] = '['; /* ] */
}
return ((char *)NULL);
/* negative subscripts to indexed arrays count back from end */
if (var && array_p (var))
ind = array_max_index (array_cell (var)) + 1 + ind;
if (ind < 0)
INDEX_ERROR();
}
if (indp)
*indp = ind;
@@ -940,7 +950,7 @@ index_error:
akey = expand_assignment_string_to_string (t, 0); /* [ */
t[len - 1] = ']';
if (akey == 0 || *akey == 0)
goto index_error;
INDEX_ERROR();
}
if (var == 0 || value_cell (var) == 0) /* XXX - check invisible_p(var) ? */
+21 -12
View File
@@ -1,6 +1,6 @@
/* arrayfunc.c -- High-level array functions used by other parts of the shell. */
/* Copyright (C) 2001-2009 Free Software Foundation, Inc.
/* Copyright (C) 2001-2010 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -843,6 +843,21 @@ array_variable_part (s, subp, lenp)
return (var == 0 || invisible_p (var)) ? (SHELL_VAR *)0 : var;
}
#define INDEX_ERROR() \
do \
{ \
if (var) \
err_badarraysub (var->name); \
else \
{ \
t[-1] = '\0'; \
err_badarraysub (s); \
t[-1] = '['; /* ] */\
} \
return ((char *)NULL); \
} \
while (0)
/* Return a string containing the elements in the array and subscript
described by S. If the subscript is * or @, obeys quoting rules akin
to the expansion of $* and $@ including double quoting. If RTYPE
@@ -920,16 +935,10 @@ array_value_internal (s, quoted, allow_all, rtype, indp)
ind = array_expand_index (t, len);
if (ind < 0)
{
index_error:
if (var)
err_badarraysub (var->name);
else
{
t[-1] = '\0';
err_badarraysub (s);
t[-1] = '['; /* ] */
}
return ((char *)NULL);
if (var && array_p (var))
ind = array_max_index (array_cell (var)) + 1 + ind;
if (ind < 0)
INDEX_ERROR();
}
if (indp)
*indp = ind;
@@ -940,7 +949,7 @@ index_error:
akey = expand_assignment_string_to_string (t, 0); /* [ */
t[len - 1] = ']';
if (akey == 0 || *akey == 0)
goto index_error;
INDEX_ERROR();
}
if (var == 0 || value_cell (var) == 0) /* XXX - check invisible_p(var) ? */
+12 -12
View File
@@ -1,7 +1,7 @@
@%:@! /bin/sh
@%:@ From configure.in for Bash 4.1, version 4.023.
@%:@ From configure.in for Bash 4.2, version 4.031.
@%:@ Guess values for system-dependent variables and create Makefiles.
@%:@ Generated by GNU Autoconf 2.63 for bash 4.1-maint.
@%:@ Generated by GNU Autoconf 2.63 for bash 4.2-devel.
@%:@
@%:@ Report bugs to <bug-bash@gnu.org>.
@%:@
@@ -597,8 +597,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='bash'
PACKAGE_TARNAME='bash'
PACKAGE_VERSION='4.1-maint'
PACKAGE_STRING='bash 4.1-maint'
PACKAGE_VERSION='4.2-devel'
PACKAGE_STRING='bash 4.2-devel'
PACKAGE_BUGREPORT='bug-bash@gnu.org'
ac_unique_file="shell.h"
@@ -1411,7 +1411,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures bash 4.1-maint to adapt to many kinds of systems.
\`configure' configures bash 4.2-devel to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1476,7 +1476,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of bash 4.1-maint:";;
short | recursive ) echo "Configuration of bash 4.2-devel:";;
esac
cat <<\_ACEOF
@@ -1652,7 +1652,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
bash configure 4.1-maint
bash configure 4.2-devel
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1666,7 +1666,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by bash $as_me 4.1-maint, which was
It was created by bash $as_me 4.2-devel, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2079,8 +2079,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
ac_config_headers="$ac_config_headers config.h"
BASHVERS=4.1
RELSTATUS=maint
BASHVERS=4.2
RELSTATUS=devel
case "$RELSTATUS" in
alp*|bet*|dev*|rc*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
@@ -31484,7 +31484,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by bash $as_me 4.1-maint, which was
This file was extended by bash $as_me 4.2-devel, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -31547,7 +31547,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
bash config.status 4.1-maint
bash config.status 4.2-devel
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+11 -11
View File
@@ -15,25 +15,25 @@
'configure.in'
],
{
'AM_PROG_F77_C_O' => 1,
'_LT_AC_TAGCONFIG' => 1,
'm4_pattern_forbid' => 1,
'AM_PROG_F77_C_O' => 1,
'AC_INIT' => 1,
'AC_CANONICAL_TARGET' => 1,
'm4_pattern_forbid' => 1,
'_AM_COND_IF' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_CANONICAL_TARGET' => 1,
'AC_SUBST' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_FC_SRCEXT' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_PROG_LIBTOOL' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'LT_SUPPORTED_TAG' => 1,
'AC_CONFIG_LINKS' => 1,
'm4_sinclude' => 1,
'LT_SUPPORTED_TAG' => 1,
'AM_MAINTAINER_MODE' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'_m4_warn' => 1,
@@ -49,13 +49,13 @@
'AC_CANONICAL_BUILD' => 1,
'AC_FC_FREEFORM' => 1,
'AH_OUTPUT' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'AM_PROG_CC_C_O' => 1,
'm4_pattern_allow' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'sinclude' => 1,
'AM_CONDITIONAL' => 1,
'm4_pattern_allow' => 1,
'AM_PROG_CC_C_O' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_CONDITIONAL' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'm4_include' => 1,
+1 -1
View File
@@ -1,4 +1,4 @@
m4trace:configure.in:29: -1- AC_INIT([bash], [4.1-maint], [bug-bash@gnu.org])
m4trace:configure.in:29: -1- AC_INIT([bash], [4.2-devel], [bug-bash@gnu.org])
m4trace:configure.in:29: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.in:29: -1- m4_pattern_forbid([_AC_])
m4trace:configure.in:29: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
+2
View File
@@ -215,6 +215,8 @@ cd_builtin (list)
lflag = (cdable_vars ? LCD_DOVARS : 0) |
((interactive && cdspelling) ? LCD_DOSPELL : 0);
if (eflag && no_symlinks == 0)
eflag = 0;
if (list == 0)
{
Vendored
+12 -12
View File
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.in for Bash 4.1, version 4.023.
# From configure.in for Bash 4.2, version 4.031.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.63 for bash 4.1-maint.
# Generated by GNU Autoconf 2.63 for bash 4.2-devel.
#
# Report bugs to <bug-bash@gnu.org>.
#
@@ -597,8 +597,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='bash'
PACKAGE_TARNAME='bash'
PACKAGE_VERSION='4.1-maint'
PACKAGE_STRING='bash 4.1-maint'
PACKAGE_VERSION='4.2-devel'
PACKAGE_STRING='bash 4.2-devel'
PACKAGE_BUGREPORT='bug-bash@gnu.org'
ac_unique_file="shell.h"
@@ -1411,7 +1411,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures bash 4.1-maint to adapt to many kinds of systems.
\`configure' configures bash 4.2-devel to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1476,7 +1476,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of bash 4.1-maint:";;
short | recursive ) echo "Configuration of bash 4.2-devel:";;
esac
cat <<\_ACEOF
@@ -1652,7 +1652,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
bash configure 4.1-maint
bash configure 4.2-devel
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1666,7 +1666,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by bash $as_me 4.1-maint, which was
It was created by bash $as_me 4.2-devel, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2079,8 +2079,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
ac_config_headers="$ac_config_headers config.h"
BASHVERS=4.1
RELSTATUS=maint
BASHVERS=4.2
RELSTATUS=devel
case "$RELSTATUS" in
alp*|bet*|dev*|rc*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
@@ -31484,7 +31484,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by bash $as_me 4.1-maint, which was
This file was extended by bash $as_me 4.2-devel, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -31547,7 +31547,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
bash config.status 4.1-maint
bash config.status 4.2-devel
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+4 -4
View File
@@ -1,5 +1,5 @@
dnl
dnl Configure script for bash-4.1
dnl Configure script for bash-4.2
dnl
dnl report bugs to chet@po.cwru.edu
dnl
@@ -21,10 +21,10 @@ dnl Process this file with autoconf to produce a configure script.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_REVISION([for Bash 4.1, version 4.023])dnl
AC_REVISION([for Bash 4.2, version 4.031])dnl
define(bashvers, 4.1)
define(relstatus, maint)
define(bashvers, 4.2)
define(relstatus, devel)
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
+1 -1
View File
@@ -727,7 +727,7 @@ AC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getgroups gethostname \
AC_REPLACE_FUNCS(rename)
dnl checks for c library functions
AC_CHECK_FUNCS(bcopy bzero confstr fnmatch \
AC_CHECK_FUNCS(bcopy bzero confstr faccessat fnmatch \
getaddrinfo gethostbyname getservbyname getservent inet_aton \
memmove pathconf putenv raise regcomp regexec \
setenv setlinebuf setlocale setvbuf siginterrupt strchr \
+702 -699
View File
File diff suppressed because it is too large Load Diff
+24 -6
View File
@@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
.\" Last Change: Sun May 30 17:03:08 EDT 2010
.\" Last Change: Sat Jun 12 15:34:58 EDT 2010
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2010 May 30" "GNU Bash-4.1"
.TH BASH 1 "2010 June 12" "GNU Bash-4.1"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -2343,9 +2343,13 @@ using arbitrary strings.
An indexed array is created automatically if any variable is assigned to
using the syntax \fIname\fP[\fIsubscript\fP]=\fIvalue\fP. The
.I subscript
is treated as an arithmetic expression that must evaluate to a number
greater than or equal to zero. To explicitly declare an indexed array,
use
is treated as an arithmetic expression that must evaluate to a number.
If
.I subscript
evaluates to a number less than zero, it is used as
an offset from one greater than the array's maximum index (so a subcript
of -1 refers to the last element of the array).
To explicitly declare an indexed array, use
.B declare \-a \fIname\fP
(see
.SM
@@ -2724,9 +2728,13 @@ If \fIlength\fP is omitted, expands to the substring of
.B
ARITHMETIC EVALUATION
below).
\fIlength\fP must evaluate to a number greater than or equal to zero.
If \fIoffset\fP evaluates to a number less than zero, the value
is used as an offset from the end of the value of \fIparameter\fP.
If \fIlength\fP evaluates to a number less than zero, and \fIparameter\fP
is not \fB@\fP and not an indexed or associative array, it is interpreted
as an offset from the end of the value of \fIparameter\fP rather than
a number of characters, and the expansion is the characters between the
two offsets.
If \fIparameter\fP is \fB@\fP, the result is \fIlength\fP positional
parameters beginning at \fIoffset\fP.
If \fIparameter\fP is an indexed array name subscripted by @ or *,
@@ -8881,6 +8889,16 @@ changes its behavior to that of version 4.0 with respect to locale-specific
string comparison when using the conditional command's < and > operators
and the effect of interrupting a command list.
.TP 8
.B compat41
@item compat41
If set,
.BR bash ,
when in posix mode, treats a single quote in a double-quoted
parameter expansion as a special character. The single quotes must match
(an even number) and the characters between the single quotes are considered
quoted. This is the behavior of posix mode through version 4.1.
The default bash behavior remains as in previous versions.
.TP 8
.B dirspell
If set,
.B bash
+33 -8
View File
@@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
.\" Last Change: Sun May 30 17:03:08 EDT 2010
.\" Last Change: Sat Jun 12 15:34:58 EDT 2010
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2010 May 30" "GNU Bash-4.1"
.TH BASH 1 "2010 June 12" "GNU Bash-4.1"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -2343,9 +2343,13 @@ using arbitrary strings.
An indexed array is created automatically if any variable is assigned to
using the syntax \fIname\fP[\fIsubscript\fP]=\fIvalue\fP. The
.I subscript
is treated as an arithmetic expression that must evaluate to a number
greater than or equal to zero. To explicitly declare an indexed array,
use
is treated as an arithmetic expression that must evaluate to a number.
If
.I subscript
evaluates to a number less than zero, it is used as
an offset from one greater than the array's maximum index (so a subcript
of -1 refers to the last element of the array).
To explicitly declare an indexed array, use
.B declare \-a \fIname\fP
(see
.SM
@@ -2724,9 +2728,13 @@ If \fIlength\fP is omitted, expands to the substring of
.B
ARITHMETIC EVALUATION
below).
\fIlength\fP must evaluate to a number greater than or equal to zero.
If \fIoffset\fP evaluates to a number less than zero, the value
is used as an offset from the end of the value of \fIparameter\fP.
If \fIlength\fP evaluates to a number less than zero, and \fIparameter\fP
is not \fB@\fP and not an indexed or associative array, it is interpreted
as an offset from the end of the value of \fIparameter\fP rather than
a number of characters, and the expansion is the characters between the
two offsets.
If \fIparameter\fP is \fB@\fP, the result is \fIlength\fP positional
parameters beginning at \fIoffset\fP.
If \fIparameter\fP is an indexed array name subscripted by @ or *,
@@ -6737,7 +6745,7 @@ The return value is 0 unless the shell is not executing a subroutine
call or \fIexpr\fP does not correspond to a valid position in the
call stack.
.TP
\fBcd\fP [\fB\-L|-P\fP] [\fIdir\fP]
\fBcd\fP [\fB\-L\fP|[\fB\-P\fP [\fB\-e\fP]]] [\fIdir\fP]
Change the current directory to \fIdir\fP. The variable
.SM
.B HOME
@@ -6770,7 +6778,15 @@ option to the
.B set
builtin command); the
.B \-L
option forces symbolic links to be followed. An argument of
option forces symbolic links to be followed.
If the
.B \-e
option is supplied with
.BR \-P ,
and the current working directory cannot be successfully determined
after a successful directory change, \fBcd\fP will return an unsuccessful
status.
An argument of
.B \-
is equivalent to
.SM
@@ -8873,6 +8889,15 @@ changes its behavior to that of version 4.0 with respect to locale-specific
string comparison when using the conditional command's < and > operators
and the effect of interrupting a command list.
.TP 8
.B compat41
@item compat41
If set,
.BR bash ,
when in posix mode, treats a single quote in a double-quoted
parameter expansion as a special character. The single quotes must match
(an even number) and the characters between the single quotes are considered
quoted. This is the behavior of posix mode through version 4.1.
.TP 8
.B dirspell
If set,
.B bash
+13 -3
View File
@@ -8695,7 +8695,7 @@ current frame is frame 0.
The return value is 0 unless the shell is not executing a subroutine
call or <I>expr</I> does not correspond to a valid position in the
call stack.
<DT><B>cd</B> [<B>-L|-P</B>] [<I>dir</I>]<DD>
<DT><B>cd</B> [<B>-L</B>|[<B>-P</B> [<B>-e</B>]]] [<I>dir</I>]<DD>
Change the current directory to <I>dir</I>. The variable
<FONT SIZE=-1><B>HOME</B>
@@ -8740,7 +8740,17 @@ option to the
builtin command); the
<B>-L</B>
option forces symbolic links to be followed. An argument of
option forces symbolic links to be followed.
If the
<B>-e</B>
option is supplied with
<B>-P</B>,
and the current working directory cannot be successfully determined
after a successful directory change, <B>cd</B> will return an unsuccessful
status.
An argument of
<B>-</B>
is equivalent to
@@ -12704,6 +12714,6 @@ There may be only one active coprocess at a time.
</DL>
<HR>
This document was created by man2html from bash.1.<BR>
Time: 01 June 2010 11:58:46 EDT
Time: 07 June 2010 16:19:05 EDT
</BODY>
</HTML>
BIN
View File
Binary file not shown.
+63 -57
View File
@@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Tue Jun 1 11:58:35 2010
%%CreationDate: Mon Jun 7 16:18:58 2010
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%+ font Times-Italic
@@ -5951,13 +5951,13 @@ ent e)144 679.2 R -.15(xe)-.15 G 1.328(cution call stack.).15 F .001
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S 389.54(SH\(1\) B).35 F(ASH\(1\))
-.35 E/F1 10/Times-Bold@0 SF(cd)108 84 Q F0([)2.5 E F1(\255L|-P)A F0 2.5
(][)C/F2 10/Times-Italic@0 SF(dir)-2.5 E F0(])A .21
(Change the current directory to)144 96 R F2(dir)2.71 E F0 5.21(.T)C .21
(he v)-5.21 F(ariable)-.25 E/F3 9/Times-Bold@0 SF(HOME)2.71 E F0 .21
(is the def)2.46 F(ault)-.1 E F2(dir)2.71 E F0 5.21(.T).73 G .21(he v)
-5.21 F(ariable)-.25 E F3(CDP)2.71 E -.855(AT)-.666 G(H).855 E F0 .776
(de\214nes the search path for the directory containing)144 108 R F2
-.35 E/F1 10/Times-Bold@0 SF(cd)108 84 Q F0([)2.5 E F1<ad4c>A F0(|[)A F1
<ad50>A F0([)2.5 E F1<ad65>A F0(]]] [)A/F2 10/Times-Italic@0 SF(dir)A F0
(])A .21(Change the current directory to)144 96 R F2(dir)2.71 E F0 5.21
(.T)C .21(he v)-5.21 F(ariable)-.25 E/F3 9/Times-Bold@0 SF(HOME)2.71 E
F0 .21(is the def)2.46 F(ault)-.1 E F2(dir)2.71 E F0 5.21(.T).73 G .21
(he v)-5.21 F(ariable)-.25 E F3(CDP)2.71 E -.855(AT)-.666 G(H).855 E F0
.776(de\214nes the search path for the directory containing)144 108 R F2
(dir)3.276 E F0 5.777(.A).73 G(lternati)-5.777 E 1.077 -.15(ve d)-.25 H
.777(irectory names in).15 F F3(CDP)3.277 E -.855(AT)-.666 G(H).855 E F0
.764(are separated by a colon \(:\).)144 120 R 3.264(An)5.764 G .764
@@ -5970,110 +5970,116 @@ F0 .764(is the same as the current direc-)3.014 F(tory)144 132 Q 2.973
(option says to use)2.974 F .58(the ph)144 144 R .58
(ysical directory structure instead of follo)-.05 F .579
(wing symbolic links \(see also the)-.25 F F1<ad50>3.079 E F0 .579
(option to the)3.079 F F1(set)144 156 Q F0 -.2(bu)3.383 G .883
(iltin command\); the).2 F F1<ad4c>3.383 E F0 .884
(option forces symbolic links to be follo)3.384 F 3.384(wed. An)-.25 F
(ar)3.384 E .884(gument of)-.18 F F1<ad>3.384 E F0(is)3.384 E(equi)144
168 Q -.25(va)-.25 G .316(lent to).25 F F3($OLDPWD)2.816 E/F4 9
/Times-Roman@0 SF(.)A F0 .316(If a non-empty directory name from)4.816 F
F3(CDP)2.815 E -.855(AT)-.666 G(H).855 E F0 .315(is used, or if)2.565 F
F1<ad>2.815 E F0 .315(is the \214rst)2.815 F(ar)144 180 Q .116(gument, \
and the directory change is successful, the absolute pathname of the ne)
-.18 F 2.616(ww)-.25 G .116(orking direc-)-2.716 F 1.165
(tory is written to the standard output.)144 192 R 1.164(The return v)
6.164 F 1.164(alue is true if the directory w)-.25 F 1.164
(as successfully)-.1 F(changed; f)144 204 Q(alse otherwise.)-.1 E F1
(command)108 220.8 Q F0([)2.5 E F1(\255pVv)A F0(])A F2(command)2.5 E F0
([)2.5 E F2(ar)A(g)-.37 E F0(...])2.5 E(Run)144 232.8 Q F2(command)2.956
E F0(with)3.527 E F2(ar)3.087 E(gs)-.37 E F0 .257
(option to the)3.079 F F1(set)144 156 Q F0 -.2(bu)2.716 G .216
(iltin command\); the).2 F F1<ad4c>2.716 E F0 .216
(option forces symbolic links to be follo)2.716 F 2.717(wed. If)-.25 F
(the)2.717 E F1<ad65>2.717 E F0 .217(option is sup-)2.717 F 1.087
(plied with)144 168 R F1<ad50>3.587 E F0 3.587(,a)C 1.087
(nd the current w)-3.587 F 1.086
(orking directory cannot be successfully determined after a suc-)-.1 F
.44(cessful directory change,)144 180 R F1(cd)2.94 E F0 .44
(will return an unsuccessful status.)2.94 F .44(An ar)5.44 F .44
(gument of)-.18 F F1<ad>2.94 E F0 .44(is equi)2.94 F -.25(va)-.25 G .44
(lent to).25 F F3($OLDPWD)144 192 Q/F4 9/Times-Roman@0 SF(.)A F0 1.045
(If a non-empty directory name from)5.545 F F3(CDP)3.545 E -.855(AT)
-.666 G(H).855 E F0 1.044(is used, or if)3.295 F F1<ad>3.544 E F0 1.044
(is the \214rst ar)3.544 F(gument,)-.18 E .021(and the directory change\
is successful, the absolute pathname of the ne)144 204 R 2.522(ww)-.25
G .022(orking directory is writ-)-2.622 F .165
(ten to the standard output.)144 216 R .165(The return v)5.165 F .165
(alue is true if the directory w)-.25 F .165(as successfully changed; f)
-.1 F(alse)-.1 E(otherwise.)144 228 Q F1(command)108 244.8 Q F0([)2.5 E
F1(\255pVv)A F0(])A F2(command)2.5 E F0([)2.5 E F2(ar)A(g)-.37 E F0
(...])2.5 E(Run)144 256.8 Q F2(command)2.956 E F0(with)3.527 E F2(ar)
3.087 E(gs)-.37 E F0 .257
(suppressing the normal shell function lookup. Only b)3.027 F .257
(uiltin commands or)-.2 F .502(commands found in the)144 244.8 R F3
(uiltin commands or)-.2 F .502(commands found in the)144 268.8 R F3
-.666(PA)3.002 G(TH)-.189 E F0 .502(are e)2.752 F -.15(xe)-.15 G 3.002
(cuted. If).15 F(the)3.002 E F1<ad70>3.002 E F0 .502(option is gi)3.002
F -.15(ve)-.25 G .501(n, the search for).15 F F2(command)3.201 E F0(is)
3.771 E .399(performed using a def)144 256.8 R .399(ault v)-.1 F .399
3.771 E .399(performed using a def)144 280.8 R .399(ault v)-.1 F .399
(alue for)-.25 F F3 -.666(PA)2.899 G(TH)-.189 E F0 .4
(that is guaranteed to \214nd all of the standard utilities.)2.649 F(If)
5.4 E .175(either the)144 268.8 R F1<ad56>2.675 E F0(or)2.675 E F1<ad76>
5.4 E .175(either the)144 292.8 R F1<ad56>2.675 E F0(or)2.675 E F1<ad76>
2.675 E F0 .175(option is supplied, a description of)2.675 F F2(command)
2.875 E F0 .174(is printed.)3.445 F(The)5.174 E F1<ad76>2.674 E F0 .174
(option causes)2.674 F 3.11(as)144 280.8 S .61(ingle w)-3.11 F .61
(option causes)2.674 F 3.11(as)144 304.8 S .61(ingle w)-3.11 F .61
(ord indicating the command or \214le name used to in)-.1 F -.2(vo)-.4 G
-.1(ke).2 G F2(command)3.41 E F0 .61(to be displayed; the)3.88 F F1
<ad56>144 292.8 Q F0 .25(option produces a more v)2.75 F .25
<ad56>144 316.8 Q F0 .25(option produces a more v)2.75 F .25
(erbose description.)-.15 F .249(If the)5.25 F F1<ad56>2.749 E F0(or)
2.749 E F1<ad76>2.749 E F0 .249(option is supplied, the e)2.749 F .249
(xit status)-.15 F 1.004(is 0 if)144 304.8 R F2(command)3.704 E F0 -.1
(xit status)-.15 F 1.004(is 0 if)144 328.8 R F2(command)3.704 E F0 -.1
(wa)4.274 G 3.504(sf).1 G 1.005(ound, and 1 if not.)-3.504 F 1.005
(If neither option is supplied and an error occurred or)6.005 F F2
(command)144.2 316.8 Q F0 1.599(cannot be found, the e)4.869 F 1.599
(command)144.2 340.8 Q F0 1.599(cannot be found, the e)4.869 F 1.599
(xit status is 127.)-.15 F 1.599(Otherwise, the e)6.599 F 1.598
(xit status of the)-.15 F F1(command)4.098 E F0 -.2(bu)144 328.8 S
(xit status of the)-.15 F F1(command)4.098 E F0 -.2(bu)144 352.8 S
(iltin is the e).2 E(xit status of)-.15 E F2(command)2.5 E F0(.).77 E F1
(compgen)108 345.6 Q F0([)2.5 E F2(option)A F0 2.5(][)C F2(wor)-2.5 E(d)
-.37 E F0(])A .012(Generate possible completion matches for)144 357.6 R
(compgen)108 369.6 Q F0([)2.5 E F2(option)A F0 2.5(][)C F2(wor)-2.5 E(d)
-.37 E F0(])A .012(Generate possible completion matches for)144 381.6 R
F2(wor)2.513 E(d)-.37 E F0 .013(according to the)2.513 F F2(option)2.513
E F0 .013(s, which may be an)B 2.513(yo)-.15 G(ption)-2.513 E .982
(accepted by the)144 369.6 R F1(complete)3.482 E F0 -.2(bu)3.481 G .981
(accepted by the)144 393.6 R F1(complete)3.482 E F0 -.2(bu)3.481 G .981
(iltin with the e).2 F .981(xception of)-.15 F F1<ad70>3.481 E F0(and)
3.481 E F1<ad72>3.481 E F0 3.481(,a)C .981(nd write the matches to the)
-3.481 F 1.415(standard output.)144 381.6 R 1.415(When using the)6.415 F
-3.481 F 1.415(standard output.)144 405.6 R 1.415(When using the)6.415 F
F1<ad46>3.915 E F0(or)3.915 E F1<ad43>3.915 E F0 1.415(options, the v)
3.915 F 1.415(arious shell v)-.25 F 1.415(ariables set by the pro-)-.25
F(grammable completion f)144 393.6 Q(acilities, while a)-.1 E -.25(va)
F(grammable completion f)144 417.6 Q(acilities, while a)-.1 E -.25(va)
-.2 G(ilable, will not ha).25 E .3 -.15(ve u)-.2 H(seful v).15 E(alues.)
-.25 E .352(The matches will be generated in the same w)144 417.6 R .352
-.25 E .352(The matches will be generated in the same w)144 441.6 R .352
(ay as if the programmable completion code had gen-)-.1 F .02(erated th\
em directly from a completion speci\214cation with the same \215ags.)144
429.6 R(If)5.02 E F2(wor)2.52 E(d)-.37 E F0 .02(is speci\214ed, only)
2.52 F(those completions matching)144 441.6 Q F2(wor)2.5 E(d)-.37 E F0
(will be displayed.)2.5 E(The return v)144 465.6 Q
453.6 R(If)5.02 E F2(wor)2.52 E(d)-.37 E F0 .02(is speci\214ed, only)
2.52 F(those completions matching)144 465.6 Q F2(wor)2.5 E(d)-.37 E F0
(will be displayed.)2.5 E(The return v)144 489.6 Q
(alue is true unless an in)-.25 E -.25(va)-.4 G
(lid option is supplied, or no matches were generated.).25 E F1
(complete)108 482.4 Q F0([)3.729 E F1(\255abcdefgjksuv)A F0 3.729(][)C
(complete)108 506.4 Q F0([)3.729 E F1(\255abcdefgjksuv)A F0 3.729(][)C
F1<ad6f>-3.729 E F2(comp-option)3.729 E F0 3.729(][)C F1(\255DE)-3.729 E
F0 3.728(][)C F1<ad41>-3.728 E F2(action)3.728 E F0 3.728(][)C F1<ad47>
-3.728 E F2(globpat)3.728 E F0 3.728(][)C F1<ad57>-3.728 E F2(wor)3.728
E(dlist)-.37 E F0 3.728(][)C F1<ad46>-3.728 E F2(func-)3.728 E(tion)108
494.4 Q F0 2.5(][)C F1<ad43>-2.5 E F2(command)2.5 E F0(])A([)144 506.4 Q
518.4 Q F0 2.5(][)C F1<ad43>-2.5 E F2(command)2.5 E F0(])A([)144 530.4 Q
F1<ad58>A F2(\214lterpat)2.5 E F0 2.5(][)C F1<ad50>-2.5 E F2(pr)2.5 E
(e\214x)-.37 E F0 2.5(][)C F1<ad53>-2.5 E F2(suf)2.5 E<8c78>-.18 E F0(])
A F2(name)2.5 E F0([)2.5 E F2(name ...)A F0(])A F1(complete \255pr)108
518.4 Q F0([)2.5 E F1(\255DE)A F0 2.5(][)C F2(name)-2.5 E F0(...])2.5 E
.634(Specify ho)144 530.4 R 3.134(wa)-.25 G -.18(rg)-3.134 G .634
542.4 Q F0([)2.5 E F1(\255DE)A F0 2.5(][)C F2(name)-2.5 E F0(...])2.5 E
.634(Specify ho)144 554.4 R 3.134(wa)-.25 G -.18(rg)-3.134 G .634
(uments to each).18 F F2(name)3.134 E F0 .634(should be completed.)3.134
F .633(If the)5.634 F F1<ad70>3.133 E F0 .633
(option is supplied, or if no)3.133 F .139(options are supplied, e)144
542.4 R .139(xisting completion speci\214cations are printed in a w)-.15
566.4 R .139(xisting completion speci\214cations are printed in a w)-.15
F .14(ay that allo)-.1 F .14(ws them to be)-.25 F .31(reused as input.)
144 554.4 R(The)5.31 E F1<ad72>2.81 E F0 .31(option remo)2.81 F -.15(ve)
144 578.4 R(The)5.31 E F1<ad72>2.81 E F0 .31(option remo)2.81 F -.15(ve)
-.15 G 2.81(sac).15 G .31(ompletion speci\214cation for each)-2.81 F F2
(name)2.81 E F0 2.81(,o)C 1.11 -.4(r, i)-2.81 H 2.81(fn).4 G(o)-2.81 E
F2(name)2.81 E F0(s)A 1.346
(are supplied, all completion speci\214cations.)144 566.4 R(The)6.347 E
(are supplied, all completion speci\214cations.)144 590.4 R(The)6.347 E
F1<ad44>3.847 E F0 1.347(option indicates that the remaining options)
3.847 F .5(and actions should apply to the `)144 578.4 R(`def)-.74 E
3.847 F .5(and actions should apply to the `)144 602.4 R(`def)-.74 E
(ault')-.1 E 3('c)-.74 G .5
(ommand completion; that is, completion attempted on)-3 F 3.455(ac)144
590.4 S .955(ommand for which no completion has pre)-3.455 F .955
614.4 S .955(ommand for which no completion has pre)-3.455 F .955
(viously been de\214ned.)-.25 F(The)5.955 E F1<ad45>3.455 E F0 .955
(option indicates that)3.455 F .065
(the remaining options and actions should apply to `)144 602.4 R
(the remaining options and actions should apply to `)144 626.4 R
(`empty')-.74 E 2.564('c)-.74 G .064
(ommand completion; that is, comple-)-2.564 F
(tion attempted on a blank line.)144 614.4 Q 1.437
(tion attempted on a blank line.)144 638.4 Q 1.437
(The process of applying these completion speci\214cations when w)144
638.4 R 1.438(ord completion is attempted is)-.1 F(described abo)144
650.4 Q .3 -.15(ve u)-.15 H(nder).15 E F1(Pr)2.5 E
662.4 R 1.438(ord completion is attempted is)-.1 F(described abo)144
674.4 Q .3 -.15(ve u)-.15 H(nder).15 E F1(Pr)2.5 E
(ogrammable Completion)-.18 E F0(.)A .556
(Other options, if speci\214ed, ha)144 674.4 R .856 -.15(ve t)-.2 H .555
(Other options, if speci\214ed, ha)144 698.4 R .856 -.15(ve t)-.2 H .555
(he follo).15 F .555(wing meanings.)-.25 F .555(The ar)5.555 F .555
(guments to the)-.18 F F1<ad47>3.055 E F0(,)A F1<ad57>3.055 E F0 3.055
(,a)C(nd)-3.055 E F1<ad58>3.055 E F0 .722(options \(and, if necessary)
144 686.4 R 3.222(,t)-.65 G(he)-3.222 E F1<ad50>3.222 E F0(and)3.222 E
144 710.4 R 3.222(,t)-.65 G(he)-3.222 E F1<ad50>3.222 E F0(and)3.222 E
F1<ad53>3.222 E F0 .723
(options\) should be quoted to protect them from e)3.222 F(xpan-)-.15 E
(sion before the)144 698.4 Q F1(complete)2.5 E F0 -.2(bu)2.5 G
(sion before the)144 722.4 Q F1(complete)2.5 E F0 -.2(bu)2.5 G
(iltin is in).2 E -.2(vo)-.4 G -.1(ke).2 G(d.).1 E(GNU Bash-4.1)72 768 Q
(2010 May 30)147.345 E(51)197.335 E 0 Cg EP
%%Page: 52 52
+5 -5
View File
@@ -6,13 +6,13 @@
\entry{eval}{38}{\code {eval}}
\entry{exec}{38}{\code {exec}}
\entry{exit}{38}{\code {exit}}
\entry{export}{38}{\code {export}}
\entry{export}{39}{\code {export}}
\entry{getopts}{39}{\code {getopts}}
\entry{hash}{39}{\code {hash}}
\entry{hash}{40}{\code {hash}}
\entry{pwd}{40}{\code {pwd}}
\entry{readonly}{40}{\code {readonly}}
\entry{return}{40}{\code {return}}
\entry{shift}{40}{\code {shift}}
\entry{shift}{41}{\code {shift}}
\entry{test}{41}{\code {test}}
\entry{[}{41}{\code {[}}
\entry{times}{42}{\code {times}}
@@ -26,11 +26,11 @@
\entry{command}{45}{\code {command}}
\entry{declare}{45}{\code {declare}}
\entry{echo}{47}{\code {echo}}
\entry{enable}{47}{\code {enable}}
\entry{enable}{48}{\code {enable}}
\entry{help}{48}{\code {help}}
\entry{let}{48}{\code {let}}
\entry{local}{48}{\code {local}}
\entry{logout}{48}{\code {logout}}
\entry{logout}{49}{\code {logout}}
\entry{mapfile}{49}{\code {mapfile}}
\entry{printf}{49}{\code {printf}}
\entry{read}{50}{\code {read}}
+5 -5
View File
@@ -25,18 +25,18 @@
\entry {\code {disown}}{93}
\initial {E}
\entry {\code {echo}}{47}
\entry {\code {enable}}{47}
\entry {\code {enable}}{48}
\entry {\code {eval}}{38}
\entry {\code {exec}}{38}
\entry {\code {exit}}{38}
\entry {\code {export}}{38}
\entry {\code {export}}{39}
\initial {F}
\entry {\code {fc}}{123}
\entry {\code {fg}}{92}
\initial {G}
\entry {\code {getopts}}{39}
\initial {H}
\entry {\code {hash}}{39}
\entry {\code {hash}}{40}
\entry {\code {help}}{48}
\entry {\code {history}}{124}
\initial {J}
@@ -46,7 +46,7 @@
\initial {L}
\entry {\code {let}}{48}
\entry {\code {local}}{48}
\entry {\code {logout}}{48}
\entry {\code {logout}}{49}
\initial {M}
\entry {\code {mapfile}}{49}
\initial {P}
@@ -61,7 +61,7 @@
\entry {\code {return}}{40}
\initial {S}
\entry {\code {set}}{53}
\entry {\code {shift}}{40}
\entry {\code {shift}}{41}
\entry {\code {shopt}}{57}
\entry {\code {source}}{51}
\entry {\code {suspend}}{93}
BIN
View File
Binary file not shown.
+8 -4
View File
@@ -1,6 +1,6 @@
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on June, 1 2010 by texi2html 1.64 -->
<!-- Created on June, 7 2010 by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
@@ -3971,7 +3971,7 @@ The return status is zero unless <VAR>n</VAR> is not greater than or equal to 1.
<DT><CODE>cd</CODE>
<DD><A NAME="IDX71"></A>
<TABLE><tr><td>&nbsp;</td><td class=example><pre>cd [-L|-P] [<VAR>directory</VAR>]
<TABLE><tr><td>&nbsp;</td><td class=example><pre>cd [-L|[-P [-e]]] [<VAR>directory</VAR>]
</pre></td></tr></table>Change the current working directory to <VAR>directory</VAR>.
If <VAR>directory</VAR> is not given, the value of the <CODE>HOME</CODE> shell
variable is used.
@@ -3981,6 +3981,10 @@ If <VAR>directory</VAR> begins with a slash, <CODE>CDPATH</CODE> is not used.
The <SAMP>`-P'</SAMP> option means to not follow symbolic links; symbolic
links are followed by default or with the <SAMP>`-L'</SAMP> option.
If the <SAMP>`-e'</SAMP> option is supplied with <SAMP>`-P'</SAMP>
and the current working directory cannot be successfully determined
after a successful directory change, <CODE>cd</CODE> will return an unsuccessful
status.
If <VAR>directory</VAR> is <SAMP>`-'</SAMP>, it is equivalent to <CODE>$OLDPWD</CODE>.
</P><P>
@@ -16308,7 +16312,7 @@ to permit their use in free software.
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1>About this document</H1>
This document was generated by <I>Chet Ramey</I> on <I>June, 1 2010</I>
This document was generated by <I>Chet Ramey</I> on <I>June, 7 2010</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
<P></P>
@@ -16470,7 +16474,7 @@ the following structure:
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Chet Ramey</I> on <I>June, 1 2010</I>
by <I>Chet Ramey</I> on <I>June, 7 2010</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
+151 -148
View File
@@ -1,5 +1,5 @@
This is bashref.info, produced by makeinfo version 4.13 from
/Users/chet/src/bash/src/doc/bashref.texi.
/usr/homes/chet/src/bash/src/doc/bashref.texi.
This text is a brief description of the features that are present in
the Bash shell (version 4.1, 30 May 2010).
@@ -2539,14 +2539,17 @@ standard.
greater than or equal to 1.
`cd'
cd [-L|-P] [DIRECTORY]
cd [-L|[-P [-e]]] [DIRECTORY]
Change the current working directory to DIRECTORY. If DIRECTORY
is not given, the value of the `HOME' shell variable is used. If
the shell variable `CDPATH' exists, it is used as a search path.
If DIRECTORY begins with a slash, `CDPATH' is not used.
The `-P' option means to not follow symbolic links; symbolic links
are followed by default or with the `-L' option. If DIRECTORY is
are followed by default or with the `-L' option. If the `-e'
option is supplied with `-P' and the current working directory
cannot be successfully determined after a successful directory
change, `cd' will return an unsuccessful status. If DIRECTORY is
`-', it is equivalent to `$OLDPWD'.
If a non-empty directory name from `CDPATH' is used, or if `-' is
@@ -9825,7 +9828,7 @@ D.1 Index of Shell Builtin Commands
* :: Bourne Shell Builtins.
(line 11)
* [: Bourne Shell Builtins.
(line 214)
(line 217)
* alias: Bash Builtins. (line 11)
* bg: Job Control Builtins.
(line 7)
@@ -9844,7 +9847,7 @@ D.1 Index of Shell Builtin Commands
* compopt: Programmable Completion Builtins.
(line 217)
* continue: Bourne Shell Builtins.
(line 55)
(line 58)
* declare: Bash Builtins. (line 142)
* dirs: Directory Stack Builtins.
(line 7)
@@ -9853,21 +9856,21 @@ D.1 Index of Shell Builtin Commands
* echo: Bash Builtins. (line 226)
* enable: Bash Builtins. (line 286)
* eval: Bourne Shell Builtins.
(line 63)
(line 66)
* exec: Bourne Shell Builtins.
(line 70)
(line 73)
* exit: Bourne Shell Builtins.
(line 82)
(line 85)
* export: Bourne Shell Builtins.
(line 88)
(line 91)
* fc: Bash History Builtins.
(line 10)
* fg: Job Control Builtins.
(line 16)
* getopts: Bourne Shell Builtins.
(line 103)
(line 106)
* hash: Bourne Shell Builtins.
(line 145)
(line 148)
* help: Bash Builtins. (line 314)
* history: Bash History Builtins.
(line 39)
@@ -9885,34 +9888,34 @@ D.1 Index of Shell Builtin Commands
* pushd: Directory Stack Builtins.
(line 58)
* pwd: Bourne Shell Builtins.
(line 164)
(line 167)
* read: Bash Builtins. (line 446)
* readarray: Bash Builtins. (line 526)
* readonly: Bourne Shell Builtins.
(line 173)
(line 176)
* return: Bourne Shell Builtins.
(line 189)
(line 192)
* set: The Set Builtin. (line 11)
* shift: Bourne Shell Builtins.
(line 202)
(line 205)
* shopt: The Shopt Builtin. (line 9)
* source: Bash Builtins. (line 534)
* suspend: Job Control Builtins.
(line 94)
* test: Bourne Shell Builtins.
(line 214)
(line 217)
* times: Bourne Shell Builtins.
(line 282)
(line 285)
* trap: Bourne Shell Builtins.
(line 287)
(line 290)
* type: Bash Builtins. (line 538)
* typeset: Bash Builtins. (line 569)
* ulimit: Bash Builtins. (line 575)
* umask: Bourne Shell Builtins.
(line 333)
(line 336)
* unalias: Bash Builtins. (line 664)
* unset: Bourne Shell Builtins.
(line 350)
(line 353)
* wait: Job Control Builtins.
(line 73)
@@ -10413,133 +10416,133 @@ D.5 Concept Index

Tag Table:
Node: Top1336
Node: Introduction3165
Node: What is Bash?3393
Node: What is a shell?4506
Node: Definitions7046
Node: Basic Shell Features9964
Node: Shell Syntax11183
Node: Shell Operation12213
Node: Quoting13507
Node: Escape Character14810
Node: Single Quotes15295
Node: Double Quotes15643
Node: ANSI-C Quoting16768
Node: Locale Translation18012
Node: Comments18908
Node: Shell Commands19526
Node: Simple Commands20398
Node: Pipelines21029
Node: Lists23576
Node: Compound Commands25305
Node: Looping Constructs26109
Node: Conditional Constructs28564
Node: Command Grouping36677
Node: Coprocesses38156
Node: GNU Parallel39821
Node: Shell Functions42289
Node: Shell Parameters47035
Node: Positional Parameters49451
Node: Special Parameters50351
Node: Shell Expansions53315
Node: Brace Expansion55240
Node: Tilde Expansion57995
Node: Shell Parameter Expansion60346
Node: Command Substitution69247
Node: Arithmetic Expansion70580
Node: Process Substitution71430
Node: Word Splitting72480
Node: Filename Expansion74103
Node: Pattern Matching76242
Node: Quote Removal79881
Node: Redirections80176
Node: Executing Commands88701
Node: Simple Command Expansion89371
Node: Command Search and Execution91301
Node: Command Execution Environment93638
Node: Environment96624
Node: Exit Status98284
Node: Signals99905
Node: Shell Scripts101873
Node: Shell Builtin Commands104391
Node: Bourne Shell Builtins106419
Node: Bash Builtins123887
Node: Modifying Shell Behavior150092
Node: The Set Builtin150437
Node: The Shopt Builtin159961
Node: Special Builtins171295
Node: Shell Variables172274
Node: Bourne Shell Variables172714
Node: Bash Variables174695
Node: Bash Features199033
Node: Invoking Bash199916
Node: Bash Startup Files205680
Node: Interactive Shells210692
Node: What is an Interactive Shell?211102
Node: Is this Shell Interactive?211751
Node: Interactive Shell Behavior212566
Node: Bash Conditional Expressions215846
Node: Shell Arithmetic219594
Node: Aliases222353
Node: Arrays224925
Node: The Directory Stack228883
Node: Directory Stack Builtins229597
Node: Printing a Prompt232489
Node: The Restricted Shell235241
Node: Bash POSIX Mode237073
Node: Job Control245899
Node: Job Control Basics246359
Node: Job Control Builtins251076
Node: Job Control Variables255440
Node: Command Line Editing256598
Node: Introduction and Notation258165
Node: Readline Interaction259787
Node: Readline Bare Essentials260978
Node: Readline Movement Commands262767
Node: Readline Killing Commands263732
Node: Readline Arguments265652
Node: Searching266696
Node: Readline Init File268882
Node: Readline Init File Syntax270029
Node: Conditional Init Constructs285133
Node: Sample Init File287666
Node: Bindable Readline Commands290783
Node: Commands For Moving291990
Node: Commands For History293134
Node: Commands For Text296289
Node: Commands For Killing298962
Node: Numeric Arguments301413
Node: Commands For Completion302552
Node: Keyboard Macros306744
Node: Miscellaneous Commands307315
Node: Readline vi Mode313121
Node: Programmable Completion314028
Node: Programmable Completion Builtins321238
Node: Using History Interactively330374
Node: Bash History Facilities331058
Node: Bash History Builtins333972
Node: History Interaction337829
Node: Event Designators340534
Node: Word Designators341549
Node: Modifiers343188
Node: Installing Bash344592
Node: Basic Installation345729
Node: Compilers and Options348421
Node: Compiling For Multiple Architectures349162
Node: Installation Names350826
Node: Specifying the System Type351644
Node: Sharing Defaults352360
Node: Operation Controls353033
Node: Optional Features353991
Node: Reporting Bugs363550
Node: Major Differences From The Bourne Shell364751
Node: GNU Free Documentation License381438
Node: Indexes406634
Node: Builtin Index407088
Node: Reserved Word Index413915
Node: Variable Index416363
Node: Function Index429317
Node: Concept Index436326
Node: Top1340
Node: Introduction3169
Node: What is Bash?3397
Node: What is a shell?4510
Node: Definitions7050
Node: Basic Shell Features9968
Node: Shell Syntax11187
Node: Shell Operation12217
Node: Quoting13511
Node: Escape Character14814
Node: Single Quotes15299
Node: Double Quotes15647
Node: ANSI-C Quoting16772
Node: Locale Translation18016
Node: Comments18912
Node: Shell Commands19530
Node: Simple Commands20402
Node: Pipelines21033
Node: Lists23580
Node: Compound Commands25309
Node: Looping Constructs26113
Node: Conditional Constructs28568
Node: Command Grouping36681
Node: Coprocesses38160
Node: GNU Parallel39825
Node: Shell Functions42293
Node: Shell Parameters47039
Node: Positional Parameters49455
Node: Special Parameters50355
Node: Shell Expansions53319
Node: Brace Expansion55244
Node: Tilde Expansion57999
Node: Shell Parameter Expansion60350
Node: Command Substitution69251
Node: Arithmetic Expansion70584
Node: Process Substitution71434
Node: Word Splitting72484
Node: Filename Expansion74107
Node: Pattern Matching76246
Node: Quote Removal79885
Node: Redirections80180
Node: Executing Commands88705
Node: Simple Command Expansion89375
Node: Command Search and Execution91305
Node: Command Execution Environment93642
Node: Environment96628
Node: Exit Status98288
Node: Signals99909
Node: Shell Scripts101877
Node: Shell Builtin Commands104395
Node: Bourne Shell Builtins106423
Node: Bash Builtins124101
Node: Modifying Shell Behavior150306
Node: The Set Builtin150651
Node: The Shopt Builtin160175
Node: Special Builtins171509
Node: Shell Variables172488
Node: Bourne Shell Variables172928
Node: Bash Variables174909
Node: Bash Features199247
Node: Invoking Bash200130
Node: Bash Startup Files205894
Node: Interactive Shells210906
Node: What is an Interactive Shell?211316
Node: Is this Shell Interactive?211965
Node: Interactive Shell Behavior212780
Node: Bash Conditional Expressions216060
Node: Shell Arithmetic219808
Node: Aliases222567
Node: Arrays225139
Node: The Directory Stack229097
Node: Directory Stack Builtins229811
Node: Printing a Prompt232703
Node: The Restricted Shell235455
Node: Bash POSIX Mode237287
Node: Job Control246113
Node: Job Control Basics246573
Node: Job Control Builtins251290
Node: Job Control Variables255654
Node: Command Line Editing256812
Node: Introduction and Notation258379
Node: Readline Interaction260001
Node: Readline Bare Essentials261192
Node: Readline Movement Commands262981
Node: Readline Killing Commands263946
Node: Readline Arguments265866
Node: Searching266910
Node: Readline Init File269096
Node: Readline Init File Syntax270243
Node: Conditional Init Constructs285347
Node: Sample Init File287880
Node: Bindable Readline Commands290997
Node: Commands For Moving292204
Node: Commands For History293348
Node: Commands For Text296503
Node: Commands For Killing299176
Node: Numeric Arguments301627
Node: Commands For Completion302766
Node: Keyboard Macros306958
Node: Miscellaneous Commands307529
Node: Readline vi Mode313335
Node: Programmable Completion314242
Node: Programmable Completion Builtins321452
Node: Using History Interactively330588
Node: Bash History Facilities331272
Node: Bash History Builtins334186
Node: History Interaction338043
Node: Event Designators340748
Node: Word Designators341763
Node: Modifiers343402
Node: Installing Bash344806
Node: Basic Installation345943
Node: Compilers and Options348635
Node: Compiling For Multiple Architectures349376
Node: Installation Names351040
Node: Specifying the System Type351858
Node: Sharing Defaults352574
Node: Operation Controls353247
Node: Optional Features354205
Node: Reporting Bugs363764
Node: Major Differences From The Bourne Shell364965
Node: GNU Free Documentation License381652
Node: Indexes406848
Node: Builtin Index407302
Node: Reserved Word Index414129
Node: Variable Index416577
Node: Function Index429531
Node: Concept Index436540

End Tag Table
+17 -17
View File
@@ -1,6 +1,6 @@
This is TeX, Version 3.141592 (Web2C 7.5.4) (format=tex 2008.12.11) 1 JUN 2010 14:16
**/Users/chet/src/bash/src/doc/bashref.texi
(/Users/chet/src/bash/src/doc/bashref.texi (./texinfo.tex
This is TeX, Version 3.141592 (Web2C 7.5.4) (format=tex 2008.12.11) 7 JUN 2010 16:19
**/usr/homes/chet/src/bash/src/doc/bashref.texi
(/usr/homes/chet/src/bash/src/doc/bashref.texi (./texinfo.tex
Loading texinfo [version 2009-01-18.17]:
\bindingoffset=\dimen16
\normaloffset=\dimen17
@@ -232,7 +232,7 @@ arallel -k traceroute[]
[15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29]
[30] [31] [32] [33] [34] Chapter 4 [35] [36] [37] [38] [39] [40] [41] [42]
[43]
Underfull \hbox (badness 5231) in paragraph at lines 3395--3408
Underfull \hbox (badness 5231) in paragraph at lines 3399--3412
@texttt emacs-meta[]@textrm , @texttt emacs-ctlx[]@textrm , @texttt vi[]@textr
m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
@@ -245,7 +245,7 @@ m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
.etc.
[44] [45] [46] [47] [48] [49]
Overfull \hbox (172.34125pt too wide) in paragraph at lines 3852--3852
Overfull \hbox (172.34125pt too wide) in paragraph at lines 3856--3856
[]@texttt read [-ers] [-a @textttsl aname@texttt ] [-d @textttsl de-lim@texttt
] [-i @textttsl text@texttt ] [-n @textttsl nchars@texttt ] [-N @textttsl ncha
rs@texttt ] [-p @textttsl prompt@texttt ] [-t @textttsl time-
@@ -260,7 +260,7 @@ rs@texttt ] [-p @textttsl prompt@texttt ] [-t @textttsl time-
[50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] Chapter 5 [62]
[63] [64] [65] [66] [67] [68] [69] [70] [71] Chapter 6 [72]
Overfull \hbox (51.96864pt too wide) in paragraph at lines 5445--5445
Overfull \hbox (51.96864pt too wide) in paragraph at lines 5449--5449
[]@texttt bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@t
exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
@@ -273,7 +273,7 @@ exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
.etc.
Overfull \hbox (76.23077pt too wide) in paragraph at lines 5446--5446
Overfull \hbox (76.23077pt too wide) in paragraph at lines 5450--5450
[]@texttt bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@texttt
] [-O @textttsl shopt_option@texttt ] -c @textttsl string @texttt [@textttsl ar
-
@@ -287,7 +287,7 @@ Overfull \hbox (76.23077pt too wide) in paragraph at lines 5446--5446
.etc.
Overfull \hbox (34.72258pt too wide) in paragraph at lines 5447--5447
Overfull \hbox (34.72258pt too wide) in paragraph at lines 5451--5451
[]@texttt bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@text
tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
@@ -300,7 +300,7 @@ tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
.etc.
[73] [74]
Underfull \hbox (badness 2245) in paragraph at lines 5620--5622
Underfull \hbox (badness 2245) in paragraph at lines 5624--5626
[]@textrm When a lo-gin shell ex-its, Bash reads and ex-e-cutes com-mands from
the file
@@ -313,7 +313,7 @@ the file
.etc.
[75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88]
Underfull \hbox (badness 2521) in paragraph at lines 6789--6792
Underfull \hbox (badness 2521) in paragraph at lines 6793--6796
@textrm `@texttt --enable-strict-posix-default[]@textrm '[] to @texttt configur
e[] @textrm when build-ing (see Sec-tion 10.8
@@ -326,8 +326,8 @@ e[] @textrm when build-ing (see Sec-tion 10.8
.etc.
Chapter 7 [89] [90] [91] [92] [93]
(/Users/chet/src/bash/src/lib/readline/doc/rluser.texi Chapter 8 [94] [95]
[96] [97] [98] [99] [100]
(/usr/homes/chet/src/bash/src/lib/readline/doc/rluser.texi Chapter 8 [94]
[95] [96] [97] [98] [99] [100]
Underfull \hbox (badness 5231) in paragraph at lines 551--567
@texttt emacs-meta[]@textrm , @texttt emacs-ctlx[]@textrm , @texttt vi[]@textr
m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
@@ -379,9 +379,9 @@ Underfull \hbox (badness 2753) in paragraph at lines 1919--1922
.@texttt o
.etc.
[121]) (/Users/chet/src/bash/src/lib/readline/doc/hsuser.texi Chapter 9
[121]) (/usr/homes/chet/src/bash/src/lib/readline/doc/hsuser.texi Chapter 9
[122] [123] [124] [125] [126]) Chapter 10 [127] [128] [129] [130] [131]
Underfull \hbox (badness 2772) in paragraph at lines 7390--7394
Underfull \hbox (badness 2772) in paragraph at lines 7394--7398
[]@textrm Enable sup-port for large files (@texttt http://www.sas.com/standard
s/large_
@@ -400,11 +400,11 @@ s/large_
[159] [160] )
Here is how much of TeX's memory you used:
2081 strings out of 97980
28558 string characters out of 1221004
28590 string characters out of 1221004
65603 words of memory out of 1500000
2897 multiletter control sequences out of 10000+50000
32127 words of font info for 112 fonts, out of 1200000 for 2000
51 hyphenation exceptions out of 8191
16i,6n,14p,315b,702s stack positions out of 5000i,500n,6000p,200000b,5000s
16i,6n,14p,319b,702s stack positions out of 5000i,500n,6000p,200000b,5000s
Output written on bashref.dvi (166 pages, 675816 bytes).
Output written on bashref.dvi (166 pages, 676044 bytes).
BIN
View File
Binary file not shown.
+1187 -1178
View File
File diff suppressed because it is too large Load Diff
+17 -3
View File
@@ -1765,9 +1765,13 @@ If @var{length} is omitted, expands to the substring of
(@pxref{Shell Arithmetic}).
This is referred to as Substring Expansion.
@var{length} must evaluate to a number greater than or equal to zero.
If @var{offset} evaluates to a number less than zero, the value
is used as an offset from the end of the value of @var{parameter}.
If @var{length} evaluates to a number less than zero, and @var{parameter}
is not @samp{@@} and not an indexed or associative array, it is interpreted
as an offset from the end of the value of @var{parameter} rather than
a number of characters, and the expansion is the characters between the
two offsets.
If @var{parameter} is @samp{@@}, the result is @var{length} positional
parameters beginning at @var{offset}.
If @var{parameter} is an indexed array name subscripted
@@ -4505,6 +4509,13 @@ changes its behavior to that of version 4.0 with respect to locale-specific
string comparison when using the conditional command's < and > operators
and the effect of interrupting a command list.
@item compat41
If set, Bash, when in posix mode, treats a single quote in a double-quoted
parameter expansion as a special character. The single quotes must match
(an even number) and the characters between the single quotes are considered
quoted. This is the behavior of @sc{posix} mode through version 4.1.
The default Bash behavior remains as in previous versions.
@item dirspell
If set, Bash
attempts spelling correction on directory names during word completion
@@ -6197,8 +6208,11 @@ name[@var{subscript}]=@var{value}
@noindent
The @var{subscript}
is treated as an arithmetic expression that must evaluate to a number
greater than or equal to zero. To explicitly declare an array, use
is treated as an arithmetic expression that must evaluate to a number.
If @var{subscript} evaluates to a number less than zero, it is used as
an offset from one greater than the array's maximum index (so a subcript
of -1 refers to the last element of the array).
To explicitly declare an array, use
@example
declare -a @var{name}
@end example
+21 -4
View File
@@ -1765,9 +1765,13 @@ If @var{length} is omitted, expands to the substring of
(@pxref{Shell Arithmetic}).
This is referred to as Substring Expansion.
@var{length} must evaluate to a number greater than or equal to zero.
If @var{offset} evaluates to a number less than zero, the value
is used as an offset from the end of the value of @var{parameter}.
If @var{length} evaluates to a number less than zero, and @var{parameter}
is not @samp{@@} and not an indexed or associative array, it is interpreted
as an offset from the end of the value of @var{parameter} rather than
a number of characters, and the expansion is the characters between the
two offsets.
If @var{parameter} is @samp{@@}, the result is @var{length} positional
parameters beginning at @var{offset}.
If @var{parameter} is an indexed array name subscripted
@@ -2931,7 +2935,7 @@ The return status is zero unless @var{n} is not greater than or equal to 1.
@item cd
@btindex cd
@example
cd [-L|-P] [@var{directory}]
cd [-L|[-P [-e]]] [@var{directory}]
@end example
Change the current working directory to @var{directory}.
If @var{directory} is not given, the value of the @env{HOME} shell
@@ -2941,6 +2945,10 @@ If @var{directory} begins with a slash, @env{CDPATH} is not used.
The @option{-P} option means to not follow symbolic links; symbolic
links are followed by default or with the @option{-L} option.
If the @option{-e} option is supplied with @option{-P}
and the current working directory cannot be successfully determined
after a successful directory change, @code{cd} will return an unsuccessful
status.
If @var{directory} is @samp{-}, it is equivalent to @env{$OLDPWD}.
If a non-empty directory name from @env{CDPATH} is used, or if
@@ -4501,6 +4509,12 @@ changes its behavior to that of version 4.0 with respect to locale-specific
string comparison when using the conditional command's < and > operators
and the effect of interrupting a command list.
@item compat41
If set, Bash, when in posix mode, treats a single quote in a double-quoted
parameter expansion as a special character. The single quotes must match
(an even number) and the characters between the single quotes are considered
quoted. This is the behavior of @sc{posix} mode through version 4.1.
@item dirspell
If set, Bash
attempts spelling correction on directory names during word completion
@@ -6193,8 +6207,11 @@ name[@var{subscript}]=@var{value}
@noindent
The @var{subscript}
is treated as an arithmetic expression that must evaluate to a number
greater than or equal to zero. To explicitly declare an array, use
is treated as an arithmetic expression that must evaluate to a number.
If @var{subscript} evaluates to a number less than zero, it is used as
an offset from one greater than the array's maximum index (so a subcript
of -1 refers to the last element of the array).
To explicitly declare an array, use
@example
declare -a @var{name}
@end example
+679 -676
View File
File diff suppressed because it is too large Load Diff
+1244 -1239
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Tue Jun 1 11:58:36 2010
%%CreationDate: Mon Jun 7 16:18:58 2010
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%DocumentSuppliedResources: procset grops 1.19 2
+3 -3
View File
@@ -2,9 +2,9 @@
Copyright (C) 1988-2010 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Sun May 30 17:03:21 EDT 2010
@set LASTCHANGE Sat Jun 12 15:35:23 EDT 2010
@set EDITION 4.1
@set VERSION 4.1
@set UPDATED 30 May 2010
@set UPDATED-MONTH May 2010
@set UPDATED 12 June 2010
@set UPDATED-MONTH June 2010
+2 -2
View File
@@ -2,9 +2,9 @@
Copyright (C) 1988-2010 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Sat May 29 21:00:00 EDT 2010
@set LASTCHANGE Sun May 30 17:03:21 EDT 2010
@set EDITION 4.1
@set VERSION 4.1
@set UPDATED 29 May 2010
@set UPDATED 30 May 2010
@set UPDATED-MONTH May 2010
+43 -42
View File
@@ -1,56 +1,57 @@
#!/bin/bash
#
# The Bash shell script executes a command with a time-out.
# Upon time-out expiration SIGTERM (15) is sent to the process. If the signal
# is blocked, then the subsequent SIGKILL (9) terminates it.
#
# The Bash script executes a command with a time-out.
# Based on the Bash documentation example.
# Hello Chet,
# please find attached a "little easier" :-) to comprehend
# time-out example. If you find it suitable, feel free to include
# anywhere: the very same logic as in the original examples/scripts, a
# little more transparent implementation to my taste.
#
# Dmitry V Golovashkin <Dmitry.Golovashkin@sas.com>
# Upon time-out expiration SIGTERM (15) is sent to the process. If the signal
# is blocked, then the subsequent SIGKILL (9) terminates it.
# Dmitry V Golovashkin (E-mail: dvg@ieee.org)
#
script_name="${0##*/}"
scriptName="${0##*/}"
# Default values.
readonly param_timeout=5
readonly param_interval=1
readonly param_delay=1
declare -i DEFAULT_TIMEOUT=9
declare -i DEFAULT_INTERVAL=1
declare -i DEFAULT_DELAY=1
declare -i timeout=param_timeout
declare -i interval=param_interval
declare -i delay=param_delay
# Timeout.
declare -i timeout=DEFAULT_TIMEOUT
# Interval between checks if the process is still alive.
declare -i interval=DEFAULT_INTERVAL
# Delay between posting the SIGTERM signal and destroying the process by SIGKILL.
declare -i delay=DEFAULT_DELAY
blue="$(tput setaf 4)"
bold_red="$(tput bold; tput setaf 1)"
off="$(tput sgr0)"
function printUsage() {
cat <<EOF
function print_usage() {
cat <<EOF
Synopsis
$scriptName [-t timeout] [-i interval] [-d delay] command
Execute a command with a time-out.
Upon time-out expiration SIGTERM (15) is sent to the process. If SIGTERM
signal is blocked, then the subsequent SIGKILL (9) terminates it.
Synopsis: $script_name [-t timeout] [-i interval] [-d delay] command
-t timeout
Number of seconds to wait for command completion.
Default value: $DEFAULT_TIMEOUT seconds.
Executes the command with a time-out. Upon time-out expiration SIGTERM (15) is
sent to the process. If SIGTERM signal is blocked, then the subsequent SIGKILL
(9) terminates it.
-i interval
Interval between checks if the process is still alive.
Positive integer, default value: $DEFAULT_INTERVAL seconds.
$blue-t timeout$off
Number of seconds to wait for command completion.
Default value: $param_timeout seconds. In some practical situations
this value ${bold_red}must$off be increased (for instance -t 180) to allow
the command to complete.
-d delay
Delay between posting the SIGTERM signal and destroying the
process by SIGKILL. Default value: $DEFAULT_DELAY seconds.
$blue-i interval$off
Interval between checks if the process is still alive.
Positive integer, default value: $param_interval seconds.
Default value is OK for most situations.
$blue-d delay$off
Delay between posting the SIGTERM signal and destroying the process by
SIGKILL. Default value: $param_delay seconds.
Default value is OK for most situations.
As of today, Bash does not support floating point arithmetic (sleep does),
therefore all delay/time values must be integers.
therefore all time values must be integers.
Dmitry Golovashkin (E-mail: dvg@ieee.org)
EOF
exit 1 # No useful work was done.
}
# Options.
@@ -59,7 +60,7 @@ while getopts ":t:i:d:" option; do
t) timeout=$OPTARG ;;
i) interval=$OPTARG ;;
d) delay=$OPTARG ;;
*) printUsage; exit 1 ;;
*) print_usage ;;
esac
done
shift $((OPTIND - 1))
@@ -67,11 +68,10 @@ shift $((OPTIND - 1))
# $# should be at least 1 (the command to execute), however it may be strictly
# greater than 1 if the command itself has options.
if (($# == 0 || interval <= 0)); then
printUsage
exit 1
print_usage
fi
# kill -0 pid Exit code indicates if a signal may be sent to $pid process.
# kill -0 pid Exit code indicates if a signal may be sent to "pid" process.
(
((t = timeout))
@@ -89,3 +89,4 @@ fi
) 2> /dev/null &
exec "$@"
+8
View File
@@ -477,6 +477,14 @@ get_y_or_n (for_pager)
{
int c;
/* For now, disable pager in callback mode, until we later convert to state
driven functions. Have to wait until next major version to add new
state definition, since it will change value of RL_STATE_DONE. */
#if defined (READLINE_CALLBACKS)
if (RL_ISSTATE (RL_STATE_CALLBACK))
return 1;
#endif
for (;;)
{
RL_SETSTATE(RL_STATE_MOREINPUT);
+1 -1
View File
@@ -164,7 +164,7 @@ int _rl_completion_case_fold = 0;
/* Non-zero means that `-' and `_' are equivalent when comparing filenames
for completion. */
int _rl_completion_case_map = 1;
int _rl_completion_case_map = 0;
/* If zero, don't match hidden files (filenames beginning with a `.' on
Unix) when doing filename completion. */
+1 -1
View File
@@ -3256,7 +3256,7 @@ parse_matched_pair (qc, open, close, lenp, flags)
within a double-quoted ${...} construct "an even number of
unescaped double-quotes or single-quotes, if any, shall occur." */
/* This was changed in Austin Group Interp 221 */
if MBTEST(posixly_correct && /*shell_compatibility_level > 41 &&*/ dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
continue;
/* Could also check open == '`' if we want to parse grouping constructs
-3
View File
@@ -3257,10 +3257,7 @@ parse_matched_pair (qc, open, close, lenp, flags)
unescaped double-quotes or single-quotes, if any, shall occur." */
/* This was changed in Austin Group Interp 221 */
if MBTEST(posixly_correct && /*shell_compatibility_level > 41 &&*/ dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
{
itrace("parse_matched_pair: found single quote in double-quoted dolbrace");
continue;
}
/* Could also check open == '`' if we want to parse grouping constructs
inside old-style command substitution. */
+1 -1
View File
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
#define PATCHLEVEL 7
#define PATCHLEVEL 0
#endif /* _PATCHLEVEL_H_ */
+1 -1
View File
@@ -1,6 +1,6 @@
/* patchlevel.h -- current bash patch level */
/* Copyright (C) 2001-2009 Free Software Foundation, Inc.
/* Copyright (C) 2001-2010 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
+333 -209
View File
File diff suppressed because it is too large Load Diff
+3 -1
View File
@@ -1,6 +1,6 @@
/* print_command -- A way to make readable commands from a command tree. */
/* Copyright (C) 1989-2009 Free Software Foundation, Inc.
/* Copyright (C) 1989-2010 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -363,6 +363,7 @@ xtrace_set (fd, fp)
int fd;
FILE *fp;
{
itrace("xtrace_set: fd = %d fp = 0x%x", fd, fp);
if (fd >= 0 && sh_validfd (fd) == 0)
{
internal_error (_("xtrace_set: %d: invalid file descriptor"), fd);
@@ -383,6 +384,7 @@ xtrace_set (fd, fp)
void
xtrace_init ()
{
itrace("xtrace_init");
xtrace_set (-1, stderr);
}
+13 -3
View File
@@ -1462,7 +1462,7 @@ extract_dollar_brace_string (string, sindex, quoted, flags)
if (c == '\'')
{
/*itrace("extract_dollar_brace_string: c == single quote flags = %d quoted = %d dolbrace_state = %d", flags, quoted, dolbrace_state);*/
if (posixly_correct && /*shell_compatibility_level > 41 &&*/ dolbrace_state != DOLBRACE_QUOTE)
if (posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE)
ADVANCE_CHAR (string, slen, i);
else
{
@@ -6057,7 +6057,7 @@ verify_substring_values (v, value, substr, vtype, e1p, e2p)
free (temp1);
if (expok == 0)
return (0);
if (*e2p < 0)
if ((vtype == VT_ARRAYVAR || vtype == VT_POSPARMS) && *e2p < 0)
{
internal_error (_("%s: substring expression < 0"), t);
return (0);
@@ -6069,7 +6069,17 @@ verify_substring_values (v, value, substr, vtype, e1p, e2p)
if (vtype != VT_ARRAYVAR)
#endif
{
*e2p += *e1p; /* want E2 chars starting at E1 */
if (*e2p < 0)
{
*e2p += len;
if (*e2p < 0 || *e2p < *e1p)
{
internal_error (_("%s: substring expression < 0"), t);
return (0);
}
}
else
*e2p += *e1p; /* want E2 chars starting at E1 */
if (*e2p > len)
*e2p = len;
}
+13 -3
View File
@@ -4,7 +4,7 @@
/* ``Have a little faith, there's magic in the night. You ain't a
beauty, but, hey, you're alright.'' */
/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
/* Copyright (C) 1987-2010 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -6057,7 +6057,7 @@ verify_substring_values (v, value, substr, vtype, e1p, e2p)
free (temp1);
if (expok == 0)
return (0);
if (*e2p < 0)
if ((vtype == VT_ARRAYVAR || vtype == VT_POSPARMS) && *e2p < 0)
{
internal_error (_("%s: substring expression < 0"), t);
return (0);
@@ -6069,7 +6069,17 @@ verify_substring_values (v, value, substr, vtype, e1p, e2p)
if (vtype != VT_ARRAYVAR)
#endif
{
*e2p += *e1p; /* want E2 chars starting at E1 */
if (*e2p < 0)
{
*e2p += len;
if (*e2p < 0 || *e2p < *e1p)
{
internal_error (_("%s: substring expression < 0"), t);
return (0);
}
}
else
*e2p += *e1p; /* want E2 chars starting at E1 */
if (*e2p > len)
*e2p = len;
}
+1 -1
View File
@@ -1,4 +1,4 @@
BUILD_DIR=/usr/local/build/chet/bash/bash-current
BUILD_DIR=/usr/local/build/bash/bash-current
THIS_SH=$BUILD_DIR/bash
PATH=$PATH:$BUILD_DIR
+2 -2
View File
@@ -140,7 +140,7 @@ three
one
two
three
4.1
4.2
echo ${BASH_VERSION%\.*}
4.1
4.2
echo ${BASH_VERSION%\.*}
+53 -27
View File
@@ -31,28 +31,49 @@ a[0] Abcdefghijklmnop
[e] abcdefghijklmnOp
[f] abcdefghijklmnoP
a
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
5
8
11
14
0 [0] Abcdefghijklmnop
1 [1] aBcdefghijklmnop
2 [2] abCdefghijklmnop
3 [3] abcDefghijklmnop
4 [4] abcdEfghijklmnop
5 [5] abcdeFghijklmnop
6 [6] abcdefGhijklmnop
7 [7] abcdefgHijklmnop
8 [8] abcdefghIjklmnop
9 [9] abcdefghiJklmnop
10 [a] abcdefghijKlmnop
11 [b] abcdefghijkLmnop
12 [c] abcdefghijklMnop
13 [d] abcdefghijklmNop
14 [e] abcdefghijklmnOp
15 [f] abcdefghijklmnoP
16 a
2 [2] abCdefghijklmnop
5 [5] abcdeFghijklmnop
8 [8] abcdefghIjklmnop
11 [b] abcdefghijkLmnop
14 [e] abcdefghijklmnOp
[0] Abcdefghijklmnop
[1] aBcdefghijklmnop
[2] abCdefghijklmnop
@@ -131,8 +152,13 @@ a
[28] aaa
[29] aaa
1 2 3 4 5
foo 0
foo 1
foo 2
foo 3
foo 4
foo 0 1
foo 1 2
foo 2 3
foo 3 4
foo 4 5
+3
View File
@@ -11,6 +11,7 @@ shopt -s cmdhist
shopt -u compat31
shopt -u compat32
shopt -u compat40
shopt -u compat41
shopt -u dirspell
shopt -u dotglob
shopt -u execfail
@@ -65,6 +66,7 @@ shopt -u checkwinsize
shopt -u compat31
shopt -u compat32
shopt -u compat40
shopt -u compat41
shopt -u dirspell
shopt -u dotglob
shopt -u execfail
@@ -96,6 +98,7 @@ checkwinsize off
compat31 off
compat32 off
compat40 off
compat41 off
dirspell off
dotglob off
execfail off
+4
View File
@@ -588,6 +588,10 @@ initialize_shell_variables (env, privmode)
/* Get the user's real and effective user ids. */
uidset ();
temp_var = find_variable ("BASH_XTRACEFD");
if (temp_var && imported_p (temp_var))
sv_xtracefd (temp_var->name);
/* Initialize the dynamic variables, and seed their values. */
initialize_dynamic_variables ();
}
+6 -1
View File
@@ -1,6 +1,6 @@
/* variables.c -- Functions for hacking shell variables. */
/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
/* Copyright (C) 1987-2010 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -588,6 +588,10 @@ initialize_shell_variables (env, privmode)
/* Get the user's real and effective user ids. */
uidset ();
temp_var = find_variable ("BASH_XTRACEFD");
if (temp_var && imported_p (temp_var))
sv_xtracefd (temp_var->name);
/* Initialize the dynamic variables, and seed their values. */
initialize_dynamic_variables ();
}
@@ -4729,6 +4733,7 @@ sv_xtracefd (name)
int fd;
FILE *fp;
itrace("sv_xtracefd: %s", name);
v = find_variable (name);
if (v == 0)
{
+2 -2
View File
@@ -1,6 +1,6 @@
/* version.c -- distribution and version numbers. */
/* Copyright (C) 1989-2009 Free Software Foundation, Inc.
/* Copyright (C) 1989-2010 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -43,7 +43,7 @@ const char * const release_status = (char *)0;
#endif
const char * const sccs_version = SCCSVERSION;
const char * const bash_copyright = N_("Copyright (C) 2009 Free Software Foundation, Inc.");
const char * const bash_copyright = N_("Copyright (C) 2010 Free Software Foundation, Inc.");
const char * const bash_license = N_("License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n");
/* If == 31, shell compatible with bash-3.1, == 32 with bash-3.2, and so on */
+94
View File
@@ -0,0 +1,94 @@
/* version.c -- distribution and version numbers. */
/* Copyright (C) 1989-2009 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Bash is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Bash. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <stdio.h>
#include "stdc.h"
#include "version.h"
#include "patchlevel.h"
#include "conftypes.h"
#include "bashintl.h"
extern char *shell_name;
/* Defines from version.h */
const char * const dist_version = DISTVERSION;
const int patch_level = PATCHLEVEL;
const int build_version = BUILDVERSION;
#ifdef RELSTATUS
const char * const release_status = RELSTATUS;
#else
const char * const release_status = (char *)0;
#endif
const char * const sccs_version = SCCSVERSION;
const char * const bash_copyright = N_("Copyright (C) 2009 Free Software Foundation, Inc.");
const char * const bash_license = N_("License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n");
/* If == 31, shell compatible with bash-3.1, == 32 with bash-3.2, and so on */
int shell_compatibility_level = DEFAULT_COMPAT_LEVEL;
/* Functions for getting, setting, and displaying the shell version. */
/* Forward declarations so we don't have to include externs.h */
extern char *shell_version_string __P((void));
extern void show_shell_version __P((int));
/* Give version information about this shell. */
char *
shell_version_string ()
{
static char tt[32] = { '\0' };
if (tt[0] == '\0')
{
if (release_status)
#if defined (HAVE_SNPRINTF)
snprintf (tt, sizeof (tt), "%s.%d(%d)-%s", dist_version, patch_level, build_version, release_status);
#else
sprintf (tt, "%s.%d(%d)-%s", dist_version, patch_level, build_version, release_status);
#endif
else
#if defined (HAVE_SNPRINTF)
snprintf (tt, sizeof (tt), "%s.%d(%d)", dist_version, patch_level, build_version);
#else
sprintf (tt, "%s.%d(%d)", dist_version, patch_level, build_version);
#endif
}
return tt;
}
void
show_shell_version (extended)
int extended;
{
printf (_("GNU bash, version %s (%s)\n"), shell_version_string (), MACHTYPE);
if (extended)
{
printf ("%s\n", _(bash_copyright));
printf ("%s\n", _(bash_license));
printf (_("This is free software; you are free to change and redistribute it.\n"));
printf (_("There is NO WARRANTY, to the extent permitted by law.\n"));
}
}