commit bash-20101229 snapshot

This commit is contained in:
Chet Ramey
2011-12-12 22:12:40 -05:00
parent 89c77bc75b
commit 54a1fa7c24
67 changed files with 9323 additions and 7739 deletions
+20
View File
@@ -1,3 +1,23 @@
This document details the changes between this version, bash-4.2-rc1,
and the previous version, bash-4.2-beta.
1. Changes to Bash
a. Fixed a bug that caused some redirection errors to leak file descriptors.
b. Fixed a bug that caused unary `+' and `-' arithmetic operators to have a
higher precedence than unary `!' and `~'.
c. Fixed a bug that caused simple commands in a pipeline to affect the exit
status ($?) seen by subsequent pipeline commands.
2. Changes to Readline
3. New Features in Bash
4. New Features in Readline
------------------------------------------------------------------------------
This document details the changes between this version, bash-4.2-beta,
and the previous version, bash-4.2-alpha.
+20
View File
@@ -1,3 +1,23 @@
This document details the changes between this version, bash-4.2-rc1,
and the previous version, bash-4.2-beta.
1. Changes to Bash
a. Fixed a bug that caused some redirection errors to leak file descriptors.
b. Fixed a bug that caused unary `+' and `-' arithmetic operators to have a
higher precedence than unary `!' and `~'.
c. Fixed a bug that caused simple commands in a pipeline to affect the exit
status ($?) seen by subsequent pipeline commands.
2. Changes to Readline
3. New Features in Bash
4. New Features in Readline
------------------------------------------------------------------------------
This document details the changes between this version, bash-4.2-beta,
and the previous version, bash-4.2-alpha.
+13 -11
View File
@@ -295,7 +295,8 @@ version and versions 2.0 and above.
37. Bash-4.0 now allows SIGCHLD to interrupt the wait builtin, as Posix
specifies, so the SIGCHLD trap is no longer always invoked once per
exiting child if you are using `wait' to wait for all children.
exiting child if you are using `wait' to wait for all children. As
of bash-4.2, this is the status quo only when in posix mode.
38. Since bash-4.0 now follows Posix rules for finding the closing delimiter
of a $() command substitution, it will not behave as previous versions
@@ -330,7 +331,8 @@ version and versions 2.0 and above.
44. Bash-4.1 uses the current locale when comparing strings using the < and
> operators to the `[[' command. This can be reverted to the previous
behavior by setting one of the `compatNN' shopt options.
behavior (ASCII collating and strcmp(3)) by setting one of the
`compatNN' shopt options, where NN is less than 41.
45. Command substitutions now remove the caller's trap strings when trap is
run to set a new trap in the subshell. Previous to bash-4.2, the old
@@ -350,26 +352,26 @@ Shell Compatibility Level
=========================
Bash-4.0 introduced the concept of a `shell compatibility level', specified
as a set of options to the shopt builtin (compat31, compat32, compat40 at
this writing). There is only one current compatibility level -- each
option is mutually exclusive. This list does not mention behavior that is
standard for a particular version (e.g., setting compat32 means that quoting
the rhs of the regexp matching operator quotes special regexp characters in
the word, which is default behavior in bash-3.2 and above).
as a set of options to the shopt builtin (compat31, compat32, compat40, and
compat41 at this writing). There is only one current compatibility level --
each option is mutually exclusive. This list does not mention behavior
that is standard for a particular version (e.g., setting compat32 means that
quoting the rhs of the regexp matching operator quotes special regexp
characters in the word, which is default behavior in bash-3.2 and above).
compat31 set
- the < and > operators to the [[ command do not consider the current
locale when comparing strings
locale when comparing strings; they use ASCII ordering
- quoting the rhs of the regexp matching operator (=~) has no
special effect
compat32 set
- the < and > operators to the [[ command do not consider the current
locale when comparing strings
locale when comparing strings; they use ASCII ordering
compat40 set
- the < and > operators to the [[ command do not consider the current
locale when comparing strings
locale when comparing strings; they use ASCII ordering
- 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)
+95
View File
@@ -10784,6 +10784,10 @@ doc/{bash.1,bashref.texi}
configure.in
- changed release status to 4.2-beta
12/14
-----
[bash-4.2-beta frozen]
12/18
-----
redir.c
@@ -10813,3 +10817,94 @@ doc/bash.1
- change the description of while and until to use `list-1' and
`list-2', similar to the Posix description. Suggested by
Jeff Haemer <jeffrey.haemer@gmail.com>
12/27
-----
execute_cmd.c
- slight changes to execute_command_internal and how it captures the
exit status of (command) and shell control structures with pipes to
avoid multiple variable assignments to last_command_exit_value
- change to execute_simple_command so that parent branches of shells
forked to execute commands in pipelines don't change $? to 0
(if (pipe_out != NO_PIPE) result = last_command_exit_value). Fixes
bug reported by Damien Nadà <dnade.ext@orange-ftgroup.com>
12/28
-----
configure.in
- changed version to bash-4.2-rc1
1/2/2011
--------
lib/readline/complete.c
- fix rl_filename_completion_function to dequote and save users_dirname
before calling any function to transform the directory name passed
to opendir(). Fix from Andreas Schwab <schwab@linux-m68k.org>
lib/readline/doc/
- make sure to note that rl_directory_completion_hook cannot modify
the directory name argument if it returns 0
bashline.c
- make sure that bash_directory_completion_hook consistently returns
non-zero whenever it modifies its directory name argument
lib/readline/terminal.c
- don't bother with the declarations (extern or not) for PC, BS, and
UP if NCURSES_VERSION is defined, since ncurses defines local
versions of those symbols in the library. Fixes bug most recently
reported by Kevin Scott <kscott@eznet.net> against Mac OS X
include/filecntl.h
- make sure O_TEXT and O_BINARY are defined to avoid Windows-specific
(or cygwin-specific) code. This and the following changes from
Eric Blake <eblake@redhat.com> for current cygwin systems
input.h
- add a B_TEXT flag to note when the underlying file descriptor is
opened in O_TEXT mode
lib/sh/tmpfile.c
- make sure temporary files are opened in binary mode (O_BINARY) on
systems where it matters
input.c
- make sure to set the B_TEXT flag if the file descriptor has O_TEXT
in its flags (returned by fcntl)
- change b_fill_buffer to compensate for lseek() and read() returning
different offsets on files opened in O_TEXT mode
- cygwin now is able to lseek on files and set the unbuffered and text
flags appropriately, so can use the general test for a seekable fd
- now that cygwin uses O_TEXT or O_BINARY appropriately, we no longer
have to manually translate \r\n to \n
redir.c
- remove the Cygwin-1.1 code from here_document_to_fd; cygwin is now
up to version 1.7 and can unlink an open file descriptor
- make sure temporary files used for here documents are opened in
binary mode (O_BINARY) on systems where it matters
execute_cmd.c,parse.y
- make sure error messages use all printable characters in filenames
and strings
{builtins/evalfile,shell,subst}.c
- remove cygwin-specific calls to setmode to force file descriptors
into text mode, since we're using text or binary mode according to
the mode of the mount point
execute_cmd.c
- when creating pipes and making them stdin and stdout, make sure to
tell stdio that the mode of the underlying file descriptor may have
changed from text to binary
subst.c
- when creating pipes for command substitution, make sure to
tell stdio that the mode of the underlying file descriptor may have
changed from text to binary
1/3
---
doc/{bash.1,bashref.texi}
- changes to the readonly documentation suggested by Jan Schampera
<jan.schampera@web.de>
+96
View File
@@ -10784,6 +10784,10 @@ doc/{bash.1,bashref.texi}
configure.in
- changed release status to 4.2-beta
12/14
-----
[bash-4.2-beta frozen]
12/18
-----
redir.c
@@ -10806,3 +10810,95 @@ expr.c
-----
lib/sh/fpurge.c
- updated version from gnulib, inlined gnulib stdio-impl.h
12/24
-----
doc/bash.1
- change the description of while and until to use `list-1' and
`list-2', similar to the Posix description. Suggested by
Jeff Haemer <jeffrey.haemer@gmail.com>
12/27
-----
execute_cmd.c
- slight changes to execute_command_internal and how it captures the
exit status of (command) and shell control structures with pipes to
avoid multiple variable assignments to last_command_exit_value
- change to execute_simple_command so that parent branches of shells
forked to execute commands in pipelines don't change $? to 0
(if (pipe_out != NO_PIPE) result = last_command_exit_value). Fixes
bug reported by Damien Nadà <dnade.ext@orange-ftgroup.com>
12/28
-----
configure.in
- changed version to bash-4.2-rc1
1/2/2011
--------
lib/readline/complete.c
- fix rl_filename_completion_function to dequote and save users_dirname
before calling any function to transform the directory name passed
to opendir(). Fix from Andreas Schwab <schwab@linux-m68k.org>
lib/readline/doc/
- make sure to note that rl_directory_completion_hook cannot modify
the directory name argument if it returns 0
bashline.c
- make sure that bash_directory_completion_hook consistently returns
non-zero whenever it modifies its directory name argument
lib/readline/terminal.c
- don't bother with the declarations (extern or not) for PC, BS, and
UP if NCURSES_VERSION is defined, since ncurses defines local
versions of those symbols in the library. Fixes bug most recently
reported by Kevin Scott <kscott@eznet.net> against Mac OS X
include/filecntl.h
- make sure O_TEXT and O_BINARY are defined to avoid Windows-specific
(or cygwin-specific) code. This and the following changes from
Eric Blake <eblake@redhat.com> for current cygwin systems
input.h
- add a B_TEXT flag to note when the underlying file descriptor is
opened in O_TEXT mode
lib/sh/tmpfile.c
- make sure temporary files are opened in binary mode (O_BINARY) on
systems where it matters
input.c
- make sure to set the B_TEXT flag if the file descriptor has O_TEXT
in its flags (returned by fcntl)
- change b_fill_buffer to compensate for lseek() and read() returning
different offsets on files opened in O_TEXT mode
- cygwin now is able to lseek on files and set the unbuffered and text
flags appropriately, so can use the general test for a seekable fd
- now that cygwin uses O_TEXT or O_BINARY appropriately, we no longer
have to manually translate \r\n to \n
redir.c
- remove the Cygwin-1.1 code from here_document_to_fd; cygwin is now
up to version 1.7 and can unlink an open file descriptor
- make sure temporary files used for here documents are opened in
binary mode (O_BINARY) on systems where it matters
execute_cmd.c,parse.y
- make sure error messages use all printable characters in filenames
and strings
{builtins/evalfile,shell,subst}.c
- remove cygwin-specific calls to setmode to force file descriptors
into text mode, since we're using text or binary mode according to
the mode of the mount point
execute_cmd.c
- when creating pipes and making them stdin and stdout, make sure to
tell stdio that the mode of the underlying file descriptor may have
changed from text to binary
subst.c
- when creating pipes for command substitution, make sure to
tell stdio that the mode of the underlying file descriptor may have
changed from text to binary
+2 -2
View File
@@ -376,8 +376,8 @@ does not provide the necessary support.
The Restricted Shell::, for a description of restricted mode.
`--enable-select'
Include the `select' builtin, which allows the generation of simple
menus (*note Conditional Constructs::).
Include the `select' compound command, which allows the generation
of simple menus (*note Conditional Constructs::).
`--enable-separate-helpfiles'
Use external files for the documentation displayed by the `help'
+1
View File
@@ -850,6 +850,7 @@ tests/exec5.sub f
tests/exec6.sub f
tests/exec7.sub f
tests/exec8.sub f
tests/exec9.sub f
tests/exp.tests f
tests/exp.right f
tests/exp1.sub f
+11 -11
View File
@@ -1,7 +1,7 @@
@%:@! /bin/sh
@%:@ From configure.in for Bash 4.2, version 4.034.
@%:@ From configure.in for Bash 4.2, version 4.035.
@%:@ Guess values for system-dependent variables and create Makefiles.
@%:@ Generated by GNU Autoconf 2.63 for bash 4.2-beta.
@%:@ Generated by GNU Autoconf 2.63 for bash 4.2-rc1.
@%:@
@%:@ 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.2-beta'
PACKAGE_STRING='bash 4.2-beta'
PACKAGE_VERSION='4.2-rc1'
PACKAGE_STRING='bash 4.2-rc1'
PACKAGE_BUGREPORT='bug-bash@gnu.org'
ac_unique_file="shell.h"
@@ -1410,7 +1410,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.2-beta to adapt to many kinds of systems.
\`configure' configures bash 4.2-rc1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1475,7 +1475,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of bash 4.2-beta:";;
short | recursive ) echo "Configuration of bash 4.2-rc1:";;
esac
cat <<\_ACEOF
@@ -1650,7 +1650,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
bash configure 4.2-beta
bash configure 4.2-rc1
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1664,7 +1664,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.2-beta, which was
It was created by bash $as_me 4.2-rc1, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2078,7 +2078,7 @@ ac_config_headers="$ac_config_headers config.h"
BASHVERS=4.2
RELSTATUS=beta
RELSTATUS=rc1
case "$RELSTATUS" in
alp*|bet*|dev*|rc*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
@@ -31862,7 +31862,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.2-beta, which was
This file was extended by bash $as_me 4.2-rc1, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -31925,7 +31925,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
bash config.status 4.2-beta
bash config.status 4.2-rc1
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'
],
{
'_LT_AC_TAGCONFIG' => 1,
'AM_PROG_F77_C_O' => 1,
'AC_INIT' => 1,
'_LT_AC_TAGCONFIG' => 1,
'm4_pattern_forbid' => 1,
'_AM_COND_IF' => 1,
'AC_INIT' => 1,
'AC_CANONICAL_TARGET' => 1,
'AC_SUBST' => 1,
'_AM_COND_IF' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_FC_SRCEXT' => 1,
'AC_SUBST' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_FC_SRCEXT' => 1,
'AC_PROG_LIBTOOL' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'AC_CONFIG_LINKS' => 1,
'm4_sinclude' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'LT_SUPPORTED_TAG' => 1,
'm4_sinclude' => 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,
'_AM_SUBST_NOTMAKE' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'sinclude' => 1,
'm4_pattern_allow' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'AM_PROG_CC_C_O' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'm4_pattern_allow' => 1,
'sinclude' => 1,
'AM_CONDITIONAL' => 1,
'AC_CANONICAL_SYSTEM' => 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.2-beta], [bug-bash@gnu.org])
m4trace:configure.in:29: -1- AC_INIT([bash], [4.2-rc1], [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'])
+8 -3
View File
@@ -2695,7 +2695,9 @@ bash_filename_rewrite_hook (fname, fnlen)
}
/* Handle symbolic link references and other directory name
expansions while hacking completion. */
expansions while hacking completion. This should return 1 if it modifies
the DIRNAME argument, 0 otherwise. It should make sure not to modify
DIRNAME if it returns 0. */
static int
bash_directory_completion_hook (dirname)
char **dirname;
@@ -2752,6 +2754,7 @@ bash_directory_completion_hook (dirname)
{
/* Dequote the filename even if we don't expand it. */
new_dirname = bash_dequote_filename (local_dirname, rl_completion_quote_character);
return_value = STREQ (local_dirname, new_dirname) == 0;
free (local_dirname);
local_dirname = *dirname = new_dirname;
}
@@ -2775,14 +2778,14 @@ bash_directory_completion_hook (dirname)
free (temp1);
temp1 = temp2;
temp2 = sh_canonpath (temp1, PATH_CHECKDOTDOT|PATH_CHECKEXISTS);
return_value = temp2 != 0;
return_value |= temp2 != 0;
}
}
/* If we can't canonicalize, bail. */
if (temp2 == 0)
{
free (temp1);
return 1;
return return_value;
}
len1 = strlen (temp1);
if (temp1[len1 - 1] == '/')
@@ -2795,10 +2798,12 @@ bash_directory_completion_hook (dirname)
temp2[len2 + 1] = '\0';
}
}
return_value |= STREQ (local_dirname, temp2) == 0;
free (local_dirname);
*dirname = temp2;
free (temp1);
}
return (return_value);
}
-2
View File
@@ -499,11 +499,9 @@ initialize_readline ()
/* Tell the completer that we want a crack first. */
rl_attempted_completion_function = attempt_shell_completion;
#if 0
/* Tell the completer that we might want to follow symbolic links or
do other expansion on directory names. */
rl_directory_completion_hook = bash_directory_completion_hook;
#endif
rl_filename_rewrite_hook = bash_filename_rewrite_hook;
+1 -1
View File
@@ -1,7 +1,7 @@
This file is declare.def, from which is created declare.c.
It implements the builtins "declare" and "local" in Bash.
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.
-4
View File
@@ -149,10 +149,6 @@ file_error_and_exit:
return ((flags & FEVAL_BUILTIN) ? EXECUTION_FAILURE : -1);
}
#if defined (__CYGWIN__) && defined (O_TEXT)
setmode (fd, O_TEXT);
#endif
if (S_ISREG (finfo.st_mode) && file_size <= SSIZE_MAX)
{
string = (char *)xmalloc (1 + file_size);
+2 -1
View File
@@ -70,6 +70,7 @@ extern int posixly_correct;
extern int indirection_level, subshell_environment;
extern int return_catch_flag, return_catch_value;
extern int last_command_exit_value;
extern int executing_command_builtin;
/* How many `levels' of sourced files we have. */
int sourcelevel = 0;
@@ -342,7 +343,7 @@ source_file (filename, sflags)
if (sflags)
flags |= FEVAL_NOPUSHARGS;
/* POSIX shells exit if non-interactive and file error. */
if (posixly_correct && interactive_shell == 0)
if (posixly_correct && interactive_shell == 0 && executing_command_builtin == 0)
flags |= FEVAL_LONGJMP;
rval = _evalfile (filename, flags);
+1 -1
View File
@@ -82,7 +82,7 @@ export_builtin (list)
$BUILTIN readonly
$FUNCTION readonly_builtin
$SHORT_DOC readonly [-af] [name[=value] ...] or readonly -p
$SHORT_DOC readonly [-aAf] [name[=value] ...] or readonly -p
Mark shell variables as unchangeable.
Mark each NAME as read-only; the values of these NAMEs may not be
+1 -1
View File
@@ -1,7 +1,7 @@
This file is setattr.def, from which is created setattr.c.
It implements the builtins "export" and "readonly", in Bash.
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.
Vendored
+11 -11
View File
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.in for Bash 4.2, version 4.034.
# From configure.in for Bash 4.2, version 4.035.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.63 for bash 4.2-beta.
# Generated by GNU Autoconf 2.63 for bash 4.2-rc1.
#
# 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.2-beta'
PACKAGE_STRING='bash 4.2-beta'
PACKAGE_VERSION='4.2-rc1'
PACKAGE_STRING='bash 4.2-rc1'
PACKAGE_BUGREPORT='bug-bash@gnu.org'
ac_unique_file="shell.h"
@@ -1410,7 +1410,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.2-beta to adapt to many kinds of systems.
\`configure' configures bash 4.2-rc1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1475,7 +1475,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of bash 4.2-beta:";;
short | recursive ) echo "Configuration of bash 4.2-rc1:";;
esac
cat <<\_ACEOF
@@ -1650,7 +1650,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
bash configure 4.2-beta
bash configure 4.2-rc1
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1664,7 +1664,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.2-beta, which was
It was created by bash $as_me 4.2-rc1, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2078,7 +2078,7 @@ ac_config_headers="$ac_config_headers config.h"
BASHVERS=4.2
RELSTATUS=beta
RELSTATUS=rc1
case "$RELSTATUS" in
alp*|bet*|dev*|rc*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
@@ -31862,7 +31862,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.2-beta, which was
This file was extended by bash $as_me 4.2-rc1, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -31925,7 +31925,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
bash config.status 4.2-beta
bash config.status 4.2-rc1
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+2 -2
View File
@@ -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.2, version 4.034])dnl
AC_REVISION([for Bash 4.2, version 4.035])dnl
define(bashvers, 4.2)
define(relstatus, beta)
define(relstatus, rc1)
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
+97 -24
View File
@@ -1,4 +1,4 @@
This is the Bash FAQ, version 4.12, for Bash version 4.1.
This is the Bash FAQ, version 4.12, for Bash version 4.2.
This document contains a set of frequently-asked questions concerning
Bash, the GNU Bourne-Again Shell. Bash is a freely-available command
@@ -36,8 +36,8 @@ A10) What is the bash `posix mode'?
Section B: The latest version
B1) What's new in version 4.1?
B2) Are there any user-visible incompatibilities between bash-4.1 and
B1) What's new in version 4.2?
B2) Are there any user-visible incompatibilities between bash-4.2 and
previous bash versions?
Section C: Differences from other Unix shells
@@ -144,26 +144,26 @@ of Case Western Reserve University.
A2) What's the latest version?
The latest version is 4.1, first made available on 31 December, 2009.
The latest version is 4.2, first made available on NN December, 2010.
A3) Where can I get it?
Bash is the GNU project's shell, and so is available from the
master GNU archive site, ftp.gnu.org, and its mirrors. The
latest version is also available for FTP from ftp.cwru.edu.
The following URLs tell how to get version 4.1:
The following URLs tell how to get version 4.2:
ftp://ftp.gnu.org/pub/gnu/bash/bash-4.1.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-4.1.tar.gz
ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-4.2.tar.gz
Formatted versions of the documentation are available with the URLs:
ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-4.1.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-4.1.tar.gz
ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-4.2.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-4.2.tar.gz
Any patches for the current version are available with the URL:
ftp://ftp.cwru.edu/pub/bash/bash-4.1-patches/
ftp://ftp.cwru.edu/pub/bash/bash-4.2-patches/
A4) On what machines will bash run?
@@ -219,7 +219,7 @@ Mark began to work with bash-2.05, but I don't know the current status.
Bash-3.0 compiles and runs with no modifications under Microsoft's Services
for Unix (SFU), once known as Interix. I do not anticipate any problems
with building bash-4.1, but will gladly accept any patches that are needed.
with building bash-4.2, but will gladly accept any patches that are needed.
A6) How can I build bash with gcc?
@@ -388,14 +388,88 @@ They are also listed in a section in the Bash Reference Manual
Section B: The latest version
B1) What's new in version 4.1?
B1) What's new in version 4.2?
Bash-4.1 is the first revision to the fourth major release of bash.
Bash-4.2 is the second revision to the fourth major release of bash.
Bash-4.1 contains the following new features (see the manual page for
complete descriptions and the CHANGES and NEWS files in the bash-4.1
Bash-4.2 contains the following new features (see the manual page for
complete descriptions and the CHANGES and NEWS files in the bash-4.2
distribution):
o `exec -a foo' now sets $0 to `foo' in an executable shell script without a
leading #!.
o Subshells begun to execute command substitutions or run shell functions or
builtins in subshells do not reset trap strings until a new trap is
specified. This allows $(trap) to display the caller's traps and the
trap strings to persist until a new trap is set.
o `trap -p' will now show signals ignored at shell startup, though their
disposition still cannot be modified.
o $'...', echo, and printf understand \uXXXX and \UXXXXXXXX escape sequences.
o declare/typeset has a new `-g' option, which creates variables in the
global scope even when run in a shell function.
o test/[/[[ have a new -v variable unary operator, which returns success if
`variable' has been set.
o Posix parsing changes to allow `! time command' and multiple consecutive
instances of `!' (which toggle) and `time' (which have no cumulative
effect).
o Posix change to allow `time' as a command by itself to print the elapsed
user, system, and real times for the shell and its children.
o $((...)) is always parsed as an arithmetic expansion first, instead of as
a potential nested command substitution, as Posix requires.
o A new FUNCNEST variable to allow the user to control the maximum shell
function nesting (recursive execution) level.
o The mapfile builtin now supplies a third argument to the callback command:
the line about to be assigned to the supplied array index.
o The printf builtin has as new %(fmt)T specifier, which allows time values
to use strftime-like formatting.
o There is a new `compat41' shell option.
o The cd builtin has a new Posix-mandated `-e' option.
o Negative subscripts to indexed arrays, previously errors, now are treated
as offsets from the maximum assigned index + 1.
o Negative length specifications in the ${var:offset:length} expansion,
previously errors, are now treated as offsets from the end of the variable.
o Parsing change to allow `time -p --'.
o Posix-mode parsing change to not recognize `time' as a keyword if the
following token begins with a `-'. This means no more Posix-mode
`time -p'. Posix interpretation 267.
o There is a new `lastpipe' shell option that runs the last command of a
pipeline in the current shell context. The lastpipe option has no
effect if job control is enabled.
o History expansion no longer expands the `$!' variable expansion.
o Posix mode shells no longer exit if a variable assignment error occurs
with an assignment preceding a command that is not a special builtin.
o Non-interactive mode shells exit if -u is enabled an an attempt is made
to use an unset variable with the % or # expansions, the `//', `^', or
`,' expansions, or the parameter length expansion.
o Posix-mode shells use the argument passed to `.' as-is if a $PATH search
fails, effectively searching the current directory. Posix-2008 change.
A short feature history dating back to Bash-2.0:
Bash-4.1 contained the following new features:
o Here-documents within $(...) command substitutions may once more be
delimited by the closing right paren, instead of requiring a newline.
@@ -502,8 +576,6 @@ o New bindable readline variable: enable-meta-key. Controls whether or not
readline sends the smm/rmm sequences if the terminal indicates it has a
meta key that enables eight-bit characters.
A short feature history dating from Bash-2.0:
Bash-4.0 contained the following new features:
o When using substring expansion on the positional parameters, a starting
@@ -901,10 +973,10 @@ grammar tighter and smaller (66 reduce-reduce conflicts gone)
lots of code now smaller and faster
test suite greatly expanded
B2) Are there any user-visible incompatibilities between bash-4.1 and
B2) Are there any user-visible incompatibilities between bash-4.2 and
previous bash versions?
There are a few incompatibilities between version 4.1 and previous
There are a few incompatibilities between version 4.2 and previous
versions. They are detailed in the file COMPAT in the bash distribution.
That file is not meant to be all-encompassing; send mail to
bash-maintainers@gnu.org (or bug-bash@gnu.org if you would like
@@ -1118,7 +1190,7 @@ C3) Which new features in ksh-93 are not in bash, and which are?
This list is current through ksh93t+ (05/05/2009)
New things in ksh-93 not in bash-4.1:
New things in ksh-93 not in bash-4.2:
floating point arithmetic and variables
math library functions
${!name[sub]} name of subscript for associative array
@@ -1140,7 +1212,7 @@ New things in ksh-93 not in bash-4.1:
`fc' has been renamed to `hist'
`.' can execute shell functions
getopts -a
printf %B, %H, %P, %R, %T, %Z modifiers, output base for %d, `=' flag
printf %B, %H, %P, %R, %Z modifiers, output base for %d, `=' flag
read -n/-N differ/-v
set -o showme/-o multiline (bash default)
`sleep' and `getconf' builtins (bash has loadable versions)
@@ -1148,16 +1220,14 @@ New things in ksh-93 not in bash-4.1:
[[ -R name ]] (checks whether or not name is a nameref)
typeset -C/-S/-T/-X/-h/-s
experimental `type' definitions (a la typedef) using typeset
negative subscripts for indexed array variables
array expansions ${array[sub1..sub2]} and ${!array[sub1..sub2]}
associative array assignments using `;' as element separator
command substitution $(n<#) expands to current byte offset for fd N
new '${ ' form of command substitution, executed in current shell
new >;/<>;/<#pat/<##pat/<#/># redirections
brace expansion printf-like formats
[[ -v var ]] operators (checks whether or not var is set)
New things in ksh-93 present in bash-4.1:
New things in ksh-93 present in bash-4.2:
associative arrays
[n]<&word- and [n]>&word- redirections (combination dup and close)
for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command
@@ -1165,6 +1235,7 @@ New things in ksh-93 present in bash-4.1:
expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]},
${!param*}
compound array assignment
negative subscripts for indexed array variables
the `!' reserved word
loadable builtins -- but ksh uses `builtin' while bash uses `enable'
new $'...' and $"..." quoting
@@ -1174,6 +1245,7 @@ New things in ksh-93 present in bash-4.1:
`command', `builtin', `disown' builtins
echo -e
exec -c/-a
printf %T modifier
read -A (bash uses read -a)
read -t/-d
trap -p
@@ -1193,6 +1265,7 @@ New things in ksh-93 present in bash-4.1:
negative offsets in ${param:offset:length}
redirection operators preceded with {varname} to store fd number in varname
DEBUG can force skipping following command
[[ -v var ]] operator (checks whether or not var is set)
Section D: Why does bash do some things differently than other Unix shells?
+3 -2
View File
@@ -1,4 +1,4 @@
This is the Bash FAQ, version 4.10, for Bash version 4.1.
This is the Bash FAQ, version 4.12, for Bash version 4.1.
This document contains a set of frequently-asked questions concerning
Bash, the GNU Bourne-Again Shell. Bash is a freely-available command
@@ -1778,7 +1778,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)
Section F: Things to watch out for on certain Unix versions
+2104 -2094
View File
File diff suppressed because it is too large Load Diff
+41 -23
View File
@@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
.\" Last Change: Fri Dec 24 16:00:06 EST 2010
.\" Last Change: Tue Dec 28 13:41:43 EST 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 December 24" "GNU Bash-4.2"
.TH BASH 1 "2010 December 28" "GNU Bash-4.2"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -693,7 +693,7 @@ Conditional operators such as \fB\-f\fP must be unquoted to be recognized
as primaries.
.if t .sp 0.5
.if n .sp 1
When used with \fB[[\fP, The \fB<\fP and \fB>\fP operators sort
When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort
lexicographically using the current locale.
.if t .sp 0.5
.if n .sp 1
@@ -1475,7 +1475,6 @@ this instance of
The values assigned to the array members are as follows:
.sp .5
.RS
.PD 0
.TP 24
.B BASH_VERSINFO[\fR0\fP]
The major version number (the \fIrelease\fP).
@@ -1496,7 +1495,6 @@ The release status (e.g., \fIbeta1\fP).
The value of
.SM
.BR MACHTYPE .
.PD
.RE
.TP
.B BASH_VERSION
@@ -1863,7 +1861,7 @@ A sample value is
.if n ".:~:/usr".
.TP
.B COLUMNS
Used by the \fBselect\fP builtin command to determine the terminal width
Used by the \fBselect\fP compound command to determine the terminal width
when printing selection lists. Automatically set upon receipt of a
.SM
.BR SIGWINCH .
@@ -2095,7 +2093,7 @@ strings preceded by a \fB$\fP.
This variable determines the locale category used for number formatting.
.TP
.B LINES
Used by the \fBselect\fP builtin command to determine the column length
Used by the \fBselect\fP compound command to determine the column length
for printing selection lists. Automatically set upon receipt of a
.SM
.BR SIGWINCH .
@@ -2276,6 +2274,7 @@ If this variable is not set, \fBbash\fP acts as if it had the
value \fB$\(aq\enreal\et%3lR\enuser\et%3lU\ensys\t%3lS\(aq\fP.
If the value is null, no timing information is displayed.
A trailing newline is added when the format string is displayed.
.PD 0
.TP
.B TMOUT
If set to a value greater than zero,
@@ -2451,6 +2450,9 @@ builtins each accept a
option to specify an indexed array and a
.B \-A
option to specify an associative array.
If both options are supplied,
.B \-A
takes precedence.
The
.B read
builtin accepts a
@@ -2675,7 +2677,7 @@ a level of variable indirection is introduced.
expanded and that value is used in the rest of the substitution, rather
than the value of \fIparameter\fP itself.
This is known as \fIindirect expansion\fP.
The exceptions to this are the expansions of ${\fB!\\fPfIprefix\fP\fB*\fP} and
The exceptions to this are the expansions of ${\fB!\fP\fIprefix\fP\fB*\fP} and
${\fB!\fP\fIname\fP[\fI@\fP]} described below.
The exclamation point must immediately follow the left brace in order to
introduce indirection.
@@ -2949,7 +2951,6 @@ array in turn, and the expansion is the resultant list.
.PP
\fICommand substitution\fP allows the output of a command to replace
the command name. There are two forms:
.PP
.RS
.PP
\fB$(\fP\fIcommand\fP\|\fB)\fP
@@ -3986,8 +3987,9 @@ Unless otherwise specified, primaries that operate on files follow symbolic
links and operate on the target of the link, rather than the link itself.
.if t .sp 0.5
.if n .sp 1
When used with \fB[[\fP, The \fB<\fP and \fB>\fP operators sort
When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort
lexicographically using the current locale.
The \fBtest\fP command sorts using ASCII ordering.
.sp 1
.PD 0
.TP
@@ -4241,7 +4243,6 @@ arguments, if any.
.SH COMMAND EXECUTION ENVIRONMENT
The shell has an \fIexecution environment\fP, which consists of the
following:
.if n .sp 1
.IP \(bu
open files inherited by the shell at invocation, as modified by
redirections supplied to the \fBexec\fP builtin
@@ -7224,10 +7225,10 @@ with the exceptions that \fB+a\fP
may not be used to destroy an array variable and \fB+r\fP will not
remove the readonly attribute.
When used in a function, makes each
\fIname\fP local, as with the
\fIname\fP local, as with the
.B local
command,
unless the \fB\-g\P option is supplied,
unless the \fB\-g\fP option is supplied,
If a variable name is followed by =\fIvalue\fP, the value of
the variable is set to \fIvalue\fP.
The return value is 0 unless an invalid option is encountered,
@@ -7794,9 +7795,10 @@ Display the description of each \fIpattern\fP in a manpage-like format
.B \-s
Display only a short usage synopsis for each \fIpattern\fP
.PD
.RE
.PP
The return status is 0 unless no command matches
.IR pattern .
.RE
.TP
\fBhistory [\fIn\fP]
.PD 0
@@ -8370,7 +8372,7 @@ times out (in which case the return code is greater than 128), or an
invalid file descriptor is supplied as the argument to \fB\-u\fP.
.RE
.TP
\fBreadonly\fP [\fB\-aApf\fP] [\fIname\fP[=\fIword\fP] ...]
\fBreadonly\fP [\fB\-aAf\fP] [\fB\-p\fP] [\fIname\fP[=\fIword\fP] ...]
.PD
The given
\fInames\fP are marked readonly; the values of these
@@ -8386,11 +8388,16 @@ The
option restricts the variables to indexed arrays; the
.B \-A
option restricts the variables to associative arrays.
If both options are supplied,
.B \-A
takes precedence.
If no
.I name
arguments are given, or if the
.B \-p
option is supplied, a list of all readonly names is printed.
The other options may be used to restrict the output to a subset of
the set of readonly names.
The
.B \-p
option causes output to be displayed in a format that
@@ -8910,24 +8917,29 @@ easy re-editing of multi-line commands.
If set,
.B bash
changes its behavior to that of version 3.1 with respect to quoted
arguments to the conditional command's \fB=~\fP operator.
arguments to the \fB[[\fP conditional command's \fB=~\fP operator.
.TP 8
.B compat32
If set,
.B bash
changes its behavior to that of version 3.2 with respect to locale-specific
string comparison when using the conditional command's \fB<\fP and \fB>\fP
operators.
string comparison when using the \fB[[\fP
conditional command's \fB<\fP and \fB>\fP operators.
Bash versions prior to bash-4.1 use ASCII collation and
.IR strcmp (3);
bash-4.1 and later
use the current locale's collation sequence and
.IR strcoll (3).
.TP 8
.B compat40
If set,
.B bash
changes its behavior to that of version 4.0 with respect to locale-specific
string comparison when using the conditional command's \fB<\fP and \fB>\fP
operators and the effect of interrupting a command list.
string comparison when using the \fB[[\fP
conditional command's \fB<\fP and \fB>\fP operators (see previous item)
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
@@ -9030,7 +9042,7 @@ This option is enabled by default.
.TP 8
.B globstar
If set, the pattern \fB**\fP used in a pathname expansion context will
match a files and zero or more directories and subdirectories.
match all files and zero or more directories and subdirectories.
If the pattern is followed by a \fB/\fP, only directories and
subdirectories match.
.TP 8
@@ -9181,6 +9193,7 @@ This option is enabled by default.
If set, the \fBecho\fP builtin expands backslash-escape sequences
by default.
.RE
.PD
.TP
\fBsuspend\fP [\fB\-f\fP]
Suspend the execution of this shell until it receives a
@@ -9288,6 +9301,11 @@ precedence using the rules listed above.
5 or more arguments
The expression is parsed and evaluated according to precedence
using the rules listed above.
.if t .sp 0.5
.if n .sp 1
.LP
When used with \fBtest\fP or \fB[\fP, the \fB<\fP and \fB>\fP operators
sort lexicographically using ASCII ordering.
.RE
.PD
.TP
@@ -9867,7 +9885,7 @@ it provides for filing a bug report.
.PP
Comments and bug reports concerning
this manual page should be directed to
.IR chet@po.cwru.edu .
.IR chet.ramey@case.edu .
.SH BUGS
.PP
It's too big and too slow.
+41 -22
View File
@@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
.\" Last Change: Fri Dec 24 16:00:06 EST 2010
.\" Last Change: Tue Dec 28 13:41:43 EST 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 December 24" "GNU Bash-4.2"
.TH BASH 1 "2010 December 28" "GNU Bash-4.2"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -693,7 +693,7 @@ Conditional operators such as \fB\-f\fP must be unquoted to be recognized
as primaries.
.if t .sp 0.5
.if n .sp 1
When used with \fB[[\fP, The \fB<\fP and \fB>\fP operators sort
When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort
lexicographically using the current locale.
.if t .sp 0.5
.if n .sp 1
@@ -1475,7 +1475,6 @@ this instance of
The values assigned to the array members are as follows:
.sp .5
.RS
.PD 0
.TP 24
.B BASH_VERSINFO[\fR0\fP]
The major version number (the \fIrelease\fP).
@@ -1496,7 +1495,6 @@ The release status (e.g., \fIbeta1\fP).
The value of
.SM
.BR MACHTYPE .
.PD
.RE
.TP
.B BASH_VERSION
@@ -1863,7 +1861,7 @@ A sample value is
.if n ".:~:/usr".
.TP
.B COLUMNS
Used by the \fBselect\fP builtin command to determine the terminal width
Used by the \fBselect\fP compound command to determine the terminal width
when printing selection lists. Automatically set upon receipt of a
.SM
.BR SIGWINCH .
@@ -2095,7 +2093,7 @@ strings preceded by a \fB$\fP.
This variable determines the locale category used for number formatting.
.TP
.B LINES
Used by the \fBselect\fP builtin command to determine the column length
Used by the \fBselect\fP compound command to determine the column length
for printing selection lists. Automatically set upon receipt of a
.SM
.BR SIGWINCH .
@@ -2276,6 +2274,7 @@ If this variable is not set, \fBbash\fP acts as if it had the
value \fB$\(aq\enreal\et%3lR\enuser\et%3lU\ensys\t%3lS\(aq\fP.
If the value is null, no timing information is displayed.
A trailing newline is added when the format string is displayed.
.PD 0
.TP
.B TMOUT
If set to a value greater than zero,
@@ -2451,6 +2450,9 @@ builtins each accept a
option to specify an indexed array and a
.B \-A
option to specify an associative array.
If both options are supplied,
.B \-A
takes precedence.
The
.B read
builtin accepts a
@@ -2675,7 +2677,7 @@ a level of variable indirection is introduced.
expanded and that value is used in the rest of the substitution, rather
than the value of \fIparameter\fP itself.
This is known as \fIindirect expansion\fP.
The exceptions to this are the expansions of ${\fB!\\fPfIprefix\fP\fB*\fP} and
The exceptions to this are the expansions of ${\fB!\fP\fIprefix\fP\fB*\fP} and
${\fB!\fP\fIname\fP[\fI@\fP]} described below.
The exclamation point must immediately follow the left brace in order to
introduce indirection.
@@ -2949,7 +2951,6 @@ array in turn, and the expansion is the resultant list.
.PP
\fICommand substitution\fP allows the output of a command to replace
the command name. There are two forms:
.PP
.RS
.PP
\fB$(\fP\fIcommand\fP\|\fB)\fP
@@ -3296,6 +3297,7 @@ and
the syntax \fB[.\fP\fIsymbol\fP\fB.]\fP matches the collating symbol
\fIsymbol\fP.
.RE
.RE
.PD
.PP
If the \fBextglob\fP shell option is enabled using the \fBshopt\fP
@@ -3985,8 +3987,9 @@ Unless otherwise specified, primaries that operate on files follow symbolic
links and operate on the target of the link, rather than the link itself.
.if t .sp 0.5
.if n .sp 1
When used with \fB[[\fP, The \fB<\fP and \fB>\fP operators sort
When used with \fB[[\fP, the \fB<\fP and \fB>\fP operators sort
lexicographically using the current locale.
The \fBtest\fP command sorts using ASCII ordering.
.sp 1
.PD 0
.TP
@@ -4240,7 +4243,6 @@ arguments, if any.
.SH COMMAND EXECUTION ENVIRONMENT
The shell has an \fIexecution environment\fP, which consists of the
following:
.if n .sp 1
.IP \(bu
open files inherited by the shell at invocation, as modified by
redirections supplied to the \fBexec\fP builtin
@@ -7223,10 +7225,10 @@ with the exceptions that \fB+a\fP
may not be used to destroy an array variable and \fB+r\fP will not
remove the readonly attribute.
When used in a function, makes each
\fIname\fP local, as with the
\fIname\fP local, as with the
.B local
command,
unless the \fB\-g\P option is supplied,
unless the \fB\-g\fP option is supplied,
If a variable name is followed by =\fIvalue\fP, the value of
the variable is set to \fIvalue\fP.
The return value is 0 unless an invalid option is encountered,
@@ -7793,9 +7795,10 @@ Display the description of each \fIpattern\fP in a manpage-like format
.B \-s
Display only a short usage synopsis for each \fIpattern\fP
.PD
.RE
.PP
The return status is 0 unless no command matches
.IR pattern .
.RE
.TP
\fBhistory [\fIn\fP]
.PD 0
@@ -8369,7 +8372,7 @@ times out (in which case the return code is greater than 128), or an
invalid file descriptor is supplied as the argument to \fB\-u\fP.
.RE
.TP
\fBreadonly\fP [\fB\-aApf\fP] [\fIname\fP[=\fIword\fP] ...]
\fBreadonly\fP [\fB\-aAf\fP] [\fB\-p\fP] [\fIname\fP[=\fIword\fP] ...]
.PD
The given
\fInames\fP are marked readonly; the values of these
@@ -8385,11 +8388,16 @@ The
option restricts the variables to indexed arrays; the
.B \-A
option restricts the variables to associative arrays.
If both options are supplied,
.B \-A
takes precedence.
If no
.I name
arguments are given, or if the
.B \-p
option is supplied, a list of all readonly names is printed.
The other options may be used to restrict the output to a subset of
the set of readonly names.
The
.B \-p
option causes output to be displayed in a format that
@@ -8909,24 +8917,29 @@ easy re-editing of multi-line commands.
If set,
.B bash
changes its behavior to that of version 3.1 with respect to quoted
arguments to the conditional command's \fB=~\fP operator.
arguments to the \fB[[\fP conditional command's \fB=~\fP operator.
.TP 8
.B compat32
If set,
.B bash
changes its behavior to that of version 3.2 with respect to locale-specific
string comparison when using the conditional command's \fB<\fP and \fB>\fP
operators.
string comparison when using the \fB[[\fP
conditional command's \fB<\fP and \fB>\fP operators.
Bash versions prior to bash-4.1 use ASCII collation and
.IR strcmp (3);
bash-4.1 and later
use the current locale's collation sequence and
.IR strcoll (3).
.TP 8
.B compat40
If set,
.B bash
changes its behavior to that of version 4.0 with respect to locale-specific
string comparison when using the conditional command's \fB<\fP and \fB>\fP
operators and the effect of interrupting a command list.
string comparison when using the \fB[[\fP
conditional command's \fB<\fP and \fB>\fP operators (see previous item)
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
@@ -9029,7 +9042,7 @@ This option is enabled by default.
.TP 8
.B globstar
If set, the pattern \fB**\fP used in a pathname expansion context will
match a files and zero or more directories and subdirectories.
match all files and zero or more directories and subdirectories.
If the pattern is followed by a \fB/\fP, only directories and
subdirectories match.
.TP 8
@@ -9180,6 +9193,7 @@ This option is enabled by default.
If set, the \fBecho\fP builtin expands backslash-escape sequences
by default.
.RE
.PD
.TP
\fBsuspend\fP [\fB\-f\fP]
Suspend the execution of this shell until it receives a
@@ -9287,6 +9301,11 @@ precedence using the rules listed above.
5 or more arguments
The expression is parsed and evaluated according to precedence
using the rules listed above.
.if t .sp 0.5
.if n .sp 1
.LP
When used with \fBtest\fP or \fB[\fP, the \fB<\fP and \fB>\fP operators
sort lexicographically using ASCII ordering.
.RE
.PD
.TP
+40 -23
View File
@@ -3,7 +3,7 @@
</HEAD>
<BODY><TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2010 December 6<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2010 December 28<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<BR><A HREF="#index">Index</A>
@@ -915,7 +915,7 @@ as primaries.
<P>
When used with <B>[[</B>, The <B>&lt;</B> and <B>&gt;</B> operators sort
When used with <B>[[</B>, the <B>&lt;</B> and <B>&gt;</B> operators sort
lexicographically using the current locale.
<P>
@@ -1126,26 +1126,23 @@ the corresponding <B>then</B> <I>list</I> is executed and the
command completes. Otherwise, the <B>else</B> <I>list</I> is
executed, if present. The exit status is the exit status of the
last command executed, or zero if no condition tested true.
<DT><B>while</B> <I>list</I>; <B>do</B> <I>list</I>; <B>done</B><DD>
<DT><B>while</B> <I>list-1</I>; <B>do</B> <I>list-2</I>; <B>done</B><DD>
<DT><B>until</B> <I>list</I>; <B>do</B> <I>list</I>; <B>done</B><DD>
<DT><B>until</B> <I>list-1</I>; <B>do</B> <I>list-2</I>; <B>done</B><DD>
The <B>while</B> command continuously executes the <B>do</B>
<I>list</I> as long as the last command in <I>list</I> returns
The <B>while</B> command continuously executes the list
<I>list-2</I> as long as the last command in the list <I>list-1</I> returns
an exit status of zero. The <B>until</B> command is identical
to the <B>while</B> command, except that the test is negated;
the
<B>do</B>
<I>list</I>
<I>list-2</I>
is executed as long as the last command in
<I>list</I>
<I>list-1</I>
returns a non-zero exit status.
The exit status of the <B>while</B> and <B>until</B> commands
is the exit status
of the last <B>do</B> <I>list</I> command executed, or zero if
of the last command executed in <I>list-2</I>, or zero if
none was executed.
</DL>
<A NAME="lbAP">&nbsp;</A>
@@ -2399,7 +2396,7 @@ A sample value is
<DT><B>COLUMNS</B>
<DD>
Used by the <B>select</B> builtin command to determine the terminal width
Used by the <B>select</B> compound command to determine the terminal width
when printing selection lists. Automatically set upon receipt of a
<FONT SIZE=-1><B>SIGWINCH</B>.
@@ -2692,7 +2689,7 @@ This variable determines the locale category used for number formatting.
<DT><B>LINES</B>
<DD>
Used by the <B>select</B> builtin command to determine the column length
Used by the <B>select</B> compound command to determine the column length
for printing selection lists. Automatically set upon receipt of a
<FONT SIZE=-1><B>SIGWINCH</B>.
@@ -4104,6 +4101,7 @@ The special pattern characters have the following meanings:
<P>
<DL COMPACT><DT><DD>
<DL COMPACT>
<DT><B>*</B>
@@ -4210,6 +4208,8 @@ the syntax <B>[.</B><I>symbol</I><B>.]</B> matches the collating symbol
<I>symbol</I>.
</DL>
</DL>
<P>
@@ -5140,8 +5140,9 @@ links and operate on the target of the link, rather than the link itself.
<P>
When used with <B>[[</B>, The <B>&lt;</B> and <B>&gt;</B> operators sort
When used with <B>[[</B>, the <B>&lt;</B> and <B>&gt;</B> operators sort
lexicographically using the current locale.
The <B>test</B> command sorts using ASCII ordering.
<P>
<DL COMPACT>
@@ -11401,7 +11402,7 @@ If set,
<B>bash</B>
changes its behavior to that of version 3.1 with respect to quoted
arguments to the conditional command's <B>=~</B> operator.
arguments to the <B>[[</B> conditional command's <B>=~</B> operator.
<DT><B>compat32</B>
<DD>
@@ -11409,8 +11410,15 @@ If set,
<B>bash</B>
changes its behavior to that of version 3.2 with respect to locale-specific
string comparison when using the conditional command's <B>&lt;</B> and <B>&gt;</B>
operators.
string comparison when using the <B>[[</B>
conditional command's <B>&lt;</B> and <B>&gt;</B> operators.
Bash versions prior to bash-4.1 use ASCII collation and
<I>strcmp</I>(3);
bash-4.1 and later
use the current locale's collation sequence and
<I>strcoll</I>(3).
<DT><B>compat40</B>
<DD>
@@ -11418,8 +11426,9 @@ If set,
<B>bash</B>
changes its behavior to that of version 4.0 with respect to locale-specific
string comparison when using the conditional command's <B>&lt;</B> and <B>&gt;</B>
operators and the effect of interrupting a command list.
string comparison when using the <B>[[</B>
conditional command's <B>&lt;</B> and <B>&gt;</B> operators (see previous item)
and the effect of interrupting a command list.
<DT><B>compat41</B>
<DD>
@@ -11865,7 +11874,15 @@ precedence using the rules listed above.
<DT>5 or more arguments<DD>
The expression is parsed and evaluated according to precedence
using the rules listed above.
</DL></DL>
<P>
</DL>
<P>
When used with <B>test</B> or <B>[</B>, the <B>&lt;</B> and <B>&gt;</B> operators
sort lexicographically using ASCII ordering.
</DL>
<DT><B>times</B>
@@ -12674,7 +12691,7 @@ There may be only one active coprocess at a time.
<HR>
<TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>GNU Bash-4.2<TH ALIGN=CENTER width=33%>2010 December 6<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>GNU Bash-4.2<TH ALIGN=CENTER width=33%>2010 December 28<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<HR>
@@ -12780,6 +12797,6 @@ There may be only one active coprocess at a time.
</DL>
<HR>
This document was created by man2html from bash.1.<BR>
Time: 07 December 2010 16:12:47 EST
Time: 28 December 2010 14:30:29 EST
</BODY>
</HTML>
BIN
View File
Binary file not shown.
+4356 -4348
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -20,11 +20,11 @@
\entry{umask}{43}{\code {umask}}
\entry{unset}{43}{\code {unset}}
\entry{alias}{43}{\code {alias}}
\entry{bind}{43}{\code {bind}}
\entry{bind}{44}{\code {bind}}
\entry{builtin}{45}{\code {builtin}}
\entry{caller}{45}{\code {caller}}
\entry{command}{45}{\code {command}}
\entry{declare}{45}{\code {declare}}
\entry{declare}{46}{\code {declare}}
\entry{echo}{47}{\code {echo}}
\entry{enable}{48}{\code {enable}}
\entry{help}{48}{\code {help}}
+2 -2
View File
@@ -8,7 +8,7 @@
\entry {\code {alias}}{43}
\initial {B}
\entry {\code {bg}}{92}
\entry {\code {bind}}{43}
\entry {\code {bind}}{44}
\entry {\code {break}}{37}
\entry {\code {builtin}}{45}
\initial {C}
@@ -20,7 +20,7 @@
\entry {\code {compopt}}{122}
\entry {\code {continue}}{38}
\initial {D}
\entry {\code {declare}}{45}
\entry {\code {declare}}{46}
\entry {\code {dirs}}{83}
\entry {\code {disown}}{93}
\initial {E}
BIN
View File
Binary file not shown.
+23 -15
View File
@@ -1,6 +1,6 @@
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on December, 7 2010 by texi2html 1.64 -->
<!-- Created on December, 28 2010 by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
@@ -33,10 +33,10 @@ Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
<H1>Bash Reference Manual</H1></P><P>
This text is a brief description of the features that are present in
the Bash shell (version 4.2, 20 October 2010).
the Bash shell (version 4.2, 28 December 2010).
</P><P>
This is Edition 4.2, last updated 20 October 2010,
This is Edition 4.2, last updated 28 December 2010,
of <CITE>The GNU Bash Reference Manual</CITE>,
for <CODE>Bash</CODE>, Version 4.2.
</P><P>
@@ -1338,7 +1338,7 @@ Conditional operators such as <SAMP>`-f'</SAMP> must be unquoted to be recognize
as primaries.
</P><P>
When used with <SAMP>`[['</SAMP>, The <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP> operators sort
When used with <SAMP>`[['</SAMP>, the <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP> operators sort
lexicographically using the current locale.
</P><P>
@@ -4316,6 +4316,10 @@ using the rules listed above.
</DL>
<P>
When used with <CODE>test</CODE> or <SAMP>`['</SAMP>, the <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP>
operators sort lexicographically using ASCII ordering.
</P><P>
<DT><CODE>times</CODE>
<DD><A NAME="IDX85"></A>
<TABLE><tr><td>&nbsp;</td><td class=example><pre>times
@@ -5766,15 +5770,18 @@ arguments to the conditional command's <SAMP>`=~'</SAMP> operator.
<DT><CODE>compat32</CODE>
<DD>If set, Bash
changes its behavior to that of version 3.2 with respect to locale-specific
string comparison when using the conditional command's <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP>
operators.
string comparison when using the <SAMP>`[['</SAMP>
conditional command's <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP> operators.
Bash versions prior to bash-4.0 use ASCII collation and strcmp(3);
bash-4.1 and later use the current locale's collation sequence and strcoll(3).
<P>
<DT><CODE>compat40</CODE>
<DD>If set, Bash
changes its behavior to that of version 4.0 with respect to locale-specific
string comparison when using the conditional command's <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP>
operators and the effect of interrupting a command list.
string comparison when using the <SAMP>`[['</SAMP>
conditional command's <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP> operators (see previous item)
and the effect of interrupting a command list.
<P>
<DT><CODE>compat41</CODE>
@@ -6438,7 +6445,7 @@ being closed.
<A NAME="IDX166"></A>
<DT><CODE>COLUMNS</CODE>
<DD><A NAME="IDX167"></A>
Used by the <CODE>select</CODE> builtin command to determine the terminal width
Used by the <CODE>select</CODE> command to determine the terminal width
when printing selection lists. Automatically set upon receipt of a
<CODE>SIGWINCH</CODE>.
<P>
@@ -6849,7 +6856,7 @@ The line number in the script or shell function currently executing.
<A NAME="IDX246"></A>
<DT><CODE>LINES</CODE>
<DD><A NAME="IDX247"></A>
Used by the <CODE>select</CODE> builtin command to determine the column length
Used by the <CODE>select</CODE> command to determine the column length
for printing selection lists. Automatically set upon receipt of a
<CODE>SIGWINCH</CODE>.
<P>
@@ -7791,8 +7798,9 @@ If the <VAR>file</VAR> argument to one of the primaries is one of
descriptor 0, 1, or 2, respectively, is checked.
</P><P>
When used with <SAMP>`[['</SAMP>, The <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP> operators sort
When used with <SAMP>`[['</SAMP>, the <SAMP>`&#60;'</SAMP> and <SAMP>`&#62;'</SAMP> operators sort
lexicographically using the current locale.
The <CODE>test</CODE> command uses ASCII ordering.
</P><P>
Unless otherwise specified, primaries that operate on files follow symbolic
@@ -13287,8 +13295,8 @@ when called as <CODE>rbash</CODE>, enters a restricted mode. See
<P>
<DT><CODE>--enable-select</CODE>
<DD>Include the <CODE>select</CODE> builtin, which allows the generation of simple
menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
<DD>Include the <CODE>select</CODE> compound command, which allows the generation of
simple menus (see section <A HREF="bashref.html#SEC21">3.2.4.2 Conditional Constructs</A>).
<P>
<DT><CODE>--enable-separate-helpfiles</CODE>
@@ -16372,7 +16380,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>December, 7 2010</I>
This document was generated by <I>Chet Ramey</I> on <I>December, 28 2010</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
<P></P>
@@ -16534,7 +16542,7 @@ the following structure:
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Chet Ramey</I> on <I>December, 7 2010</I>
by <I>Chet Ramey</I> on <I>December, 28 2010</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
+156 -149
View File
@@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 4.13 from
/Users/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.2, 20 October 2010).
the Bash shell (version 4.2, 28 December 2010).
This is Edition 4.2, last updated 20 October 2010, of `The GNU Bash
This is Edition 4.2, last updated 28 December 2010, of `The GNU Bash
Reference Manual', for `Bash', Version 4.2.
Copyright (C) 1988-2010 Free Software Foundation, Inc.
@@ -38,9 +38,9 @@ Bash Features
*************
This text is a brief description of the features that are present in
the Bash shell (version 4.2, 20 October 2010).
the Bash shell (version 4.2, 28 December 2010).
This is Edition 4.2, last updated 20 October 2010, of `The GNU Bash
This is Edition 4.2, last updated 28 December 2010, of `The GNU Bash
Reference Manual', for `Bash', Version 4.2.
Bash contains features that appear in other popular shells, and some
@@ -876,7 +876,7 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre
performed. Conditional operators such as `-f' must be unquoted to
be recognized as primaries.
When used with `[[', The `<' and `>' operators sort
When used with `[[', the `<' and `>' operators sort
lexicographically using the current locale.
When the `==' and `!=' operators are used, the string to the right
@@ -2799,6 +2799,9 @@ standard.
The expression is parsed and evaluated according to precedence
using the rules listed above.
When used with `test' or `[', the `<' and `>' operators sort
lexicographically using ASCII ordering.
`times'
times
Print out the user and system times used by the shell and its
@@ -3919,13 +3922,16 @@ This builtin allows you to change additional shell optional behavior.
`compat32'
If set, Bash changes its behavior to that of version 3.2 with
respect to locale-specific string comparison when using the
conditional command's `<' and `>' operators.
`[[' conditional command's `<' and `>' operators. Bash
versions prior to bash-4.0 use ASCII collation and strcmp(3);
bash-4.1 and later use the current locale's collation
sequence and strcoll(3).
`compat40'
If set, Bash 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.
`[[' conditional command's `<' and `>' operators (see
previous item) and the effect of interrupting a command list.
`compat41'
If set, Bash, when in posix mode, treats a single quote in a
@@ -4363,9 +4369,9 @@ Variables::).
unsetting it will result in the standard error being closed.
`COLUMNS'
Used by the `select' builtin command to determine the terminal
width when printing selection lists. Automatically set upon
receipt of a `SIGWINCH'.
Used by the `select' command to determine the terminal width when
printing selection lists. Automatically set upon receipt of a
`SIGWINCH'.
`COMP_CWORD'
An index into `${COMP_WORDS}' of the word containing the current
@@ -4635,8 +4641,8 @@ Variables::).
executing.
`LINES'
Used by the `select' builtin command to determine the column length
for printing selection lists. Automatically set upon receipt of a
Used by the `select' command to determine the column length for
printing selection lists. Automatically set upon receipt of a
`SIGWINCH'.
`MACHTYPE'
@@ -5239,8 +5245,9 @@ checked. If the FILE argument to one of the primaries is one of
`/dev/stdin', `/dev/stdout', or `/dev/stderr', file descriptor 0, 1, or
2, respectively, is checked.
When used with `[[', The `<' and `>' operators sort
lexicographically using the current locale.
When used with `[[', the `<' and `>' operators sort
lexicographically using the current locale. The `test' command uses
ASCII ordering.
Unless otherwise specified, primaries that operate on files follow
symbolic links and operate on the target of the link, rather than the
@@ -8928,8 +8935,8 @@ does not provide the necessary support.
The Restricted Shell::, for a description of restricted mode.
`--enable-select'
Include the `select' builtin, which allows the generation of simple
menus (*note Conditional Constructs::).
Include the `select' compound command, which allows the generation
of simple menus (*note Conditional Constructs::).
`--enable-separate-helpfiles'
Use external files for the documentation displayed by the `help'
@@ -9954,17 +9961,17 @@ D.1 Index of Shell Builtin Commands
* test: Bourne Shell Builtins.
(line 217)
* times: Bourne Shell Builtins.
(line 287)
(line 290)
* trap: Bourne Shell Builtins.
(line 292)
(line 295)
* type: Bash Builtins. (line 539)
* typeset: Bash Builtins. (line 570)
* ulimit: Bash Builtins. (line 576)
* umask: Bourne Shell Builtins.
(line 338)
(line 341)
* unalias: Bash Builtins. (line 665)
* unset: Bourne Shell Builtins.
(line 355)
(line 358)
* wait: Job Control Builtins.
(line 73)
@@ -10467,133 +10474,133 @@ D.5 Concept Index

Tag Table:
Node: Top1344
Node: Introduction3181
Node: What is Bash?3409
Node: What is a shell?4522
Node: Definitions7062
Node: Basic Shell Features9980
Node: Shell Syntax11199
Node: Shell Operation12229
Node: Quoting13523
Node: Escape Character14826
Node: Single Quotes15311
Node: Double Quotes15659
Node: ANSI-C Quoting16784
Node: Locale Translation18028
Node: Comments18924
Node: Shell Commands19542
Node: Simple Commands20414
Node: Pipelines21045
Node: Lists23739
Node: Compound Commands25468
Node: Looping Constructs26272
Node: Conditional Constructs28731
Node: Command Grouping36844
Node: Coprocesses38323
Node: GNU Parallel39988
Node: Shell Functions42456
Node: Shell Parameters47400
Node: Positional Parameters49816
Node: Special Parameters50716
Node: Shell Expansions53680
Node: Brace Expansion55605
Node: Tilde Expansion58360
Node: Shell Parameter Expansion60711
Node: Command Substitution69846
Node: Arithmetic Expansion71179
Node: Process Substitution72029
Node: Word Splitting73079
Node: Filename Expansion74702
Node: Pattern Matching76841
Node: Quote Removal80480
Node: Redirections80775
Node: Executing Commands89300
Node: Simple Command Expansion89970
Node: Command Search and Execution91900
Node: Command Execution Environment94237
Node: Environment97223
Node: Exit Status98883
Node: Signals100504
Node: Shell Scripts102472
Node: Shell Builtin Commands104990
Node: Bourne Shell Builtins107018
Node: Bash Builtins124836
Node: Modifying Shell Behavior151050
Node: The Set Builtin151395
Node: The Shopt Builtin160929
Node: Special Builtins172894
Node: Shell Variables173873
Node: Bourne Shell Variables174313
Node: Bash Variables176340
Node: Bash Features201265
Node: Invoking Bash202148
Node: Bash Startup Files207912
Node: Interactive Shells212933
Node: What is an Interactive Shell?213343
Node: Is this Shell Interactive?213992
Node: Interactive Shell Behavior214807
Node: Bash Conditional Expressions218087
Node: Shell Arithmetic221835
Node: Aliases224594
Node: Arrays227166
Node: The Directory Stack231281
Node: Directory Stack Builtins231995
Node: Printing a Prompt234887
Node: The Restricted Shell237639
Node: Bash POSIX Mode239471
Node: Job Control248132
Node: Job Control Basics248592
Node: Job Control Builtins253309
Node: Job Control Variables257673
Node: Command Line Editing258831
Node: Introduction and Notation260398
Node: Readline Interaction262020
Node: Readline Bare Essentials263211
Node: Readline Movement Commands265000
Node: Readline Killing Commands265965
Node: Readline Arguments267885
Node: Searching268929
Node: Readline Init File271115
Node: Readline Init File Syntax272262
Node: Conditional Init Constructs287604
Node: Sample Init File290137
Node: Bindable Readline Commands293254
Node: Commands For Moving294461
Node: Commands For History295605
Node: Commands For Text299040
Node: Commands For Killing301713
Node: Numeric Arguments304170
Node: Commands For Completion305309
Node: Keyboard Macros309501
Node: Miscellaneous Commands310072
Node: Readline vi Mode315878
Node: Programmable Completion316785
Node: Programmable Completion Builtins323995
Node: Using History Interactively333131
Node: Bash History Facilities333815
Node: Bash History Builtins336729
Node: History Interaction340586
Node: Event Designators343291
Node: Word Designators344513
Node: Modifiers346152
Node: Installing Bash347556
Node: Basic Installation348693
Node: Compilers and Options351385
Node: Compiling For Multiple Architectures352126
Node: Installation Names353790
Node: Specifying the System Type354608
Node: Sharing Defaults355324
Node: Operation Controls355997
Node: Optional Features356955
Node: Reporting Bugs366514
Node: Major Differences From The Bourne Shell367715
Node: GNU Free Documentation License384402
Node: Indexes409598
Node: Builtin Index410052
Node: Reserved Word Index416879
Node: Variable Index419327
Node: Function Index432422
Node: Concept Index439431
Node: Top1346
Node: Introduction3185
Node: What is Bash?3413
Node: What is a shell?4526
Node: Definitions7066
Node: Basic Shell Features9984
Node: Shell Syntax11203
Node: Shell Operation12233
Node: Quoting13527
Node: Escape Character14830
Node: Single Quotes15315
Node: Double Quotes15663
Node: ANSI-C Quoting16788
Node: Locale Translation18032
Node: Comments18928
Node: Shell Commands19546
Node: Simple Commands20418
Node: Pipelines21049
Node: Lists23743
Node: Compound Commands25472
Node: Looping Constructs26276
Node: Conditional Constructs28735
Node: Command Grouping36848
Node: Coprocesses38327
Node: GNU Parallel39992
Node: Shell Functions42460
Node: Shell Parameters47404
Node: Positional Parameters49820
Node: Special Parameters50720
Node: Shell Expansions53684
Node: Brace Expansion55609
Node: Tilde Expansion58364
Node: Shell Parameter Expansion60715
Node: Command Substitution69850
Node: Arithmetic Expansion71183
Node: Process Substitution72033
Node: Word Splitting73083
Node: Filename Expansion74706
Node: Pattern Matching76845
Node: Quote Removal80484
Node: Redirections80779
Node: Executing Commands89304
Node: Simple Command Expansion89974
Node: Command Search and Execution91904
Node: Command Execution Environment94241
Node: Environment97227
Node: Exit Status98887
Node: Signals100508
Node: Shell Scripts102476
Node: Shell Builtin Commands104994
Node: Bourne Shell Builtins107022
Node: Bash Builtins124952
Node: Modifying Shell Behavior151166
Node: The Set Builtin151511
Node: The Shopt Builtin161045
Node: Special Builtins173217
Node: Shell Variables174196
Node: Bourne Shell Variables174636
Node: Bash Variables176663
Node: Bash Features201572
Node: Invoking Bash202455
Node: Bash Startup Files208219
Node: Interactive Shells213240
Node: What is an Interactive Shell?213650
Node: Is this Shell Interactive?214299
Node: Interactive Shell Behavior215114
Node: Bash Conditional Expressions218394
Node: Shell Arithmetic222183
Node: Aliases224942
Node: Arrays227514
Node: The Directory Stack231629
Node: Directory Stack Builtins232343
Node: Printing a Prompt235235
Node: The Restricted Shell237987
Node: Bash POSIX Mode239819
Node: Job Control248480
Node: Job Control Basics248940
Node: Job Control Builtins253657
Node: Job Control Variables258021
Node: Command Line Editing259179
Node: Introduction and Notation260746
Node: Readline Interaction262368
Node: Readline Bare Essentials263559
Node: Readline Movement Commands265348
Node: Readline Killing Commands266313
Node: Readline Arguments268233
Node: Searching269277
Node: Readline Init File271463
Node: Readline Init File Syntax272610
Node: Conditional Init Constructs287952
Node: Sample Init File290485
Node: Bindable Readline Commands293602
Node: Commands For Moving294809
Node: Commands For History295953
Node: Commands For Text299388
Node: Commands For Killing302061
Node: Numeric Arguments304518
Node: Commands For Completion305657
Node: Keyboard Macros309849
Node: Miscellaneous Commands310420
Node: Readline vi Mode316226
Node: Programmable Completion317133
Node: Programmable Completion Builtins324343
Node: Using History Interactively333479
Node: Bash History Facilities334163
Node: Bash History Builtins337077
Node: History Interaction340934
Node: Event Designators343639
Node: Word Designators344861
Node: Modifiers346500
Node: Installing Bash347904
Node: Basic Installation349041
Node: Compilers and Options351733
Node: Compiling For Multiple Architectures352474
Node: Installation Names354138
Node: Specifying the System Type354956
Node: Sharing Defaults355672
Node: Operation Controls356345
Node: Optional Features357303
Node: Reporting Bugs366871
Node: Major Differences From The Bourne Shell368072
Node: GNU Free Documentation License384759
Node: Indexes409955
Node: Builtin Index410409
Node: Reserved Word Index417236
Node: Variable Index419684
Node: Function Index432779
Node: Concept Index439788

End Tag Table
+11 -11
View File
@@ -1,4 +1,4 @@
This is TeX, Version 3.141592 (Web2C 7.5.4) (format=tex 2008.12.11) 7 DEC 2010 16:12
This is TeX, Version 3.141592 (Web2C 7.5.4) (format=tex 2008.12.11) 28 DEC 2010 14:30
**/Users/chet/src/bash/src/doc/bashref.texi
(/Users/chet/src/bash/src/doc/bashref.texi (./texinfo.tex
Loading texinfo [version 2009-01-18.17]:
@@ -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 3411--3424
Underfull \hbox (badness 5231) in paragraph at lines 3414--3427
@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 3869--3869
Overfull \hbox (172.34125pt too wide) in paragraph at lines 3872--3872
[]@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 5487--5487
Overfull \hbox (51.96864pt too wide) in paragraph at lines 5493--5493
[]@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 5488--5488
Overfull \hbox (76.23077pt too wide) in paragraph at lines 5494--5494
[]@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 5488--5488
.etc.
Overfull \hbox (34.72258pt too wide) in paragraph at lines 5489--5489
Overfull \hbox (34.72258pt too wide) in paragraph at lines 5495--5495
[]@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 5662--5664
Underfull \hbox (badness 2245) in paragraph at lines 5668--5670
[]@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 6831--6834
Underfull \hbox (badness 2521) in paragraph at lines 6838--6841
@textrm `@texttt --enable-strict-posix-default[]@textrm '[] to @texttt configur
e[] @textrm when build-ing (see Sec-tion 10.8
@@ -382,7 +382,7 @@ Underfull \hbox (badness 2753) in paragraph at lines 1929--1932
[121] [122]) (/Users/chet/src/bash/src/lib/readline/doc/hsuser.texi Chapter 9
[123] [124] [125] [126] [127] [128]) Chapter 10 [129] [130] [131] [132]
[133]
Underfull \hbox (badness 2772) in paragraph at lines 7432--7436
Underfull \hbox (badness 2772) in paragraph at lines 7439--7443
[]@textrm Enable sup-port for large files (@texttt http://www.sas.com/standard
s/large_
@@ -402,10 +402,10 @@ s/large_
Here is how much of TeX's memory you used:
2081 strings out of 97980
28558 string characters out of 1221004
65620 words of memory out of 1500000
65622 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
Output written on bashref.dvi (168 pages, 679664 bytes).
Output written on bashref.dvi (168 pages, 680092 bytes).
BIN
View File
Binary file not shown.
+452 -442
View File
File diff suppressed because it is too large Load Diff
+24 -13
View File
@@ -995,7 +995,7 @@ substitution, and quote removal are performed.
Conditional operators such as @samp{-f} must be unquoted to be recognized
as primaries.
When used with @samp{[[}, The @samp{<} and @samp{>} operators sort
When used with @samp{[[}, the @samp{<} and @samp{>} operators sort
lexicographically using the current locale.
When the @samp{==} and @samp{!=} operators are used, the string to the
@@ -3132,7 +3132,7 @@ is supplied.
@item readonly
@btindex readonly
@example
readonly [-aApf] [@var{name}[=@var{value}]] @dots{}
readonly [-aAf] [-p] [@var{name}[=@var{value}]] @dots{}
@end example
Mark each @var{name} as readonly.
The values of these names may not be changed by subsequent assignment.
@@ -3141,8 +3141,11 @@ function.
The @option{-a} option means each @var{name} refers to an indexed
array variable; the @option{-A} option means each @var{name} refers
to an associative array variable.
If both options are supplied, @option{-A} takes precedence.
If no @var{name} arguments are given, or if the @option{-p}
option is supplied, a list of all readonly names is printed.
The other options may be used to restrict the output to a subset of
the set of readonly names.
The @option{-p} option causes output to be displayed in a format that
may be reused as input.
If a variable name is followed by =@var{value}, the value of
@@ -3264,6 +3267,9 @@ The expression is parsed and evaluated according to precedence
using the rules listed above.
@end table
When used with @code{test} or @samp{[}, the @samp{<} and @samp{>}
operators sort lexicographically using ASCII ordering.
@item times
@btindex times
@example
@@ -3561,7 +3567,7 @@ the function is defined are displayed as well.
@option{-F} implies @option{-f}.
The @option{-g} option forces variables to be created or modified at
the global scope, even when \fBdeclare\fP is executed in a shell function.
the global scope, even when @code{declare} is executed in a shell function.
It is ignored in all other cases.
The following options can be used to restrict output to variables with
@@ -4510,14 +4516,17 @@ arguments to the conditional command's @samp{=~} operator.
@item compat32
If set, Bash
changes its behavior to that of version 3.2 with respect to locale-specific
string comparison when using the conditional command's @samp{<} and @samp{>}
operators.
string comparison when using the @samp{[[}
conditional command's @samp{<} and @samp{>} operators.
Bash versions prior to bash-4.0 use ASCII collation and strcmp(3);
bash-4.1 and later use the current locale's collation sequence and strcoll(3).
@item compat40
If set, Bash
changes its behavior to that of version 4.0 with respect to locale-specific
string comparison when using the conditional command's @samp{<} and @samp{>}
operators and the effect of interrupting a command list.
string comparison when using the @samp{[[}
conditional command's @samp{<} and @samp{>} operators (see previous item)
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
@@ -4602,7 +4611,7 @@ This option is enabled by default.
@item globstar
If set, the pattern @samp{**} used in a filename expansion context will
match a files and zero or more directories and subdirectories.
match all files and zero or more directories and subdirectories.
If the pattern is followed by a @samp{/}, only directories and
subdirectories match.
@@ -4982,7 +4991,7 @@ descriptor) and then unsetting it will result in the standard error
being closed.
@item COLUMNS
Used by the @code{select} builtin command to determine the terminal width
Used by the @code{select} command to determine the terminal width
when printing selection lists. Automatically set upon receipt of a
@code{SIGWINCH}.
@@ -5271,7 +5280,7 @@ This variable determines the locale category used for number formatting.
The line number in the script or shell function currently executing.
@item LINES
Used by the @code{select} builtin command to determine the column length
Used by the @code{select} command to determine the column length
for printing selection lists. Automatically set upon receipt of a
@code{SIGWINCH}.
@@ -5926,8 +5935,9 @@ If the @var{file} argument to one of the primaries is one of
@file{/dev/stdin}, @file{/dev/stdout}, or @file{/dev/stderr}, file
descriptor 0, 1, or 2, respectively, is checked.
When used with @samp{[[}, The @samp{<} and @samp{>} operators sort
When used with @samp{[[}, the @samp{<} and @samp{>} operators sort
lexicographically using the current locale.
The @code{test} command uses ASCII ordering.
Unless otherwise specified, primaries that operate on files follow symbolic
links and operate on the target of the link, rather than the link itself.
@@ -6321,6 +6331,7 @@ entire array.
The @code{declare}, @code{local}, and @code{readonly}
builtins each accept a @option{-a} option to specify an indexed
array and a @option{-A} option to specify an associative array.
If both options are supplied, @option{-A} takes precedence.
The @code{read} builtin accepts a @option{-a}
option to assign a list of words read from the standard input
to an array, and can read values from the standard input into
@@ -7575,8 +7586,8 @@ when called as @code{rbash}, enters a restricted mode. See
@ref{The Restricted Shell}, for a description of restricted mode.
@item --enable-select
Include the @code{select} builtin, which allows the generation of simple
menus (@pxref{Conditional Constructs}).
Include the @code{select} compound command, which allows the generation of
simple menus (@pxref{Conditional Constructs}).
@item --enable-separate-helpfiles
Use external files for the documentation displayed by the @code{help} builtin
+24 -12
View File
@@ -995,7 +995,7 @@ substitution, and quote removal are performed.
Conditional operators such as @samp{-f} must be unquoted to be recognized
as primaries.
When used with @samp{[[}, The @samp{<} and @samp{>} operators sort
When used with @samp{[[}, the @samp{<} and @samp{>} operators sort
lexicographically using the current locale.
When the @samp{==} and @samp{!=} operators are used, the string to the
@@ -3132,7 +3132,7 @@ is supplied.
@item readonly
@btindex readonly
@example
readonly [-aApf] [@var{name}[=@var{value}]] @dots{}
readonly [-aAf] [-p] [@var{name}[=@var{value}]] @dots{}
@end example
Mark each @var{name} as readonly.
The values of these names may not be changed by subsequent assignment.
@@ -3141,8 +3141,11 @@ function.
The @option{-a} option means each @var{name} refers to an indexed
array variable; the @option{-A} option means each @var{name} refers
to an associative array variable.
If both options are supplied, @option{-A} takes precedence.
If no @var{name} arguments are given, or if the @option{-p}
option is supplied, a list of all readonly names is printed.
The other options may be used to restrict the output to a subset of
the set of readonly names.
The @option{-p} option causes output to be displayed in a format that
may be reused as input.
If a variable name is followed by =@var{value}, the value of
@@ -3239,6 +3242,7 @@ If the first argument is not a valid unary operator, the expression is
false.
@item 3 arguments
The following conditions are applied in the order listed.
If the second argument is one of the binary conditional
operators (@pxref{Bash Conditional Expressions}), the
result of the expression is the result of the binary test using the
@@ -3263,6 +3267,9 @@ The expression is parsed and evaluated according to precedence
using the rules listed above.
@end table
When used with @code{test} or @samp{[}, the @samp{<} and @samp{>}
operators sort lexicographically using ASCII ordering.
@item times
@btindex times
@example
@@ -4509,14 +4516,17 @@ arguments to the conditional command's @samp{=~} operator.
@item compat32
If set, Bash
changes its behavior to that of version 3.2 with respect to locale-specific
string comparison when using the conditional command's @samp{<} and @samp{>}
operators.
string comparison when using the @samp{[[}
conditional command's @samp{<} and @samp{>} operators.
Bash versions prior to bash-4.0 use ASCII collation and strcmp(3);
bash-4.1 and later use the current locale's collation sequence and strcoll(3).
@item compat40
If set, Bash
changes its behavior to that of version 4.0 with respect to locale-specific
string comparison when using the conditional command's @samp{<} and @samp{>}
operators and the effect of interrupting a command list.
string comparison when using the @samp{[[}
conditional command's @samp{<} and @samp{>} operators (see previous item)
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
@@ -4601,7 +4611,7 @@ This option is enabled by default.
@item globstar
If set, the pattern @samp{**} used in a filename expansion context will
match a files and zero or more directories and subdirectories.
match all files and zero or more directories and subdirectories.
If the pattern is followed by a @samp{/}, only directories and
subdirectories match.
@@ -4981,7 +4991,7 @@ descriptor) and then unsetting it will result in the standard error
being closed.
@item COLUMNS
Used by the @code{select} builtin command to determine the terminal width
Used by the @code{select} command to determine the terminal width
when printing selection lists. Automatically set upon receipt of a
@code{SIGWINCH}.
@@ -5270,7 +5280,7 @@ This variable determines the locale category used for number formatting.
The line number in the script or shell function currently executing.
@item LINES
Used by the @code{select} builtin command to determine the column length
Used by the @code{select} command to determine the column length
for printing selection lists. Automatically set upon receipt of a
@code{SIGWINCH}.
@@ -5925,8 +5935,9 @@ If the @var{file} argument to one of the primaries is one of
@file{/dev/stdin}, @file{/dev/stdout}, or @file{/dev/stderr}, file
descriptor 0, 1, or 2, respectively, is checked.
When used with @samp{[[}, The @samp{<} and @samp{>} operators sort
When used with @samp{[[}, the @samp{<} and @samp{>} operators sort
lexicographically using the current locale.
The @code{test} command uses ASCII ordering.
Unless otherwise specified, primaries that operate on files follow symbolic
links and operate on the target of the link, rather than the link itself.
@@ -6320,6 +6331,7 @@ entire array.
The @code{declare}, @code{local}, and @code{readonly}
builtins each accept a @option{-a} option to specify an indexed
array and a @option{-A} option to specify an associative array.
If both options are supplied, @option{-A} takes precedence.
The @code{read} builtin accepts a @option{-a}
option to assign a list of words read from the standard input
to an array, and can read values from the standard input into
@@ -7574,8 +7586,8 @@ when called as @code{rbash}, enters a restricted mode. See
@ref{The Restricted Shell}, for a description of restricted mode.
@item --enable-select
Include the @code{select} builtin, which allows the generation of simple
menus (@pxref{Conditional Constructs}).
Include the @code{select} compound command, which allows the generation of
simple menus (@pxref{Conditional Constructs}).
@item --enable-separate-helpfiles
Use external files for the documentation displayed by the @code{help} builtin
+92 -85
View File
@@ -1227,17 +1227,21 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
easy re-editing of multi-line commands.
ccoommppaatt3311
If set, bbaasshh changes its behavior to that of version 3.1
with respect to quoted arguments to the conditional com-
mand's ==~~ operator.
with respect to quoted arguments to the [[[[ conditional
command's ==~~ operator.
ccoommppaatt3322
If set, bbaasshh changes its behavior to that of version 3.2
with respect to locale-specific string comparison when
using the conditional command's << and >> operators.
using the [[[[ conditional command's << and >> operators.
Bash versions prior to bash-4.1 use ASCII collation and
_s_t_r_c_m_p(3); bash-4.1 and later use the current locale's
collation sequence and _s_t_r_c_o_l_l(3).
ccoommppaatt4400
If set, bbaasshh 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.
with respect to locale-specific string comparison when
using the [[[[ conditional command's << and >> operators
(see previous item) and the effect of interrupting a
command list.
ccoommppaatt4411
@item compat41 If set, bbaasshh, when in posix mode, treats
a single quote in a double-quoted parameter expansion as
@@ -1458,31 +1462,34 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
The expression is parsed and evaluated according to
precedence using the rules listed above.
ttiimmeess Print the accumulated user and system times for the shell and
When used with tteesstt or [[, the << and >> operators sort lexico-
graphically using ASCII ordering.
ttiimmeess Print the accumulated user and system times for the shell and
for processes run from the shell. The return status is 0.
ttrraapp [--llpp] [[_a_r_g] _s_i_g_s_p_e_c ...]
The command _a_r_g is to be read and executed when the shell
receives signal(s) _s_i_g_s_p_e_c. If _a_r_g is absent (and there is a
single _s_i_g_s_p_e_c) or --, each specified signal is reset to its
original disposition (the value it had upon entrance to the
shell). If _a_r_g is the null string the signal specified by each
_s_i_g_s_p_e_c is ignored by the shell and by the commands it invokes.
If _a_r_g is not present and --pp has been supplied, then the trap
commands associated with each _s_i_g_s_p_e_c are displayed. If no
arguments are supplied or if only --pp is given, ttrraapp prints the
list of commands associated with each signal. The --ll option
causes the shell to print a list of signal names and their cor-
responding numbers. Each _s_i_g_s_p_e_c is either a signal name
defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are
The command _a_r_g is to be read and executed when the shell
receives signal(s) _s_i_g_s_p_e_c. If _a_r_g is absent (and there is a
single _s_i_g_s_p_e_c) or --, each specified signal is reset to its
original disposition (the value it had upon entrance to the
shell). If _a_r_g is the null string the signal specified by each
_s_i_g_s_p_e_c is ignored by the shell and by the commands it invokes.
If _a_r_g is not present and --pp has been supplied, then the trap
commands associated with each _s_i_g_s_p_e_c are displayed. If no
arguments are supplied or if only --pp is given, ttrraapp prints the
list of commands associated with each signal. The --ll option
causes the shell to print a list of signal names and their cor-
responding numbers. Each _s_i_g_s_p_e_c is either a signal name
defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are
case insensitive and the SSIIGG prefix is optional.
If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_r_g is executed on exit
from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_r_g is exe-
cuted before every _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command,
_s_e_l_e_c_t command, every arithmetic _f_o_r command, and before the
first command executes in a shell function (see SSHHEELLLL GGRRAAMMMMAARR
above). Refer to the description of the eexxttddeebbuugg option to the
If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_r_g is executed on exit
from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_r_g is exe-
cuted before every _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command,
_s_e_l_e_c_t command, every arithmetic _f_o_r command, and before the
first command executes in a shell function (see SSHHEELLLL GGRRAAMMMMAARR
above). Refer to the description of the eexxttddeebbuugg option to the
sshhoopptt builtin for details of its effect on the DDEEBBUUGG trap. If a
_s_i_g_s_p_e_c is RREETTUURRNN, the command _a_r_g is executed each time a shell
function or a script executed with the .. or ssoouurrccee builtins fin-
@@ -1490,53 +1497,53 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
If a _s_i_g_s_p_e_c is EERRRR, the command _a_r_g is executed whenever a sim-
ple command has a non-zero exit status, subject to the following
conditions. The EERRRR trap is not executed if the failed command
is part of the command list immediately following a wwhhiillee or
uunnttiill keyword, part of the test in an _i_f statement, part of a
command executed in a &&&& or |||| list, or if the command's return
value is being inverted via !!. These are the same conditions
conditions. The EERRRR trap is not executed if the failed command
is part of the command list immediately following a wwhhiillee or
uunnttiill keyword, part of the test in an _i_f statement, part of a
command executed in a &&&& or |||| list, or if the command's return
value is being inverted via !!. These are the same conditions
obeyed by the eerrrreexxiitt option.
Signals ignored upon entry to the shell cannot be trapped or
reset. Trapped signals that are not being ignored are reset to
Signals ignored upon entry to the shell cannot be trapped or
reset. Trapped signals that are not being ignored are reset to
their original values in a subshell or subshell environment when
one is created. The return status is false if any _s_i_g_s_p_e_c is
one is created. The return status is false if any _s_i_g_s_p_e_c is
invalid; otherwise ttrraapp returns true.
ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...]
With no options, indicate how each _n_a_m_e would be interpreted if
With no options, indicate how each _n_a_m_e would be interpreted if
used as a command name. If the --tt option is used, ttyyppee prints a
string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or
_f_i_l_e if _n_a_m_e is an alias, shell reserved word, function,
builtin, or disk file, respectively. If the _n_a_m_e is not found,
then nothing is printed, and an exit status of false is
returned. If the --pp option is used, ttyyppee either returns the
string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or
_f_i_l_e if _n_a_m_e is an alias, shell reserved word, function,
builtin, or disk file, respectively. If the _n_a_m_e is not found,
then nothing is printed, and an exit status of false is
returned. If the --pp option is used, ttyyppee either returns the
name of the disk file that would be executed if _n_a_m_e were speci-
fied as a command name, or nothing if ``type -t name'' would not
return _f_i_l_e. The --PP option forces a PPAATTHH search for each _n_a_m_e,
return _f_i_l_e. The --PP option forces a PPAATTHH search for each _n_a_m_e,
even if ``type -t name'' would not return _f_i_l_e. If a command is
hashed, --pp and --PP print the hashed value, not necessarily the
hashed, --pp and --PP print the hashed value, not necessarily the
file that appears first in PPAATTHH. If the --aa option is used, ttyyppee
prints all of the places that contain an executable named _n_a_m_e.
This includes aliases and functions, if and only if the --pp
option is not also used. The table of hashed commands is not
consulted when using --aa. The --ff option suppresses shell func-
tion lookup, as with the ccoommmmaanndd builtin. ttyyppee returns true if
prints all of the places that contain an executable named _n_a_m_e.
This includes aliases and functions, if and only if the --pp
option is not also used. The table of hashed commands is not
consulted when using --aa. The --ff option suppresses shell func-
tion lookup, as with the ccoommmmaanndd builtin. ttyyppee returns true if
all of the arguments are found, false if any are not found.
uulliimmiitt [--HHSSTTaabbccddeeffiillmmnnppqqrrssttuuvvxx [_l_i_m_i_t]]
Provides control over the resources available to the shell and
to processes started by it, on systems that allow such control.
Provides control over the resources available to the shell and
to processes started by it, on systems that allow such control.
The --HH and --SS options specify that the hard or soft limit is set
for the given resource. A hard limit cannot be increased by a
non-root user once it is set; a soft limit may be increased up
to the value of the hard limit. If neither --HH nor --SS is speci-
for the given resource. A hard limit cannot be increased by a
non-root user once it is set; a soft limit may be increased up
to the value of the hard limit. If neither --HH nor --SS is speci-
fied, both the soft and hard limits are set. The value of _l_i_m_i_t
can be a number in the unit specified for the resource or one of
the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd, which stand for the
current hard limit, the current soft limit, and no limit,
respectively. If _l_i_m_i_t is omitted, the current value of the
soft limit of the resource is printed, unless the --HH option is
current hard limit, the current soft limit, and no limit,
respectively. If _l_i_m_i_t is omitted, the current value of the
soft limit of the resource is printed, unless the --HH option is
given. When more than one resource is specified, the limit name
and unit are printed before the value. Other options are inter-
preted as follows:
@@ -1545,11 +1552,11 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
--cc The maximum size of core files created
--dd The maximum size of a process's data segment
--ee The maximum scheduling priority ("nice")
--ff The maximum size of files written by the shell and its
--ff The maximum size of files written by the shell and its
children
--ii The maximum number of pending signals
--ll The maximum size that may be locked into memory
--mm The maximum resident set size (many systems do not honor
--mm The maximum resident set size (many systems do not honor
this limit)
--nn The maximum number of open file descriptors (most systems
do not allow this value to be set)
@@ -1558,58 +1565,58 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
--rr The maximum real-time scheduling priority
--ss The maximum stack size
--tt The maximum amount of cpu time in seconds
--uu The maximum number of processes available to a single
--uu The maximum number of processes available to a single
user
--vv The maximum amount of virtual memory available to the
--vv The maximum amount of virtual memory available to the
shell and, on some systems, to its children
--xx The maximum number of file locks
--TT The maximum number of threads
If _l_i_m_i_t is given, it is the new value of the specified resource
(the --aa option is display only). If no option is given, then --ff
is assumed. Values are in 1024-byte increments, except for --tt,
which is in seconds, --pp, which is in units of 512-byte blocks,
and --TT, --bb, --nn, and --uu, which are unscaled values. The return
is assumed. Values are in 1024-byte increments, except for --tt,
which is in seconds, --pp, which is in units of 512-byte blocks,
and --TT, --bb, --nn, and --uu, which are unscaled values. The return
status is 0 unless an invalid option or argument is supplied, or
an error occurs while setting a new limit.
uummaasskk [--pp] [--SS] [_m_o_d_e]
The user file-creation mask is set to _m_o_d_e. If _m_o_d_e begins with
a digit, it is interpreted as an octal number; otherwise it is
interpreted as a symbolic mode mask similar to that accepted by
_c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is
printed. The --SS option causes the mask to be printed in sym-
bolic form; the default output is an octal number. If the --pp
a digit, it is interpreted as an octal number; otherwise it is
interpreted as a symbolic mode mask similar to that accepted by
_c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is
printed. The --SS option causes the mask to be printed in sym-
bolic form; the default output is an octal number. If the --pp
option is supplied, and _m_o_d_e is omitted, the output is in a form
that may be reused as input. The return status is 0 if the mode
was successfully changed or if no _m_o_d_e argument was supplied,
was successfully changed or if no _m_o_d_e argument was supplied,
and false otherwise.
uunnaalliiaass [-aa] [_n_a_m_e ...]
Remove each _n_a_m_e from the list of defined aliases. If --aa is
supplied, all alias definitions are removed. The return value
Remove each _n_a_m_e from the list of defined aliases. If --aa is
supplied, all alias definitions are removed. The return value
is true unless a supplied _n_a_m_e is not a defined alias.
uunnsseett [-ffvv] [_n_a_m_e ...]
For each _n_a_m_e, remove the corresponding variable or function.
For each _n_a_m_e, remove the corresponding variable or function.
If no options are supplied, or the --vv option is given, each _n_a_m_e
refers to a shell variable. Read-only variables may not be
unset. If --ff is specified, each _n_a_m_e refers to a shell func-
tion, and the function definition is removed. Each unset vari-
able or function is removed from the environment passed to sub-
sequent commands. If any of CCOOMMPP__WWOORRDDBBRREEAAKKSS, RRAANNDDOOMM, SSEECCOONNDDSS,
LLIINNEENNOO, HHIISSTTCCMMDD, FFUUNNCCNNAAMMEE, GGRROOUUPPSS, or DDIIRRSSTTAACCKK are unset, they
lose their special properties, even if they are subsequently
refers to a shell variable. Read-only variables may not be
unset. If --ff is specified, each _n_a_m_e refers to a shell func-
tion, and the function definition is removed. Each unset vari-
able or function is removed from the environment passed to sub-
sequent commands. If any of CCOOMMPP__WWOORRDDBBRREEAAKKSS, RRAANNDDOOMM, SSEECCOONNDDSS,
LLIINNEENNOO, HHIISSTTCCMMDD, FFUUNNCCNNAAMMEE, GGRROOUUPPSS, or DDIIRRSSTTAACCKK are unset, they
lose their special properties, even if they are subsequently
reset. The exit status is true unless a _n_a_m_e is readonly.
wwaaiitt [_n _._._.]
Wait for each specified process and return its termination sta-
tus. Each _n may be a process ID or a job specification; if a
job spec is given, all processes in that job's pipeline are
waited for. If _n is not given, all currently active child pro-
cesses are waited for, and the return status is zero. If _n
specifies a non-existent process or job, the return status is
127. Otherwise, the return status is the exit status of the
Wait for each specified process and return its termination sta-
tus. Each _n may be a process ID or a job specification; if a
job spec is given, all processes in that job's pipeline are
waited for. If _n is not given, all currently active child pro-
cesses are waited for, and the return status is zero. If _n
specifies a non-existent process or job, the return status is
127. Otherwise, the return status is the exit status of the
last process or job waited for.
SSEEEE AALLSSOO
+320 -305
View File
@@ -1,13 +1,13 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Tue Dec 7 16:12:42 2010
%%CreationDate: Tue Dec 28 14:30:24 2010
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%+ font Times-Italic
%%+ font Symbol
%%+ font Courier
%%DocumentSuppliedResources: procset grops 1.19 2
%%Pages: 21
%%Pages: 22
%%PageOrder: Ascend
%%DocumentMedia: Default 595 842 0 () ()
%%Orientation: Portrait
@@ -2130,9 +2130,9 @@ F0(and)2.25 E F3(COLUMNS)2.5 E/F4 9/Times-Roman@0 SF(.)A F1(cmdhist)144
(ws easy re-editing of multi-line commands.)-.25 E F1(compat31)144 702 Q
F0 .42(If set,)184 714 R F1(bash)2.92 E F0 .42(changes its beha)2.92 F
.419(vior to that of v)-.2 F .419(ersion 3.1 with respect to quoted ar)
-.15 F(guments)-.18 E(to the conditional command')184 726 Q(s)-.55 E F1
(=~)2.5 E F0(operator)2.5 E(.)-.55 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)
148.735 E(16)198.725 E 0 Cg EP
-.15 F(guments)-.18 E(to the)184 726 Q F1([[)2.5 E F0
(conditional command')2.5 E(s)-.55 E F1(=~)2.5 E F0(operator)2.5 E(.)
-.55 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(16)198.725 E 0 Cg EP
%%Page: 17 17
%%BeginPageSetup
BP
@@ -2141,567 +2141,582 @@ BP
(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10
/Times-Bold@0 SF(compat32)144 84 Q F0 1.409(If set,)184 96 R F1(bash)
3.909 E F0 1.409(changes its beha)3.909 F 1.409(vior to that of v)-.2 F
1.41(ersion 3.2 with respect to locale-speci\214c)-.15 F
(string comparison when using the conditional command')184 108 Q(s)-.55
E F1(<)2.5 E F0(and)2.5 E F1(>)2.5 E F0(operators.)2.5 E F1(compat40)144
120 Q F0 1.41(If set,)184 132 R F1(bash)3.91 E F0 1.41(changes its beha)
3.91 F 1.409(vior to that of v)-.2 F 1.409
(ersion 4.0 with respect to locale-speci\214c)-.15 F 1.682
(string comparison when using the conditional command')184 144 R(s)-.55
E F1(<)4.183 E F0(and)4.183 E F1(>)4.183 E F0 1.683(operators and the)
4.183 F(ef)184 156 Q(fect of interrupting a command list.)-.25 E F1
(compat41)144 168 Q F0 1.232(@item compat41 If set,)184 180 R F1(bash)
3.732 E F0 3.732(,w)C 1.232
(hen in posix mode, treats a single quote in a double-)-3.732 F 1.213
(quoted parameter e)184 192 R 1.213(xpansion as a special character)-.15
F 6.213(.T)-.55 G 1.214(he single quotes must match \(an)-6.213 F -2.15
-.25(ev e)184 204 T 2.949(nn).25 G .448(umber\) and the characters betw\
een the single quotes are considered quoted.)-2.949 F(This)5.448 E .062
(is the beha)184 216 R .062(vior of posix mode through v)-.2 F .062
(ersion 4.1.)-.15 F .062(The def)5.062 F .062(ault bash beha)-.1 F .063
(vior remains as)-.2 F(in pre)184 228 Q(vious v)-.25 E(ersions.)-.15 E
F1(dirspell)144 240 Q F0 .859(If set,)7.77 F F1(bash)3.359 E F0 .858
1.41(ersion 3.2 with respect to locale-speci\214c)-.15 F 1.266
(string comparison when using the)184 108 R F1([[)3.766 E F0 1.266
(conditional command')3.766 F(s)-.55 E F1(<)3.766 E F0(and)3.766 E F1(>)
3.766 E F0 3.765(operators. Bash)3.765 F -.15(ve)184 120 S .512
(rsions prior to bash-4.1 use ASCII collation and).15 F/F2 10
/Times-Italic@0 SF(str)3.012 E(cmp)-.37 E F0 .513
(\(3\); bash-4.1 and later use the).19 F(current locale')184 132 Q 2.5
(sc)-.55 G(ollation sequence and)-2.5 E F2(str)2.5 E(coll)-.37 E F0
(\(3\).).51 E F1(compat40)144 144 Q F0 1.41(If set,)184 156 R F1(bash)
3.91 E F0 1.41(changes its beha)3.91 F 1.409(vior to that of v)-.2 F
1.409(ersion 4.0 with respect to locale-speci\214c)-.15 F .422
(string comparison when using the)184 168 R F1([[)2.922 E F0 .422
(conditional command')2.922 F(s)-.55 E F1(<)2.922 E F0(and)2.922 E F1(>)
2.923 E F0 .423(operators \(see pre-)2.923 F(vious item\) and the ef)184
180 Q(fect of interrupting a command list.)-.25 E F1(compat41)144 192 Q
F0 1.232(@item compat41 If set,)184 204 R F1(bash)3.732 E F0 3.732(,w)C
1.232(hen in posix mode, treats a single quote in a double-)-3.732 F
1.213(quoted parameter e)184 216 R 1.213
(xpansion as a special character)-.15 F 6.213(.T)-.55 G 1.214
(he single quotes must match \(an)-6.213 F -2.15 -.25(ev e)184 228 T
2.949(nn).25 G .448(umber\) and the characters between the single quote\
s are considered quoted.)-2.949 F(This)5.448 E .062(is the beha)184 240
R .062(vior of posix mode through v)-.2 F .062(ersion 4.1.)-.15 F .062
(The def)5.062 F .062(ault bash beha)-.1 F .063(vior remains as)-.2 F
(in pre)184 252 Q(vious v)-.25 E(ersions.)-.15 E F1(dirspell)144 264 Q
F0 .859(If set,)7.77 F F1(bash)3.359 E F0 .858
(attempts spelling correction on directory names during w)3.359 F .858
(ord completion if)-.1 F
(the directory name initially supplied does not e)184 252 Q(xist.)-.15 E
F1(dotglob)144 264 Q F0 .165(If set,)7.77 F F1(bash)2.665 E F0 .165
(the directory name initially supplied does not e)184 276 Q(xist.)-.15 E
F1(dotglob)144 288 Q F0 .165(If set,)7.77 F F1(bash)2.665 E F0 .165
(includes \214lenames be)2.665 F .165(ginning with a `.)-.15 F 2.665('i)
-.7 G 2.665(nt)-2.665 G .165(he results of pathname e)-2.665 F
(xpansion.)-.15 E F1(execfail)144 276 Q F0 1.387
(xpansion.)-.15 E F1(execfail)144 300 Q F0 1.387
(If set, a non-interacti)7.79 F 1.687 -.15(ve s)-.25 H 1.386
(hell will not e).15 F 1.386(xit if it cannot e)-.15 F -.15(xe)-.15 G
1.386(cute the \214le speci\214ed as an).15 F(ar)184 288 Q
1.386(cute the \214le speci\214ed as an).15 F(ar)184 312 Q
(gument to the)-.18 E F1(exec)2.5 E F0 -.2(bu)2.5 G(iltin command.).2 E
(An interacti)5 E .3 -.15(ve s)-.25 H(hell does not e).15 E(xit if)-.15
E F1(exec)2.5 E F0 -.1(fa)2.5 G(ils.).1 E F1(expand_aliases)144 300 Q F0
.716(If set, aliases are e)184 312 R .717(xpanded as described abo)-.15
F 1.017 -.15(ve u)-.15 H(nder).15 E/F2 9/Times-Bold@0 SF(ALIASES)3.217 E
/F3 9/Times-Roman@0 SF(.)A F0 .717(This option is enabled)5.217 F
(by def)184 324 Q(ault for interacti)-.1 E .3 -.15(ve s)-.25 H(hells.)
.15 E F1(extdeb)144 336 Q(ug)-.2 E F0(If set, beha)184 348 Q
E F1(exec)2.5 E F0 -.1(fa)2.5 G(ils.).1 E F1(expand_aliases)144 324 Q F0
.716(If set, aliases are e)184 336 R .717(xpanded as described abo)-.15
F 1.017 -.15(ve u)-.15 H(nder).15 E/F3 9/Times-Bold@0 SF(ALIASES)3.217 E
/F4 9/Times-Roman@0 SF(.)A F0 .717(This option is enabled)5.217 F
(by def)184 348 Q(ault for interacti)-.1 E .3 -.15(ve s)-.25 H(hells.)
.15 E F1(extdeb)144 360 Q(ug)-.2 E F0(If set, beha)184 372 Q
(vior intended for use by deb)-.2 E(uggers is enabled:)-.2 E F1(1.)184
360 Q F0(The)28.5 E F1<ad46>4.251 E F0 1.751(option to the)4.251 F F1
384 Q F0(The)28.5 E F1<ad46>4.251 E F0 1.751(option to the)4.251 F F1
(declar)4.251 E(e)-.18 E F0 -.2(bu)4.251 G 1.751
(iltin displays the source \214le name and line).2 F
(number corresponding to each function name supplied as an ar)220 372 Q
(gument.)-.18 E F1(2.)184 384 Q F0 1.667(If the command run by the)28.5
(number corresponding to each function name supplied as an ar)220 396 Q
(gument.)-.18 E F1(2.)184 408 Q F0 1.667(If the command run by the)28.5
F F1(DEB)4.167 E(UG)-.1 E F0 1.667(trap returns a non-zero v)4.167 F
1.667(alue, the ne)-.25 F(xt)-.15 E(command is skipped and not e)220 396
Q -.15(xe)-.15 G(cuted.).15 E F1(3.)184 408 Q F0 .841
1.667(alue, the ne)-.25 F(xt)-.15 E(command is skipped and not e)220 420
Q -.15(xe)-.15 G(cuted.).15 E F1(3.)184 432 Q F0 .841
(If the command run by the)28.5 F F1(DEB)3.341 E(UG)-.1 E F0 .841
(trap returns a v)3.341 F .84(alue of 2, and the shell is)-.25 F -.15
(exe)220 420 S .488
(exe)220 444 S .488
(cuting in a subroutine \(a shell function or a shell script e).15 F
-.15(xe)-.15 G .488(cuted by the).15 F F1(.)2.988 E F0(or)2.988 E F1
(sour)220 432 Q(ce)-.18 E F0 -.2(bu)2.5 G(iltins\), a call to).2 E F1
-.18(re)2.5 G(tur).18 E(n)-.15 E F0(is simulated.)2.5 E F1(4.)184 444 Q
F2 -.27(BA)28.5 G(SH_ARGC).27 E F0(and)3.154 E F2 -.27(BA)3.404 G
(sour)220 456 Q(ce)-.18 E F0 -.2(bu)2.5 G(iltins\), a call to).2 E F1
-.18(re)2.5 G(tur).18 E(n)-.15 E F0(is simulated.)2.5 E F1(4.)184 468 Q
F3 -.27(BA)28.5 G(SH_ARGC).27 E F0(and)3.154 E F3 -.27(BA)3.404 G
(SH_ARGV).27 E F0 .904(are updated as described in their descriptions)
3.154 F(abo)220 456 Q -.15(ve)-.15 G(.).15 E F1(5.)184 468 Q F0 1.359
3.154 F(abo)220 480 Q -.15(ve)-.15 G(.).15 E F1(5.)184 492 Q F0 1.359
(Function tracing is enabled:)28.5 F 1.359
(command substitution, shell functions, and sub-)6.359 F(shells in)220
480 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(ith)-2.5 E F1(\()2.5 E/F4 10
/Times-Italic@0 SF(command)2.5 E F1(\))2.5 E F0(inherit the)2.5 E F1
(DEB)2.5 E(UG)-.1 E F0(and)2.5 E F1(RETURN)2.5 E F0(traps.)2.5 E F1(6.)
184 492 Q F0 .805(Error tracing is enabled:)28.5 F .804
(command substitution, shell functions, and subshells)5.805 F(in)220 504
Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(ith)-2.5 E F1(\()2.5 E F4
504 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(ith)-2.5 E F1(\()2.5 E F2
(command)2.5 E F1(\))2.5 E F0(inherit the)2.5 E F1(DEB)2.5 E(UG)-.1 E F0
(and)2.5 E F1(RETURN)2.5 E F0(traps.)2.5 E F1(6.)184 516 Q F0 .805
(Error tracing is enabled:)28.5 F .804
(command substitution, shell functions, and subshells)5.805 F(in)220 528
Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(ith)-2.5 E F1(\()2.5 E F2
(command)2.5 E F1(\))2.5 E F0(inherit the)2.5 E F1(ERR)2.5 E F0(trap.)
2.5 E F1(extglob)144 516 Q F0 .4(If set, the e)8.89 F .4
2.5 E F1(extglob)144 540 Q F0 .4(If set, the e)8.89 F .4
(xtended pattern matching features described abo)-.15 F .7 -.15(ve u)
-.15 H(nder).15 E F1 -.1(Pa)2.9 G .4(thname Expan-).1 F(sion)184 528 Q
F0(are enabled.)2.5 E F1(extquote)144 540 Q F0 2.473(If set,)184 552 R
F1($)4.973 E F0<08>A F4(string)A F0 4.973<0861>C(nd)-4.973 E F1($)4.973
E F0(")A F4(string)A F0 4.973("q)C 2.473(uoting is performed within)
-4.973 F F1(${)4.973 E F4(par)A(ameter)-.15 E F1(})A F0 -.15(ex)4.973 G
(pansions).15 E(enclosed in double quotes.)184 564 Q
(This option is enabled by def)5 E(ault.)-.1 E F1(failglob)144 576 Q F0
-.15 H(nder).15 E F1 -.1(Pa)2.9 G .4(thname Expan-).1 F(sion)184 552 Q
F0(are enabled.)2.5 E F1(extquote)144 564 Q F0 2.473(If set,)184 576 R
F1($)4.973 E F0<08>A F2(string)A F0 4.973<0861>C(nd)-4.973 E F1($)4.973
E F0(")A F2(string)A F0 4.973("q)C 2.473(uoting is performed within)
-4.973 F F1(${)4.973 E F2(par)A(ameter)-.15 E F1(})A F0 -.15(ex)4.973 G
(pansions).15 E(enclosed in double quotes.)184 588 Q
(This option is enabled by def)5 E(ault.)-.1 E F1(failglob)144 600 Q F0
1.424(If set, patterns which f)7.77 F 1.425
(ail to match \214lenames during pathname e)-.1 F 1.425
(xpansion result in an)-.15 F -.15(ex)184 588 S(pansion error).15 E(.)
-.55 E F1 -.25(fo)144 600 S -.18(rc).25 G(e_\214gnor).18 E(e)-.18 E F0
.937(If set, the suf)184 612 R<8c78>-.25 E .936(es speci\214ed by the)
-.15 F F2(FIGNORE)3.436 E F0 .936(shell v)3.186 F .936(ariable cause w)
-.25 F .936(ords to be ignored)-.1 F .32(when performing w)184 624 R .32
(xpansion result in an)-.15 F -.15(ex)184 612 S(pansion error).15 E(.)
-.55 E F1 -.25(fo)144 624 S -.18(rc).25 G(e_\214gnor).18 E(e)-.18 E F0
.937(If set, the suf)184 636 R<8c78>-.25 E .936(es speci\214ed by the)
-.15 F F3(FIGNORE)3.436 E F0 .936(shell v)3.186 F .936(ariable cause w)
-.25 F .936(ords to be ignored)-.1 F .32(when performing w)184 648 R .32
(ord completion e)-.1 F -.15(ve)-.25 G 2.82(ni).15 G 2.82(ft)-2.82 G .32
(he ignored w)-2.82 F .32(ords are the only possible com-)-.1 F 2.948
(pletions. See)184 636 R F2 .448(SHELL V)2.948 F(ARIABLES)-1.215 E F0
(abo)2.698 E .748 -.15(ve f)-.15 H .448(or a description of).15 F F2
(FIGNORE)2.947 E F3(.)A F0 .447(This option is)4.947 F(enabled by def)
184 648 Q(ault.)-.1 E F1(globstar)144 660 Q F0 .178(If set, the pattern)
(pletions. See)184 660 R F3 .448(SHELL V)2.948 F(ARIABLES)-1.215 E F0
(abo)2.698 E .748 -.15(ve f)-.15 H .448(or a description of).15 F F3
(FIGNORE)2.947 E F4(.)A F0 .447(This option is)4.947 F(enabled by def)
184 672 Q(ault.)-.1 E F1(globstar)144 684 Q F0 .178(If set, the pattern)
5 F F1(**)2.678 E F0 .178(used in a pathname e)2.678 F .178
(xpansion conte)-.15 F .179(xt will match a \214les and zero or)-.15 F
1.298(more directories and subdirectories.)184 672 R 1.298
1.298(more directories and subdirectories.)184 696 R 1.298
(If the pattern is follo)6.298 F 1.298(wed by a)-.25 F F1(/)3.797 E F0
3.797(,o)C 1.297(nly directories)-3.797 F(and subdirectories match.)184
684 Q F1(gnu_errfmt)144 696 Q F0(If set, shell error messages are writt\
en in the standard GNU error message format.)184 708 Q(GNU Bash-4.0)72
768 Q(2004 Apr 20)148.735 E(17)198.725 E 0 Cg EP
708 Q(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(17)198.725 E 0 Cg EP
%%Page: 18 18
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48
(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10
/Times-Bold@0 SF(histappend)144 84 Q F0 .676
/Times-Bold@0 SF(gnu_errfmt)144 84 Q F0(If set, shell error messages ar\
e written in the standard GNU error message format.)184 96 Q F1
(histappend)144 108 Q F0 .676
(If set, the history list is appended to the \214le named by the v)184
96 R .676(alue of the)-.25 F/F2 9/Times-Bold@0 SF(HISTFILE)3.177 E F0
-.25(va)2.927 G(ri-).25 E(able when the shell e)184 108 Q
120 R .676(alue of the)-.25 F/F2 9/Times-Bold@0 SF(HISTFILE)3.177 E F0
-.25(va)2.927 G(ri-).25 E(able when the shell e)184 132 Q
(xits, rather than o)-.15 E -.15(ve)-.15 G(rwriting the \214le.).15 E F1
(histr)144 120 Q(eedit)-.18 E F0 .576(If set, and)184 132 R F1 -.18(re)
(histr)144 144 Q(eedit)-.18 E F0 .576(If set, and)184 156 R F1 -.18(re)
3.076 G(adline).18 E F0 .575(is being used, a user is gi)3.076 F -.15
(ve)-.25 G 3.075(nt).15 G .575(he opportunity to re-edit a f)-3.075 F
.575(ailed his-)-.1 F(tory substitution.)184 144 Q F1(histv)144 156 Q
(erify)-.1 E F0 .402(If set, and)184 168 R F1 -.18(re)2.903 G(adline).18
.575(ailed his-)-.1 F(tory substitution.)184 168 Q F1(histv)144 180 Q
(erify)-.1 E F0 .402(If set, and)184 192 R F1 -.18(re)2.903 G(adline).18
E F0 .403
(is being used, the results of history substitution are not immediately)
2.903 F .662(passed to the shell parser)184 180 R 5.662(.I)-.55 G .661
2.903 F .662(passed to the shell parser)184 204 R 5.662(.I)-.55 G .661
(nstead, the resulting line is loaded into the)-5.662 F F1 -.18(re)3.161
G(adline).18 E F0(editing)3.161 E -.2(bu)184 192 S -.25(ff).2 G(er).25 E
G(adline).18 E F0(editing)3.161 E -.2(bu)184 216 S -.25(ff).2 G(er).25 E
2.5(,a)-.4 G(llo)-2.5 E(wing further modi\214cation.)-.25 E F1
(hostcomplete)144 204 Q F0 1.181(If set, and)184 216 R F1 -.18(re)3.681
(hostcomplete)144 228 Q F0 1.181(If set, and)184 240 R F1 -.18(re)3.681
G(adline).18 E F0 1.181(is being used,)3.681 F F1(bash)3.682 E F0 1.182
(will attempt to perform hostname completion)3.682 F 1.381(when a w)184
228 R 1.381(ord containing a)-.1 F F1(@)3.881 E F0 1.381
252 R 1.381(ord containing a)-.1 F F1(@)3.881 E F0 1.381
(is being completed \(see)3.881 F F1(Completing)3.88 E F0(under)3.88 E
F2(READLINE)3.88 E F0(abo)184 240 Q -.15(ve)-.15 G 2.5(\). This).15 F
(is enabled by def)2.5 E(ault.)-.1 E F1(huponexit)144 252 Q F0(If set,)
184 264 Q F1(bash)2.5 E F0(will send)2.5 E F2(SIGHUP)2.5 E F0
F2(READLINE)3.88 E F0(abo)184 264 Q -.15(ve)-.15 G 2.5(\). This).15 F
(is enabled by def)2.5 E(ault.)-.1 E F1(huponexit)144 276 Q F0(If set,)
184 288 Q F1(bash)2.5 E F0(will send)2.5 E F2(SIGHUP)2.5 E F0
(to all jobs when an interacti)2.25 E .3 -.15(ve l)-.25 H(ogin shell e)
.15 E(xits.)-.15 E F1(interacti)144 276 Q -.1(ve)-.1 G(_comments).1 E F0
.33(If set, allo)184 288 R 2.83(waw)-.25 G .33(ord be)-2.93 F .33
.15 E(xits.)-.15 E F1(interacti)144 300 Q -.1(ve)-.1 G(_comments).1 E F0
.33(If set, allo)184 312 R 2.83(waw)-.25 G .33(ord be)-2.93 F .33
(ginning with)-.15 F F1(#)2.83 E F0 .33(to cause that w)2.83 F .33
(ord and all remaining characters on)-.1 F .967
(that line to be ignored in an interacti)184 300 R 1.267 -.15(ve s)-.25
(that line to be ignored in an interacti)184 324 R 1.267 -.15(ve s)-.25
H .967(hell \(see).15 F F2(COMMENTS)3.467 E F0(abo)3.217 E -.15(ve)-.15
G 3.467(\). This).15 F .967(option is)3.467 F(enabled by def)184 312 Q
(ault.)-.1 E F1(lastpipe)144 324 Q F0 1.211
G 3.467(\). This).15 F .967(option is)3.467 F(enabled by def)184 336 Q
(ault.)-.1 E F1(lastpipe)144 348 Q F0 1.211
(If set, and job control is not acti)6.66 F -.15(ve)-.25 G 3.712(,t).15
G 1.212(he shell runs the last command of a pipeline not)-3.712 F -.15
(exe)184 336 S(cuted in the background in the current shell en).15 E
(vironment.)-.4 E F1(lithist)144 348 Q F0 .655(If set, and the)15.55 F
(exe)184 360 S(cuted in the background in the current shell en).15 E
(vironment.)-.4 E F1(lithist)144 372 Q F0 .655(If set, and the)15.55 F
F1(cmdhist)3.155 E F0 .654
(option is enabled, multi-line commands are sa)3.154 F -.15(ve)-.2 G
3.154(dt).15 G 3.154(ot)-3.154 G .654(he history)-3.154 F
(with embedded ne)184 360 Q
(with embedded ne)184 384 Q
(wlines rather than using semicolon separators where possible.)-.25 E F1
(login_shell)144 372 Q F0 .486
(login_shell)144 396 Q F0 .486
(The shell sets this option if it is started as a login shell \(see)184
384 R F2(INV)2.987 E(OCA)-.405 E(TION)-.855 E F0(abo)2.737 E -.15(ve)
-.15 G 2.987(\). The).15 F -.25(va)184 396 S(lue may not be changed.).25
E F1(mailwar)144 408 Q(n)-.15 E F0 .815(If set, and a \214le that)184
420 R F1(bash)3.315 E F0 .814
408 R F2(INV)2.987 E(OCA)-.405 E(TION)-.855 E F0(abo)2.737 E -.15(ve)
-.15 G 2.987(\). The).15 F -.25(va)184 420 S(lue may not be changed.).25
E F1(mailwar)144 432 Q(n)-.15 E F0 .815(If set, and a \214le that)184
444 R F1(bash)3.315 E F0 .814
(is checking for mail has been accessed since the last time it)3.315 F
-.1(wa)184 432 S 2.5(sc).1 G(heck)-2.5 E(ed, the message `)-.1 E
-.1(wa)184 456 S 2.5(sc).1 G(heck)-2.5 E(ed, the message `)-.1 E
(`The mail in)-.74 E/F3 10/Times-Italic@0 SF(mail\214le)2.5 E F0
(has been read')2.5 E 2.5('i)-.74 G 2.5(sd)-2.5 G(isplayed.)-2.5 E F1
(no_empty_cmd_completion)144 444 Q F0 .324(If set, and)184 456 R F1 -.18
(no_empty_cmd_completion)144 468 Q F0 .324(If set, and)184 480 R F1 -.18
(re)2.824 G(adline).18 E F0 .324(is being used,)2.824 F F1(bash)2.824 E
F0 .324(will not attempt to search the)2.824 F F2 -.666(PA)2.825 G(TH)
-.189 E F0 .325(for possible)2.575 F
(completions when completion is attempted on an empty line.)184 468 Q F1
(nocaseglob)144 480 Q F0 .437(If set,)184 492 R F1(bash)2.937 E F0 .436
(completions when completion is attempted on an empty line.)184 492 Q F1
(nocaseglob)144 504 Q F0 .437(If set,)184 516 R F1(bash)2.937 E F0 .436
(matches \214lenames in a case\255insensiti)2.937 F .736 -.15(ve f)-.25
H .436(ashion when performing pathname).05 F -.15(ex)184 504 S
H .436(ashion when performing pathname).05 F -.15(ex)184 528 S
(pansion \(see).15 E F1 -.1(Pa)2.5 G(thname Expansion).1 E F0(abo)2.5 E
-.15(ve)-.15 G(\).).15 E F1(nocasematch)144 516 Q F0 1.193(If set,)184
528 R F1(bash)3.693 E F0 1.194(matches patterns in a case\255insensiti)
-.15(ve)-.15 G(\).).15 E F1(nocasematch)144 540 Q F0 1.193(If set,)184
552 R F1(bash)3.693 E F0 1.194(matches patterns in a case\255insensiti)
3.693 F 1.494 -.15(ve f)-.25 H 1.194(ashion when performing matching).05
F(while e)184 540 Q -.15(xe)-.15 G(cuting).15 E F1(case)2.5 E F0(or)2.5
E F1([[)2.5 E F0(conditional commands.)2.5 E F1(nullglob)144 552 Q F0
.855(If set,)184 564 R F1(bash)3.355 E F0(allo)3.355 E .855
F(while e)184 564 Q -.15(xe)-.15 G(cuting).15 E F1(case)2.5 E F0(or)2.5
E F1([[)2.5 E F0(conditional commands.)2.5 E F1(nullglob)144 576 Q F0
.855(If set,)184 588 R F1(bash)3.355 E F0(allo)3.355 E .855
(ws patterns which match no \214les \(see)-.25 F F1 -.1(Pa)3.354 G .854
(thname Expansion).1 F F0(abo)3.354 E -.15(ve)-.15 G 3.354(\)t).15 G(o)
-3.354 E -.15(ex)184 576 S(pand to a null string, rather than themselv)
.15 E(es.)-.15 E F1(pr)144 588 Q(ogcomp)-.18 E F0 .676
(If set, the programmable completion f)184 600 R .677(acilities \(see)
-3.354 E -.15(ex)184 600 S(pand to a null string, rather than themselv)
.15 E(es.)-.15 E F1(pr)144 612 Q(ogcomp)-.18 E F0 .676
(If set, the programmable completion f)184 624 R .677(acilities \(see)
-.1 F F1(Pr)3.177 E .677(ogrammable Completion)-.18 F F0(abo)3.177 E
-.15(ve)-.15 G(\)).15 E(are enabled.)184 612 Q
(This option is enabled by def)5 E(ault.)-.1 E F1(pr)144 624 Q(omptv)
-.18 E(ars)-.1 E F0 1.448(If set, prompt strings under)184 636 R 1.448
-.15(ve)-.15 G(\)).15 E(are enabled.)184 636 Q
(This option is enabled by def)5 E(ault.)-.1 E F1(pr)144 648 Q(omptv)
-.18 E(ars)-.1 E F0 1.448(If set, prompt strings under)184 660 R 1.448
(go parameter e)-.18 F 1.447(xpansion, command substitution, arithmetic)
-.15 F -.15(ex)184 648 S .17(pansion, and quote remo).15 F -.25(va)-.15
-.15 F -.15(ex)184 672 S .17(pansion, and quote remo).15 F -.25(va)-.15
G 2.67(la).25 G .17(fter being e)-2.67 F .17(xpanded as described in)
-.15 F F2(PR)2.671 E(OMPTING)-.27 E F0(abo)2.421 E -.15(ve)-.15 G(.).15
E(This option is enabled by def)184 660 Q(ault.)-.1 E F1 -.18(re)144 672
E(This option is enabled by def)184 684 Q(ault.)-.1 E F1 -.18(re)144 696
S(stricted_shell).18 E F0 1.069
(The shell sets this option if it is started in restricted mode \(see)
184 684 R F2 1.069(RESTRICTED SHELL)3.569 F F0(belo)184 696 Q 4.178
184 708 R F2 1.069(RESTRICTED SHELL)3.569 F F0(belo)184 720 Q 4.178
(w\). The)-.25 F -.25(va)4.178 G 1.678(lue may not be changed.).25 F
1.678(This is not reset when the startup \214les are)6.678 F -.15(exe)
184 708 S(cuted, allo).15 E(wing the startup \214les to disco)-.25 E
-.15(ve)-.15 G 2.5(rw).15 G(hether or not a shell is restricted.)-2.5 E
1.678(This is not reset when the startup \214les are)6.678 F
(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(18)198.725 E 0 Cg EP
%%Page: 19 19
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48
(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10
/Times-Bold@0 SF(shift_v)144 84 Q(erbose)-.1 E F0 .502(If set, the)184
96 R F1(shift)3.002 E F0 -.2(bu)3.002 G .501
(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E -.15(exe)184
84 S(cuted, allo).15 E(wing the startup \214les to disco)-.25 E -.15(ve)
-.15 G 2.5(rw).15 G(hether or not a shell is restricted.)-2.5 E/F1 10
/Times-Bold@0 SF(shift_v)144 96 Q(erbose)-.1 E F0 .502(If set, the)184
108 R F1(shift)3.002 E F0 -.2(bu)3.002 G .501
(iltin prints an error message when the shift count e).2 F .501
(xceeds the number)-.15 F(of positional parameters.)184 108 Q F1(sour)
144 120 Q(cepath)-.18 E F0 .77(If set, the)184 132 R F1(sour)3.27 E(ce)
(xceeds the number)-.15 F(of positional parameters.)184 120 Q F1(sour)
144 132 Q(cepath)-.18 E F0 .77(If set, the)184 144 R F1(sour)3.27 E(ce)
-.18 E F0(\()3.27 E F1(.)A F0 3.27(\)b)C .77(uiltin uses the v)-3.47 F
.771(alue of)-.25 F/F2 9/Times-Bold@0 SF -.666(PA)3.271 G(TH)-.189 E F0
.771(to \214nd the directory containing the)3.021 F
(\214le supplied as an ar)184 144 Q 2.5(gument. This)-.18 F
(option is enabled by def)2.5 E(ault.)-.1 E F1(xpg_echo)144 156 Q F0
(If set, the)184 168 Q F1(echo)2.5 E F0 -.2(bu)2.5 G(iltin e).2 E
(\214le supplied as an ar)184 156 Q 2.5(gument. This)-.18 F
(option is enabled by def)2.5 E(ault.)-.1 E F1(xpg_echo)144 168 Q F0
(If set, the)184 180 Q F1(echo)2.5 E F0 -.2(bu)2.5 G(iltin e).2 E
(xpands backslash-escape sequences by def)-.15 E(ault.)-.1 E F1(suspend)
108 180 Q F0([)2.5 E F1<ad66>A F0(])A 1.002(Suspend the e)144 192 R -.15
108 192 Q F0([)2.5 E F1<ad66>A F0(])A 1.002(Suspend the e)144 204 R -.15
(xe)-.15 G 1.002(cution of this shell until it recei).15 F -.15(ve)-.25
G 3.501(sa).15 G F2(SIGCONT)A F0 3.501(signal. A)3.251 F 1.001
(login shell cannot be)3.501 F .022(suspended; the)144 204 R F1<ad66>
(login shell cannot be)3.501 F .022(suspended; the)144 216 R F1<ad66>
2.522 E F0 .022(option can be used to o)2.522 F -.15(ve)-.15 G .022
(rride this and force the suspension.).15 F .023(The return status is)
5.023 F 2.5(0u)144 216 S(nless the shell is a login shell and)-2.5 E F1
5.023 F 2.5(0u)144 228 S(nless the shell is a login shell and)-2.5 E F1
<ad66>2.5 E F0(is not supplied, or if job control is not enabled.)2.5 E
F1(test)108 228 Q/F3 10/Times-Italic@0 SF -.2(ex)2.5 G(pr).2 E F1([)108
240 Q F3 -.2(ex)2.5 G(pr).2 E F1(])2.5 E F0 1.15
F1(test)108 240 Q/F3 10/Times-Italic@0 SF -.2(ex)2.5 G(pr).2 E F1([)108
252 Q F3 -.2(ex)2.5 G(pr).2 E F1(])2.5 E F0 1.15
(Return a status of 0 or 1 depending on the e)6.77 F -.25(va)-.25 G 1.15
(luation of the conditional e).25 F(xpression)-.15 E F3 -.2(ex)3.65 G
(pr).2 E F0 6.15(.E).73 G(ach)-6.15 E 1.187
(operator and operand must be a separate ar)144 252 R 3.688
(operator and operand must be a separate ar)144 264 R 3.688
(gument. Expressions)-.18 F 1.188(are composed of the primaries)3.688 F
1.89(described abo)144 264 R 2.19 -.15(ve u)-.15 H(nder).15 E F2
1.89(described abo)144 276 R 2.19 -.15(ve u)-.15 H(nder).15 E F2
(CONDITION)4.39 E 1.89(AL EXPRESSIONS)-.18 F/F4 9/Times-Roman@0 SF(.)A
F1(test)6.39 E F0 1.889(does not accept an)4.389 F 4.389(yo)-.15 G 1.889
(ptions, nor)-4.389 F(does it accept and ignore an ar)144 276 Q
(ptions, nor)-4.389 F(does it accept and ignore an ar)144 288 Q
(gument of)-.18 E F1<adad>2.5 E F0(as signifying the end of options.)2.5
E .785(Expressions may be combined using the follo)144 294 R .786
E .785(Expressions may be combined using the follo)144 306 R .786
(wing operators, listed in decreasing order of prece-)-.25 F 3.412
(dence. The)144 306 R -.25(eva)3.412 G .912
(dence. The)144 318 R -.25(eva)3.412 G .912
(luation depends on the number of ar).25 F .911(guments; see belo)-.18 F
4.711 -.65(w. O)-.25 H .911(perator precedence is).65 F
(used when there are \214v)144 318 Q 2.5(eo)-.15 G 2.5(rm)-2.5 G(ore ar)
-2.5 E(guments.)-.18 E F1(!)144 330 Q F3 -.2(ex)2.5 G(pr).2 E F0 -.35
(used when there are \214v)144 330 Q 2.5(eo)-.15 G 2.5(rm)-2.5 G(ore ar)
-2.5 E(guments.)-.18 E F1(!)144 342 Q F3 -.2(ex)2.5 G(pr).2 E F0 -.35
(Tr)12.6 G(ue if).35 E F3 -.2(ex)2.5 G(pr).2 E F0(is f)3.23 E(alse.)-.1
E F1(\()144 342 Q F3 -.2(ex)2.5 G(pr).2 E F1(\))2.5 E F0 .26
E F1(\()144 354 Q F3 -.2(ex)2.5 G(pr).2 E F1(\))2.5 E F0 .26
(Returns the v)6.77 F .26(alue of)-.25 F F3 -.2(ex)2.76 G(pr).2 E F0
5.26(.T)C .26(his may be used to o)-5.26 F -.15(ve)-.15 G .26
(rride the normal precedence of opera-).15 F(tors.)180 354 Q F3 -.2(ex)
144 366 S(pr1).2 E F0<ad>2.5 E F1(a)A F3 -.2(ex)2.5 G(pr2).2 E F0 -.35
(Tr)180 378 S(ue if both).35 E F3 -.2(ex)2.5 G(pr1).2 E F0(and)2.5 E F3
-.2(ex)2.5 G(pr2).2 E F0(are true.)2.52 E F3 -.2(ex)144 390 S(pr1).2 E
F0<ad>2.5 E F1(o)A F3 -.2(ex)2.5 G(pr2).2 E F0 -.35(Tr)180 402 S
(rride the normal precedence of opera-).15 F(tors.)180 366 Q F3 -.2(ex)
144 378 S(pr1).2 E F0<ad>2.5 E F1(a)A F3 -.2(ex)2.5 G(pr2).2 E F0 -.35
(Tr)180 390 S(ue if both).35 E F3 -.2(ex)2.5 G(pr1).2 E F0(and)2.5 E F3
-.2(ex)2.5 G(pr2).2 E F0(are true.)2.52 E F3 -.2(ex)144 402 S(pr1).2 E
F0<ad>2.5 E F1(o)A F3 -.2(ex)2.5 G(pr2).2 E F0 -.35(Tr)180 414 S
(ue if either).35 E F3 -.2(ex)2.5 G(pr1).2 E F0(or)2.5 E F3 -.2(ex)2.5 G
(pr2).2 E F0(is true.)2.52 E F1(test)144 418.8 Q F0(and)2.5 E F1([)2.5 E
(pr2).2 E F0(is true.)2.52 E F1(test)144 430.8 Q F0(and)2.5 E F1([)2.5 E
F0 -.25(eva)2.5 G(luate conditional e).25 E
(xpressions using a set of rules based on the number of ar)-.15 E
(guments.)-.18 E 2.5(0a)144 436.8 S -.18(rg)-2.5 G(uments).18 E(The e)
180 448.8 Q(xpression is f)-.15 E(alse.)-.1 E 2.5(1a)144 460.8 S -.18
(rg)-2.5 G(ument).18 E(The e)180 472.8 Q
(guments.)-.18 E 2.5(0a)144 448.8 S -.18(rg)-2.5 G(uments).18 E(The e)
180 460.8 Q(xpression is f)-.15 E(alse.)-.1 E 2.5(1a)144 472.8 S -.18
(rg)-2.5 G(ument).18 E(The e)180 484.8 Q
(xpression is true if and only if the ar)-.15 E(gument is not null.)-.18
E 2.5(2a)144 484.8 S -.18(rg)-2.5 G(uments).18 E .37(If the \214rst ar)
180 496.8 R .37(gument is)-.18 F F1(!)2.87 E F0 2.87(,t)C .37(he e)-2.87
E 2.5(2a)144 496.8 S -.18(rg)-2.5 G(uments).18 E .37(If the \214rst ar)
180 508.8 R .37(gument is)-.18 F F1(!)2.87 E F0 2.87(,t)C .37(he e)-2.87
F .37(xpression is true if and only if the second ar)-.15 F .37
(gument is null.)-.18 F .379(If the \214rst ar)180 508.8 R .38
(gument is null.)-.18 F .379(If the \214rst ar)180 520.8 R .38
(gument is one of the unary conditional operators listed abo)-.18 F .68
-.15(ve u)-.15 H(nder).15 E F2(CONDI-)2.88 E(TION)180 520.8 Q .553
-.15(ve u)-.15 H(nder).15 E F2(CONDI-)2.88 E(TION)180 532.8 Q .553
(AL EXPRESSIONS)-.18 F F4(,)A F0 .552(the e)2.802 F .552
(xpression is true if the unary test is true.)-.15 F .552
(If the \214rst ar)5.552 F(gu-)-.18 E(ment is not a v)180 532.8 Q
(If the \214rst ar)5.552 F(gu-)-.18 E(ment is not a v)180 544.8 Q
(alid unary conditional operator)-.25 E 2.5(,t)-.4 G(he e)-2.5 E
(xpression is f)-.15 E(alse.)-.1 E 2.5(3a)144 544.8 S -.18(rg)-2.5 G
(uments).18 E .236(The follo)180 556.8 R .236
(xpression is f)-.15 E(alse.)-.1 E 2.5(3a)144 556.8 S -.18(rg)-2.5 G
(uments).18 E .236(The follo)180 568.8 R .236
(wing conditions are applied in the order listed.)-.25 F .236
(If the second ar)5.236 F .236(gument is one of)-.18 F .855
(the binary conditional operators listed abo)180 568.8 R 1.155 -.15
(the binary conditional operators listed abo)180 580.8 R 1.155 -.15
(ve u)-.15 H(nder).15 E F2(CONDITION)3.355 E .855(AL EXPRESSIONS)-.18 F
F4(,)A F0(the)3.104 E .578(result of the e)180 580.8 R .578(xpression i\
F4(,)A F0(the)3.104 E .578(result of the e)180 592.8 R .578(xpression i\
s the result of the binary test using the \214rst and third ar)-.15 F
(guments)-.18 E 1.333(as operands.)180 592.8 R(The)6.333 E F1<ad61>3.833
(guments)-.18 E 1.333(as operands.)180 604.8 R(The)6.333 E F1<ad61>3.833
E F0(and)3.833 E F1<ad6f>3.832 E F0 1.332
(operators are considered binary operators when there are)3.832 F .558
(three ar)180 604.8 R 3.058(guments. If)-.18 F .558(the \214rst ar)3.058
(three ar)180 616.8 R 3.058(guments. If)-.18 F .558(the \214rst ar)3.058
F .558(gument is)-.18 F F1(!)3.058 E F0 3.058(,t)C .558(he v)-3.058 F
.558(alue is the ne)-.25 F -.05(ga)-.15 G .558(tion of the tw).05 F
(o-ar)-.1 E(gument)-.18 E .521(test using the second and third ar)180
616.8 R 3.021(guments. If)-.18 F .521(the \214rst ar)3.021 F .52
628.8 R 3.021(guments. If)-.18 F .521(the \214rst ar)3.021 F .52
(gument is e)-.18 F(xactly)-.15 E F1(\()3.02 E F0 .52(and the third)3.02
F(ar)180 628.8 Q .485(gument is e)-.18 F(xactly)-.15 E F1(\))2.985 E F0
F(ar)180 640.8 Q .485(gument is e)-.18 F(xactly)-.15 E F1(\))2.985 E F0
2.985(,t)C .485(he result is the one-ar)-2.985 F .485
(gument test of the second ar)-.18 F 2.985(gument. Other)-.18 F(-)-.2 E
(wise, the e)180 640.8 Q(xpression is f)-.15 E(alse.)-.1 E 2.5(4a)144
652.8 S -.18(rg)-2.5 G(uments).18 E .385(If the \214rst ar)180 664.8 R
(wise, the e)180 652.8 Q(xpression is f)-.15 E(alse.)-.1 E 2.5(4a)144
664.8 S -.18(rg)-2.5 G(uments).18 E .385(If the \214rst ar)180 676.8 R
.385(gument is)-.18 F F1(!)2.885 E F0 2.885(,t)C .385
(he result is the ne)-2.885 F -.05(ga)-.15 G .384(tion of the three-ar)
.05 F .384(gument e)-.18 F .384(xpression com-)-.15 F 1.647
(posed of the remaining ar)180 676.8 R 4.147(guments. Otherwise,)-.18 F
(posed of the remaining ar)180 688.8 R 4.147(guments. Otherwise,)-.18 F
1.647(the e)4.147 F 1.648(xpression is parsed and e)-.15 F -.25(va)-.25
G(luated).25 E(according to precedence using the rules listed abo)180
688.8 Q -.15(ve)-.15 G(.).15 E 2.5(5o)144 700.8 S 2.5(rm)-2.5 G(ore ar)
-2.5 E(guments)-.18 E 1.635(The e)180 712.8 R 1.635
(xpression is parsed and e)-.15 F -.25(va)-.25 G 1.635
(luated according to precedence using the rules listed).25 F(abo)180
724.8 Q -.15(ve)-.15 G(.).15 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735
700.8 Q -.15(ve)-.15 G(.).15 E(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735
E(19)198.725 E 0 Cg EP
%%Page: 20 20
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48
(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10
/Times-Bold@0 SF(times)108 84 Q F0 1.229(Print the accumulated user and\
system times for the shell and for processes run from the shell.)13.23
F(The return status is 0.)144 96 Q F1(trap)108 112.8 Q F0([)2.5 E F1
(\255lp)A F0 2.5(][)C([)-2.5 E/F2 10/Times-Italic@0 SF(ar)A(g)-.37 E F0
(])A F2(sigspec)2.5 E F0(...])2.5 E .703(The command)144 124.8 R F2(ar)
3.533 E(g)-.37 E F0 .703(is to be read and e)3.423 F -.15(xe)-.15 G .702
(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E 2.5(5o)144
84 S 2.5(rm)-2.5 G(ore ar)-2.5 E(guments)-.18 E 1.635(The e)180 96 R
1.635(xpression is parsed and e)-.15 F -.25(va)-.25 G 1.635
(luated according to precedence using the rules listed).25 F(abo)180 108
Q -.15(ve)-.15 G(.).15 E(When used with)144 126 Q/F1 10/Times-Bold@0 SF
(test)2.5 E F0(or)2.5 E F1([)2.5 E F0 2.5(,t)C(he)-2.5 E F1(<)2.5 E F0
(and)2.5 E F1(>)2.5 E F0(operators sort le)2.5 E
(xicographically using ASCII ordering.)-.15 E F1(times)108 142.8 Q F0
1.229(Print the accumulated user and system times for the shell and for\
processes run from the shell.)13.23 F(The return status is 0.)144 154.8
Q F1(trap)108 171.6 Q F0([)2.5 E F1(\255lp)A F0 2.5(][)C([)-2.5 E/F2 10
/Times-Italic@0 SF(ar)A(g)-.37 E F0(])A F2(sigspec)2.5 E F0(...])2.5 E
.703(The command)144 183.6 R F2(ar)3.533 E(g)-.37 E F0 .703
(is to be read and e)3.423 F -.15(xe)-.15 G .702
(cuted when the shell recei).15 F -.15(ve)-.25 G 3.202(ss).15 G
(ignal\(s\))-3.202 E F2(sigspec)3.202 E F0 5.702(.I).31 G(f)-5.702 E F2
(ar)3.532 E(g)-.37 E F0(is)3.422 E .608(absent \(and there is a single)
144 136.8 R F2(sigspec)3.108 E F0 3.108(\)o)C(r)-3.108 E F1<ad>3.108 E
144 195.6 R F2(sigspec)3.108 E F0 3.108(\)o)C(r)-3.108 E F1<ad>3.108 E
F0 3.108(,e)C .608
(ach speci\214ed signal is reset to its original disposition)-3.108 F
.659(\(the v)144 148.8 R .659(alue it had upon entrance to the shell\).)
.659(\(the v)144 207.6 R .659(alue it had upon entrance to the shell\).)
-.25 F(If)5.658 E F2(ar)3.488 E(g)-.37 E F0 .658
(is the null string the signal speci\214ed by each)3.378 F F2(sigspec)
144.34 160.8 Q F0 .58(is ignored by the shell and by the commands it in)
144.34 219.6 Q F0 .58(is ignored by the shell and by the commands it in)
3.39 F -.2(vo)-.4 G -.1(ke).2 G 3.081(s. If).1 F F2(ar)3.411 E(g)-.37 E
F0 .581(is not present and)3.301 F F1<ad70>3.081 E F0(has)3.081 E 1.215
(been supplied, then the trap commands associated with each)144 172.8 R
(been supplied, then the trap commands associated with each)144 231.6 R
F2(sigspec)4.054 E F0 1.214(are displayed.)4.024 F 1.214(If no ar)6.214
F(gu-)-.18 E .86(ments are supplied or if only)144 184.8 R F1<ad70>3.36
F(gu-)-.18 E .86(ments are supplied or if only)144 243.6 R F1<ad70>3.36
E F0 .86(is gi)3.36 F -.15(ve)-.25 G(n,).15 E F1(trap)3.36 E F0 .86
(prints the list of commands associated with each)3.36 F 2.83
(signal. The)144 196.8 R F1<ad6c>2.83 E F0 .33(option causes the shell \
(signal. The)144 255.6 R F1<ad6c>2.83 E F0 .33(option causes the shell \
to print a list of signal names and their corresponding num-)2.83 F 4.31
(bers. Each)144 208.8 R F2(sigspec)4.65 E F0 1.811
(bers. Each)144 267.6 R F2(sigspec)4.65 E F0 1.811
(is either a signal name de\214ned in <)4.62 F F2(signal.h)A F0 1.811
(>, or a signal number)B 6.811(.S)-.55 G(ignal)-6.811 E
(names are case insensiti)144 220.8 Q .3 -.15(ve a)-.25 H(nd the).15 E
(names are case insensiti)144 279.6 Q .3 -.15(ve a)-.25 H(nd the).15 E
/F3 9/Times-Bold@0 SF(SIG)2.5 E F0(pre\214x is optional.)2.25 E 1.649
(If a)144 238.8 R F2(sigspec)4.489 E F0(is)4.459 E F3(EXIT)4.149 E F0
(If a)144 297.6 R F2(sigspec)4.489 E F0(is)4.459 E F3(EXIT)4.149 E F0
1.649(\(0\) the command)3.899 F F2(ar)4.479 E(g)-.37 E F0 1.649(is e)
4.369 F -.15(xe)-.15 G 1.649(cuted on e).15 F 1.648(xit from the shell.)
-.15 F 1.648(If a)6.648 F F2(sigspec)4.488 E F0(is)4.458 E F3(DEB)144
250.8 Q(UG)-.09 E/F4 9/Times-Roman@0 SF(,)A F0 1.167(the command)3.417 F
309.6 Q(UG)-.09 E/F4 9/Times-Roman@0 SF(,)A F0 1.167(the command)3.417 F
F2(ar)3.997 E(g)-.37 E F0 1.167(is e)3.887 F -.15(xe)-.15 G 1.167
(cuted before e).15 F -.15(ve)-.25 G(ry).15 E F2 1.168(simple command)
3.667 F F0(,)A F2(for)3.668 E F0(command,)3.668 E F2(case)3.668 E F0
(com-)3.668 E(mand,)144 262.8 Q F2(select)2.647 E F0 .147(command, e)
(com-)3.668 E(mand,)144 321.6 Q F2(select)2.647 E F0 .147(command, e)
2.647 F -.15(ve)-.25 G .147(ry arithmetic).15 F F2(for)2.647 E F0 .146
(command, and before the \214rst command e)2.647 F -.15(xe)-.15 G .146
(cutes in a).15 F .145(shell function \(see)144 274.8 R F3 .145
(cutes in a).15 F .145(shell function \(see)144 333.6 R F3 .145
(SHELL GRAMMAR)2.645 F F0(abo)2.395 E -.15(ve)-.15 G 2.646(\). Refer).15
F .146(to the description of the)2.646 F F1(extdeb)2.646 E(ug)-.2 E F0
.146(option to)2.646 F(the)144 286.8 Q F1(shopt)3.201 E F0 -.2(bu)3.201
.146(option to)2.646 F(the)144 345.6 Q F1(shopt)3.201 E F0 -.2(bu)3.201
G .7(iltin for details of its ef).2 F .7(fect on the)-.25 F F1(DEB)3.2 E
(UG)-.1 E F0 3.2(trap. If)3.2 F(a)3.2 E F2(sigspec)3.54 E F0(is)3.51 E
F3(RETURN)3.2 E F4(,)A F0 .7(the com-)2.95 F(mand)144 298.8 Q F2(ar)
F3(RETURN)3.2 E F4(,)A F0 .7(the com-)2.95 F(mand)144 357.6 Q F2(ar)
3.473 E(g)-.37 E F0 .643(is e)3.363 F -.15(xe)-.15 G .643
(cuted each time a shell function or a script e).15 F -.15(xe)-.15 G
.644(cuted with the).15 F F1(.)3.144 E F0(or)3.144 E F1(sour)3.144 E(ce)
-.18 E F0 -.2(bu)3.144 G(iltins).2 E(\214nishes e)144 310.8 Q -.15(xe)
-.15 G(cuting.).15 E .929(If a)144 328.8 R F2(sigspec)3.769 E F0(is)
-.18 E F0 -.2(bu)3.144 G(iltins).2 E(\214nishes e)144 369.6 Q -.15(xe)
-.15 G(cuting.).15 E .929(If a)144 387.6 R F2(sigspec)3.769 E F0(is)
3.739 E F3(ERR)3.429 E F4(,)A F0 .929(the command)3.179 F F2(ar)3.759 E
(g)-.37 E F0 .929(is e)3.649 F -.15(xe)-.15 G .929(cuted whene).15 F
-.15(ve)-.25 G 3.429(ras).15 G .928(imple command has a non\255zero)
-3.429 F -.15(ex)144 340.8 S 1.008(it status, subject to the follo).15 F
-3.429 F -.15(ex)144 399.6 S 1.008(it status, subject to the follo).15 F
1.009(wing conditions.)-.25 F(The)6.009 E F3(ERR)3.509 E F0 1.009
(trap is not e)3.259 F -.15(xe)-.15 G 1.009(cuted if the f).15 F 1.009
(ailed com-)-.1 F .324
(mand is part of the command list immediately follo)144 352.8 R .324
(mand is part of the command list immediately follo)144 411.6 R .324
(wing a)-.25 F F1(while)2.824 E F0(or)2.824 E F1(until)2.824 E F0 -.1
(ke)2.824 G(yw)-.05 E .324(ord, part of the test)-.1 F .151(in an)144
364.8 R F2(if)2.661 E F0 .151(statement, part of a command e)4.611 F
423.6 R F2(if)2.661 E F0 .151(statement, part of a command e)4.611 F
-.15(xe)-.15 G .151(cuted in a).15 F F1(&&)2.651 E F0(or)2.651 E F1(||)
2.651 E F0 .151(list, or if the command')2.651 F 2.651(sr)-.55 G .151
(eturn v)-2.651 F(alue)-.25 E(is being in)144 376.8 Q -.15(ve)-.4 G
(eturn v)-2.651 F(alue)-.25 E(is being in)144 435.6 Q -.15(ve)-.4 G
(rted via).15 E F1(!)2.5 E F0 5(.T)C(hese are the same conditions obe)-5
E(yed by the)-.15 E F1(err)2.5 E(exit)-.18 E F0(option.)2.5 E 1.095
(Signals ignored upon entry to the shell cannot be trapped or reset.)144
394.8 R -.35(Tr)6.095 G 1.095(apped signals that are not).35 F .662
(being ignored are reset to their original v)144 406.8 R .662
453.6 R -.35(Tr)6.095 G 1.095(apped signals that are not).35 F .662
(being ignored are reset to their original v)144 465.6 R .662
(alues in a subshell or subshell en)-.25 F .662(vironment when one is)
-.4 F 2.5(created. The)144 418.8 R(return status is f)2.5 E(alse if an)
-.4 F 2.5(created. The)144 477.6 R(return status is f)2.5 E(alse if an)
-.1 E(y)-.15 E F2(sigspec)2.84 E F0(is in)2.81 E -.25(va)-.4 G
(lid; otherwise).25 E F1(trap)2.5 E F0(returns true.)2.5 E F1(type)108
435.6 Q F0([)2.5 E F1(\255aftpP)A F0(])A F2(name)2.5 E F0([)2.5 E F2
(name)A F0(...])2.5 E -.4(Wi)144 447.6 S .174
494.4 Q F0([)2.5 E F1(\255aftpP)A F0(])A F2(name)2.5 E F0([)2.5 E F2
(name)A F0(...])2.5 E -.4(Wi)144 506.4 S .174
(th no options, indicate ho).4 F 2.674(we)-.25 G(ach)-2.674 E F2(name)
3.034 E F0 -.1(wo)2.854 G .173
(uld be interpreted if used as a command name.).1 F .173(If the)5.173 F
F1<ad74>144 459.6 Q F0 .842(option is used,)3.342 F F1(type)3.342 E F0
F1<ad74>144 518.4 Q F0 .842(option is used,)3.342 F F1(type)3.342 E F0
.843(prints a string which is one of)3.343 F F2(alias)3.343 E F0(,).27 E
F2 -.1(ke)3.343 G(ywor)-.2 E(d)-.37 E F0(,).77 E F2(function)3.343 E F0
(,).24 E F2 -.2(bu)3.343 G(iltin).2 E F0 3.343(,o).24 G(r)-3.343 E F2
(\214le)5.253 E F0(if)3.523 E F2(name)144.36 471.6 Q F0 .087
(\214le)5.253 E F0(if)3.523 E F2(name)144.36 530.4 Q F0 .087
(is an alias, shell reserv)2.767 F .087(ed w)-.15 F .087
(ord, function, b)-.1 F .086(uiltin, or disk \214le, respecti)-.2 F -.15
(ve)-.25 G(ly).15 E 5.086(.I)-.65 G 2.586(ft)-5.086 G(he)-2.586 E F2
(name)2.946 E F0 .086(is not)2.766 F .118
(found, then nothing is printed, and an e)144 483.6 R .118
(found, then nothing is printed, and an e)144 542.4 R .118
(xit status of f)-.15 F .118(alse is returned.)-.1 F .119(If the)5.119 F
F1<ad70>2.619 E F0 .119(option is used,)2.619 F F1(type)2.619 E F0 .855
(either returns the name of the disk \214le that w)144 495.6 R .855
(either returns the name of the disk \214le that w)144 554.4 R .855
(ould be e)-.1 F -.15(xe)-.15 G .855(cuted if).15 F F2(name)3.715 E F0
.855(were speci\214ed as a com-)3.535 F .64(mand name, or nothing if)144
507.6 R/F5 10/Courier@0 SF .64(type -t name)3.14 F F0 -.1(wo)3.14 G .641
566.4 R/F5 10/Courier@0 SF .64(type -t name)3.14 F F0 -.1(wo)3.14 G .641
(uld not return).1 F F2(\214le)3.141 E F0 5.641(.T).18 G(he)-5.641 E F1
<ad50>3.141 E F0 .641(option forces a)3.141 F F3 -.666(PA)3.141 G(TH)
-.189 E F0 .113(search for each)144 519.6 R F2(name)2.613 E F0 2.613(,e)
-.189 E F0 .113(search for each)144 578.4 R F2(name)2.613 E F0 2.613(,e)
C -.15(ve)-2.863 G 2.613(ni).15 G(f)-2.613 E F5 .113(type -t name)2.613
F F0 -.1(wo)2.613 G .113(uld not return).1 F F2(\214le)2.613 E F0 5.113
(.I).18 G 2.613(fa)-5.113 G .112(command is hashed,)-.001 F F1<ad70>
2.612 E F0(and)144 531.6 Q F1<ad50>2.944 E F0 .444(print the hashed v)
2.612 E F0(and)144 590.4 Q F1<ad50>2.944 E F0 .444(print the hashed v)
2.944 F .444(alue, not necessarily the \214le that appears \214rst in)
-.25 F F3 -.666(PA)2.945 G(TH)-.189 E F4(.)A F0 .445(If the)4.945 F F1
<ad61>2.945 E F0(option)2.945 E .265(is used,)144 543.6 R F1(type)2.765
<ad61>2.945 E F0(option)2.945 E .265(is used,)144 602.4 R F1(type)2.765
E F0 .265(prints all of the places that contain an e)2.765 F -.15(xe)
-.15 G .265(cutable named).15 F F2(name)2.765 E F0 5.265(.T).18 G .265
(his includes aliases)-5.265 F .426(and functions, if and only if the)
144 555.6 R F1<ad70>2.926 E F0 .426(option is not also used.)2.926 F
144 614.4 R F1<ad70>2.926 E F0 .426(option is not also used.)2.926 F
.427(The table of hashed commands is not)5.426 F .549
(consulted when using)144 567.6 R F1<ad61>3.049 E F0 5.549(.T)C(he)
(consulted when using)144 626.4 R F1<ad61>3.049 E F0 5.549(.T)C(he)
-5.549 E F1<ad66>3.049 E F0 .548
(option suppresses shell function lookup, as with the)3.049 F F1
(command)3.048 E F0 -.2(bu)144 579.6 S(iltin.).2 E F1(type)5 E F0
(command)3.048 E F0 -.2(bu)144 638.4 S(iltin.).2 E F1(type)5 E F0
(returns true if all of the ar)2.5 E(guments are found, f)-.18 E
(alse if an)-.1 E 2.5(ya)-.15 G(re not found.)-2.5 E F1(ulimit)108 596.4
(alse if an)-.1 E 2.5(ya)-.15 G(re not found.)-2.5 E F1(ulimit)108 655.2
Q F0([)2.5 E F1(\255HST)A(abcde\214lmnpqrstuvx)-.92 E F0([)2.5 E F2
(limit)A F0(]])A(Pro)144 608.4 Q .243(vides control o)-.15 F -.15(ve)
(limit)A F0(]])A(Pro)144 667.2 Q .243(vides control o)-.15 F -.15(ve)
-.15 G 2.743(rt).15 G .243(he resources a)-2.743 F -.25(va)-.2 G .244
(ilable to the shell and to processes started by it, on systems).25 F
.944(that allo)144 620.4 R 3.444(ws)-.25 G .944(uch control.)-3.444 F
.944(that allo)144 679.2 R 3.444(ws)-.25 G .944(uch control.)-3.444 F
(The)5.944 E F1<ad48>3.444 E F0(and)3.444 E F1<ad53>3.444 E F0 .943
(options specify that the hard or soft limit is set for the)3.444 F(gi)
144 632.4 Q -.15(ve)-.25 G 2.708(nr).15 G 2.708(esource. A)-2.708 F .208
144 691.2 Q -.15(ve)-.25 G 2.708(nr).15 G 2.708(esource. A)-2.708 F .208
(hard limit cannot be increased by a non-root user once it is set; a so\
ft limit may)2.708 F .426(be increased up to the v)144 644.4 R .426
ft limit may)2.708 F .426(be increased up to the v)144 703.2 R .426
(alue of the hard limit.)-.25 F .425(If neither)5.426 F F1<ad48>2.925 E
F0(nor)2.925 E F1<ad53>2.925 E F0 .425
(is speci\214ed, both the soft and)2.925 F .139(hard limits are set.)144
656.4 R .139(The v)5.139 F .139(alue of)-.25 F F2(limit)2.729 E F0 .139
715.2 R .139(The v)5.139 F .139(alue of)-.25 F F2(limit)2.729 E F0 .139
(can be a number in the unit speci\214ed for the resource or one)3.319 F
.742(of the special v)144 668.4 R(alues)-.25 E F1(hard)3.242 E F0(,)A F1
.742(of the special v)144 727.2 R(alues)-.25 E F1(hard)3.242 E F0(,)A F1
(soft)3.241 E F0 3.241(,o)C(r)-3.241 E F1(unlimited)3.241 E F0 3.241(,w)
C .741(hich stand for the current hard limit, the current)-3.241 F .78
(soft limit, and no limit, respecti)144 680.4 R -.15(ve)-.25 G(ly).15 E
5.78(.I)-.65 G(f)-5.78 E F2(limit)3.37 E F0 .78
(is omitted, the current v)3.96 F .78(alue of the soft limit of the)-.25
F .499(resource is printed, unless the)144 692.4 R F1<ad48>2.999 E F0
.499(option is gi)2.999 F -.15(ve)-.25 G 2.999(n. When).15 F .498
(more than one resource is speci\214ed, the)2.999 F
(limit name and unit are printed before the v)144 704.4 Q 2.5
(alue. Other)-.25 F(options are interpreted as follo)2.5 E(ws:)-.25 E F1
<ad61>144 716.4 Q F0(All current limits are reported)25.3 E
C .741(hich stand for the current hard limit, the current)-3.241 F
(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(20)198.725 E 0 Cg EP
%%Page: 21 21
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48
(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10
/Times-Bold@0 SF<ad62>144 84 Q F0(The maximum sock)24.74 E(et b)-.1 E
(uf)-.2 E(fer size)-.25 E F1<ad63>144 96 Q F0
(The maximum size of core \214les created)25.86 E F1<ad64>144 108 Q F0
(The maximum size of a process')24.74 E 2.5(sd)-.55 G(ata se)-2.5 E
(gment)-.15 E F1<ad65>144 120 Q F0
(The maximum scheduling priority \("nice"\))25.86 E F1<ad66>144 132 Q F0
(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E .78
(soft limit, and no limit, respecti)144 84 R -.15(ve)-.25 G(ly).15 E
5.78(.I)-.65 G(f)-5.78 E/F1 10/Times-Italic@0 SF(limit)3.37 E F0 .78
(is omitted, the current v)3.96 F .78(alue of the soft limit of the)-.25
F .499(resource is printed, unless the)144 96 R/F2 10/Times-Bold@0 SF
<ad48>2.999 E F0 .499(option is gi)2.999 F -.15(ve)-.25 G 2.999(n. When)
.15 F .498(more than one resource is speci\214ed, the)2.999 F
(limit name and unit are printed before the v)144 108 Q 2.5(alue. Other)
-.25 F(options are interpreted as follo)2.5 E(ws:)-.25 E F2<ad61>144 120
Q F0(All current limits are reported)25.3 E F2<ad62>144 132 Q F0
(The maximum sock)24.74 E(et b)-.1 E(uf)-.2 E(fer size)-.25 E F2<ad63>
144 144 Q F0(The maximum size of core \214les created)25.86 E F2<ad64>
144 156 Q F0(The maximum size of a process')24.74 E 2.5(sd)-.55 G
(ata se)-2.5 E(gment)-.15 E F2<ad65>144 168 Q F0
(The maximum scheduling priority \("nice"\))25.86 E F2<ad66>144 180 Q F0
(The maximum size of \214les written by the shell and its children)26.97
E F1<ad69>144 144 Q F0(The maximum number of pending signals)27.52 E F1
<ad6c>144 156 Q F0(The maximum size that may be lock)27.52 E
(ed into memory)-.1 E F1<ad6d>144 168 Q F0
E F2<ad69>144 192 Q F0(The maximum number of pending signals)27.52 E F2
<ad6c>144 204 Q F0(The maximum size that may be lock)27.52 E
(ed into memory)-.1 E F2<ad6d>144 216 Q F0
(The maximum resident set size \(man)21.97 E 2.5(ys)-.15 G
(ystems do not honor this limit\))-2.5 E F1<ad6e>144 180 Q F0 .791(The \
(ystems do not honor this limit\))-2.5 E F2<ad6e>144 228 Q F0 .791(The \
maximum number of open \214le descriptors \(most systems do not allo)
24.74 F 3.291(wt)-.25 G .791(his v)-3.291 F .791(alue to)-.25 F
(be set\))180 192 Q F1<ad70>144 204 Q F0
(The pipe size in 512-byte blocks \(this may not be set\))24.74 E F1
<ad71>144 216 Q F0(The maximum number of bytes in POSIX message queues)
24.74 E F1<ad72>144 228 Q F0(The maximum real-time scheduling priority)
25.86 E F1<ad73>144 240 Q F0(The maximum stack size)26.41 E F1<ad74>144
252 Q F0(The maximum amount of cpu time in seconds)26.97 E F1<ad75>144
264 Q F0(The maximum number of processes a)24.74 E -.25(va)-.2 G
(ilable to a single user).25 E F1<ad76>144 276 Q F0 .47
(be set\))180 240 Q F2<ad70>144 252 Q F0
(The pipe size in 512-byte blocks \(this may not be set\))24.74 E F2
<ad71>144 264 Q F0(The maximum number of bytes in POSIX message queues)
24.74 E F2<ad72>144 276 Q F0(The maximum real-time scheduling priority)
25.86 E F2<ad73>144 288 Q F0(The maximum stack size)26.41 E F2<ad74>144
300 Q F0(The maximum amount of cpu time in seconds)26.97 E F2<ad75>144
312 Q F0(The maximum number of processes a)24.74 E -.25(va)-.2 G
(ilable to a single user).25 E F2<ad76>144 324 Q F0 .47
(The maximum amount of virtual memory a)25.3 F -.25(va)-.2 G .47
(ilable to the shell and, on some systems, to).25 F(its children)180 288
Q F1<ad78>144 300 Q F0(The maximum number of \214le locks)25.3 E F1
<ad54>144 312 Q F0(The maximum number of threads)23.63 E(If)144 328.8 Q
/F2 10/Times-Italic@0 SF(limit)2.933 E F0 .343(is gi)3.523 F -.15(ve)
-.25 G .343(n, it is the ne).15 F 2.843(wv)-.25 G .343
(alue of the speci\214ed resource \(the)-3.093 F F1<ad61>2.843 E F0 .343
(ilable to the shell and, on some systems, to).25 F(its children)180 336
Q F2<ad78>144 348 Q F0(The maximum number of \214le locks)25.3 E F2
<ad54>144 360 Q F0(The maximum number of threads)23.63 E(If)144 376.8 Q
F1(limit)2.933 E F0 .343(is gi)3.523 F -.15(ve)-.25 G .343
(n, it is the ne).15 F 2.843(wv)-.25 G .343
(alue of the speci\214ed resource \(the)-3.093 F F2<ad61>2.843 E F0 .343
(option is display only\).)2.843 F .343(If no)5.343 F .176(option is gi)
144 340.8 R -.15(ve)-.25 G .176(n, then).15 F F1<ad66>2.676 E F0 .175
144 388.8 R -.15(ve)-.25 G .176(n, then).15 F F2<ad66>2.676 E F0 .175
(is assumed.)2.676 F -1.11(Va)5.175 G .175
(lues are in 1024-byte increments, e)1.11 F .175(xcept for)-.15 F F1
<ad74>2.675 E F0 2.675(,w)C .175(hich is in)-2.675 F(seconds,)144 352.8
Q F1<ad70>2.515 E F0 2.515(,w)C .015
(hich is in units of 512-byte blocks, and)-2.515 F F1<ad54>2.516 E F0(,)
A F1<ad62>2.516 E F0(,)A F1<ad6e>2.516 E F0 2.516(,a)C(nd)-2.516 E F1
(lues are in 1024-byte increments, e)1.11 F .175(xcept for)-.15 F F2
<ad74>2.675 E F0 2.675(,w)C .175(hich is in)-2.675 F(seconds,)144 400.8
Q F2<ad70>2.515 E F0 2.515(,w)C .015
(hich is in units of 512-byte blocks, and)-2.515 F F2<ad54>2.516 E F0(,)
A F2<ad62>2.516 E F0(,)A F2<ad6e>2.516 E F0 2.516(,a)C(nd)-2.516 E F2
<ad75>2.516 E F0 2.516(,w)C .016(hich are unscaled v)-2.516 F(al-)-.25 E
3.788(ues. The)144 364.8 R 1.287(return status is 0 unless an in)3.787 F
3.788(ues. The)144 412.8 R 1.287(return status is 0 unless an in)3.787 F
-.25(va)-.4 G 1.287(lid option or ar).25 F 1.287
(gument is supplied, or an error occurs)-.18 F(while setting a ne)144
376.8 Q 2.5(wl)-.25 G(imit.)-2.5 E F1(umask)108 393.6 Q F0([)2.5 E F1
<ad70>A F0 2.5(][)C F1<ad53>-2.5 E F0 2.5(][)C F2(mode)-2.5 E F0(])A .2
(The user \214le-creation mask is set to)144 405.6 R F2(mode)2.7 E F0
5.2(.I).18 G(f)-5.2 E F2(mode)3.08 E F0(be)2.88 E .2
424.8 Q 2.5(wl)-.25 G(imit.)-2.5 E F2(umask)108 441.6 Q F0([)2.5 E F2
<ad70>A F0 2.5(][)C F2<ad53>-2.5 E F0 2.5(][)C F1(mode)-2.5 E F0(])A .2
(The user \214le-creation mask is set to)144 453.6 R F1(mode)2.7 E F0
5.2(.I).18 G(f)-5.2 E F1(mode)3.08 E F0(be)2.88 E .2
(gins with a digit, it is interpreted as an octal)-.15 F .066(number; o\
therwise it is interpreted as a symbolic mode mask similar to that acce\
pted by)144 417.6 R F2 -.15(ch)2.566 G(mod).15 E F0(\(1\).).77 E(If)144
429.6 Q F2(mode)3.262 E F0 .382(is omitted, the current v)3.062 F .382
(alue of the mask is printed.)-.25 F(The)5.382 E F1<ad53>2.882 E F0 .382
pted by)144 465.6 R F1 -.15(ch)2.566 G(mod).15 E F0(\(1\).).77 E(If)144
477.6 Q F1(mode)3.262 E F0 .382(is omitted, the current v)3.062 F .382
(alue of the mask is printed.)-.25 F(The)5.382 E F2<ad53>2.882 E F0 .382
(option causes the mask to be)2.882 F .547
(printed in symbolic form; the def)144 441.6 R .547
(printed in symbolic form; the def)144 489.6 R .547
(ault output is an octal number)-.1 F 5.547(.I)-.55 G 3.047(ft)-5.547 G
(he)-3.047 E F1<ad70>3.047 E F0 .547(option is supplied, and)3.047 F F2
(mode)144.38 453.6 Q F0 .551
(he)-3.047 E F2<ad70>3.047 E F0 .547(option is supplied, and)3.047 F F1
(mode)144.38 501.6 Q F0 .551
(is omitted, the output is in a form that may be reused as input.)3.231
F .552(The return status is 0 if the)5.552 F(mode w)144 465.6 Q
(as successfully changed or if no)-.1 E F2(mode)2.5 E F0(ar)2.5 E
(gument w)-.18 E(as supplied, and f)-.1 E(alse otherwise.)-.1 E F1
(unalias)108 482.4 Q F0<5bad>2.5 E F1(a)A F0 2.5(][)C F2(name)-2.5 E F0
(...])2.5 E(Remo)144 494.4 Q 1.955 -.15(ve e)-.15 H(ach).15 E F2(name)
F .552(The return status is 0 if the)5.552 F(mode w)144 513.6 Q
(as successfully changed or if no)-.1 E F1(mode)2.5 E F0(ar)2.5 E
(gument w)-.18 E(as supplied, and f)-.1 E(alse otherwise.)-.1 E F2
(unalias)108 530.4 Q F0<5bad>2.5 E F2(a)A F0 2.5(][)C F1(name)-2.5 E F0
(...])2.5 E(Remo)144 542.4 Q 1.955 -.15(ve e)-.15 H(ach).15 E F1(name)
4.155 E F0 1.655(from the list of de\214ned aliases.)4.155 F(If)6.655 E
F1<ad61>4.155 E F0 1.655(is supplied, all alias de\214nitions are)4.155
F(remo)144 506.4 Q -.15(ve)-.15 G 2.5(d. The).15 F(return v)2.5 E
(alue is true unless a supplied)-.25 E F2(name)2.86 E F0
(is not a de\214ned alias.)2.68 E F1(unset)108 523.2 Q F0<5bad>2.5 E F1
(fv)A F0 2.5(][)C F2(name)-2.5 E F0(...])2.5 E -.15(Fo)144 535.2 S 3.106
(re).15 G(ach)-3.106 E F2(name)3.106 E F0 3.106(,r).18 G(emo)-3.106 E
F2<ad61>4.155 E F0 1.655(is supplied, all alias de\214nitions are)4.155
F(remo)144 554.4 Q -.15(ve)-.15 G 2.5(d. The).15 F(return v)2.5 E
(alue is true unless a supplied)-.25 E F1(name)2.86 E F0
(is not a de\214ned alias.)2.68 E F2(unset)108 571.2 Q F0<5bad>2.5 E F2
(fv)A F0 2.5(][)C F1(name)-2.5 E F0(...])2.5 E -.15(Fo)144 583.2 S 3.106
(re).15 G(ach)-3.106 E F1(name)3.106 E F0 3.106(,r).18 G(emo)-3.106 E
.906 -.15(ve t)-.15 H .606(he corresponding v).15 F .607
(ariable or function.)-.25 F .607(If no options are supplied, or the)
5.607 F F1<ad76>144 547.2 Q F0 .305(option is gi)2.805 F -.15(ve)-.25 G
.305(n, each).15 F F2(name)3.165 E F0 .305(refers to a shell v)2.985 F
5.607 F F2<ad76>144 595.2 Q F0 .305(option is gi)2.805 F -.15(ve)-.25 G
.305(n, each).15 F F1(name)3.165 E F0 .305(refers to a shell v)2.985 F
2.805(ariable. Read-only)-.25 F -.25(va)2.805 G .304
(riables may not be unset.).25 F(If)5.304 E F1<ad66>144 559.2 Q F0 .459
(is speci\214ed, each)2.959 F F2(name)3.319 E F0 .459
(riables may not be unset.).25 F(If)5.304 E F2<ad66>144 607.2 Q F0 .459
(is speci\214ed, each)2.959 F F1(name)3.319 E F0 .459
(refers to a shell function, and the function de\214nition is remo)3.139
F -.15(ve)-.15 G 2.96(d. Each).15 F .903(unset v)144 571.2 R .903
F -.15(ve)-.15 G 2.96(d. Each).15 F .903(unset v)144 619.2 R .903
(ariable or function is remo)-.25 F -.15(ve)-.15 G 3.402(df).15 G .902
(rom the en)-3.402 F .902(vironment passed to subsequent commands.)-.4 F
(If)5.902 E(an)144 583.2 Q 6.915(yo)-.15 G(f)-6.915 E/F3 9/Times-Bold@0
(If)5.902 E(an)144 631.2 Q 6.915(yo)-.15 G(f)-6.915 E/F3 9/Times-Bold@0
SF(COMP_W)6.915 E(ORDBREAKS)-.09 E/F4 9/Times-Roman@0 SF(,)A F3(RANDOM)
6.665 E F4(,)A F3(SECONDS)6.665 E F4(,)A F3(LINENO)6.665 E F4(,)A F3
(HISTCMD)6.666 E F4(,)A F3(FUNCN)6.666 E(AME)-.18 E F4(,)A F3(GR)144
595.2 Q(OUPS)-.27 E F4(,)A F0(or)2.523 E F3(DIRST)2.773 E -.495(AC)-.81
643.2 Q(OUPS)-.27 E F4(,)A F0(or)2.523 E F3(DIRST)2.773 E -.495(AC)-.81
G(K).495 E F0 .272(are unset, the)2.522 F 2.772(yl)-.15 G .272
(ose their special properties, e)-2.772 F -.15(ve)-.25 G 2.772(ni).15 G
2.772(ft)-2.772 G(he)-2.772 E 2.772(ya)-.15 G .272(re subsequently)
-2.772 F 2.5(reset. The)144 607.2 R -.15(ex)2.5 G
(it status is true unless a).15 E F2(name)2.86 E F0(is readonly)2.68 E
(.)-.65 E F1(wait)108 624 Q F0([)2.5 E F2 2.5(n.)C(..)-2.5 E F0(])A -.8
(Wa)144 636 S .288
-2.772 F 2.5(reset. The)144 655.2 R -.15(ex)2.5 G
(it status is true unless a).15 E F1(name)2.86 E F0(is readonly)2.68 E
(.)-.65 E F2(wait)108 672 Q F0([)2.5 E F1 2.5(n.)C(..)-2.5 E F0(])A -.8
(Wa)144 684 S .288
(it for each speci\214ed process and return its termination status.).8 F
(Each)5.288 E F2(n)3.148 E F0 .288(may be a process ID or a)3.028 F .722
(job speci\214cation; if a job spec is gi)144 648 R -.15(ve)-.25 G .722
(Each)5.288 E F1(n)3.148 E F0 .288(may be a process ID or a)3.028 F .722
(job speci\214cation; if a job spec is gi)144 696 R -.15(ve)-.25 G .722
(n, all processes in that job').15 F 3.222(sp)-.55 G .722(ipeline are w)
-3.222 F .722(aited for)-.1 F 5.722(.I)-.55 G(f)-5.722 E F2(n)3.582 E F0
(is)3.462 E 1.265(not gi)144 660 R -.15(ve)-.25 G 1.265
-3.222 F .722(aited for)-.1 F 5.722(.I)-.55 G(f)-5.722 E F1(n)3.582 E F0
(is)3.462 E 1.265(not gi)144 708 R -.15(ve)-.25 G 1.265
(n, all currently acti).15 F 1.565 -.15(ve c)-.25 H 1.265
(hild processes are w).15 F 1.265(aited for)-.1 F 3.765(,a)-.4 G 1.266
(nd the return status is zero.)-3.765 F(If)6.266 E F2(n)4.126 E F0 .457
(speci\214es a non-e)144 672 R .457
(nd the return status is zero.)-3.765 F(If)6.266 E F1(n)4.126 E F0 .457
(speci\214es a non-e)144 720 R .457
(xistent process or job, the return status is 127.)-.15 F .457
(Otherwise, the return status is the)5.457 F -.15(ex)144 684 S
(it status of the last process or job w).15 E(aited for)-.1 E(.)-.55 E
/F5 10.95/Times-Bold@0 SF(SEE ALSO)72 700.8 Q F0(bash\(1\), sh\(1\))108
712.8 Q(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(21)198.725 E 0 Cg EP
(Otherwise, the return status is the)5.457 F(GNU Bash-4.0)72 768 Q
(2004 Apr 20)148.735 E(21)198.725 E 0 Cg EP
%%Page: 22 22
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 290.48
(TINS\(1\) B)-.92 F(ASH_B)-.35 E(UIL)-.1 E(TINS\(1\))-.92 E -.15(ex)144
84 S(it status of the last process or job w).15 E(aited for)-.1 E(.)-.55
E/F1 10.95/Times-Bold@0 SF(SEE ALSO)72 100.8 Q F0(bash\(1\), sh\(1\))108
112.8 Q(GNU Bash-4.0)72 768 Q(2004 Apr 20)148.735 E(22)198.725 E 0 Cg EP
%%Trailer
end
%%EOF
+1 -1
View File
@@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Tue Dec 7 16:12:42 2010
%%CreationDate: Tue Dec 28 14:30:24 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 Wed Oct 20 21:37:22 EDT 2010
@set LASTCHANGE Tue Dec 28 13:41:22 EST 2010
@set EDITION 4.2
@set VERSION 4.2
@set UPDATED 20 October 2010
@set UPDATED-MONTH October 2010
@set UPDATED 28 December 2010
@set UPDATED-MONTH December 2010
+21 -7
View File
@@ -610,19 +610,17 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
invert = (command->flags & CMD_INVERT_RETURN) != 0;
ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0;
last_command_exit_value = wait_for (paren_pid);
exec_result = wait_for (paren_pid);
/* If we have to, invert the return value. */
if (invert)
exec_result = ((last_command_exit_value == EXECUTION_SUCCESS)
exec_result = ((exec_result == EXECUTION_SUCCESS)
? EXECUTION_FAILURE
: EXECUTION_SUCCESS);
else
exec_result = last_command_exit_value;
last_command_exit_value = exec_result;
if (user_subshell && was_error_trap && ignore_return == 0 && invert == 0 && exec_result != EXECUTION_SUCCESS)
{
last_command_exit_value = exec_result;
save_line_number = line_number;
line_number = line_number_for_err_trap;
run_error_trap ();
@@ -631,12 +629,11 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
if (user_subshell && ignore_return == 0 && invert == 0 && exit_immediately_on_error && exec_result != EXECUTION_SUCCESS)
{
last_command_exit_value = exec_result;
run_pending_traps ();
jump_to_top_level (ERREXIT);
}
return (last_command_exit_value = exec_result);
return (last_command_exit_value);
}
else
{
@@ -3738,6 +3735,10 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
}
else
{
/* Don't let simple commands that aren't the last command in a
pipeline change $? for the rest of the pipeline (or at all). */
if (pipe_out != NO_PIPE)
result = last_command_exit_value;
close_pipes (pipe_in, pipe_out);
#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD)
unlink_fifo_list ();
@@ -4720,6 +4721,9 @@ execute_disk_command (words, redirects, command_line, pipe_in, pipe_out,
hookf = find_function (NOTFOUND_HOOK);
if (hookf == 0)
{
/* Make sure filenames are displayed using printable characters */
if (ansic_shouldquote (pathname))
pathname = ansic_quote (pathname, 0, NULL);
internal_error (_("%s: command not found"), pathname);
exit (EX_NOTFOUND); /* Posix.2 says the exit status is 127 */
}
@@ -5144,6 +5148,10 @@ do_piping (pipe_in, pipe_out)
dup_error (pipe_in, 0);
if (pipe_in > 0)
close (pipe_in);
#ifdef __CYGWIN__
/* Let stdio know the fd may have changed from text to binary mode. */
freopen (NULL, "r", stdin);
#endif /* __CYGWIN__ */
}
if (pipe_out != NO_PIPE)
{
@@ -5159,5 +5167,11 @@ do_piping (pipe_in, pipe_out)
if (dup2 (1, 2) < 0)
dup_error (1, 2);
}
#ifdef __CYGWIN__
/* Let stdio know the fd may have changed from text to binary mode, and
make sure to preserve stdout line buffering. */
freopen (NULL, "w", stdout);
sh_setlinebuf (stdout);
#endif /* __CYGWIN__ */
}
}
+23 -7
View File
@@ -610,19 +610,17 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
invert = (command->flags & CMD_INVERT_RETURN) != 0;
ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0;
last_command_exit_value = wait_for (paren_pid);
exec_result = wait_for (paren_pid);
/* If we have to, invert the return value. */
if (invert)
exec_result = ((last_command_exit_value == EXECUTION_SUCCESS)
exec_result = ((exec_result == EXECUTION_SUCCESS)
? EXECUTION_FAILURE
: EXECUTION_SUCCESS);
else
exec_result = last_command_exit_value;
last_command_exit_value = exec_result;
if (user_subshell && was_error_trap && ignore_return == 0 && invert == 0 && exec_result != EXECUTION_SUCCESS)
{
last_command_exit_value = exec_result;
save_line_number = line_number;
line_number = line_number_for_err_trap;
run_error_trap ();
@@ -631,12 +629,11 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
if (user_subshell && ignore_return == 0 && invert == 0 && exit_immediately_on_error && exec_result != EXECUTION_SUCCESS)
{
last_command_exit_value = exec_result;
run_pending_traps ();
jump_to_top_level (ERREXIT);
}
return (last_command_exit_value = exec_result);
return (last_command_exit_value);
}
else
{
@@ -684,6 +681,7 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
if (redirection_undo_list)
{
/* XXX - why copy here? */
my_undo_list = (REDIRECT *)copy_redirects (redirection_undo_list);
dispose_redirects (redirection_undo_list);
redirection_undo_list = (REDIRECT *)NULL;
@@ -693,6 +691,7 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
if (exec_redirection_undo_list)
{
/* XXX - why copy here? */
exec_undo_list = (REDIRECT *)copy_redirects (exec_redirection_undo_list);
dispose_redirects (exec_redirection_undo_list);
exec_redirection_undo_list = (REDIRECT *)NULL;
@@ -3736,6 +3735,10 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
}
else
{
/* Don't let simple commands that aren't the last command in a
pipeline change $? for the rest of the pipeline (or at all). */
if (pipe_out != NO_PIPE)
result = last_command_exit_value;
close_pipes (pipe_in, pipe_out);
#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD)
unlink_fifo_list ();
@@ -4718,6 +4721,9 @@ execute_disk_command (words, redirects, command_line, pipe_in, pipe_out,
hookf = find_function (NOTFOUND_HOOK);
if (hookf == 0)
{
/* Make sure filenames are displayed using printable characters */
if (ansic_shouldquote (pathname))
pathname = ansic_quote (pathname, 0, NULL);
internal_error (_("%s: command not found"), pathname);
exit (EX_NOTFOUND); /* Posix.2 says the exit status is 127 */
}
@@ -5142,6 +5148,10 @@ do_piping (pipe_in, pipe_out)
dup_error (pipe_in, 0);
if (pipe_in > 0)
close (pipe_in);
#ifdef __CYGWIN__
/* Let stdio know the fd may have changed from text to binary mode. */
freopen (NULL, "r", stdin);
#endif /* __CYGWIN__ */
}
if (pipe_out != NO_PIPE)
{
@@ -5157,5 +5167,11 @@ do_piping (pipe_in, pipe_out)
if (dup2 (1, 2) < 0)
dup_error (1, 2);
}
#ifdef __CYGWIN__
/* Let stdio know the fd may have changed from text to binary mode, and
make sure to preserve stdout line buffering. */
freopen (NULL, "w", stdout);
sh_setlinebuf (stdout);
#endif /* __CYGWIN__ */
}
}
+8
View File
@@ -42,4 +42,12 @@
# endif
#endif
/* Make sure O_BINARY and O_TEXT are defined to avoid Windows-specific code. */
#if !defined (O_BINARY)
# define O_BINARY 0
#endif
#if !defined (O_TEXT)
# define O_TEXT 0
#endif
#endif /* ! _FILECNTL_H_ */
+45
View File
@@ -0,0 +1,45 @@
/* filecntl.h - Definitions to set file descriptors to close-on-exec. */
/* Copyright (C) 1993 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/>.
*/
#if !defined (_FILECNTL_H_)
#define _FILECNTL_H_
#include <fcntl.h>
/* Definitions to set file descriptors to close-on-exec, the Posix way. */
#if !defined (FD_CLOEXEC)
#define FD_CLOEXEC 1
#endif
#define FD_NCLOEXEC 0
#define SET_CLOSE_ON_EXEC(fd) (fcntl ((fd), F_SETFD, FD_CLOEXEC))
#define SET_OPEN_ON_EXEC(fd) (fcntl ((fd), F_SETFD, FD_NCLOEXEC))
/* How to open a file in non-blocking mode, the Posix.1 way. */
#if !defined (O_NONBLOCK)
# if defined (O_NDELAY)
# define O_NONBLOCK O_NDELAY
# else
# define O_NONBLOCK 0
# endif
#endif
#endif /* ! _FILECNTL_H_ */
+22 -15
View File
@@ -193,6 +193,8 @@ make_buffered_stream (fd, buffer, bufsize)
bp->b_used = bp->b_inputp = bp->b_flag = 0;
if (bufsize == 1)
bp->b_flag |= B_UNBUFF;
if (O_TEXT && (fcntl (fd, F_GETFL) & O_TEXT) != 0)
bp->b_flag |= O_TEXT;
return (bp);
}
@@ -361,11 +363,7 @@ duplicate_buffered_stream (fd1, fd2)
}
/* Return 1 if a seek on FD will succeed. */
#ifndef __CYGWIN__
# define fd_is_seekable(fd) (lseek ((fd), 0L, SEEK_CUR) >= 0)
#else
# define fd_is_seekable(fd) 0
#endif /* __CYGWIN__ */
#define fd_is_seekable(fd) (lseek ((fd), 0L, SEEK_CUR) >= 0)
/* Take FD, a file descriptor, and create and return a buffered stream
corresponding to it. If something is wrong and the file descriptor
@@ -472,9 +470,27 @@ b_fill_buffer (bp)
BUFFERED_STREAM *bp;
{
ssize_t nr;
off_t o;
CHECK_TERMSIG;
nr = zread (bp->b_fd, bp->b_buffer, bp->b_size);
/* In an environment where text and binary files are treated differently,
compensate for lseek() on text files returning an offset different from
the count of characters read() returns. Text-mode streams have to be
treated as unbuffered. */
if ((bp->b_flag & (B_TEXT | B_UNBUFF)) == B_TEXT)
{
o = lseek (bp->b_fd, 0, SEEK_CUR);
nr = zread (bp->b_fd, bp->b_buffer, bp->b_size);
if (nr > 0 && nr < lseek (bp->b_fd, 0, SEEK_CUR) - o)
{
lseek (bp->b_fd, o, SEEK_SET);
bp->b_flag |= B_UNBUFF;
bp->b_size = 1;
nr = zread (bp->b_fd, bp->b_buffer, bp->b_size);
}
}
else
nr = zread (bp->b_fd, bp->b_buffer, bp->b_size);
if (nr <= 0)
{
bp->b_used = 0;
@@ -486,15 +502,6 @@ b_fill_buffer (bp)
return (EOF);
}
#if defined (__CYGWIN__)
/* If on cygwin, translate \r\n to \n. */
if (nr >= 2 && bp->b_buffer[nr - 2] == '\r' && bp->b_buffer[nr - 1] == '\n')
{
bp->b_buffer[nr - 2] = '\n';
nr--;
}
#endif
bp->b_used = nr;
bp->b_inputp = 0;
return (bp->b_buffer[bp->b_inputp++] & 0xFF);
+650
View File
@@ -0,0 +1,650 @@
/* input.c -- functions to perform buffered input with synchronization. */
/* Copyright (C) 1992-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 "bashtypes.h"
#if !defined (_MINIX) && defined (HAVE_SYS_FILE_H)
# include <sys/file.h>
#endif
#include "filecntl.h"
#include "posixstat.h"
#include <stdio.h>
#include <errno.h>
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#endif
#include "bashansi.h"
#include "bashintl.h"
#include "command.h"
#include "general.h"
#include "input.h"
#include "error.h"
#include "externs.h"
#include "quit.h"
#if !defined (errno)
extern int errno;
#endif /* !errno */
#if defined (EAGAIN)
# define X_EAGAIN EAGAIN
#else
# define X_EAGAIN -99
#endif
#if defined (EWOULDBLOCK)
# define X_EWOULDBLOCK EWOULDBLOCK
#else
# define X_EWOULDBLOCK -99
#endif
extern void termsig_handler __P((int));
/* Functions to handle reading input on systems that don't restart read(2)
if a signal is received. */
static char localbuf[128];
static int local_index = 0, local_bufused = 0;
/* Posix and USG systems do not guarantee to restart read () if it is
interrupted by a signal. We do the read ourselves, and restart it
if it returns EINTR. */
int
getc_with_restart (stream)
FILE *stream;
{
unsigned char uc;
CHECK_TERMSIG;
/* Try local buffering to reduce the number of read(2) calls. */
if (local_index == local_bufused || local_bufused == 0)
{
while (1)
{
CHECK_TERMSIG;
local_bufused = read (fileno (stream), localbuf, sizeof(localbuf));
if (local_bufused > 0)
break;
else if (errno == X_EAGAIN || errno == X_EWOULDBLOCK)
{
if (sh_unset_nodelay_mode (fileno (stream)) < 0)
{
sys_error (_("cannot reset nodelay mode for fd %d"), fileno (stream));
return EOF;
}
continue;
}
else if (local_bufused == 0 || errno != EINTR)
{
local_index = 0;
return EOF;
}
}
local_index = 0;
}
uc = localbuf[local_index++];
return uc;
}
int
ungetc_with_restart (c, stream)
int c;
FILE *stream;
{
if (local_index == 0 || c == EOF)
return EOF;
localbuf[--local_index] = c;
return c;
}
#if defined (BUFFERED_INPUT)
/* A facility similar to stdio, but input-only. */
#if defined (USING_BASH_MALLOC)
# define MAX_INPUT_BUFFER_SIZE 8176
#else
# define MAX_INPUT_BUFFER_SIZE 8192
#endif
#if !defined (SEEK_CUR)
# define SEEK_CUR 1
#endif /* !SEEK_CUR */
#ifdef max
# undef max
#endif
#define max(a, b) (((a) > (b)) ? (a) : (b))
#ifdef min
# undef min
#endif
#define min(a, b) ((a) > (b) ? (b) : (a))
extern int interactive_shell;
int bash_input_fd_changed;
/* This provides a way to map from a file descriptor to the buffer
associated with that file descriptor, rather than just the other
way around. This is needed so that buffers are managed properly
in constructs like 3<&4. buffers[x]->b_fd == x -- that is how the
correspondence is maintained. */
static BUFFERED_STREAM **buffers = (BUFFERED_STREAM **)NULL;
static int nbuffers;
#define ALLOCATE_BUFFERS(n) \
do { if ((n) >= nbuffers) allocate_buffers (n); } while (0)
/* Make sure `buffers' has at least N elements. */
static void
allocate_buffers (n)
int n;
{
register int i, orig_nbuffers;
orig_nbuffers = nbuffers;
nbuffers = n + 20;
buffers = (BUFFERED_STREAM **)xrealloc
(buffers, nbuffers * sizeof (BUFFERED_STREAM *));
/* Zero out the new buffers. */
for (i = orig_nbuffers; i < nbuffers; i++)
buffers[i] = (BUFFERED_STREAM *)NULL;
}
/* Construct and return a BUFFERED_STREAM corresponding to file descriptor
FD, using BUFFER. */
static BUFFERED_STREAM *
make_buffered_stream (fd, buffer, bufsize)
int fd;
char *buffer;
size_t bufsize;
{
BUFFERED_STREAM *bp;
bp = (BUFFERED_STREAM *)xmalloc (sizeof (BUFFERED_STREAM));
ALLOCATE_BUFFERS (fd);
buffers[fd] = bp;
bp->b_fd = fd;
bp->b_buffer = buffer;
bp->b_size = bufsize;
bp->b_used = bp->b_inputp = bp->b_flag = 0;
if (bufsize == 1)
bp->b_flag |= B_UNBUFF;
if (O_TEXT && (fcntl (fd, F_GETFL) & O_TEXT) != 0)
bp->b_flag |= O_TEXT;
return (bp);
}
/* Allocate a new BUFFERED_STREAM, copy BP to it, and return the new copy. */
static BUFFERED_STREAM *
copy_buffered_stream (bp)
BUFFERED_STREAM *bp;
{
BUFFERED_STREAM *nbp;
if (!bp)
return ((BUFFERED_STREAM *)NULL);
nbp = (BUFFERED_STREAM *)xmalloc (sizeof (BUFFERED_STREAM));
xbcopy ((char *)bp, (char *)nbp, sizeof (BUFFERED_STREAM));
return (nbp);
}
int
set_bash_input_fd (fd)
int fd;
{
if (bash_input.type == st_bstream)
bash_input.location.buffered_fd = fd;
else if (interactive_shell == 0)
default_buffered_input = fd;
return 0;
}
int
fd_is_bash_input (fd)
int fd;
{
if (bash_input.type == st_bstream && bash_input.location.buffered_fd == fd)
return 1;
else if (interactive_shell == 0 && default_buffered_input == fd)
return 1;
return 0;
}
/* Save the buffered stream corresponding to file descriptor FD (which bash
is using to read input) to a buffered stream associated with NEW_FD. If
NEW_FD is -1, a new file descriptor is allocated with fcntl. The new
file descriptor is returned on success, -1 on error. */
int
save_bash_input (fd, new_fd)
int fd, new_fd;
{
int nfd;
/* Sync the stream so we can re-read from the new file descriptor. We
might be able to avoid this by copying the buffered stream verbatim
to the new file descriptor. */
if (buffers[fd])
sync_buffered_stream (fd);
/* Now take care of duplicating the file descriptor that bash is
using for input, so we can reinitialize it later. */
nfd = (new_fd == -1) ? fcntl (fd, F_DUPFD, 10) : new_fd;
if (nfd == -1)
{
if (fcntl (fd, F_GETFD, 0) == 0)
sys_error (_("cannot allocate new file descriptor for bash input from fd %d"), fd);
return -1;
}
if (buffers[nfd])
{
/* What's this? A stray buffer without an associated open file
descriptor? Free up the buffer and report the error. */
internal_error (_("save_bash_input: buffer already exists for new fd %d"), nfd);
free_buffered_stream (buffers[nfd]);
}
/* Reinitialize bash_input.location. */
if (bash_input.type == st_bstream)
{
bash_input.location.buffered_fd = nfd;
fd_to_buffered_stream (nfd);
close_buffered_fd (fd); /* XXX */
}
else
/* If the current input type is not a buffered stream, but the shell
is not interactive and therefore using a buffered stream to read
input (e.g. with an `eval exec 3>output' inside a script), note
that the input fd has been changed. pop_stream() looks at this
value and adjusts the input fd to the new value of
default_buffered_input accordingly. */
bash_input_fd_changed++;
if (default_buffered_input == fd)
default_buffered_input = nfd;
SET_CLOSE_ON_EXEC (nfd);
return nfd;
}
/* Check that file descriptor FD is not the one that bash is currently
using to read input from a script. FD is about to be duplicated onto,
which means that the kernel will close it for us. If FD is the bash
input file descriptor, we need to seek backwards in the script (if
possible and necessary -- scripts read from stdin are still unbuffered),
allocate a new file descriptor to use for bash input, and re-initialize
the buffered stream. Make sure the file descriptor used to save bash
input is set close-on-exec. Returns 0 on success, -1 on failure. This
works only if fd is > 0 -- if fd == 0 and bash is reading input from
fd 0, save_bash_input is used instead, to cooperate with input
redirection (look at redir.c:add_undo_redirect()). */
int
check_bash_input (fd)
int fd;
{
if (fd_is_bash_input (fd))
{
if (fd > 0)
return ((save_bash_input (fd, -1) == -1) ? -1 : 0);
else if (fd == 0)
return ((sync_buffered_stream (fd) == -1) ? -1 : 0);
}
return 0;
}
/* This is the buffered stream analogue of dup2(fd1, fd2). The
BUFFERED_STREAM corresponding to fd2 is deallocated, if one exists.
BUFFERS[fd1] is copied to BUFFERS[fd2]. This is called by the
redirect code for constructs like 4<&0 and 3</etc/rc.local. */
int
duplicate_buffered_stream (fd1, fd2)
int fd1, fd2;
{
int is_bash_input, m;
if (fd1 == fd2)
return 0;
m = max (fd1, fd2);
ALLOCATE_BUFFERS (m);
/* If FD2 is the file descriptor bash is currently using for shell input,
we need to do some extra work to make sure that the buffered stream
actually exists (it might not if fd1 was not active, and the copy
didn't actually do anything). */
is_bash_input = (bash_input.type == st_bstream) &&
(bash_input.location.buffered_fd == fd2);
if (buffers[fd2])
{
/* If the two objects share the same b_buffer, don't free it. */
if (buffers[fd1] && buffers[fd1]->b_buffer && buffers[fd1]->b_buffer == buffers[fd2]->b_buffer)
buffers[fd2] = (BUFFERED_STREAM *)NULL;
else
free_buffered_stream (buffers[fd2]);
}
buffers[fd2] = copy_buffered_stream (buffers[fd1]);
if (buffers[fd2])
buffers[fd2]->b_fd = fd2;
if (is_bash_input)
{
if (!buffers[fd2])
fd_to_buffered_stream (fd2);
buffers[fd2]->b_flag |= B_WASBASHINPUT;
}
return (fd2);
}
/* Return 1 if a seek on FD will succeed. */
#ifndef __CYGWIN__
# define fd_is_seekable(fd) (lseek ((fd), 0L, SEEK_CUR) >= 0)
#else
# define fd_is_seekable(fd) 0
#endif /* __CYGWIN__ */
/* Take FD, a file descriptor, and create and return a buffered stream
corresponding to it. If something is wrong and the file descriptor
is invalid, return a NULL stream. */
BUFFERED_STREAM *
fd_to_buffered_stream (fd)
int fd;
{
char *buffer;
size_t size;
struct stat sb;
if (fstat (fd, &sb) < 0)
{
close (fd);
return ((BUFFERED_STREAM *)NULL);
}
size = (fd_is_seekable (fd)) ? min (sb.st_size, MAX_INPUT_BUFFER_SIZE) : 1;
if (size == 0)
size = 1;
buffer = (char *)xmalloc (size);
return (make_buffered_stream (fd, buffer, size));
}
/* Return a buffered stream corresponding to FILE, a file name. */
BUFFERED_STREAM *
open_buffered_stream (file)
char *file;
{
int fd;
fd = open (file, O_RDONLY);
return ((fd >= 0) ? fd_to_buffered_stream (fd) : (BUFFERED_STREAM *)NULL);
}
/* Deallocate a buffered stream and free up its resources. Make sure we
zero out the slot in BUFFERS that points to BP. */
void
free_buffered_stream (bp)
BUFFERED_STREAM *bp;
{
int n;
if (!bp)
return;
n = bp->b_fd;
if (bp->b_buffer)
free (bp->b_buffer);
free (bp);
buffers[n] = (BUFFERED_STREAM *)NULL;
}
/* Close the file descriptor associated with BP, a buffered stream, and free
up the stream. Return the status of closing BP's file descriptor. */
int
close_buffered_stream (bp)
BUFFERED_STREAM *bp;
{
int fd;
if (!bp)
return (0);
fd = bp->b_fd;
free_buffered_stream (bp);
return (close (fd));
}
/* Deallocate the buffered stream associated with file descriptor FD, and
close FD. Return the status of the close on FD. */
int
close_buffered_fd (fd)
int fd;
{
if (fd < 0)
{
errno = EBADF;
return -1;
}
if (fd >= nbuffers || !buffers || !buffers[fd])
return (close (fd));
return (close_buffered_stream (buffers[fd]));
}
/* Make the BUFFERED_STREAM associcated with buffers[FD] be BP, and return
the old BUFFERED_STREAM. */
BUFFERED_STREAM *
set_buffered_stream (fd, bp)
int fd;
BUFFERED_STREAM *bp;
{
BUFFERED_STREAM *ret;
ret = buffers[fd];
buffers[fd] = bp;
return ret;
}
/* Read a buffer full of characters from BP, a buffered stream. */
static int
b_fill_buffer (bp)
BUFFERED_STREAM *bp;
{
ssize_t nr;
CHECK_TERMSIG;
nr = zread (bp->b_fd, bp->b_buffer, bp->b_size);
if (nr <= 0)
{
bp->b_used = 0;
bp->b_buffer[0] = 0;
if (nr == 0)
bp->b_flag |= B_EOF;
else
bp->b_flag |= B_ERROR;
return (EOF);
}
#if defined (__CYGWIN__)
/* If on cygwin, translate \r\n to \n. */
if (nr >= 2 && bp->b_buffer[nr - 2] == '\r' && bp->b_buffer[nr - 1] == '\n')
{
bp->b_buffer[nr - 2] = '\n';
nr--;
}
#endif
bp->b_used = nr;
bp->b_inputp = 0;
return (bp->b_buffer[bp->b_inputp++] & 0xFF);
}
/* Get a character from buffered stream BP. */
#define bufstream_getc(bp) \
(bp->b_inputp == bp->b_used || !bp->b_used) \
? b_fill_buffer (bp) \
: bp->b_buffer[bp->b_inputp++] & 0xFF
/* Push C back onto buffered stream BP. */
static int
bufstream_ungetc(c, bp)
int c;
BUFFERED_STREAM *bp;
{
if (c == EOF || bp->b_inputp == 0)
return (EOF);
bp->b_buffer[--bp->b_inputp] = c;
return (c);
}
/* Seek backwards on file BFD to synchronize what we've read so far
with the underlying file pointer. */
int
sync_buffered_stream (bfd)
int bfd;
{
BUFFERED_STREAM *bp;
off_t chars_left;
if (buffers == 0 || (bp = buffers[bfd]) == 0)
return (-1);
chars_left = bp->b_used - bp->b_inputp;
if (chars_left)
lseek (bp->b_fd, -chars_left, SEEK_CUR);
bp->b_used = bp->b_inputp = 0;
return (0);
}
int
buffered_getchar ()
{
CHECK_TERMSIG;
#if !defined (DJGPP)
return (bufstream_getc (buffers[bash_input.location.buffered_fd]));
#else
/* On DJGPP, ignore \r. */
int ch;
while ((ch = bufstream_getc (buffers[bash_input.location.buffered_fd])) == '\r')
;
return ch;
#endif
}
int
buffered_ungetchar (c)
int c;
{
return (bufstream_ungetc (c, buffers[bash_input.location.buffered_fd]));
}
/* Make input come from file descriptor BFD through a buffered stream. */
void
with_input_from_buffered_stream (bfd, name)
int bfd;
char *name;
{
INPUT_STREAM location;
BUFFERED_STREAM *bp;
location.buffered_fd = bfd;
/* Make sure the buffered stream exists. */
bp = fd_to_buffered_stream (bfd);
init_yy_io (bp == 0 ? return_EOF : buffered_getchar,
buffered_ungetchar, st_bstream, name, location);
}
#if defined (TEST)
void *
xmalloc(s)
int s;
{
return (malloc (s));
}
void *
xrealloc(s, size)
char *s;
int size;
{
if (!s)
return(malloc (size));
else
return(realloc (s, size));
}
void
init_yy_io ()
{
}
process(bp)
BUFFERED_STREAM *bp;
{
int c;
while ((c = bufstream_getc(bp)) != EOF)
putchar(c);
}
BASH_INPUT bash_input;
struct stat dsb; /* can be used from gdb */
/* imitate /bin/cat */
main(argc, argv)
int argc;
char **argv;
{
register int i;
BUFFERED_STREAM *bp;
if (argc == 1) {
bp = fd_to_buffered_stream (0);
process(bp);
exit(0);
}
for (i = 1; i < argc; i++) {
if (argv[i][0] == '-' && argv[i][1] == '\0') {
bp = fd_to_buffered_stream (0);
if (!bp)
continue;
process(bp);
free_buffered_stream (bp);
} else {
bp = open_buffered_stream (argv[i]);
if (!bp)
continue;
process(bp);
close_buffered_stream (bp);
}
}
exit(0);
}
#endif /* TEST */
#endif /* BUFFERED_INPUT */
+1
View File
@@ -48,6 +48,7 @@ enum stream_type {st_none, st_stdin, st_stream, st_string, st_bstream};
#define B_ERROR 0x02
#define B_UNBUFF 0x04
#define B_WASBASHINPUT 0x08
#define B_TEXT 0x10
/* A buffered stream. Like a FILE *, but with our own buffering and
synchronization. Look in input.c for the implementation. */
+132
View File
@@ -0,0 +1,132 @@
/* input.h -- Structures and unions used for reading input. */
/* Copyright (C) 1993-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/>.
*/
#if !defined (_INPUT_H_)
#define _INPUT_H_
#include "stdc.h"
/* Function pointers can be declared as (Function *)foo. */
#if !defined (_FUNCTION_DEF)
# define _FUNCTION_DEF
typedef int Function ();
typedef void VFunction ();
typedef char *CPFunction (); /* no longer used */
typedef char **CPPFunction (); /* no longer used */
#endif /* _FUNCTION_DEF */
typedef int sh_cget_func_t __P((void)); /* sh_ivoidfunc_t */
typedef int sh_cunget_func_t __P((int)); /* sh_intfunc_t */
enum stream_type {st_none, st_stdin, st_stream, st_string, st_bstream};
#if defined (BUFFERED_INPUT)
/* Possible values for b_flag. */
#undef B_EOF
#undef B_ERROR /* There are some systems with this define */
#undef B_UNBUFF
#define B_EOF 0x01
#define B_ERROR 0x02
#define B_UNBUFF 0x04
#define B_WASBASHINPUT 0x08
/* A buffered stream. Like a FILE *, but with our own buffering and
synchronization. Look in input.c for the implementation. */
typedef struct BSTREAM
{
int b_fd;
char *b_buffer; /* The buffer that holds characters read. */
size_t b_size; /* How big the buffer is. */
size_t b_used; /* How much of the buffer we're using, */
int b_flag; /* Flag values. */
size_t b_inputp; /* The input pointer, index into b_buffer. */
} BUFFERED_STREAM;
#if 0
extern BUFFERED_STREAM **buffers;
#endif
extern int default_buffered_input;
#endif /* BUFFERED_INPUT */
typedef union {
FILE *file;
char *string;
#if defined (BUFFERED_INPUT)
int buffered_fd;
#endif
} INPUT_STREAM;
typedef struct {
enum stream_type type;
char *name;
INPUT_STREAM location;
sh_cget_func_t *getter;
sh_cunget_func_t *ungetter;
} BASH_INPUT;
extern BASH_INPUT bash_input;
/* Functions from parse.y whose use directly or indirectly depends on the
definitions in this file. */
extern void initialize_bash_input __P((void));
extern void init_yy_io __P((sh_cget_func_t *, sh_cunget_func_t *, enum stream_type, const char *, INPUT_STREAM));
extern char *yy_input_name __P((void));
extern void with_input_from_stdin __P((void));
extern void with_input_from_string __P((char *, const char *));
extern void with_input_from_stream __P((FILE *, const char *));
extern void push_stream __P((int));
extern void pop_stream __P((void));
extern int stream_on_stack __P((enum stream_type));
extern char *read_secondary_line __P((int));
extern int find_reserved_word __P((char *));
extern void gather_here_documents __P((void));
extern void execute_variable_command __P((char *, char *));
extern int *save_token_state __P((void));
extern void restore_token_state __P((int *));
/* Functions from input.c */
extern int getc_with_restart __P((FILE *));
extern int ungetc_with_restart __P((int, FILE *));
#if defined (BUFFERED_INPUT)
/* Functions from input.c. */
extern int fd_is_bash_input __P((int));
extern int set_bash_input_fd __P((int));
extern int save_bash_input __P((int, int));
extern int check_bash_input __P((int));
extern int duplicate_buffered_stream __P((int, int));
extern BUFFERED_STREAM *fd_to_buffered_stream __P((int));
extern BUFFERED_STREAM *set_buffered_stream __P((int, BUFFERED_STREAM *));
extern BUFFERED_STREAM *open_buffered_stream __P((char *));
extern void free_buffered_stream __P((BUFFERED_STREAM *));
extern int close_buffered_stream __P((BUFFERED_STREAM *));
extern int close_buffered_fd __P((int));
extern int sync_buffered_stream __P((int));
extern int buffered_getchar __P((void));
extern int buffered_ungetchar __P((int));
extern void with_input_from_buffered_stream __P((int, char *));
#endif /* BUFFERED_INPUT */
#endif /* _INPUT_H_ */
+13 -7
View File
@@ -2195,8 +2195,12 @@ rl_filename_completion_function (text, state)
/* We aren't done yet. We also support the "~user" syntax. */
/* Save the version of the directory that the user typed. */
users_dirname = savestring (dirname);
/* Save the version of the directory that the user typed, dequoting
it if necessary. */
if (rl_completion_found_quote && rl_filename_dequoting_function)
users_dirname = (*rl_filename_dequoting_function) (dirname, rl_completion_quote_character);
else
users_dirname = savestring (dirname);
if (*dirname == '~')
{
@@ -2208,9 +2212,13 @@ rl_filename_completion_function (text, state)
if (rl_directory_rewrite_hook)
(*rl_directory_rewrite_hook) (&dirname);
/* The directory completion hook should perform any necessary
dequoting. */
if (rl_directory_completion_hook && (*rl_directory_completion_hook) (&dirname))
/* We have saved the possibly-dequoted version of the directory name
the user typed. Now transform the directory name we're going to
pass to opendir(2). The directory completion hook should perform
any necessary dequoting. If the directory completion hook returns
0, it should not modify the directory name pointer passed as an
argument. */
else if (rl_directory_completion_hook && (*rl_directory_completion_hook) (&dirname))
{
xfree (users_dirname);
users_dirname = savestring (dirname);
@@ -2221,8 +2229,6 @@ rl_filename_completion_function (text, state)
temp = (*rl_filename_dequoting_function) (dirname, rl_completion_quote_character);
xfree (dirname);
dirname = temp;
xfree (users_dirname);
users_dirname = savestring (dirname);
}
directory = opendir (dirname);
+13 -8
View File
@@ -2195,8 +2195,12 @@ rl_filename_completion_function (text, state)
/* We aren't done yet. We also support the "~user" syntax. */
/* Save the version of the directory that the user typed. */
users_dirname = savestring (dirname);
/* Save the version of the directory that the user typed, dequoting
it if necessary. */
if (rl_completion_found_quote && rl_filename_dequoting_function)
users_dirname = (*rl_filename_dequoting_function) (dirname, rl_completion_quote_character);
else
users_dirname = savestring (dirname);
if (*dirname == '~')
{
@@ -2208,13 +2212,14 @@ rl_filename_completion_function (text, state)
if (rl_directory_rewrite_hook)
(*rl_directory_rewrite_hook) (&dirname);
/* The directory completion hook should perform any necessary
dequoting. */
/* We have saved the possibly-dequoted version of the directory name
the user typed. Now transform the directory name we're going to
pass to opendir(2). The directory completion hook should perform
any necessary dequoting. If the directory completion hook returns
0, it should not modify the directory name pointer passed as an
argument. */
if (rl_directory_completion_hook && (*rl_directory_completion_hook) (&dirname))
{
xfree (users_dirname);
users_dirname = savestring (dirname);
}
;
else if (rl_completion_found_quote && rl_filename_dequoting_function)
{
/* delete single and double quotes */
+9 -7
View File
@@ -1717,18 +1717,20 @@ from the array must be freed.
@deftypevar {rl_icppfunc_t *} rl_directory_completion_hook
This function, if defined, is allowed to modify the directory portion
of filenames Readline completes. It is called with the address of a
string (the current directory name) as an argument, and may modify that string.
of filenames Readline completes.
It could be used to expand symbolic links or shell variables in pathnames.
It is called with the address of a string (the current directory name) as an
argument, and may modify that string.
If the string is replaced with a new string, the old value should be freed.
Any modified directory name should have a trailing slash.
The modified value will be displayed as part of the completion, replacing
The modified value will be used as part of the completion, replacing
the directory portion of the pathname the user typed.
It returns an integer that should be non-zero if the function modifies
its directory argument.
It could be used to expand symbolic links or shell variables in pathnames.
At the least, even if no other expansion is performed, this function should
remove any quote characters from the directory name, because its result will
be passed directly to @code{opendir()}.
The directory completion hook returns an integer that should be non-zero if
the function modifies its directory argument.
The function should not modify the directory argument if it returns 0.
@end deftypevar
@ignore
@@ -1740,7 +1742,7 @@ it only modifies the directory name used in @code{opendir}, not what is
displayed when the possible completions are printed or inserted. It is
called before rl_directory_completion_hook.
I'm not happy with how this worksyet, so it's undocumented.
I'm not happy with how this works yet, so it's undocumented.
@end deftypevar
@end ignore
+9 -7
View File
@@ -7,7 +7,7 @@ This document describes the GNU Readline Library, a utility for aiding
in the consistency of user interface across discrete programs that need
to provide a command line interface.
Copyright (C) 1988-2007 Free Software Foundation, Inc.
Copyright (C) 1988--2010 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -1717,18 +1717,20 @@ from the array must be freed.
@deftypevar {rl_icppfunc_t *} rl_directory_completion_hook
This function, if defined, is allowed to modify the directory portion
of filenames Readline completes. It is called with the address of a
of filenames Readline completes.
It could be used to expand symbolic links or shell variables in pathnames.
It is called with the address of a
string (the current directory name) as an argument, and may modify that string.
If the string is replaced with a new string, the old value should be freed.
Any modified directory name should have a trailing slash.
The modified value will be displayed as part of the completion, replacing
The modified value may be used as part of the completion, replacing
the directory portion of the pathname the user typed.
It returns an integer that should be non-zero if the function modifies
its directory argument.
It could be used to expand symbolic links or shell variables in pathnames.
At the least, even if no other expansion is performed, this function should
remove any quote characters from the directory name, because its result will
be passed directly to @code{opendir()}.
The directory completion hook returns an integer that should be non-zero if
the function modifies its directory argument.
The function should not modify the directory argument if it returns 0.
@end deftypevar
@ignore
@@ -1740,7 +1742,7 @@ it only modifies the directory name used in @code{opendir}, not what is
displayed when the possible completions are printed or inserted. It is
called before rl_directory_completion_hook.
I'm not happy with how this worksyet, so it's undocumented.
I'm not happy with how this works yet, so it's undocumented.
@end deftypevar
@end ignore
+2 -2
View File
@@ -96,12 +96,12 @@ static char *term_string_buffer = (char *)NULL;
static int tcap_initialized;
#if !defined (__linux__)
#if !defined (__linux__) && !defined (NCURSES_VERSION)
# if defined (__EMX__) || defined (NEED_EXTERN_PC)
extern
# endif /* __EMX__ || NEED_EXTERN_PC */
char PC, *BC, *UP;
#endif /* __linux__ */
#endif /* !__linux__ && !NCURSES_VERSION */
/* Some strings to control terminal actions. These are output by tputs (). */
char *_rl_term_clreol;
+1 -1
View File
@@ -40,7 +40,7 @@
extern int errno;
#endif
#define BASEOPENFLAGS (O_CREAT | O_TRUNC | O_EXCL)
#define BASEOPENFLAGS (O_CREAT | O_TRUNC | O_EXCL | O_BINARY)
#define DEFAULT_TMPDIR "." /* bogus default, should be changed */
#define DEFAULT_NAMEROOT "shtmp"
+220
View File
@@ -0,0 +1,220 @@
/*
* tmpfile.c - functions to create and safely open temp files for the shell.
*/
/* Copyright (C) 2000 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 <bashtypes.h>
#include <posixstat.h>
#include <posixtime.h>
#include <filecntl.h>
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#endif
#include <stdio.h>
#include <errno.h>
#include <shell.h>
#ifndef errno
extern int errno;
#endif
#define BASEOPENFLAGS (O_CREAT | O_TRUNC | O_EXCL)
#define DEFAULT_TMPDIR "." /* bogus default, should be changed */
#define DEFAULT_NAMEROOT "shtmp"
extern pid_t dollar_dollar_pid;
static char *get_sys_tmpdir __P((void));
static char *get_tmpdir __P((int));
static char *sys_tmpdir = (char *)NULL;
static int ntmpfiles;
static int tmpnamelen = -1;
static unsigned long filenum = 1L;
static char *
get_sys_tmpdir ()
{
if (sys_tmpdir)
return sys_tmpdir;
#ifdef P_tmpdir
sys_tmpdir = P_tmpdir;
if (file_iswdir (sys_tmpdir))
return sys_tmpdir;
#endif
sys_tmpdir = "/tmp";
if (file_iswdir (sys_tmpdir))
return sys_tmpdir;
sys_tmpdir = "/var/tmp";
if (file_iswdir (sys_tmpdir))
return sys_tmpdir;
sys_tmpdir = "/usr/tmp";
if (file_iswdir (sys_tmpdir))
return sys_tmpdir;
sys_tmpdir = DEFAULT_TMPDIR;
return sys_tmpdir;
}
static char *
get_tmpdir (flags)
int flags;
{
char *tdir;
tdir = (flags & MT_USETMPDIR) ? get_string_value ("TMPDIR") : (char *)NULL;
if (tdir && (file_iswdir (tdir) == 0 || strlen (tdir) > PATH_MAX))
tdir = 0;
if (tdir == 0)
tdir = get_sys_tmpdir ();
#if defined (HAVE_PATHCONF) && defined (_PC_NAME_MAX)
if (tmpnamelen == -1)
tmpnamelen = pathconf (tdir, _PC_NAME_MAX);
#else
tmpnamelen = 0;
#endif
return tdir;
}
char *
sh_mktmpname (nameroot, flags)
char *nameroot;
int flags;
{
char *filename, *tdir, *lroot;
struct stat sb;
int r, tdlen;
filename = (char *)xmalloc (PATH_MAX + 1);
tdir = get_tmpdir (flags);
tdlen = strlen (tdir);
lroot = nameroot ? nameroot : DEFAULT_NAMEROOT;
#ifdef USE_MKTEMP
sprintf (filename, "%s/%s.XXXXXX", tdir, lroot);
if (mktemp (filename) == 0)
{
free (filename);
filename = NULL;
}
#else /* !USE_MKTEMP */
while (1)
{
filenum = (filenum << 1) ^
(unsigned long) time ((time_t *)0) ^
(unsigned long) dollar_dollar_pid ^
(unsigned long) ((flags & MT_USERANDOM) ? get_random_number () : ntmpfiles++);
sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum);
if (tmpnamelen > 0 && tmpnamelen < 32)
filename[tdlen + 1 + tmpnamelen] = '\0';
# ifdef HAVE_LSTAT
r = lstat (filename, &sb);
# else
r = stat (filename, &sb);
# endif
if (r < 0 && errno == ENOENT)
break;
}
#endif /* !USE_MKTEMP */
return filename;
}
int
sh_mktmpfd (nameroot, flags, namep)
char *nameroot;
int flags;
char **namep;
{
char *filename, *tdir, *lroot;
int fd, tdlen;
filename = (char *)xmalloc (PATH_MAX + 1);
tdir = get_tmpdir (flags);
tdlen = strlen (tdir);
lroot = nameroot ? nameroot : DEFAULT_NAMEROOT;
#ifdef USE_MKSTEMP
sprintf (filename, "%s/%s.XXXXXX", tdir, lroot);
fd = mkstemp (filename);
if (fd < 0 || namep == 0)
{
free (filename);
filename = NULL;
}
if (namep)
*namep = filename;
return fd;
#else /* !USE_MKSTEMP */
do
{
filenum = (filenum << 1) ^
(unsigned long) time ((time_t *)0) ^
(unsigned long) dollar_dollar_pid ^
(unsigned long) ((flags & MT_USERANDOM) ? get_random_number () : ntmpfiles++);
sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum);
if (tmpnamelen > 0 && tmpnamelen < 32)
filename[tdlen + 1 + tmpnamelen] = '\0';
fd = open (filename, BASEOPENFLAGS | ((flags & MT_READWRITE) ? O_RDWR : O_WRONLY), 0600);
}
while (fd < 0 && errno == EEXIST);
if (namep)
*namep = filename;
else
free (filename);
return fd;
#endif /* !USE_MKSTEMP */
}
FILE *
sh_mktmpfp (nameroot, flags, namep)
char *nameroot;
int flags;
char **namep;
{
int fd;
FILE *fp;
fd = sh_mktmpfd (nameroot, flags, namep);
if (fd < 0)
return ((FILE *)NULL);
fp = fdopen (fd, (flags & MT_READWRITE) ? "w+" : "w");
if (fp == 0)
close (fd);
return fp;
}
+7 -1
View File
@@ -5541,7 +5541,7 @@ static void
report_syntax_error (message)
char *message;
{
char *msg;
char *msg, *p;
if (message)
{
@@ -5557,6 +5557,12 @@ report_syntax_error (message)
parser's complaining about by looking at current_token. */
if (current_token != 0 && EOF_Reached == 0 && (msg = error_token_from_token (current_token)))
{
if (ansic_shouldquote (msg))
{
p = ansic_quote (msg, 0, NULL);
free (msg);
msg = p;
}
parser_error (line_number, _("syntax error near unexpected token `%s'"), msg);
free (msg);
+1 -2
View File
@@ -3833,8 +3833,7 @@ eof_error:
return ret;
}
/* XXX - this needs to handle functionality like subst.c:no_longjmp_on_fatal_error;
maybe extract_command_subst should handle it. */
/* Recursively call the parser to parse a $(...) command substitution. */
char *
xparse_dolparen (base, string, indp, flags)
char *base;
+1 -9
View File
@@ -449,7 +449,7 @@ here_document_to_fd (redirectee, ri)
/* In an attempt to avoid races, we close the first fd only after opening
the second. */
/* Make the document really temporary. Also make it the input. */
fd2 = open (filename, O_RDONLY, 0600);
fd2 = open (filename, O_RDONLY|O_BINARY, 0600);
if (fd2 < 0)
{
@@ -465,14 +465,6 @@ here_document_to_fd (redirectee, ri)
if (unlink (filename) < 0)
{
r = errno;
#if defined (__CYGWIN__)
/* Under CygWin 1.1.0, the unlink will fail if the file is
open. This hack will allow the previous action of silently
ignoring the error, but will still leave the file there. This
needs some kind of magic. */
if (r == EACCES)
return (fd2);
#endif /* __CYGWIN__ */
close (fd2);
free (filename);
errno = r;
+15 -14
View File
@@ -99,7 +99,7 @@ do { \
if ((r) < 0) \
{ \
if (fd >= 0) \
close (fd); \
close (fd); \
last_command_exit_value = EXECUTION_FAILURE;\
return ((e) == 0 ? EINVAL : (e));\
} \
@@ -465,14 +465,6 @@ here_document_to_fd (redirectee, ri)
if (unlink (filename) < 0)
{
r = errno;
#if defined (__CYGWIN__)
/* Under CygWin 1.1.0, the unlink will fail if the file is
open. This hack will allow the previous action of silently
ignoring the error, but will still leave the file there. This
needs some kind of magic. */
if (r == EACCES)
return (fd2);
#endif /* __CYGWIN__ */
close (fd2);
free (filename);
errno = r;
@@ -821,7 +813,10 @@ do_redirection_internal (redirect, flags)
if (redirect->rflags & REDIR_VARASSIGN)
{
redirector = fcntl (fd, F_DUPFD, SHELL_FD_BASE); /* XXX try this for now */
REDIRECTION_ERROR (redirector, errno, fd);
r = errno;
if (redirector < 0)
sys_error (_("redirection error: cannot duplicate fd"));
REDIRECTION_ERROR (redirector, r, fd);
}
if (flags & RX_UNDOABLE)
@@ -930,7 +925,10 @@ do_redirection_internal (redirect, flags)
if (redirect->rflags & REDIR_VARASSIGN)
{
redirector = fcntl (fd, F_DUPFD, SHELL_FD_BASE); /* XXX try this for now */
REDIRECTION_ERROR (redirector, errno, fd);
r = errno;
if (redirector < 0)
sys_error (_("redirection error: cannot duplicate fd"));
REDIRECTION_ERROR (redirector, r, fd);
}
if (flags & RX_ACTIVE)
@@ -990,7 +988,10 @@ do_redirection_internal (redirect, flags)
if ((flags & RX_ACTIVE) && (redirect->rflags & REDIR_VARASSIGN))
{
redirector = fcntl (redir_fd, F_DUPFD, SHELL_FD_BASE); /* XXX try this for now */
REDIRECTION_ERROR (redirector, errno, -1);
r = errno;
if (redirector < 0)
sys_error (_("redirection error: cannot duplicate fd"));
REDIRECTION_ERROR (redirector, r, -1);
}
if ((flags & RX_ACTIVE) && (redir_fd != redirector))
@@ -1115,7 +1116,7 @@ do_redirection_internal (redirect, flags)
since we're going to use it later (e.g., make sure we don't save fd 0
to fd 10 if we have a redirection like 0<&10). If the value of fdbase
puts the process over its fd limit, causing fcntl to fail, we try
again with SHELL_FD_BASE. */
again with SHELL_FD_BASE. Return 0 on success, -1 on error. */
static int
add_undo_redirect (fd, ri, fdbase)
int fd;
@@ -1197,7 +1198,7 @@ add_undo_redirect (fd, ri, fdbase)
}
/* Set up to close FD when we are finished with the current command
and its redirections. */
and its redirections. Return 0 on success, -1 on error. */
static int
add_undo_close_redirect (fd)
int fd;
-4
View File
@@ -1476,10 +1476,6 @@ open_shell_script (script_name)
not match with ours. */
fd = move_to_high_fd (fd, 1, -1);
#if defined (__CYGWIN__) && defined (O_TEXT)
setmode (fd, O_TEXT);
#endif
#if defined (BUFFERED_INPUT)
default_buffered_input = fd;
SET_CLOSE_ON_EXEC (default_buffered_input);
+1 -2
View File
@@ -1292,13 +1292,12 @@ run_one_command (command)
int code;
code = setjmp (top_level);
itrace("run_one_command: setjmp: code = %d", code);
if (code != NOT_JUMPED)
{
#if defined (PROCESS_SUBSTITUTION)
unlink_fifo_list ();
#endif /* PROCESS_SUBSTITUTION */
itrace("run_one_command: code = %d", code);
switch (code)
{
/* Some kind of throw to top_level has occured. */
+7 -4
View File
@@ -5146,10 +5146,6 @@ read_comsub (fd, quoted, rflag)
for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++)
skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL;
#ifdef __CYGWIN__
setmode (fd, O_TEXT); /* we don't want CR/LF, we want Unix-style */
#endif
/* Read the output of the command through the pipe. This may need to be
changed to understand multibyte characters in the future. */
while (1)
@@ -5360,6 +5356,13 @@ command_substitute (string, quoted)
(fildes[0] != fileno (stderr)))
close (fildes[0]);
#ifdef __CYGWIN__
/* Let stdio know the fd may have changed from text to binary mode, and
make sure to preserve stdout line buffering. */
freopen (NULL, "w", stdout);
sh_setlinebuf (stdout);
#endif /* __CYGWIN__ */
/* The currently executing shell is not interactive. */
interactive = 0;
+4 -4
View File
@@ -4306,11 +4306,15 @@ match_pattern (string, pat, mtype, sp, ep)
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1)
{
#if 0
slen = STRLEN (string);
mslen = MBSLEN (string);
plen = STRLEN (pat);
mplen = MBSLEN (pat);
if (slen == mslen && plen == mplen)
#else
if (mbsmbchar (string) == 0 && mbsmbchar (pat) == 0)
#endif
return (match_upattern (string, pat, mtype, sp, ep));
n = xdupmbstowcs (&wpat, NULL, pat);
@@ -5142,10 +5146,6 @@ read_comsub (fd, quoted, rflag)
for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++)
skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL;
#ifdef __CYGWIN__
setmode (fd, O_TEXT); /* we don't want CR/LF, we want Unix-style */
#endif
/* Read the output of the command through the pipe. This may need to be
changed to understand multibyte characters in the future. */
while (1)
+8
View File
@@ -51,4 +51,12 @@ this is ohio-state
1
testb
expand_aliases on
1
1
1
1
0
0
0
0
after
+20
View File
@@ -0,0 +1,20 @@
# make sure commands before the last one in the pipeline can't change $?
false
false | echo $?
false
(false) | echo $?
false
true | echo $?
false
(true) | echo $?
true
false | echo $?
true
(false) | echo $?
true
true | echo $?
true
(true) | echo $?
+2
View File
@@ -109,6 +109,8 @@ ${THIS_SH} ./exec7.sub
${THIS_SH} -i ./exec8.sub
${THIS_SH} ./exec9.sub
true | `echo true` &
echo after