1
0
Fork 0
mirror of synced 2025-03-06 20:53:29 +01:00

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

This commit is contained in:
Jari Aalto 2009-02-19 22:21:29 +00:00
parent 3185942a52
commit 17345e5ad2
134 changed files with 74214 additions and 4584 deletions

58
CHANGES
View file

@ -1,3 +1,59 @@
This document details the changes between this version, bash-4.0-release,
and the previous version, bash-4.0-rc1.
1. Changes to Bash
a. Changed the message printed when setlocale(3) fails to only include the
strerror error text if the call changes errno.
b. Changed trap command execution to reset the line number before running a
trap (except DEBUG and RETURN traps).
c. Fixed behavior of case-modifiying word expansions to not work on
individual words within a variable's value.
d. Fixed a bug that caused mapfile to not be interruptible when run in an
interactive shell.
e. Fixed a bug that caused mapfile to not run callbacks for the first line
read.
f. Fixed a bug that caused mapfile to not honor EOF typed in an interactive
shell.
g. Fixed the coprocess reaping code to not run straight from a signal handler.
h. Fixed a bug that caused printf -b to ignore the first % conversion specifier
in the format string on 64-bit systems.
i. Fixed a bug that caused incorrect word splitting when `:', `=', or `~'
appeared in $IFS.
j. Fixed a bug that caused data corruption in the programmable completion code
when a shell function called from a completion aborted execution.
k. Fixed a bug that caused the CPU usage reported by the `time' builtin to be
capped at 100%.
l. Changed behavior of shell when -e option is in effect to reflect consensus
of Posix shell standardization working group.
m. Fixed a bug introduced in bash-4.0-alpha that caused redirections to not
be displayed by `type' or `declare' when appearing in functions under
certain circumstances.
2. Changes to Readline
a. Fixed a bug that caused !(...) extended glob patterns to inhibit later
history expansion.
b. Reworked the signal handling to avoid calling disallowed functions from a
signal handler.
3. New Features in Bash
a. `readarray' is now a synonym for `mapfile'.
------------------------------------------------------------------------------
This document details the changes between this version, bash-4.0-rc1,
and the previous version, bash-4.0-beta2.
@ -43,7 +99,7 @@ b. Fixed a bug that caused redisplay errors when using prompts with invisible
------------------------------------------------------------------------------
This document details the changes between this version, bash-4.0-beta,
and the previous version, bash-4.0-beta.
and the previous version, bash-4.0-alpha.
1. Changes to Bash

6
COMPAT
View file

@ -312,3 +312,9 @@ bash-2.0 were significant.)
41. Beginning with bash-4.0, when one of the commands in a pipeline is killed
by a SIGINT while executing a command list, the shell acts as if it
received the interrupt.
42. Bash-4.0 changes the handling of the set -e option so that the shell exits
if a pipeline fails (and not just if the last command in the failing
pipeline is a simple command). This is not as Posix specifies. There is
work underway to update this portion of the standard; the bash-4.0
behavior attempts to capture the consensus at the time of release.

View file

@ -7286,3 +7286,244 @@ subst.c
string. Fixes bug reported by os@sernet.de.
[bash-4.0-rc1 frozen]
1/9
---
locale.c
- since setlocale() doesn't set errno to anything meaningful,
don't include the strerror() result in the error message if
it fails
- make sure the error messages printed when setlocale fails are
localizable
1/11
----
lib/readline/histexpand.c
- make sure that every time history_no_expand_chars is tested, we
also call the history_inhibit_expansion_function if it's set.
Fixes bug reported by Yang Zhang <yanghatespam@gmail.com>
1/12
----
trap.c
- make sure to call parse_and_execute with the SEVAL_RESETLINE bit
set in the flags so it will reset the line number when running
the trap commands. Partial fix for bug reported by
peter360@fastmail.us
1/14
----
builtins/reserved.def
- document `coproc' so it can be used with `help' builtin. Pointed
out by Pierre Gaston <pgas@freeshell.org>
lib/sh/casemod.c
- added two new flags: CASE_UPFIRST and CASE_LOWFIRST to casemod
the first character of the passed string and pass the rest
through unchanged. Fixes bug reported by Jan Schampera
<jan.schampera@web.de>
externs.h
- new defines for CASE_UPFIRST and CASE_LOWFIRST
subst.c
- use CASE_UPFIRST for ^ and CASE_LOWFIRST for , casemod operators
builtins/mapfile.def
- call zreset() before calling first zgetline(), to clean out any
remaining data in local buffer used by zreadc. Fixes bug
reported by Pierre Gaston <pierre.gaston@gmail.com>
1/15
----
lib/sh/zread.c
- renamed zreadintr to zreadretry -- not perfect, but better
- new functions: zreadintr, which just calls read so it can be
interruptible, and zreadcintr, which is like zreadc but uses
zreadintr to fill the buffer
lib/sh/zgetline.c
- in zgetline, when zread/zreadc return <= 0, make sure line is
non-null before assigning to line[nr]
builtins/mapfile.def
- return an error right away if the supplied array variable name
refers to a readonly or noassign array
- set interrupt_immediately so calls to zgetline can be
interrupted. Fixes bug reported by Pierre Gaston
<pierre.gaston@gmail.com>
- if interactive, pass the SEVAL_INTERACT and SEVAL_NOHIST flags
to parse_and_execute when calling callbacks. Fixes bug reported
by Pierre Gaston <pierre.gaston@gmail.com>
- add `readarray' as a synonym for mapfile
doc/{bash.1,bashref.texi}
- document behavior of mapfile builtin adding index of array element
to be assigned as additional argument to callback string. Reported
by Pierre Gaston <pierre.gaston@gmail.com>
- document readarray as synonym for mapfile
builtins/common.c
- new error function, sh_ttyerror(set), prints an error message having
to do with setting or getting terminal attributes
builtins/read.def
- print error message if read fails to set terminal attributes
1/16
----
execute_cmd.c
- new function, coproc_reap, calls coproc_dispose if sh_coproc is
marked as COPROC_DEAD
- new function, cpl_reap, disposes coprocs marked as COPROC_DEAD
from coproc list
- change coproc_pidchk to just mark the coproc as dead instead of
calling coproc_dispose, so we don't call unsafe functions from
a signal handler. Fixes bug reported by Andreas Schwab
<schwab@suse.de>
execute_cmd.h
- new extern declaration for coproc_reap
command.h
- new flags for c_flags member of a struct coproc
{jobs,nojobs}.c
- add call to coproc_reap in cleanup_dead_jobs, which will do the
right queueing or blocking of SIGCHLD
trap.c
- modify change from 1/12 to not reset the line number when running
the DEBUG and RETURN traps
1/18
----
lib/sh/casemod.c
- change default operations to work on entire passed string instead
of breaking into words at non-alpha-numerics. Use new
CASE_USEWORDS flag to enable by-word behavior. Fixes bug reported
by Jan Schampera <jan.schampera@web.de>
builtins/printf.def
- in vbprintf, bracket each call to vsnprintf (which uses the args
passed to vbprintf) with SH_VA_START and va_end, so we can
reninitialize the argument list for each call. This is actually
what the C standard requires. Fixes bug that caused printf -b
to `ignore' first % format specifier if it came first in the
string. Reported by David Leverton <levertond@googlemail.com>
builtins/mapfile.def
- start the line count at 1, since it doesn't get incremented before
(or after) reading the first line, so things like
`mapfile -n 5 -c 1 -C 'echo foo' array < file' work right and call
the callback after the first line is read. Fixes bug reported by
Pierre Gaston <pierre.gaston@gmail.com>
1/22
----
lib/readline/complete.c
- set _rl_interrupt_immediately non-zero before reading from the file
system or calling an application-defined completion function
lib/readline/signals.c
- renamed rl_signal_handler to _rl_handle_signal; new version of
rl_signal_handler that just calls _rl_handle_signal (for now)
- new function _rl_signal_handler that calls _rl_handle_signal without
any checking
lib/readline/rlprivate.h
- new extern declaration for _rl_signal_handler
- new define, RL_CHECK_SIGNALS, checks whether or not _rl_caught_signal
is set and calls _rl_signal_handler if so
lib/readline/{bind,input,readline}.c
- add RL_CHECK_SIGNALS in appropriate places
lib/readline/signals.c
- change rl_signal_handler to set a flag and return rather than
run through the entire signal handling process. If
_rl_interrupt_immediately is set, call the signal handling code
right away instead of setting the flag. Initial fix for crash
bug reported by Roman Rakus <rrakus@redhat.com>
aclocal.m4
- new macro, BASH_TYPE_SIG_ATOMIC_T, tests for sig_atomic_t in
<signal.h>, defines as int if not defined
configure.in
- call BASH_TYPE_SIG_ATOMIC_T
- call AC_C_VOLATILE
config.h.in
- empty define for sig_atomic_t
- empty define for volatile
1/27
----
subst.c
- audit calls to add_character and change to add_ifs_character (which
quotes characters in $IFS). Affects primarily `:', `=', and `~'.
Fixes bug reported by Jan Schampera <jan.schampera@web.de>; fix
suggested by Stephane Chazelas <stephane_chazelas@yahoo.fr>
2/1
---
configure.in
- call AC_C_RESTRICT
config.h.in
- add empty defintion for `restrict'
pcomplete.c
- use unwind_protects around call to execute_shell_function in
gen_shell_function_matches to prevent data corruption if
throw_to_top_level is called. Bug report and fix from
werner@suse.de.
execute_cmd.c
- don't clamp CPU usage at 100% in print_formatted_time. Bug reported
by Linda Walsh <bash@tlinx.org>
2/5
---
locale.c
- in set_locale_var, set errno to 0 before calling setlocale(), and
print strerror (errno) if setlocale fails and errno ends up non-zero
2/6
---
configure.in
- backed out of solaris change from 10/23/2008 (adding `-z interpose'
to LDFLAGS) due to solaris updates to fix a linker problem.
Updatted by Serge Dussud <Serge.Dussud@Sun.COM>
2/12
----
execute_cmd.c
- change execute_connection so failure of a pipeline will cause the
shell to exit if -e is on. From discussion on austin-group
mailing list
- change execute_command_internal so failure of a user-specified
subshell will cause the shell to exit if -e is on. From discussion
on austin-group mailing list
2/13
----
doc/{bash.1,bashref.texi}
- clarified description of set -e option to accurately reflect current
implementation
2/19
----
print_cmd.c
- fix print_deferred_heredocs to not print a space if the separator
string is null
- change print_deferred_heredocs to set `was_heredoc' after printing
something
- change connection printing code to only print the `;' separator
if we haven't just printed a here-document
- change connection printing code to print any deferred here
documents after the rhs of the connection. Fixes bug reported by
Bo Andresen <bo.andresen@zlin.dk>
[bash-4.0 frozen]

View file

@ -51,7 +51,7 @@ RBASH f
AUTHORS f
Y2K f
configure.in f
configure f
configure f 755
Makefile.in f
config-top.h f
config-bot.h f
@ -844,6 +844,7 @@ tests/glob1.sub f
tests/glob.right f
tests/heredoc.tests f
tests/heredoc.right f
tests/heredoc1.sub f
tests/herestr.tests f
tests/herestr.right f
tests/histexp.tests f
@ -875,6 +876,7 @@ tests/jobs.right f
tests/mapfile.data f
tests/mapfile.right f
tests/mapfile.tests f
tests/mapfile1.sub f
tests/more-exp.tests f
tests/more-exp.right f
tests/new-exp.tests f
@ -1005,7 +1007,9 @@ tests/run-tilde2 f
tests/run-trap f
tests/run-type f
tests/run-varenv f
tests/set-e-test f
tests/set-e.tests f
tests/set-e1.sub f
tests/set-e2.sub f
tests/set-e.right f
tests/set-x.tests f
tests/set-x.right f

24
MANIFEST.doc Normal file
View file

@ -0,0 +1,24 @@
#
# Master Manifest file for documentation-only distribution
#
doc d
MANIFEST.doc f
doc/article.ps f
doc/rose94.ps f
doc/bash.ps f
doc/bashbug.ps f
doc/builtins.ps f
doc/rbash.ps f
doc/bashref.ps f
doc/bashref.dvi f
doc/bash.0 f
doc/bashbug.0 f
doc/builtins.0 f
doc/rbash.0 f
doc/article.txt f
doc/bash.html f
doc/bashref.html f
doc/article.pdf f
doc/bash.pdf f
doc/bashref.pdf f
doc/rose94.pdf f

4
NEWS
View file

@ -72,7 +72,7 @@ t. The `help' builtin now has a new -d option, to display a short description,
and a -m option, to print help information in a man page-like format.
u. There is a new `mapfile' builtin to populate an array with lines from a
given file.
given file. The name `readarray' is a synonym.
v. If a command is not found, the shell attempts to execute a shell function
named `command_not_found_handle', supplying the command words as the
@ -102,7 +102,7 @@ bb. The command assigned to a key sequence with `bind -x' now sets two new
and cursor position by modifying READLINE_LINE_BUFFER and READLINE_POINT,
respectively.
cc. There is a new >>& redirection operator, which appends the standard output
cc. There is a new &>> redirection operator, which appends the standard output
and standard error to the named file.
dd. The parser now understands `|&' as a synonym for `2>&1 |', which redirects

12
aclocal.m4 vendored
View file

@ -531,6 +531,18 @@ AC_DEFINE(RLIMTYPE, rlim_t)
fi
])
AC_DEFUN(BASH_TYPE_SIG_ATOMIC_T,
[AC_CACHE_CHECK([for sig_atomic_t in signal.h], ac_cv_have_sig_atomic_t,
[AC_TRY_LINK([
#include <signal.h>
],[ sig_atomic_t x; ],
ac_cv_have_sig_atomic_t=yes, ac_cv_have_sig_atomic_t=no)])
if test "$ac_cv_have_sig_atomic_t" = "no"
then
AC_CHECK_TYPE(sig_atomic_t,int)
fi
])
AC_DEFUN(BASH_FUNC_LSTAT,
[dnl Cannot use AC_CHECK_FUNCS(lstat) because Linux defines lstat() as an
dnl inline function in <sys/stat.h>.

View file

@ -355,7 +355,6 @@ save_history ()
append_history (history_lines_this_session, hf);
else
write_history (hf);
sv_histsize ("HISTFILESIZE");
}
}

View file

@ -321,6 +321,16 @@ sh_wrerror ()
builtin_error (_("write error: %s"), strerror (errno));
}
void
sh_ttyerror (set)
int set;
{
if (set)
builtin_error (_("error setting terminal attributes: %s"), strerror (errno));
else
builtin_error (_("error getting terminal attributes: %s"), strerror (errno));
}
int
sh_chkwrite (s)
int s;

View file

@ -81,6 +81,7 @@ extern void sh_nojobs __P((char *));
extern void sh_restricted __P((char *));
extern void sh_notbuiltin __P((char *));
extern void sh_wrerror __P((void));
extern void sh_ttyerror __P((int));
extern int sh_chkwrite __P((int));
extern char **make_builtin_argv __P((WORD_LIST *, int *));

View file

@ -266,10 +266,7 @@ parse_and_execute (string, from_file, flags)
global_command = (COMMAND *)NULL;
if ((subshell_environment & SUBSHELL_COMSUB) && comsub_ignore_return)
{
command->flags |= CMD_IGNORE_RETURN;
itrace("parse_and_execute: turned on CMD_IGNORE_RETURN from comsub_ignore_return");
}
#if defined (ONESHOT)
/*

View file

@ -24,7 +24,7 @@ $PRODUCES mapfile.c
$BUILTIN mapfile
$FUNCTION mapfile_builtin
$SHORT_DOC mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]
Read lines from a file into an array variable.
Read lines from the standard input into an array variable.
Read lines from the standard input into the array variable ARRAY, or from
file descriptor FD if the -u option is supplied. The variable MAPFILE is
@ -42,7 +42,9 @@ Options:
Arguments:
ARRAY Array variable name to use for file data.
If -C is supplied without -c, the default quantum is 5000.
If -C is supplied without -c, the default quantum is 5000. When
CALLBACK is evaluated, it is supplied the index of the next array
element to be assigned as an additional argument.
If not supplied with an explicit origin, mapfile will clear ARRAY before
assigning to it.
@ -51,6 +53,14 @@ Exit Status:
Returns success unless an invalid option is given or ARRAY is readonly.
$END
$BUILTIN readarray
$FUNCTION mapfile_builtin
$SHORT_DOC readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]
Read lines from a file into an array variable.
A synonym for `mapfile'.
$END
#include <config.h>
#include "builtins.h"
@ -70,7 +80,6 @@ $END
#include "common.h"
#include "bashgetopt.h"
#if !defined (errno)
extern int errno;
#endif
@ -93,6 +102,7 @@ run_callback(callback, current_index)
{
unsigned int execlen;
char *execstr;
int flags;
execlen = strlen (callback) + 10;
/* 1 for space between %s and %d,
@ -100,8 +110,13 @@ run_callback(callback, current_index)
execlen += 2;
execstr = xmalloc (execlen);
flags = 0;
#if 0
if (interactive)
flags |= SEVAL_NOHIST|SEVAL_INTERACT;
#endif
snprintf (execstr, execlen, "%s %d", callback, current_index);
return parse_and_execute(execstr, NULL, 0);
return parse_and_execute(execstr, NULL, flags);
}
static void
@ -136,8 +151,13 @@ mapfile (fd, line_count_goal, origin, nskip, callback_quantum, callback, array_n
here allows us to call bind_array_element instead of bind_array_variable
and skip the variable lookup on every call. */
entry = find_or_make_array_variable (array_name, 1);
if (entry == 0)
return (EXECUTION_FAILURE);
if (entry == 0 || readonly_p (entry) || noassign_p (entry))
{
if (readonly_p (entry))
err_readonly (array_name);
return (EXECUTION_FAILURE);
}
if (flags & MAPF_CLEARARRAY)
array_flush (array_cell (entry));
@ -147,19 +167,24 @@ mapfile (fd, line_count_goal, origin, nskip, callback_quantum, callback, array_n
unbuffered_read = 1;
#endif
zreset ();
/* Skip any lines at beginning of file? */
for (line_count = 0; line_count < nskip; line_count++)
zgetline(fd, &line, &line_length, unbuffered_read);
if (zgetline (fd, &line, &line_length, unbuffered_read) < 0)
break;
line = 0;
line_length = 0;
/* Reset the buffer for bash own stream */
for (array_index = origin, line_count = 0;
zgetline(fd, &line, &line_length, unbuffered_read) != -1;
interrupt_immediately++;
for (array_index = origin, line_count = 1;
zgetline (fd, &line, &line_length, unbuffered_read) != -1;
array_index++, line_count++)
{
/* Have we exceeded # of lines to store? */
if (line_count_goal != 0 && line_count >= line_count_goal)
if (line_count_goal != 0 && line_count > line_count_goal)
break;
/* Remove trailing newlines? */
@ -184,6 +209,7 @@ mapfile (fd, line_count_goal, origin, nskip, callback_quantum, callback, array_n
if (unbuffered_read == 0)
zsyncfd (fd);
interrupt_immediately--;
return EXECUTION_SUCCESS;
}

View file

@ -879,16 +879,18 @@ vbprintf (format, va_alist)
SH_VA_START (args, format);
blen = vsnprintf (vbuf + vblen, vbsize - vblen, format, args);
va_end (args);
nlen = vblen + blen + 1;
if (nlen >= vbsize)
{
vbsize = ((nlen + 63) >> 6) << 6;
vbuf = (char *)xrealloc (vbuf, vbsize);
SH_VA_START (args, format);
blen = vsnprintf (vbuf + vblen, vbsize - vblen, format, args);
va_end (args);
}
va_end (args);
vblen += blen;
vbuf[vblen] = '\0';

View file

@ -290,9 +290,8 @@ read_builtin (list)
}
list = loptend;
/* `read -t 0 var' returns failure immediately. XXX - should it test
whether input is available with select/FIONREAD, and fail if those
are unavailable? */
/* `read -t 0 var' tests whether input is available with select/FIONREAD,
and fails if those are unavailable */
if (have_timeout && tmsec == 0 && tmusec == 0)
#if 0
return (EXECUTION_FAILURE);
@ -417,10 +416,9 @@ read_builtin (list)
termsave.attrs = &ttattrs;
ttset = ttattrs;
if (silent)
ttfd_cbreak (fd, &ttset); /* ttcbreak () */
else
ttfd_onechar (fd, &ttset); /* ttonechar () */
i = silent ? ttfd_cbreak (fd, &ttset) : ttfd_onechar (fd, &ttset);
if (i < 0)
sh_ttyerror (1);
add_unwind_protect ((Function *)ttyrestore, (char *)&termsave);
}
}
@ -432,7 +430,9 @@ read_builtin (list)
termsave.attrs = &ttattrs;
ttset = ttattrs;
ttfd_noecho (fd, &ttset); /* ttnoecho (); */
i = ttfd_noecho (fd, &ttset); /* ttnoecho (); */
if (i < 0)
sh_ttyerror (1);
add_unwind_protect ((Function *)ttyrestore, (char *)&termsave);
}

View file

@ -135,6 +135,19 @@ Exit Status:
Returns the status of the last command executed.
$END
$BUILTIN coproc
$SHORT_DOC coproc [NAME] command [redirections]
Create a coprocess named NAME.
Execute COMMAND asynchronously, with the standard output and standard
input of the command connected via a pipe to file descriptors assigned
to indices 0 and 1 of an array variable NAME in the executing shell.
The default NAME is "COPROC".
Exit Status:
Returns the exit status of COMMAND.
$END
$BUILTIN function
$SHORT_DOC function name { COMMANDS ; } or name () { COMMANDS ; }
Define shell function.

View file

@ -334,6 +334,9 @@ typedef struct subshell_com {
COMMAND *command;
} SUBSHELL_COM;
#define COPROC_RUNNING 0x01
#define COPROC_DEAD 0x02
typedef struct coproc {
char *c_name;
pid_t c_pid;

View file

@ -180,6 +180,10 @@
#undef inline
#undef restrict
#undef volatile
/* Define if cpp supports the ANSI-C stringizing `#' operator */
#undef HAVE_STRINGIZE
@ -316,6 +320,9 @@
/* Define to `unsigned int' if <sys/socket.h> doesn't define. */
#undef socklen_t
/* Define to `int' if <signal.h> doesn't define. */
#undef sig_atomic_t
#undef HAVE_MBSTATE_T
/* Define if you have quad_t in <sys/types.h>. */

330
configure vendored Normal file → Executable file
View file

@ -1,7 +1,7 @@
#! /bin/sh
# From configure.in for Bash 4.0, version 4.009.
# From configure.in for Bash 4.0, version 4.013.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.63 for bash 4.0-rc1.
# Generated by GNU Autoconf 2.63 for bash 4.0-release.
#
# 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.0-rc1'
PACKAGE_STRING='bash 4.0-rc1'
PACKAGE_VERSION='4.0-release'
PACKAGE_STRING='bash 4.0-release'
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.0-rc1 to adapt to many kinds of systems.
\`configure' configures bash 4.0-release 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.0-rc1:";;
short | recursive ) echo "Configuration of bash 4.0-release:";;
esac
cat <<\_ACEOF
@ -1648,7 +1648,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
bash configure 4.0-rc1
bash configure 4.0-release
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@ -1662,7 +1662,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.0-rc1, which was
It was created by bash $as_me 4.0-release, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@ -2074,7 +2074,7 @@ ac_config_headers="$ac_config_headers config.h"
BASHVERS=4.0
RELSTATUS=rc1
RELSTATUS=release
case "$RELSTATUS" in
alp*|bet*|dev*|rc*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
@ -6982,6 +6982,143 @@ _ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for working volatile" >&5
$as_echo_n "checking for working volatile... " >&6; }
if test "${ac_cv_c_volatile+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
volatile int x;
int * volatile y = (int *) 0;
return !x && !y;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_c_volatile=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_volatile=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_volatile" >&5
$as_echo "$ac_cv_c_volatile" >&6; }
if test $ac_cv_c_volatile = no; then
cat >>confdefs.h <<\_ACEOF
#define volatile /**/
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5
$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
if test "${ac_cv_c_restrict+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_c_restrict=no
# The order here caters to the fact that C++ does not require restrict.
for ac_kw in __restrict __restrict__ _Restrict restrict; do
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
typedef int * int_ptr;
int foo (int_ptr $ac_kw ip) {
return ip[0];
}
int
main ()
{
int s[1];
int * $ac_kw t = s;
t[0] = 0;
return foo(t)
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_c_restrict=$ac_kw
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
test "$ac_cv_c_restrict" != no && break
done
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_restrict" >&5
$as_echo "$ac_cv_c_restrict" >&6; }
case $ac_cv_c_restrict in
restrict) ;;
no) cat >>confdefs.h <<\_ACEOF
#define restrict /**/
_ACEOF
;;
*) cat >>confdefs.h <<_ACEOF
#define restrict $ac_cv_c_restrict
_ACEOF
;;
esac
MKINSTALLDIRS=
@ -19749,6 +19886,171 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
{ $as_echo "$as_me:$LINENO: checking for sig_atomic_t in signal.h" >&5
$as_echo_n "checking for sig_atomic_t in signal.h... " >&6; }
if test "${ac_cv_have_sig_atomic_t+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <signal.h>
int
main ()
{
sig_atomic_t x;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_have_sig_atomic_t=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_have_sig_atomic_t=no
fi
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_sig_atomic_t" >&5
$as_echo "$ac_cv_have_sig_atomic_t" >&6; }
if test "$ac_cv_have_sig_atomic_t" = "no"
then
{ $as_echo "$as_me:$LINENO: checking for sig_atomic_t" >&5
$as_echo_n "checking for sig_atomic_t... " >&6; }
if test "${ac_cv_type_sig_atomic_t+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_cv_type_sig_atomic_t=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
if (sizeof (sig_atomic_t))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
if (sizeof ((sig_atomic_t)))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
:
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_type_sig_atomic_t=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_sig_atomic_t" >&5
$as_echo "$ac_cv_type_sig_atomic_t" >&6; }
if test "x$ac_cv_type_sig_atomic_t" = x""yes; then
:
else
cat >>confdefs.h <<_ACEOF
#define sig_atomic_t int
_ACEOF
fi
fi
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
@ -29653,9 +29955,9 @@ sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DPATH_MAX=1024" ;;
sco3.2*) LOCAL_CFLAGS=-DMUST_UNBLOCK_CHLD ;;
sunos4*) LOCAL_CFLAGS=-DSunOS4 ;;
solaris2.5*) LOCAL_CFLAGS="-DSunOS5 -DSOLARIS" ;;
solaris2.8*) LOCAL_CFLAGS=-DSOLARIS LOCAL_LDFLAGS='-z interpose' ;;
solaris2.9*) LOCAL_CFLAGS=-DSOLARIS LOCAL_LDFLAGS='-z interpose' ;;
solaris2.10*) LOCAL_CFLAGS=-DSOLARIS LOCAL_LDFLAGS='-z interpose' ;;
solaris2.8*) LOCAL_CFLAGS=-DSOLARIS ;;
solaris2.9*) LOCAL_CFLAGS=-DSOLARIS ;;
solaris2.10*) LOCAL_CFLAGS=-DSOLARIS ;;
solaris2*) LOCAL_CFLAGS=-DSOLARIS ;;
lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
@ -30202,7 +30504,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.0-rc1, which was
This file was extended by bash $as_me 4.0-release, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -30265,7 +30567,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
bash config.status 4.0-rc1
bash config.status 4.0-release
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"

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.0, version 4.009])dnl
AC_REVISION([for Bash 4.0, version 4.013])dnl
define(bashvers, 4.0)
define(relstatus, rc1)
define(relstatus, release)
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
@ -637,6 +637,8 @@ AC_C_STRINGIZE
AC_C_LONG_DOUBLE
AC_C_PROTOTYPES
AC_C_CHAR_UNSIGNED
AC_C_VOLATILE
AC_C_RESTRICT
dnl initialize GNU gettext
AM_GNU_GETTEXT([no-libtool], [need-ngettext], [lib/intl])
@ -835,6 +837,7 @@ BASH_TYPE_LONG_LONG
BASH_TYPE_UNSIGNED_LONG_LONG
AC_TYPE_SIGNAL
BASH_TYPE_SIG_ATOMIC_T
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short, 2)
@ -1009,9 +1012,9 @@ sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DPATH_MAX=1024" ;;
sco3.2*) LOCAL_CFLAGS=-DMUST_UNBLOCK_CHLD ;;
sunos4*) LOCAL_CFLAGS=-DSunOS4 ;;
solaris2.5*) LOCAL_CFLAGS="-DSunOS5 -DSOLARIS" ;;
solaris2.8*) LOCAL_CFLAGS=-DSOLARIS LOCAL_LDFLAGS='-z interpose' ;;
solaris2.9*) LOCAL_CFLAGS=-DSOLARIS LOCAL_LDFLAGS='-z interpose' ;;
solaris2.10*) LOCAL_CFLAGS=-DSOLARIS LOCAL_LDFLAGS='-z interpose' ;;
solaris2.8*) LOCAL_CFLAGS=-DSOLARIS ;;
solaris2.9*) LOCAL_CFLAGS=-DSOLARIS ;;
solaris2.10*) LOCAL_CFLAGS=-DSOLARIS ;;
solaris2*) LOCAL_CFLAGS=-DSOLARIS ;;
lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading

300
doc/FAQ
View file

@ -1,4 +1,4 @@
This is the Bash FAQ, version 3.36, for Bash version 3.2.
This is the Bash FAQ, version 4.01, for Bash version 4.0.
This document contains a set of frequently-asked questions concerning
Bash, the GNU Bourne-Again Shell. Bash is a freely-available command
@ -36,9 +36,9 @@ A10) What is the bash `posix mode'?
Section B: The latest version
B1) What's new in version 3.2?
B2) Are there any user-visible incompatibilities between bash-3.2 and
bash-2.05b?
B1) What's new in version 4.0?
B2) Are there any user-visible incompatibilities between bash-4.0,
bash-3.2, and bash-2.05b?
Section C: Differences from other Unix shells
@ -143,26 +143,26 @@ of Case Western Reserve University.
A2) What's the latest version?
The latest version is 3.2, first made available on 12 October, 2006.
The latest version is 4.0, first made available on 20 February, 2009.
A3) Where can I get it?
Bash is the GNU project's shell, and so is available from the
master GNU archive site, ftp.gnu.org, and its mirrors. The
latest version is also available for FTP from ftp.cwru.edu.
The following URLs tell how to get version 3.2:
The following URLs tell how to get version 4.0:
ftp://ftp.gnu.org/pub/gnu/bash/bash-3.2.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-3.2.tar.gz
ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-4.0.tar.gz
Formatted versions of the documentation are available with the URLs:
ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-3.2.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-3.2.tar.gz
ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-4.0.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-4.0.tar.gz
Any patches for the current version are available with the URL:
ftp://ftp.cwru.edu/pub/bash/bash-3.2-patches/
ftp://ftp.cwru.edu/pub/bash/bash-4.0-patches/
A4) On what machines will bash run?
@ -194,9 +194,8 @@ http://www.cygwin.com/.
Cygnus originally ported bash-1.14.7, and that port was part of their
early GNU-Win32 (the original name) releases. Cygnus has also done
ports of bash-2.05b and bash-3.0 to the CYGWIN environment, and both
are available as part of their current release. Bash-3.2 is currently
being tested and should be available soon.
ports of bash-2.05b and bash-3.2 to the CYGWIN environment, and both
are available as part of their current release.
Bash-2.05b and later versions should require no local Cygnus changes to
build and run under CYGWIN.
@ -219,7 +218,7 @@ Mark began to work with bash-2.05, but I don't know the current status.
Bash-3.0 compiles and runs with no modifications under Microsoft's Services
for Unix (SFU), once known as Interix. I do not anticipate any problems
with building bash-3.1 or bash-3.2.
with building bash-4.0, but will gladly accept any patches that are needed.
A6) How can I build bash with gcc?
@ -388,12 +387,158 @@ They are also listed in a section in the Bash Reference Manual
Section B: The latest version
B1) What's new in version 3.2?
B1) What's new in version 4.0?
Bash-3.2 is the second maintenance release of the third major release of
bash. It contains the following significant new features (see the manual
page for complete descriptions and the CHANGES and NEWS files in the
bash-3.2 distribution).
Bash-4.0 is the fourth major release of bash. There are numerous new features,
some experimental. Depending on community reception, the experimental
features will evolve.
Bash-4.0 contains the following new features (see the manual page for
complete descriptions and the CHANGES and NEWS files in the bash-4.0
distribution):
o When using substring expansion on the positional parameters, a starting
index of 0 now causes $0 to be prefixed to the list.
o There is a new variable, $BASHPID, which always returns the process id of
the current shell.
o There is a new `autocd' option that, when enabled, causes bash to attempt
to `cd' to a directory name that is supplied as the first word of a
simple command.
o There is a new `checkjobs' option that causes the shell to check for and
report any running or stopped jobs at exit.
o The programmable completion code exports a new COMP_TYPE variable, set to
a character describing the type of completion being attempted.
o The programmable completion code exports a new COMP_KEY variable, set to
the character that caused the completion to be invoked (e.g., TAB).
o The programmable completion code now uses the same set of characters as
readline when breaking the command line into a list of words.
o The block multiplier for the ulimit -c and -f options is now 512 when in
Posix mode, as Posix specifies.
o Changed the behavior of the read builtin to save any partial input received
in the specified variable when the read builtin times out. This also
results in variables specified as arguments to read to be set to the empty
string when there is no input available. When the read builtin times out,
it returns an exit status greater than 128.
o The shell now has the notion of a `compatibility level', controlled by
new variables settable by `shopt'. Setting this variable currently
restores the bash-3.1 behavior when processing quoted strings on the rhs
of the `=~' operator to the `[[' command.
o The `ulimit' builtin now has new -b (socket buffer size) and -T (number
of threads) options.
o There is a new `compopt' builtin that allows completion functions to modify
completion options for existing completions or the completion currently
being executed.
o The `read' builtin has a new -i option which inserts text into the reply
buffer when using readline.
o A new `-E' option to the complete builtin allows control of the default
behavior for completion on an empty line.
o There is now limited support for completing command name words containing
globbing characters.
o The `help' builtin now has a new -d option, to display a short description,
and a -m option, to print help information in a man page-like format.
o There is a new `mapfile' builtin to populate an array with lines from a
given file.
o If a command is not found, the shell attempts to execute a shell function
named `command_not_found_handle', supplying the command words as the
function arguments.
o There is a new shell option: `globstar'. When enabled, the globbing code
treats `**' specially -- it matches all directories (and files within
them, when appropriate) recursively.
o There is a new shell option: `dirspell'. When enabled, the filename
completion code performs spelling correction on directory names during
completion.
o The `-t' option to the `read' builtin now supports fractional timeout
values.
o Brace expansion now allows zero-padding of expanded numeric values and
will add the proper number of zeroes to make sure all values contain the
same number of digits.
o There is a new bash-specific bindable readline function: `dabbrev-expand'.
It uses menu completion on a set of words taken from the history list.
o The command assigned to a key sequence with `bind -x' now sets two new
variables in the environment of the executed command: READLINE_LINE_BUFFER
and READLINE_POINT. The command can change the current readline line
and cursor position by modifying READLINE_LINE_BUFFER and READLINE_POINT,
respectively.
o There is a new >>& redirection operator, which appends the standard output
and standard error to the named file.
o The parser now understands `|&' as a synonym for `2>&1 |', which redirects
the standard error for a command through a pipe.
o The new `;&' case statement action list terminator causes execution to
continue with the action associated with the next pattern in the
statement rather than terminating the command.
o The new `;;&' case statement action list terminator causes the shell to
test the next set of patterns after completing execution of the current
action, rather than terminating the command.
o The shell understands a new variable: PROMPT_DIRTRIM. When set to an
integer value greater than zero, prompt expansion of \w and \W will
retain only that number of trailing pathname components and replace
the intervening characters with `...'.
o There are new case-modifying word expansions: uppercase (^[^]) and
lowercase (,[,]). They can work on either the first character or
array element, or globally. They accept an optional shell pattern
that determines which characters to modify. There is an optionally-
configured feature to include capitalization operators.
o The shell provides associative array variables, with the appropriate
support to create, delete, assign values to, and expand them.
o The `declare' builtin now has new -l (convert value to lowercase upon
assignment) and -u (convert value to uppercase upon assignment) options.
There is an optionally-configurable -c option to capitalize a value at
assignment.
o There is a new `coproc' reserved word that specifies a coprocess: an
asynchronous command run with two pipes connected to the creating shell.
Coprocs can be named. The input and output file descriptors and the
PID of the coprocess are available to the calling shell in variables
with coproc-specific names.
o A value of 0 for the -t option to `read' now returns success if there is
input available to be read from the specified file descriptor.
o CDPATH and GLOBIGNORE are ignored when the shell is running in privileged
mode.
o New bindable readline functions shell-forward-word and shell-backward-word,
which move forward and backward words delimited by shell metacharacters
and honor shell quoting.
o New bindable readline functions shell-backward-kill-word and shell-kill-word
which kill words backward and forward, but use the same word boundaries
as shell-forward-word and shell-backward-word.
A short feature history dating from Bash-2.0:
Bash-3.2 contained the following new features:
o Bash-3.2 now checks shell scripts for NUL characters rather than non-printing
characters when deciding whether or not a script is a binary file.
@ -401,8 +546,6 @@ o Bash-3.2 now checks shell scripts for NUL characters rather than non-printing
o Quoting the string argument to the [[ command's =~ (regexp) operator now
forces string matching, as with the other pattern-matching operators.
A short feature history dating from Bash-2.0:
Bash-3.1 contained the following new features:
o Bash-3.1 may now be configured and built in a mode that enforces strict
@ -651,10 +794,10 @@ grammar tighter and smaller (66 reduce-reduce conflicts gone)
lots of code now smaller and faster
test suite greatly expanded
B2) Are there any user-visible incompatibilities between bash-3.2 and
bash-2.05b?
B2) Are there any user-visible incompatibilities between bash-4.0, bash-3.2,
and bash-2.05b?
There are a few incompatibilities between version 2.05b and version 3.2.
There are a few incompatibilities between version 4.0 and version 3.2.
They are detailed in the file COMPAT in the bash distribution. That file
is not meant to be all-encompassing; send mail to bash-maintainers@gnu.org
if if you find something that's not mentioned there.
@ -687,25 +830,25 @@ Things bash has that sh does not:
the ${param/pat[/string]} parameter pattern substitution operator
expansions to perform substring removal (${p%[%]w}, ${p#[#]w})
expansion of positional parameters beyond $9 with ${num}
variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, REPLY,
variables: BASH, BASHPID, BASH_VERSION, BASH_VERSINFO, UID, EUID, REPLY,
TIMEFORMAT, PPID, PWD, OLDPWD, SHLVL, RANDOM, SECONDS,
LINENO, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE, HOSTNAME,
ENV, PS3, PS4, DIRSTACK, PIPESTATUS, HISTSIZE, HISTFILE,
HISTFILESIZE, HISTCONTROL, HISTIGNORE, GLOBIGNORE, GROUPS,
PROMPT_COMMAND, FCEDIT, FIGNORE, IGNOREEOF, INPUTRC,
SHELLOPTS, OPTERR, HOSTFILE, TMOUT, FUNCNAME, histchars,
auto_resume
auto_resume, PROMPT_DIRTRIM
DEBUG trap
ERR trap
variable arrays with new compound assignment syntax
redirections: <>, &>, >|, <<<, [n]<&word-, [n]>&word-
redirections: <>, &>, >|, <<<, [n]<&word-, [n]>&word-, >>&
prompt string special char translation and variable expansion
auto-export of variables in initial environment
command search finds functions before builtins
bash return builtin will exit a file sourced with `.'
builtins: cd -/-L/-P, exec -l/-c/-a, echo -e/-E, hash -d/-l/-p/-t.
export -n/-f/-p/name=value, pwd -L/-P,
read -e/-p/-a/-t/-n/-d/-s/-u,
read -e/-p/-a/-t/-n/-d/-s/-u/-i,
readonly -a/-f/name=value, trap -l, set +o,
set -b/-m/-o option/-h/-p/-B/-C/-H/-P,
unset -f/-v, ulimit -i/-m/-p/-q/-u/-x,
@ -727,7 +870,7 @@ Things bash has that sh does not:
other new bash builtins: bind, command, compgen, complete, builtin,
declare/typeset, dirs, enable, fc, help,
history, logout, popd, pushd, disown, shopt,
printf
printf, compopt, mapfile
exported functions
filename generation when using output redirection (command >a*)
POSIX.2-style globbing character classes
@ -743,7 +886,14 @@ Things bash has that sh does not:
debugger support, including `caller' builtin and new variables
RETURN trap
the `+=' assignment operator
autocd shell option and behavior
command-not-found hook with command_not_found_handle shell function
globstar shell option and `**' globbing behavior
|& synonym for `2>&1 |'
;& and ;;& case action list terminators
case-modifying word expansions and variable attributes
associative arrays
coprocesses using the `coproc' reserved word and variables
Things sh has that bash does not:
uses variable SHACCT to do shell accounting
@ -788,14 +938,14 @@ Things bash has or uses that ksh88 does not:
the ${!param*} prefix expansion operator
the ${param:offset[:length]} parameter substring operator
the ${param/pat[/string]} parameter pattern substitution operator
variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, SHLVL,
variables: BASH, BASH_VERSION, BASH_VERSINFO, BASHPID, UID, EUID, SHLVL,
TIMEFORMAT, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE,
HISTFILESIZE, HISTIGNORE, HISTCONTROL, PROMPT_COMMAND,
IGNOREEOF, FIGNORE, INPUTRC, HOSTFILE, DIRSTACK,
PIPESTATUS, HOSTNAME, OPTERR, SHELLOPTS, GLOBIGNORE,
GROUPS, FUNCNAME, histchars, auto_resume
GROUPS, FUNCNAME, histchars, auto_resume, PROMPT_DIRTRIM
prompt expansion with backslash escapes and command substitution
redirection: &> (stdout and stderr), <<<, [n]<&word-, [n]>&word-
redirection: &> (stdout and stderr), <<<, [n]<&word-, [n]>&word-, >>&
more extensive and extensible editing and programmable completion
builtins: bind, builtin, command, declare, dirs, echo -e/-E, enable,
exec -l/-c/-a, fc -s, export -n/-f/-p, hash, help, history,
@ -805,7 +955,7 @@ Things bash has or uses that ksh88 does not:
-o notify/-o physical/-o posix/-o hashall/-o onecmd/
-h/-B/-C/-b/-H/-P, set +o, suspend, trap -l, type,
typeset -a/-F/-p, ulimit -i/-q/-u/-x, umask -S, alias -p,
shopt, disown, printf, complete, compgen
shopt, disown, printf, complete, compgen, compopt, mapfile
`!' csh-style history expansion
POSIX.2-style globbing character classes
POSIX.2-style globbing equivalence classes
@ -821,18 +971,26 @@ Things bash has or uses that ksh88 does not:
Timestamps in history entries
{x..y} brace expansion
The `+=' assignment operator
autocd shell option and behavior
command-not-found hook with command_not_found_handle shell function
globstar shell option and `**' globbing behavior
|& synonym for `2>&1 |'
;& and ;;& case action list terminators
case-modifying word expansions and variable attributes
associative arrays
coprocesses using the `coproc' reserved word and variables
Things ksh88 has or uses that bash does not:
tracked aliases (alias -t)
variables: ERRNO, FPATH, EDITOR, VISUAL
co-processes (|&, >&p, <&p)
co-processes (bash uses different syntax)
weirdly-scoped functions
typeset +f to list all function names without definitions
text of command history kept in a file, not memory
builtins: alias -x, cd old new, newgrp, print,
read -p/-s/var?prompt, set -A/-o gmacs/
-o bgnice/-o markdirs/-o trackall/-o viraw/-s,
typeset -H/-L/-R/-Z/-A/-ft/-fu/-fx/-l/-u/-t, whence
typeset -H/-L/-R/-Z/-A/-ft/-fu/-fx/-t, whence
using environment to pass attributes of exported variables
arithmetic evaluation done on arguments to some builtins
reads .profile from $PWD when invoked as login shell
@ -848,33 +1006,48 @@ Implementation differences:
C3) Which new features in ksh-93 are not in bash, and which are?
New things in ksh-93 not in bash-3.2:
associative arrays
This list is current through ksh93t (11/04/2008)
New things in ksh-93 not in bash-4.0:
floating point arithmetic and variables
math library functions
${!name[sub]} name of subscript for associative array
`.' is allowed in variable names to create a hierarchical namespace
more extensive compound assignment syntax
discipline functions
`sleep' and `getconf' builtins (bash has loadable versions)
typeset -n and `nameref' variables
KEYBD trap
variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, .sh.version,
.sh.name, .sh.subscript, .sh.value, .sh.match, HISTEDIT
backreferences in pattern matching (\N)
`&' operator in pattern lists for matching
`&' operator in pattern lists for matching (match all instead of any)
exit statuses between 0 and 255
FPATH and PATH mixing
lexical scoping for local variables in `ksh' functions
no scoping for local variables in `POSIX' functions
$'' \C[.collating-element.] escape sequence
-C/-I invocation options
print -f (bash uses printf)
`fc' has been renamed to `hist'
`.' can execute shell functions
exit statuses between 0 and 255
FPATH and PATH mixing
getopts -a
-I invocation option
printf %H, %P, %T, %Z modifiers, output base for %d
lexical scoping for local variables in `ksh' functions
no scoping for local variables in `POSIX' functions
printf %B, %H, %P, %R, %T, %Z modifiers, output base for %d, `=' flag
read -N (read -n differs, too)/-v
set -o showme/-o multiline (bash default)
`sleep' and `getconf' builtins (bash has loadable versions)
typeset -n and `nameref' variables
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
redirection operators preceded with {varname} to store fd number in varname
brace expansion printf-like formats
New things in ksh-93 present in bash-3.2:
New things in ksh-93 present in bash-4.0:
associative arrays
[n]<&word- and [n]>&word- redirections (combination dup and close)
for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command
?:, ++, --, `expr1 , expr2' arithmetic operators
@ -883,24 +1056,30 @@ New things in ksh-93 present in bash-3.2:
compound array assignment
the `!' reserved word
loadable builtins -- but ksh uses `builtin' while bash uses `enable'
`command', `builtin', `disown' builtins
new $'...' and $"..." quoting
FIGNORE (but bash uses GLOBIGNORE), HISTCMD
set -o notify/-C
brace expansion and set -B
changes to kill builtin
`command', `builtin', `disown' builtins
echo -e
exec -c/-a
read -A (bash uses read -a)
read -t/-d
trap -p
exec -c/-a
`.' restores the positional parameters when it completes
set -o notify/-C
set -o pipefail
set -G (-o globstar) and **
POSIX.2 `test'
umask -S
unalias -a
command and arithmetic substitution performed on PS1, PS4, and ENV
command name completion
command name completion, TAB displaying possible completions
ENV processed only for interactive shells
set -o pipefail
The `+=' assignment operator
the `;&' case statement "fallthrough" pattern list terminator
csh-style history expansion and set -H
negative offsets in ${param:offset:length}
Section D: Why does bash do some things differently than other Unix shells?
@ -1457,6 +1636,11 @@ when assigning the variable, then expand the values to a single string that
may contain whitespace. The first problem may be solved by using backslashes
or any other quoting mechanism to escape the white space in the patterns.
Bash-4.0 introduces the concept of a `compatibility level', controlled by
several options to the `shopt' builtin. If the `compat31' option is enabled,
bash reverts to the bash-3.1 behavior with respect to quoting the rhs of
the =~ operator.
Section F: Things to watch out for on certain Unix versions
F1) Why can't I use command line editing in my `cmdtool'?
@ -1847,9 +2031,7 @@ H3) What's coming in future versions?
These are features I hope to include in a future version of bash.
Rocky Bernstein's bash debugger (support is included with bash-3.0)
associative arrays
co-processes, but with a new-style syntax that looks like function declaration
Rocky Bernstein's bash debugger (support is included with bash-4.0)
H4) What's on the bash `wish list' for future versions?
@ -1867,9 +2049,9 @@ Some of the new ksh93 pattern matching operators, like backreferencing
H5) When will the next release appear?
The next version will appear sometime in 2007. Never make predictions.
The next version will appear sometime in 2009. Never make predictions.
This document is Copyright 1995-2006 by Chester Ramey.
This document is Copyright 1995-2009 by Chester Ramey.
Permission is hereby granted, without written agreement and
without license or royalty fees, to use, copy, and distribute

BIN
doc/article.pdf Normal file

Binary file not shown.

1418
doc/article.ps Normal file

File diff suppressed because it is too large Load diff

1111
doc/article.txt Normal file

File diff suppressed because it is too large Load diff

5217
doc/bash.0 Normal file

File diff suppressed because it is too large Load diff

View file

@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
.\" Last Change: Mon Dec 29 16:49:01 EST 2008
.\" Last Change: Sat Feb 7 20:50:40 EST 2009
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2008 December 29" "GNU Bash-4.0"
.TH BASH 1 "2009 February 7" "GNU Bash-4.0"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@ -887,6 +887,9 @@ The format for a coprocess is:
.PP
This creates a coprocess named \fINAME\fP.
If \fINAME\fP is not supplied, the default name is \fICOPROC\fP.
\fINAME\fP must not be supplied if \fIcommand\fP is a \fIsimple
command\fP (see above); otherwise, it is interpreted as the first word
of the simple command.
When the coproc is executed, the shell creates an array variable (see
.B Arrays
below) named \fINAME\fP in the context of the executing shell.
@ -1361,7 +1364,7 @@ corresponding to each member of \fBFUNCNAME\fP.
file where \fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called
(or \fB${BASH_LINENO[\fP\fI$i-1\fP\fB]}\fP if referenced within another
shell function).
The corresponding source file name is \fB${BASH_SOURCE[\fP\fI$i\fP\fB]}\fB.
The corresponding source file name is \fB${BASH_SOURCE[\fP\fI$i\fP\fB]}\fP.
Use \fBLINENO\fP to obtain the current line number.
.TP
.B BASH_REMATCH
@ -1457,7 +1460,7 @@ programmable completion facilities (see \fBProgrammable Completion\fP
below).
.TP
.B COMP_WORDBREAKS
The set of characters that the Readline library treats as word
The set of characters that the \fBreadline\fP library treats as word
separators when performing word completion.
If
.SM
@ -1468,8 +1471,8 @@ subsequently reset.
.B COMP_WORDS
An array variable (see \fBArrays\fP below) consisting of the individual
words in the current command line.
The words are split on shell metacharacters as the shell parser would
separate them.
The line is split into words as \fBreadline\fP would split it, using
\fBCOMP_WORDBREAKS\fP as described above.
This variable is available only in shell functions invoked by the
programmable completion facilities (see \fBProgrammable Completion\fP
below).
@ -2484,9 +2487,10 @@ introduce indirection.
.PP
In each of the cases below, \fIword\fP is subject to tilde expansion,
parameter expansion, command substitution, and arithmetic expansion.
When not performing substring expansion, \fBbash\fP tests for a parameter
that is unset or null; omitting the colon results in a test only for a
parameter that is unset.
.PP
When not performing substring expansion, using the forms documented below,
\fBbash\fP tests for a parameter that is unset or null. Omitting the colon
results in a test only for a parameter that is unset.
.PP
.PD 0
.TP
@ -2723,7 +2727,7 @@ to uppercase; the \fB,\fP operator converts matching uppercase letters
to lowercase.
The \fB^^\fP and \fB,,\fP expansions convert each matched character in the
expanded value; the \fB^\fP and \fB,\fP expansions match and convert only
the first character.
the first character in the expanded value..
If \fIpattern\fP is omitted, it is treated like a \fB?\fP, which matches
every character.
If
@ -3173,7 +3177,7 @@ ls 2\fB>&\fP1 \fB>\fP dirlist
.PP
directs only the standard output to file
.IR dirlist ,
because the standard error was duplicated as standard output
because the standard error was duplicated from the standard output
before the standard output was redirected to
.IR dirlist .
.PP
@ -5619,7 +5623,7 @@ variable is inserted at the beginning of the current line.
If a numeric argument is supplied, this command acts as a toggle: if
the characters at the beginning of the line do not match the value
of \fBcomment\-begin\fP, the value is inserted, otherwise
the characters in \fBcomment-begin\fP are deleted from the beginning of
the characters in \fBcomment\-begin\fP are deleted from the beginning of
the line.
In either case, the line is accepted as if a newline had been typed.
The default value of
@ -7636,6 +7640,10 @@ is supplied, or
Exit a login shell.
.TP
\fBmapfile\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP]
.PD 0
.TP
\fBreadarray\fP [\fB\-n\fP \fIcount\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-s\fP \fIcount\fP] [\fB\-t\fP] [\fB\-u\fP \fIfd\fP] [\fB\-C\fP \fIcallback\fP] [\fB\-c\fP \fIquantum\fP] [\fIarray\fP]
.PD
Read lines from the standard input into array variable
.IR array ,
or from file descriptor
@ -7685,6 +7693,10 @@ If
is specified without
.BR \-c ,
the default quantum is 5000.
When \fIcallback\fP is evaluated, it is supplied the index of the next
array element to be assigned as an additional argument.
\fIcallback\fP is evaluated after the line is read but before the
array element is assigned.
.PP
If not supplied with an explicit origin, \fBmapfile\fP will clear \fIarray\fP
before assigning to it.
@ -7837,7 +7849,7 @@ The return status is 0 unless an error occurs while
reading the name of the current directory or an
invalid option is supplied.
.TP
\fBread\fP [\fB\-ers\fP] [\fB\-a\fP \fIaname\fP] [\fB\-d\fP \fIdelim\fP] [\fB\-\fP \fItext\fP] [\fB\-n\fP \fInchars\fP] [\fB\-p\fP \fIprompt\fP] [\fB\-t\fP \fItimeout\fP] [\fB\-u\fP \fIfd\fP] [\fIname\fP ...]
\fBread\fP [\fB\-ers\fP] [\fB\-a\fP \fIaname\fP] [\fB\-d\fP \fIdelim\fP] [\fB\-i\fP \fItext\fP] [\fB\-n\fP \fInchars\fP] [\fB\-p\fP \fIprompt\fP] [\fB\-t\fP \fItimeout\fP] [\fB\-u\fP \fIfd\fP] [\fIname\fP ...]
One line is read from the standard input, or from the file descriptor
\fIfd\fP supplied as an argument to the \fB\-u\fP option, and the first word
is assigned to the first
@ -8021,7 +8033,10 @@ immediately, rather than before the next primary prompt. This is
effective only when job control is enabled.
.TP 8
.B \-e
Exit immediately if a \fIsimple command\fP (see
Exit immediately if a \fIpipeline\fP (which may consist of a single
\fIsimple command\fP), a \fIsubshell\fP command enclosed in parentheses,
or one of the commands executed as part of a command list enclosed
by braces (see
.SM
.B SHELL GRAMMAR
above) exits with a non-zero status.
@ -8031,21 +8046,25 @@ command that fails is part of the command list immediately following a
or
.B until
keyword,
part of the test in an
part of the test following the
.B if
statement, part of a command executed in a
or
.B elif
reserved words, part of any command executed in a
.B &&
or
.B \(bv\(bv
list,
list except the command following the final \fB&&\fP or \fB\(bv\(bv\fP,
any command in a pipeline but the last,
or if the command's return value is
being inverted via
being inverted with
.BR ! .
Failing simple commands that are part of shell functions or command lists
enclosed in braces or parentheses satisfying the above conditions do not
cause the shell to exit.
A trap on \fBERR\fP, if set, is executed before the shell exits.
This option applies to the shell environment and each subshell environment
separately (see
.B "COMMAND EXECUTION ENVIRONMENT"
above), and may cause
subshells to exit before executing all the commands in the subshell.
.TP 8
.B \-f
Disable pathname expansion.
@ -9037,7 +9056,7 @@ The maximum number of pending signals
The maximum size that may be locked into memory
.TP
.B \-m
The maximum resident set size
The maximum resident set size (many systems do not honor this limit)
.TP
.B \-n
The maximum number of open file descriptors (most systems do not
@ -9312,7 +9331,7 @@ bfox@gnu.org
.PP
Chet Ramey, Case Western Reserve University
.br
chet@po.cwru.edu
chet.ramey@case.edu
.SH BUG REPORTS
If you find a bug in
.B bash,

12166
doc/bash.html Normal file

File diff suppressed because it is too large Load diff

BIN
doc/bash.pdf Normal file

Binary file not shown.

7998
doc/bash.ps Normal file

File diff suppressed because it is too large Load diff

50
doc/bashbug.0 Normal file
View file

@ -0,0 +1,50 @@
BASHBUG(1) BASHBUG(1)
NNAAMMEE
bashbug - report a bug in bash
SSYYNNOOPPSSIISS
bbaasshhbbuugg [_-_-_v_e_r_s_i_o_n] [_-_-_h_e_l_p] [_e_m_a_i_l_-_a_d_d_r_e_s_s]
DDEESSCCRRIIPPTTIIOONN
bbaasshhbbuugg is a shell script to help the user compose and mail bug reports
concerning bash in a standard format. bbaasshhbbuugg invokes the editor spec-
ified by the environment variable EEDDIITTOORR on a temporary copy of the bug
report format outline. The user must fill in the appropriate fields and
exit the editor. bbaasshhbbuugg then mails the completed report to _b_u_g_-
_b_a_s_h_@_g_n_u_._o_r_g, or _e_m_a_i_l_-_a_d_d_r_e_s_s. If the report cannot be mailed, it is
saved in the file _d_e_a_d_._b_a_s_h_b_u_g in the invoking user's home directory.
The bug report format outline consists of several sections. The first
section provides information about the machine, operating system, the
bash version, and the compilation environment. The second section
should be filled in with a description of the bug. The third section
should be a description of how to reproduce the bug. The optional
fourth section is for a proposed fix. Fixes are encouraged.
EENNVVIIRROONNMMEENNTT
bbaasshhbbuugg will utilize the following environment variables if they exist:
EEDDIITTOORR Specifies the preferred editor. If EEDDIITTOORR is not set, bbaasshhbbuugg
defaults to eemmaaccss.
HHOOMMEE Directory in which the failed bug report is saved if the mail
fails.
TTMMPPDDIIRR Directory in which to create temporary files and directories.
SSEEEE AALLSSOO
_b_a_s_h(1)
AAUUTTHHOORRSS
Brian Fox, Free Software Foundation
bfox@gnu.org
Chet Ramey, Case Western Reserve University
chet@po.cwru.edu
GNU Bash-4.0 1998 July 30 BASHBUG(1)

284
doc/bashbug.ps Normal file
View file

@ -0,0 +1,284 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Mon Nov 17 17:38:06 2008
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%+ font Times-Italic
%%DocumentSuppliedResources: procset grops 1.19 2
%%Pages: 1
%%PageOrder: Ascend
%%DocumentMedia: Default 595 842 0 () ()
%%Orientation: Portrait
%%EndComments
%%BeginDefaults
%%PageMedia: Default
%%EndDefaults
%%BeginProlog
%%BeginResource: procset grops 1.19 2
%!PS-Adobe-3.0 Resource-ProcSet
/setpacking where{
pop
currentpacking
true setpacking
}if
/grops 120 dict dup begin
/SC 32 def
/A/show load def
/B{0 SC 3 -1 roll widthshow}bind def
/C{0 exch ashow}bind def
/D{0 exch 0 SC 5 2 roll awidthshow}bind def
/E{0 rmoveto show}bind def
/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
/G{0 rmoveto 0 exch ashow}bind def
/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/I{0 exch rmoveto show}bind def
/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
/K{0 exch rmoveto 0 exch ashow}bind def
/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/M{rmoveto show}bind def
/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
/O{rmoveto 0 exch ashow}bind def
/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/Q{moveto show}bind def
/R{moveto 0 SC 3 -1 roll widthshow}bind def
/S{moveto 0 exch ashow}bind def
/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/SF{
findfont exch
[exch dup 0 exch 0 exch neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/MF{
findfont
[5 2 roll
0 3 1 roll
neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/level0 0 def
/RES 0 def
/PL 0 def
/LS 0 def
/MANUAL{
statusdict begin/manualfeed true store end
}bind def
/PLG{
gsave newpath clippath pathbbox grestore
exch pop add exch pop
}bind def
/BP{
/level0 save def
1 setlinecap
1 setlinejoin
72 RES div dup scale
LS{
90 rotate
}{
0 PL translate
}ifelse
1 -1 scale
}bind def
/EP{
level0 restore
showpage
}def
/DA{
newpath arcn stroke
}bind def
/SN{
transform
.25 sub exch .25 sub exch
round .25 add exch round .25 add exch
itransform
}bind def
/DL{
SN
moveto
SN
lineto stroke
}bind def
/DC{
newpath 0 360 arc closepath
}bind def
/TM matrix def
/DE{
TM currentmatrix pop
translate scale newpath 0 0 .5 0 360 arc closepath
TM setmatrix
}bind def
/RC/rcurveto load def
/RL/rlineto load def
/ST/stroke load def
/MT/moveto load def
/CL/closepath load def
/Fr{
setrgbcolor fill
}bind def
/setcmykcolor where{
pop
/Fk{
setcmykcolor fill
}bind def
}if
/Fg{
setgray fill
}bind def
/FL/fill load def
/LW/setlinewidth load def
/Cr/setrgbcolor load def
/setcmykcolor where{
pop
/Ck/setcmykcolor load def
}if
/Cg/setgray load def
/RE{
findfont
dup maxlength 1 index/FontName known not{1 add}if dict begin
{
1 index/FID ne{def}{pop pop}ifelse
}forall
/Encoding exch def
dup/FontName exch def
currentdict end definefont pop
}bind def
/DEFS 0 def
/EBEGIN{
moveto
DEFS begin
}bind def
/EEND/end load def
/CNT 0 def
/level1 0 def
/PBEGIN{
/level1 save def
translate
div 3 1 roll div exch scale
neg exch neg exch translate
0 setgray
0 setlinecap
1 setlinewidth
0 setlinejoin
10 setmiterlimit
[]0 setdash
/setstrokeadjust where{
pop
false setstrokeadjust
}if
/setoverprint where{
pop
false setoverprint
}if
newpath
/CNT countdictstack def
userdict begin
/showpage{}def
/setpagedevice{}def
}bind def
/PEND{
countdictstack CNT sub{end}repeat
level1 restore
}bind def
end def
/setpacking where{
pop
setpacking
}if
%%EndResource
%%EndProlog
%%BeginSetup
%%BeginFeature: *PageSize Default
<< /PageSize [ 595 842 ] /ImagingBBox null >> setpagedevice
%%EndFeature
%%IncludeResource: font Times-Roman
%%IncludeResource: font Times-Bold
%%IncludeResource: font Times-Italic
grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
def/PL 841.89 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron
/Zcaron/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
/Times-Italic@0 ENC0/Times-Italic RE/Times-Bold@0 ENC0/Times-Bold RE
/Times-Roman@0 ENC0/Times-Roman RE
%%EndSetup
%%Page: 1 1
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SHB).35 E 347.52(UG\(1\) B)-.1 F
(ASHB)-.35 E(UG\(1\))-.1 E/F1 10.95/Times-Bold@0 SF -.219(NA)72 84 S(ME)
.219 E F0(bashb)108 96 Q(ug \255 report a b)-.2 E(ug in bash)-.2 E F1
(SYNOPSIS)72 112.8 Q/F2 10/Times-Bold@0 SF(bashb)108 124.8 Q(ug)-.2 E F0
([)2.5 E/F3 10/Times-Italic@0 SF(--ver)A(sion)-.1 E F0 2.5(][)C F3
(--help)-2.5 E F0 2.5(][)C F3(email-addr)-2.5 E(ess)-.37 E F0(])A F1
(DESCRIPTION)72 141.6 Q F2(bashb)108 153.6 Q(ug)-.2 E F0 .446
(is a shell script to help the user compose and mail b)2.947 F .446
(ug reports concerning bash in a standard for)-.2 F(-)-.2 E(mat.)108
165.6 Q F2(bashb)5.961 E(ug)-.2 E F0(in)3.461 E -.2(vo)-.4 G -.1(ke).2 G
3.461(st).1 G .962(he editor speci\214ed by the en)-3.461 F .962
(vironment v)-.4 F(ariable)-.25 E/F4 9/Times-Bold@0 SF(EDIT)3.462 E(OR)
-.162 E F0 .962(on a temporary cop)3.212 F 3.462(yo)-.1 G(f)-3.462 E
.374(the b)108 177.6 R .374(ug report format outline. The user must \
\214ll in the appropriate \214elds and e)-.2 F .374(xit the editor)-.15
F(.)-.55 E F2(bashb)5.373 E(ug)-.2 E F0(then)2.873 E 1.141
(mails the completed report to)108 189.6 R F3 -.2(bu)3.641 G
(g-bash@gnu.or).2 E(g)-.37 E F0 3.641(,o)C(r)-3.641 E F3(email-addr)
3.641 E(ess)-.37 E F0 6.141(.I)C 3.641(ft)-6.141 G 1.142
(he report cannot be mailed, it is)-3.641 F(sa)108 201.6 Q -.15(ve)-.2 G
2.5(di).15 G 2.5(nt)-2.5 G(he \214le)-2.5 E F3(dead.bashb)2.5 E(ug)-.2 E
F0(in the in)2.5 E -.2(vo)-.4 G(king user').2 E 2.5(sh)-.55 G
(ome directory)-2.5 E(.)-.65 E .354(The b)108 218.4 R .354
(ug report format outline consists of se)-.2 F -.15(ve)-.25 G .353
(ral sections.).15 F .353(The \214rst section pro)5.353 F .353
(vides information about the)-.15 F .37
(machine, operating system, the bash v)108 230.4 R .371
(ersion, and the compilation en)-.15 F 2.871(vironment. The)-.4 F .371
(second section should)2.871 F .209
(be \214lled in with a description of the b)108 242.4 R 2.709(ug. The)
-.2 F .208(third section should be a description of ho)2.709 F 2.708(wt)
-.25 G 2.708(or)-2.708 G .208(eproduce the)-2.708 F -.2(bu)108 254.4 S
2.5(g. The).2 F(optional fourth section is for a proposed \214x.)2.5 E
(Fix)5 E(es are encouraged.)-.15 E F1(ENVIR)72 271.2 Q(ONMENT)-.329 E F2
(bashb)108 283.2 Q(ug)-.2 E F0(will utilize the follo)2.5 E(wing en)-.25
E(vironment v)-.4 E(ariables if the)-.25 E 2.5(ye)-.15 G(xist:)-2.65 E
F2(EDIT)108 300 Q(OR)-.18 E F0(Speci\214es the preferred editor)144 312
Q 2.5(.I)-.55 G(f)-2.5 E F4(EDIT)2.5 E(OR)-.162 E F0(is not set,)2.25 E
F2(bashb)2.5 E(ug)-.2 E F0(def)2.5 E(aults to)-.1 E F2(emacs)2.5 E F0(.)
A F2(HOME)108 328.8 Q F0(Directory in which the f)144 340.8 Q(ailed b)
-.1 E(ug report is sa)-.2 E -.15(ve)-.2 G 2.5(di).15 G 2.5(ft)-2.5 G
(he mail f)-2.5 E(ails.)-.1 E F2(TMPDIR)108 357.6 Q F0
(Directory in which to create temporary \214les and directories.)144
369.6 Q F1(SEE ALSO)72 386.4 Q F3(bash)108 398.4 Q F0(\(1\))A F1 -.548
(AU)72 415.2 S(THORS).548 E F0(Brian F)108 427.2 Q(ox, Free Softw)-.15 E
(are F)-.1 E(oundation)-.15 E(bfox@gnu.or)108 439.2 Q(g)-.18 E
(Chet Rame)108 456 Q 1.3 -.65(y, C)-.15 H(ase W).65 E(estern Reserv)-.8
E 2.5(eU)-.15 G(ni)-2.5 E -.15(ve)-.25 G(rsity).15 E(chet@po.cwru.edu)
108 468 Q(GNU Bash-4.0)72 768 Q(1998 July 30)148.175 E(1)203.165 E 0 Cg
EP
%%Trailer
end
%%EOF

BIN
doc/bashref.dvi Normal file

Binary file not shown.

15955
doc/bashref.html Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,13 +1,13 @@
This is bashref.info, produced by makeinfo version 4.11 from
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.0, 28 October 2008).
the Bash shell (version 4.0, 29 December 2008).
This is Edition 4.0, last updated 28 October 2008, of `The GNU Bash
This is Edition 4.0, last updated 29 December 2008, of `The GNU Bash
Reference Manual', for `Bash', Version 4.0.
Copyright (C) 1988-2008 Free Software Foundation, Inc.
Copyright (C) 1988-2009 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
@ -38,9 +38,9 @@ Bash Features
*************
This text is a brief description of the features that are present in
the Bash shell (version 4.0, 28 October 2008).
the Bash shell (version 4.0, 29 December 2008).
This is Edition 4.0, last updated 28 October 2008, of `The GNU Bash
This is Edition 4.0, last updated 29 December 2008, of `The GNU Bash
Reference Manual', for `Bash', Version 4.0.
Bash contains features that appear in other popular shells, and some
@ -955,7 +955,9 @@ established between the executing shell and the coprocess.
`coproc' [NAME] COMMAND [REDIRECTIONS]
This creates a coprocess named NAME. If NAME is not supplied, the
default name is COPROC.
default name is COPROC. NAME must not be supplied if COMMAND is a
simple command (*note Simple Commands::); otherwise, it is interpreted
as the first word of the simple command.
When the coproc is executed, the shell creates an array variable
(*note Arrays::) named NAME in the context of the executing shell. The
@ -1405,11 +1407,12 @@ introduce indirection.
In each of the cases below, WORD is subject to tilde expansion,
parameter expansion, command substitution, and arithmetic expansion.
When not performing substring expansion, Bash tests for a parameter
that is unset or null; omitting the colon results in a test only for a
parameter that is unset. Put another way, if the colon is included,
the operator tests for both existence and that the value is not null;
if the colon is omitted, the operator tests only for existence.
When not performing substring expansion, using the form described
below, Bash tests for a parameter that is unset or null. Omitting the
colon results in a test only for a parameter that is unset. Put
another way, if the colon is included, the operator tests for both
PARAMETER's existence and that its value is not null; if the colon is
omitted, the operator tests only for existence.
`${PARAMETER:-WORD}'
If PARAMETER is unset or null, the expansion of WORD is
@ -1534,14 +1537,14 @@ if the colon is omitted, the operator tests only for existence.
matching PATTERN to uppercase; the `,' operator converts matching
uppercase letters to lowercase. The `^^' and `,,' expansions
convert each matched character in the expanded value; the `^' and
`,' expansions match and convert only the first character. If
PATTERN is omitted, it is treated like a `?', which matches every
character. If PARAMETER is `@' or `*', the case modification
operation is applied to each positional parameter in turn, and the
expansion is the resultant list. If PARAMETER is an array
variable subscripted with `@' or `*', the case modification
operation is applied to each member of the array in turn, and the
expansion is the resultant list.
`,' expansions match and convert only the first character in the
expanded value. If PATTERN is omitted, it is treated like a `?',
which matches every character. If PARAMETER is `@' or `*', the
case modification operation is applied to each positional
parameter in turn, and the expansion is the resultant list. If
PARAMETER is an array variable subscripted with `@' or `*', the
case modification operation is applied to each member of the array
in turn, and the expansion is the resultant list.

@ -2184,6 +2187,10 @@ at invocation. Builtin commands that are invoked as part of a pipeline
are also executed in a subshell environment. Changes made to the
subshell environment cannot affect the shell's execution environment.
Subshells spawned to execute command substitutions inherit the value
of the `-e' option from the parent shell. When not in POSIX mode, Bash
clears the `-e' option in such subshells.
If a command is followed by a `&' and job control is not active, the
default standard input for the command is the empty file `/dev/null'.
Otherwise, the invoked command inherits the file descriptors of the
@ -3122,6 +3129,10 @@ POSIX standard.
CALLBACK.
If `-C' is specified without `-c', the default quantum is 5000.
When CALLBACK is evaluated, it is supplied the index of the next
array element to be assigned as an additional argument. CALLBACK
is evaluated after the line is read but before the array element
is assigned.
If not supplied with an explicit origin, `mapfile' will clear ARRAY
before assigning to it.
@ -3226,6 +3237,14 @@ POSIX standard.
Read input from file descriptor FD.
`readarray'
readarray [-n COUNT] [-O ORIGIN] [-s COUNT] [-t] [-u FD] [
-C CALLBACK] [-c QUANTUM] [ARRAY]
Read lines from the standard input into array variable ARRAY, or
from file descriptor FD if the `-u' option is supplied.
A synonym for `mapfile'.
`source'
source FILENAME
A synonym for `.' (*note Bourne Shell Builtins::).
@ -9463,12 +9482,13 @@ D.1 Index of Shell Builtin Commands
* mapfile: Bash Builtins. (line 342)
* popd: Directory Stack Builtins.
(line 37)
* printf: Bash Builtins. (line 383)
* printf: Bash Builtins. (line 387)
* pushd: Directory Stack Builtins.
(line 58)
* pwd: Bourne Shell Builtins.
(line 163)
* read: Bash Builtins. (line 408)
* read: Bash Builtins. (line 412)
* readarray: Bash Builtins. (line 484)
* readonly: Bourne Shell Builtins.
(line 172)
* return: Bourne Shell Builtins.
@ -9477,7 +9497,7 @@ D.1 Index of Shell Builtin Commands
* shift: Bourne Shell Builtins.
(line 201)
* shopt: The Shopt Builtin. (line 9)
* source: Bash Builtins. (line 480)
* source: Bash Builtins. (line 492)
* suspend: Job Control Builtins.
(line 94)
* test: Bourne Shell Builtins.
@ -9486,12 +9506,12 @@ D.1 Index of Shell Builtin Commands
(line 281)
* trap: Bourne Shell Builtins.
(line 286)
* type: Bash Builtins. (line 484)
* typeset: Bash Builtins. (line 515)
* ulimit: Bash Builtins. (line 521)
* type: Bash Builtins. (line 496)
* typeset: Bash Builtins. (line 527)
* ulimit: Bash Builtins. (line 533)
* umask: Bourne Shell Builtins.
(line 327)
* unalias: Bash Builtins. (line 607)
* unalias: Bash Builtins. (line 619)
* unset: Bourne Shell Builtins.
(line 344)
* wait: Job Control Builtins.
@ -9974,132 +9994,132 @@ 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 Translation17740
Node: Comments18636
Node: Shell Commands19254
Node: Simple Commands20078
Node: Pipelines20709
Node: Lists22965
Node: Compound Commands24694
Node: Looping Constructs25498
Node: Conditional Constructs27945
Node: Command Grouping35951
Node: Coprocesses37430
Node: Shell Functions38919
Node: Shell Parameters43380
Node: Positional Parameters45796
Node: Special Parameters46696
Node: Shell Expansions49660
Node: Brace Expansion51585
Node: Tilde Expansion54338
Node: Shell Parameter Expansion56689
Node: Command Substitution65520
Node: Arithmetic Expansion66853
Node: Process Substitution67703
Node: Word Splitting68753
Node: Filename Expansion70376
Node: Pattern Matching72516
Node: Quote Removal76155
Node: Redirections76450
Node: Executing Commands84593
Node: Simple Command Expansion85263
Node: Command Search and Execution87193
Node: Command Execution Environment89530
Node: Environment92329
Node: Exit Status93989
Node: Signals95610
Node: Shell Scripts97578
Node: Shell Builtin Commands100096
Node: Bourne Shell Builtins101773
Node: Bash Builtins119091
Node: Modifying Shell Behavior142764
Node: The Set Builtin143109
Node: The Shopt Builtin152149
Node: Special Builtins163011
Node: Shell Variables163990
Node: Bourne Shell Variables164430
Node: Bash Variables166411
Node: Bash Features188729
Node: Invoking Bash189612
Node: Bash Startup Files195421
Node: Interactive Shells200390
Node: What is an Interactive Shell?200800
Node: Is this Shell Interactive?201449
Node: Interactive Shell Behavior202264
Node: Bash Conditional Expressions205544
Node: Shell Arithmetic209123
Node: Aliases211869
Node: Arrays214441
Node: The Directory Stack218283
Node: Directory Stack Builtins218997
Node: Printing a Prompt221889
Node: The Restricted Shell224641
Node: Bash POSIX Mode226473
Node: Job Control234326
Node: Job Control Basics234786
Node: Job Control Builtins239399
Node: Job Control Variables243763
Node: Command Line Editing244921
Node: Introduction and Notation246488
Node: Readline Interaction248110
Node: Readline Bare Essentials249301
Node: Readline Movement Commands251090
Node: Readline Killing Commands252055
Node: Readline Arguments253975
Node: Searching255019
Node: Readline Init File257205
Node: Readline Init File Syntax258352
Node: Conditional Init Constructs271586
Node: Sample Init File274119
Node: Bindable Readline Commands277236
Node: Commands For Moving278443
Node: Commands For History279587
Node: Commands For Text282742
Node: Commands For Killing285415
Node: Numeric Arguments287866
Node: Commands For Completion289005
Node: Keyboard Macros292772
Node: Miscellaneous Commands293343
Node: Readline vi Mode298654
Node: Programmable Completion299568
Node: Programmable Completion Builtins305401
Node: Using History Interactively313827
Node: Bash History Facilities314511
Node: Bash History Builtins317425
Node: History Interaction321282
Node: Event Designators323987
Node: Word Designators325002
Node: Modifiers326641
Node: Installing Bash328045
Node: Basic Installation329182
Node: Compilers and Options331874
Node: Compiling For Multiple Architectures332615
Node: Installation Names334279
Node: Specifying the System Type335097
Node: Sharing Defaults335813
Node: Operation Controls336486
Node: Optional Features337444
Node: Reporting Bugs346846
Node: Major Differences From The Bourne Shell348040
Node: GNU Free Documentation License364727
Node: Indexes387188
Node: Builtin Index387642
Node: Reserved Word Index394396
Node: Variable Index396844
Node: Function Index408650
Node: Concept Index415382
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 Translation17744
Node: Comments18640
Node: Shell Commands19258
Node: Simple Commands20082
Node: Pipelines20713
Node: Lists22969
Node: Compound Commands24698
Node: Looping Constructs25502
Node: Conditional Constructs27949
Node: Command Grouping35955
Node: Coprocesses37434
Node: Shell Functions39078
Node: Shell Parameters43539
Node: Positional Parameters45955
Node: Special Parameters46855
Node: Shell Expansions49819
Node: Brace Expansion51744
Node: Tilde Expansion54497
Node: Shell Parameter Expansion56848
Node: Command Substitution65746
Node: Arithmetic Expansion67079
Node: Process Substitution67929
Node: Word Splitting68979
Node: Filename Expansion70602
Node: Pattern Matching72742
Node: Quote Removal76381
Node: Redirections76676
Node: Executing Commands84819
Node: Simple Command Expansion85489
Node: Command Search and Execution87419
Node: Command Execution Environment89756
Node: Environment92742
Node: Exit Status94402
Node: Signals96023
Node: Shell Scripts97991
Node: Shell Builtin Commands100509
Node: Bourne Shell Builtins102186
Node: Bash Builtins119504
Node: Modifying Shell Behavior143695
Node: The Set Builtin144040
Node: The Shopt Builtin153080
Node: Special Builtins163942
Node: Shell Variables164921
Node: Bourne Shell Variables165361
Node: Bash Variables167342
Node: Bash Features189660
Node: Invoking Bash190543
Node: Bash Startup Files196352
Node: Interactive Shells201321
Node: What is an Interactive Shell?201731
Node: Is this Shell Interactive?202380
Node: Interactive Shell Behavior203195
Node: Bash Conditional Expressions206475
Node: Shell Arithmetic210054
Node: Aliases212800
Node: Arrays215372
Node: The Directory Stack219214
Node: Directory Stack Builtins219928
Node: Printing a Prompt222820
Node: The Restricted Shell225572
Node: Bash POSIX Mode227404
Node: Job Control235257
Node: Job Control Basics235717
Node: Job Control Builtins240330
Node: Job Control Variables244694
Node: Command Line Editing245852
Node: Introduction and Notation247419
Node: Readline Interaction249041
Node: Readline Bare Essentials250232
Node: Readline Movement Commands252021
Node: Readline Killing Commands252986
Node: Readline Arguments254906
Node: Searching255950
Node: Readline Init File258136
Node: Readline Init File Syntax259283
Node: Conditional Init Constructs272517
Node: Sample Init File275050
Node: Bindable Readline Commands278167
Node: Commands For Moving279374
Node: Commands For History280518
Node: Commands For Text283673
Node: Commands For Killing286346
Node: Numeric Arguments288797
Node: Commands For Completion289936
Node: Keyboard Macros293703
Node: Miscellaneous Commands294274
Node: Readline vi Mode299585
Node: Programmable Completion300499
Node: Programmable Completion Builtins306332
Node: Using History Interactively314758
Node: Bash History Facilities315442
Node: Bash History Builtins318356
Node: History Interaction322213
Node: Event Designators324918
Node: Word Designators325933
Node: Modifiers327572
Node: Installing Bash328976
Node: Basic Installation330113
Node: Compilers and Options332805
Node: Compiling For Multiple Architectures333546
Node: Installation Names335210
Node: Specifying the System Type336028
Node: Sharing Defaults336744
Node: Operation Controls337417
Node: Optional Features338375
Node: Reporting Bugs347777
Node: Major Differences From The Bourne Shell348971
Node: GNU Free Documentation License365658
Node: Indexes388119
Node: Builtin Index388573
Node: Reserved Word Index395400
Node: Variable Index397848
Node: Function Index409654
Node: Concept Index416386

End Tag Table

BIN
doc/bashref.pdf Normal file

Binary file not shown.

16205
doc/bashref.ps Normal file

File diff suppressed because it is too large Load diff

View file

@ -1095,6 +1095,9 @@ The format for a coprocess is:
@noindent
This creates a coprocess named @var{NAME}.
If @var{NAME} is not supplied, the default name is @var{COPROC}.
@var{NAME} must not be supplied if @var{command} is a simple
command (@pxref{Simple Commands}); otherwise, it is interpreted as
the first word of the simple command.
When the coproc is executed, the shell creates an array variable
(@pxref{Arrays})
@ -1614,11 +1617,12 @@ introduce indirection.
In each of the cases below, @var{word} is subject to tilde expansion,
parameter expansion, command substitution, and arithmetic expansion.
When not performing substring expansion, Bash tests for a parameter
that is unset or null; omitting the colon results in a test only for a
parameter that is unset. Put another way, if the colon is included,
the operator tests for both existence and that the value is not null;
if the colon is omitted, the operator tests only for existence.
When not performing substring expansion, using the form described
below, Bash tests for a parameter that is unset or null.
Omitting the colon results in a test only for a parameter that is unset.
Put another way, if the colon is included,
the operator tests for both @var{parameter}'s existence and that its value
is not null; if the colon is omitted, the operator tests only for existence.
@table @code
@ -1769,7 +1773,7 @@ to uppercase; the @samp{,} operator converts matching uppercase letters
to lowercase.
The @samp{^^} and @samp{,,} expansions convert each matched character in the
expanded value; the @samp{^} and @samp{,} expansions match and convert only
the first character.
the first character in the expanded value.
If @var{pattern} is omitted, it is treated like a @samp{?}, which matches
every character.
If @var{parameter} is @samp{@@} or @samp{*},
@ -2106,7 +2110,7 @@ ls 2>&1 > @var{dirlist}
@end example
@noindent
directs only the standard output to file @var{dirlist},
because the standard error was duplicated as standard output
because the standard error was made a copy of the standard output
before the standard output was redirected to @var{dirlist}.
Bash handles several filenames specially when they are used in
@ -3169,7 +3173,7 @@ is executed whenever a simple command has a non-zero exit status,
subject to the following conditions.
The @code{ERR} trap is not executed if the failed command is part of the
command list immediately following an @code{until} or @code{while} keyword,
part of the test in an @code{if} statement,
part of the test following the @code{if} or @code{elif} reserved words,
part of a command executed in a @code{&&} or @code{||} list,
or if the command's return
status is being inverted using @code{!}.
@ -3648,6 +3652,10 @@ Specify the number of lines read between each call to @var{callback}.
If @option{-C} is specified without @option{-c},
the default quantum is 5000.
When @var{callback} is evaluated, it is supplied the index of the next
array element to be assigned as an additional argument.
@var{callback} is evaluated after the line is read but before the
array element is assigned.
If not supplied with an explicit origin, @code{mapfile} will clear @var{array}
before assigning to it.
@ -3765,6 +3773,18 @@ Read input from file descriptor @var{fd}.
@end table
@item readarray
@btindex readarray
@example
readarray [-n @var{count}] [-O @var{origin}] [-s @var{count}] [-t] [-u @var{fd}] [
-C @var{callback}] [-c @var{quantum}] [@var{array}]
@end example
Read lines from the standard input into array variable @var{array},
or from file descriptor @var{fd}
if the @option{-u} option is supplied.
A synonym for @code{mapfile}.
@item source
@btindex source
@example
@ -3858,10 +3878,11 @@ The maximum number of pending signals.
The maximum size that may be locked into memory.
@item -m
The maximum resident set size.
The maximum resident set size (many systems do not honor this limit).
@item -n
The maximum number of open file descriptors.
The maximum number of open file descriptors (most systems do not
allow this value to be set).
@item -p
The pipe buffer size.
@ -3966,18 +3987,25 @@ Cause the status of terminated background jobs to be reported
immediately, rather than before printing the next primary prompt.
@item -e
Exit immediately if a simple command (@pxref{Simple Commands}) exits
with a non-zero status, unless the command that fails is part of the
Exit immediately if a pipeline (@pxref{Pipelines}), which may consist
of a single simple command (@pxref{Simple Commands}),
a subshell command enclosed in parentheses (@pxref{Command Grouping}),
or one of the commands executed as part of a command list enclosed
by braces (@pxref{Command Grouping})
returns a non-zero status.
The shell does not exit if the command that fails is part of the
command list immediately following a @code{while} or @code{until} keyword,
part of the test in an @code{if} statement,
part of a command executed in a @code{&&} or @code{||b} list,
part of any command executed in a @code{&&} or @code{||} list except
the command following the final @code{&&} or @code{||},
any command in a pipeline but the last,
or if the command's return status is being inverted using @code{!}.
Failing simple commands that are part of shell functions or command lists
enclosed in braces or parentheses satisfying the above conditions do not
cause the shell to exit.
or if the command's return status is being inverted with @code{!}.
A trap on @code{ERR}, if set, is executed before the shell exits.
This option applies to the shell environment and each subshell environment
separately (@pxref{Command Execution Environment}), and may cause
subshells to exit before executing all the commands in the subshell.
@item -f
Disable file name generation (globbing).
@ -4773,8 +4801,8 @@ even if it is subsequently reset.
@item COMP_WORDS
An array variable consisting of the individual
words in the current command line.
The words are split on shell metacharacters as the shell parser would
separate them.
The line is split into words as Readline would split it, using
@code{COMP_WORDBREAKS} as described above.
This variable is available only in shell functions invoked by the
programmable completion facilities (@pxref{Programmable Completion}).
@ -7318,7 +7346,7 @@ to reproduce it.
the template it provides for filing a bug report.
Please send all reports concerning this manual to
@email{chet@@po.CWRU.Edu}.
@email{chet.ramey@@case.edu}.
@node Major Differences From The Bourne Shell
@appendix Major Differences From The Bourne Shell

1534
doc/builtins.0 Normal file

File diff suppressed because it is too large Load diff

2567
doc/builtins.ps Normal file

File diff suppressed because it is too large Load diff

59
doc/rbash.0 Normal file
View file

@ -0,0 +1,59 @@
RBASH(1) RBASH(1)
NNAAMMEE
rbash - restricted bash, see bbaasshh(1)
RREESSTTRRIICCTTEEDD SSHHEELLLL
If bbaasshh is started with the name rrbbaasshh, or the --rr option is supplied at
invocation, the shell becomes restricted. A restricted shell is used
to set up an environment more controlled than the standard shell. It
behaves identically to bbaasshh with the exception that the following are
disallowed or not performed:
+o changing directories with ccdd
+o setting or unsetting the values of SSHHEELLLL, PPAATTHH, EENNVV, or BBAASSHH__EENNVV
+o specifying command names containing //
+o specifying a file name containing a // as an argument to the ..
builtin command
+o Specifying a filename containing a slash as an argument to the
--pp option to the hhaasshh builtin command
+o importing function definitions from the shell environment at
startup
+o parsing the value of SSHHEELLLLOOPPTTSS from the shell environment at
startup
+o redirecting output using the >, >|, <>, >&, &>, and >> redirect-
ion operators
+o using the eexxeecc builtin command to replace the shell with another
command
+o adding or deleting builtin commands with the --ff and --dd options
to the eennaabbllee builtin command
+o Using the eennaabbllee builtin command to enable disabled shell
builtins
+o specifying the --pp option to the ccoommmmaanndd builtin command
+o turning off restricted mode with sseett ++rr or sseett ++oo rreessttrriicctteedd.
These restrictions are enforced after any startup files are read.
When a command that is found to be a shell script is executed, rrbbaasshh
turns off any restrictions in the shell spawned to execute the script.
SSEEEE AALLSSOO
bash(1)
GNU Bash-4.0 2004 Apr 20 RBASH(1)

279
doc/rbash.ps Normal file
View file

@ -0,0 +1,279 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Thu Feb 5 08:05:28 2009
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%DocumentSuppliedResources: procset grops 1.19 2
%%Pages: 1
%%PageOrder: Ascend
%%DocumentMedia: Default 595 842 0 () ()
%%Orientation: Portrait
%%EndComments
%%BeginDefaults
%%PageMedia: Default
%%EndDefaults
%%BeginProlog
%%BeginResource: procset grops 1.19 2
%!PS-Adobe-3.0 Resource-ProcSet
/setpacking where{
pop
currentpacking
true setpacking
}if
/grops 120 dict dup begin
/SC 32 def
/A/show load def
/B{0 SC 3 -1 roll widthshow}bind def
/C{0 exch ashow}bind def
/D{0 exch 0 SC 5 2 roll awidthshow}bind def
/E{0 rmoveto show}bind def
/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
/G{0 rmoveto 0 exch ashow}bind def
/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/I{0 exch rmoveto show}bind def
/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
/K{0 exch rmoveto 0 exch ashow}bind def
/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/M{rmoveto show}bind def
/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
/O{rmoveto 0 exch ashow}bind def
/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/Q{moveto show}bind def
/R{moveto 0 SC 3 -1 roll widthshow}bind def
/S{moveto 0 exch ashow}bind def
/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/SF{
findfont exch
[exch dup 0 exch 0 exch neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/MF{
findfont
[5 2 roll
0 3 1 roll
neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/level0 0 def
/RES 0 def
/PL 0 def
/LS 0 def
/MANUAL{
statusdict begin/manualfeed true store end
}bind def
/PLG{
gsave newpath clippath pathbbox grestore
exch pop add exch pop
}bind def
/BP{
/level0 save def
1 setlinecap
1 setlinejoin
72 RES div dup scale
LS{
90 rotate
}{
0 PL translate
}ifelse
1 -1 scale
}bind def
/EP{
level0 restore
showpage
}def
/DA{
newpath arcn stroke
}bind def
/SN{
transform
.25 sub exch .25 sub exch
round .25 add exch round .25 add exch
itransform
}bind def
/DL{
SN
moveto
SN
lineto stroke
}bind def
/DC{
newpath 0 360 arc closepath
}bind def
/TM matrix def
/DE{
TM currentmatrix pop
translate scale newpath 0 0 .5 0 360 arc closepath
TM setmatrix
}bind def
/RC/rcurveto load def
/RL/rlineto load def
/ST/stroke load def
/MT/moveto load def
/CL/closepath load def
/Fr{
setrgbcolor fill
}bind def
/setcmykcolor where{
pop
/Fk{
setcmykcolor fill
}bind def
}if
/Fg{
setgray fill
}bind def
/FL/fill load def
/LW/setlinewidth load def
/Cr/setrgbcolor load def
/setcmykcolor where{
pop
/Ck/setcmykcolor load def
}if
/Cg/setgray load def
/RE{
findfont
dup maxlength 1 index/FontName known not{1 add}if dict begin
{
1 index/FID ne{def}{pop pop}ifelse
}forall
/Encoding exch def
dup/FontName exch def
currentdict end definefont pop
}bind def
/DEFS 0 def
/EBEGIN{
moveto
DEFS begin
}bind def
/EEND/end load def
/CNT 0 def
/level1 0 def
/PBEGIN{
/level1 save def
translate
div 3 1 roll div exch scale
neg exch neg exch translate
0 setgray
0 setlinecap
1 setlinewidth
0 setlinejoin
10 setmiterlimit
[]0 setdash
/setstrokeadjust where{
pop
false setstrokeadjust
}if
/setoverprint where{
pop
false setoverprint
}if
newpath
/CNT countdictstack def
userdict begin
/showpage{}def
/setpagedevice{}def
}bind def
/PEND{
countdictstack CNT sub{end}repeat
level1 restore
}bind def
end def
/setpacking where{
pop
setpacking
}if
%%EndResource
%%EndProlog
%%BeginSetup
%%BeginFeature: *PageSize Default
<< /PageSize [ 595 842 ] /ImagingBBox null >> setpagedevice
%%EndFeature
%%IncludeResource: font Times-Roman
%%IncludeResource: font Times-Bold
grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
def/PL 841.89 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron
/Zcaron/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
/Times-Bold@0 ENC0/Times-Bold RE/Times-Roman@0 ENC0/Times-Roman RE
%%EndSetup
%%Page: 1 1
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF(RB)72 48 Q 376.2(ASH\(1\) RB)-.35 F(ASH\(1\))
-.35 E/F1 10.95/Times-Bold@0 SF -.219(NA)72 84 S(ME).219 E F0
(rbash \255 restricted bash, see)108 96 Q/F2 10/Times-Bold@0 SF(bash)2.5
E F0(\(1\))A F1(RESTRICTED SHELL)72 112.8 Q F0(If)108 124.8 Q F2(bash)
4.397 E F0 1.897(is started with the name)4.397 F F2(rbash)4.397 E F0
4.397(,o)C 4.397(rt)-4.397 G(he)-4.397 E F2<ad72>4.397 E F0 1.896
(option is supplied at in)4.397 F -.2(vo)-.4 G 1.896
(cation, the shell becomes).2 F 3.445(restricted. A)108 136.8 R .945
(restricted shell is used to set up an en)3.445 F .946
(vironment more controlled than the standard shell.)-.4 F(It)5.946 E
(beha)108 148.8 Q -.15(ve)-.2 G 2.5(si).15 G(dentically to)-2.5 E F2
(bash)2.5 E F0(with the e)2.5 E(xception that the follo)-.15 E
(wing are disallo)-.25 E(wed or not performed:)-.25 E 32.5<8363>108
165.6 S(hanging directories with)-32.5 E F2(cd)2.5 E F0 32.5<8373>108
182.4 S(etting or unsetting the v)-32.5 E(alues of)-.25 E F2(SHELL)2.5 E
F0(,)A F2 -.74(PA)2.5 G(TH)-.21 E F0(,)A F2(ENV)2.5 E F0 2.5(,o)C(r)-2.5
E F2 -.3(BA)2.5 G(SH_ENV).3 E F0 32.5<8373>108 199.2 S
(pecifying command names containing)-32.5 E F2(/)2.5 E F0 32.5<8373>108
216 S(pecifying a \214le name containing a)-32.5 E F2(/)2.5 E F0
(as an ar)2.5 E(gument to the)-.18 E F2(.)2.5 E F0 -.2(bu)5 G
(iltin command).2 E 32.5<8353>108 232.8 S .351
(pecifying a \214lename containing a slash as an ar)-32.5 F .351
(gument to the)-.18 F F2<ad70>2.851 E F0 .351(option to the)2.851 F F2
(hash)2.851 E F0 -.2(bu)2.851 G .351(iltin com-).2 F(mand)144 244.8 Q
32.5<8369>108 261.6 S(mporting function de\214nitions from the shell en)
-32.5 E(vironment at startup)-.4 E 32.5<8370>108 278.4 S(arsing the v)
-32.5 E(alue of)-.25 E F2(SHELLOPTS)2.5 E F0(from the shell en)2.5 E
(vironment at startup)-.4 E 32.5<8372>108 295.2 S(edirecting output usi\
ng the >, >|, <>, >&, &>, and >> redirection operators)-32.5 E 32.5
<8375>108 312 S(sing the)-32.5 E F2(exec)2.5 E F0 -.2(bu)2.5 G
(iltin command to replace the shell with another command).2 E 32.5<8361>
108 328.8 S(dding or deleting b)-32.5 E(uiltin commands with the)-.2 E
F2<ad66>2.5 E F0(and)2.5 E F2<ad64>2.5 E F0(options to the)2.5 E F2
(enable)2.5 E F0 -.2(bu)2.5 G(iltin command).2 E 32.5<8355>108 345.6 S
(sing the)-32.5 E F2(enable)2.5 E F0 -.2(bu)2.5 G
(iltin command to enable disabled shell b).2 E(uiltins)-.2 E 32.5<8373>
108 362.4 S(pecifying the)-32.5 E F2<ad70>2.5 E F0(option to the)2.5 E
F2(command)2.5 E F0 -.2(bu)2.5 G(iltin command).2 E 32.5<8374>108 379.2
S(urning of)-32.5 E 2.5(fr)-.25 G(estricted mode with)-2.5 E F2(set +r)
2.5 E F0(or)2.5 E F2(set +o r)2.5 E(estricted)-.18 E F0(.)A
(These restrictions are enforced after an)108 396 Q 2.5(ys)-.15 G
(tartup \214les are read.)-2.5 E .429
(When a command that is found to be a shell script is e)108 412.8 R -.15
(xe)-.15 G(cuted,).15 E F2(rbash)2.929 E F0 .429(turns of)2.929 F 2.929
(fa)-.25 G .729 -.15(ny r)-2.929 H .429(estrictions in the shell).15 F
(spa)108 424.8 Q(wned to e)-.15 E -.15(xe)-.15 G(cute the script.).15 E
F1(SEE ALSO)72 441.6 Q F0(bash\(1\))108 453.6 Q(GNU Bash-4.0)72 768 Q
(2004 Apr 20)148.735 E(1)203.725 E 0 Cg EP
%%Trailer
end
%%EOF

BIN
doc/rose94.pdf Normal file

Binary file not shown.

1581
doc/rose94.ps Normal file

File diff suppressed because it is too large Load diff

View file

@ -2,9 +2,9 @@
Copyright (C) 1988-2009 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Mon Dec 29 16:48:40 EST 2008
@set LASTCHANGE Fri Feb 13 18:29:03 EST 2009
@set EDITION 4.0
@set VERSION 4.0
@set UPDATED 29 December 2008
@set UPDATED-MONTH December 2008
@set UPDATED 13 February 2009
@set UPDATED-MONTH February 2009

View file

@ -513,7 +513,7 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
int pipe_in, pipe_out;
struct fd_bitmap *fds_to_close;
{
int exec_result, invert, ignore_return, was_error_trap;
int exec_result, user_subshell, invert, ignore_return, was_error_trap;
REDIRECT *my_undo_list, *exec_undo_list;
volatile int last_pid;
volatile int save_line_number;
@ -557,6 +557,8 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
return (execute_coproc (command, pipe_in, pipe_out, fds_to_close));
#endif
user_subshell = command->type == cm_subshell || ((command->flags & CMD_WANT_SUBSHELL) != 0);
if (command->type == cm_subshell ||
(command->flags & (CMD_WANT_SUBSHELL|CMD_FORCE_SUBSHELL)) ||
(shell_control_structure (command->type) &&
@ -590,6 +592,10 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
if (asynchronous == 0)
{
was_error_trap = signal_is_trapped (ERROR_TRAP) && signal_is_ignored (ERROR_TRAP) == 0;
invert = (command->flags & CMD_INVERT_RETURN) != 0;
ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0;
last_command_exit_value = wait_for (paren_pid);
/* If we have to, invert the return value. */
@ -600,6 +606,20 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
else
exec_result = last_command_exit_value;
if (user_subshell && was_error_trap && ignore_return == 0 && invert == 0 && exec_result != EXECUTION_SUCCESS)
{
last_command_exit_value = exec_result;
run_error_trap ();
}
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);
}
else
@ -741,10 +761,8 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
}
}
/* 10/6/2008 -- added test for pipe_in and pipe_out because they indicate
the presence of a pipeline, and (until Posix changes things), a
pipeline failure should not cause the parent shell to exit on an
unsuccessful return status, even in the presence of errexit.. */
/* 2009/02/13 -- pipeline failure is processed elsewhere. This handles
only the failure of a simple command. */
if (was_error_trap && ignore_return == 0 && invert == 0 && pipe_in == NO_PIPE && pipe_out == NO_PIPE && exec_result != EXECUTION_SUCCESS)
{
last_command_exit_value = exec_result;
@ -1056,8 +1074,11 @@ print_formatted_time (fp, format, rs, rsf, us, usf, ss, ssf, cpu)
else if (s[1] == 'P')
{
s++;
#if 0
/* clamp CPU usage at 100% */
if (cpu > 10000)
cpu = 10000;
#endif
sum = cpu / 100;
sum_frac = (cpu % 100) * 10;
len = mkfmt (ts, 2, 0, sum, sum_frac);
@ -1438,6 +1459,7 @@ static struct cpelement *cpe_alloc __P((struct coproc *));
static void cpe_dispose __P((struct cpelement *));
static struct cpelement *cpl_add __P((struct coproc *));
static struct cpelement *cpl_delete __P((pid_t));
static void cpl_reap __P((void));
static void cpl_flush __P((void));
static struct cpelement *cpl_search __P((pid_t));
static struct cpelement *cpl_searchbyname __P((char *));
@ -1447,8 +1469,7 @@ Coproc sh_coproc = { 0, NO_PID, -1, -1, 0, 0 };
cplist_t coproc_list = {0, 0, 0};
/* Functions to manage the list of exited background pids whose status has
been saved. */
/* Functions to manage the list of coprocs */
static struct cpelement *
cpe_alloc (cp)
@ -1527,6 +1548,37 @@ cpl_delete (pid)
return (p);
}
static void
cpl_reap ()
{
struct cpelement *prev, *p;
for (prev = p = coproc_list.head; p; prev = p, p = p->next)
if (p->coproc->c_flags & COPROC_DEAD)
{
prev->next = p->next; /* remove from list */
/* Housekeeping in the border cases. */
if (p == coproc_list.head)
coproc_list.head = coproc_list.head->next;
else if (p == coproc_list.tail)
coproc_list.tail = prev;
coproc_list.ncoproc--;
if (coproc_list.ncoproc == 0)
coproc_list.head = coproc_list.tail = 0;
else if (coproc_list.ncoproc == 1)
coproc_list.tail = coproc_list.head; /* just to make sure */
#if defined (DEBUG)
itrace("cpl_reap: deleting %d", p->coproc->c_pid);
#endif
coproc_dispose (p->coproc);
cpe_dispose (p);
}
}
/* Clear out the list of saved statuses */
static void
cpl_flush ()
@ -1679,6 +1731,16 @@ coproc_closeall ()
coproc_close (&sh_coproc);
}
void
coproc_reap ()
{
struct coproc *cp;
cp = &sh_coproc;
if (cp && (cp->c_flags & COPROC_DEAD))
coproc_dispose (cp);
}
void
coproc_rclose (cp, fd)
struct coproc *cp;
@ -1751,9 +1813,9 @@ coproc_fdrestore (cp)
cp->c_rfd = cp->c_rsave;
cp->c_wfd = cp->c_wsave;
}
void
coproc_pidchk (pid)
coproc_pidchk (pid, status)
pid_t pid;
{
struct coproc *cp;
@ -1764,7 +1826,14 @@ coproc_pidchk (pid)
itrace("coproc_pidchk: pid %d has died", pid);
#endif
if (cp)
coproc_dispose (cp);
{
cp->c_status = status;
cp->c_flags |= COPROC_DEAD;
cp->c_flags &= ~COPROC_RUNNING;
#if 0
coproc_dispose (cp);
#endif
}
}
void
@ -2035,7 +2104,7 @@ execute_connection (command, asynchronous, pipe_in, pipe_out, fds_to_close)
{
REDIRECT *rp;
COMMAND *tc, *second;
int ignore_return, exec_result;
int ignore_return, exec_result, was_error_trap, invert;
ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0;
@ -2101,7 +2170,25 @@ execute_connection (command, asynchronous, pipe_in, pipe_out, fds_to_close)
break;
case '|':
was_error_trap = signal_is_trapped (ERROR_TRAP) && signal_is_ignored (ERROR_TRAP) == 0;
invert = (command->flags & CMD_INVERT_RETURN) != 0;
ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0;
exec_result = execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close);
if (was_error_trap && ignore_return == 0 && invert == 0 && exec_result != EXECUTION_SUCCESS)
{
last_command_exit_value = exec_result;
run_error_trap ();
}
if (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);
}
break;
case AND_AND:

View file

@ -44,6 +44,7 @@ extern void coproc_dispose __P((struct coproc *));
extern void coproc_flush __P((void));
extern void coproc_close __P((struct coproc *));
extern void coproc_closeall __P((void));
extern void coproc_reap __P((void));
extern void coproc_rclose __P((struct coproc *, int));
extern void coproc_wclose __P((struct coproc *, int));
@ -52,7 +53,7 @@ extern void coproc_fdclose __P((struct coproc *, int));
extern void coproc_checkfd __P((struct coproc *, int));
extern void coproc_fdchk __P((int));
extern void coproc_pidchk __P((pid_t));
extern void coproc_pidchk __P((pid_t, int));
extern void coproc_fdsave __P((struct coproc *));
extern void coproc_fdrestore __P((struct coproc *));

View file

@ -154,12 +154,16 @@ extern char *sh_modcase __P((const char *, char *, int));
/* Defines for flags argument to sh_modcase. These need to agree with what's
in lib/sh/casemode.c */
#define CASE_LOWER 0x01
#define CASE_UPPER 0x02
#define CASE_CAPITALIZE 0x04
#define CASE_UNCAP 0x08
#define CASE_TOGGLE 0x10
#define CASE_TOGGLEALL 0x20
#define CASE_LOWER 0x0001
#define CASE_UPPER 0x0002
#define CASE_CAPITALIZE 0x0004
#define CASE_UNCAP 0x0008
#define CASE_TOGGLE 0x0010
#define CASE_TOGGLEALL 0x0020
#define CASE_UPFIRST 0x0040
#define CASE_LOWFIRST 0x0080
#define CASE_USEWORDS 0x1000
/* declarations for functions defined in lib/sh/clktck.c */
extern long get_clk_tck __P((void));
@ -433,8 +437,10 @@ extern int zmapfd __P((int, char **, char *));
/* declarations for functions defined in lib/sh/zread.c */
extern ssize_t zread __P((int, char *, size_t));
extern ssize_t zreadretry __P((int, char *, size_t));
extern ssize_t zreadintr __P((int, char *, size_t));
extern ssize_t zreadc __P((int, char *));
extern ssize_t zreadcintr __P((int, char *));
extern void zreset __P((void));
extern void zsyncfd __P((int));

7
jobs.c
View file

@ -840,6 +840,11 @@ cleanup_dead_jobs ()
if (jobs[i] && DEADJOB (i) && IS_NOTIFIED (i))
delete_job (i, 0);
}
#if defined (COPROCESS_SUPPORT)
coproc_reap ();
#endif
UNQUEUE_SIGCHLD(os);
}
@ -3081,7 +3086,7 @@ waitchld (wpid, block)
child = find_process (pid, 1, &job); /* want living procs only */
#if defined (COPROCESS_SUPPORT)
coproc_pidchk (pid);
coproc_pidchk (pid, status);
#endif
/* It is not an error to have a child terminate that we did

View file

@ -796,6 +796,8 @@ _rl_read_file (filename, sizep)
return ((char *)NULL);
}
RL_CHECK_SIGNALS ();
buffer[i] = '\0';
if (sizep)
*sizep = i;
@ -864,6 +866,7 @@ _rl_read_init_file (filename, include_level)
buffer = _rl_read_file (openname, &file_size);
xfree (openname);
RL_CHECK_SIGNALS ();
if (buffer == 0)
return (errno);

View file

@ -87,6 +87,7 @@ _rl_callback_newline ()
}
readline_internal_setup ();
RL_CHECK_SIGNALS ();
}
/* Install a readline handler, set up the terminal, and issue the prompt. */
@ -127,6 +128,7 @@ rl_callback_read_char ()
do
{
RL_CHECK_SIGNALS ();
if (RL_ISSTATE (RL_STATE_ISEARCH))
{
eof = _rl_isearch_callback (_rl_iscxt);
@ -186,6 +188,7 @@ rl_callback_read_char ()
else
eof = readline_internal_char ();
RL_CHECK_SIGNALS ();
if (rl_done == 0 && _rl_want_redisplay)
{
(*rl_redisplay_function) ();
@ -223,6 +226,7 @@ rl_callback_handler_remove ()
{
rl_linefunc = NULL;
RL_UNSETSTATE (RL_STATE_CALLBACK);
RL_CHECK_SIGNALS ();
if (in_handler)
{
in_handler = 0;

View file

@ -1019,7 +1019,9 @@ gen_completion_matches (text, start, end, our_func, found_quote, quote_char)
variable rl_attempted_completion_function. */
if (rl_attempted_completion_function)
{
_rl_interrupt_immediately++;
matches = (*rl_attempted_completion_function) (text, start, end);
_rl_interrupt_immediately--;
if (matches || rl_attempted_completion_over)
{
@ -1881,6 +1883,7 @@ rl_completion_matches (text, entry_function)
match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *));
match_list[1] = (char *)NULL;
_rl_interrupt_immediately++;
while (string = (*entry_function) (text, matches))
{
if (matches + 1 == match_list_size)
@ -1890,6 +1893,7 @@ rl_completion_matches (text, entry_function)
match_list[++matches] = string;
match_list[matches + 1] = (char *)NULL;
}
_rl_interrupt_immediately--;
/* If there were any matches, then look through them finding out the
lowest common denominator. That then becomes match_list[0]. */

View file

@ -1016,7 +1016,7 @@ history_expand (hstring, output)
}
else if (string[i] == history_expansion_char)
{
if (!cc || member (cc, history_no_expand_chars))
if (cc == 0 || member (cc, history_no_expand_chars))
continue;
/* If the calling application has set
history_inhibit_expansion_function to a function that checks
@ -1164,7 +1164,8 @@ history_expand (hstring, output)
/* If the history_expansion_char is followed by one of the
characters in history_no_expand_chars, then it is not a
candidate for expansion of any kind. */
if (member (cc, history_no_expand_chars))
if (cc == 0 || member (cc, history_no_expand_chars) ||
(history_inhibit_expansion_function && (*history_inhibit_expansion_function) (string, i)))
{
ADD_CHAR (string[i]);
break;

View file

@ -252,6 +252,7 @@ rl_gather_tyi ()
{
while (chars_avail--)
{
RL_CHECK_SIGNALS ();
k = (*rl_getc_function) (rl_instream);
if (rl_stuff_char (k) == 0)
break; /* some problem; no more room */
@ -437,6 +438,7 @@ rl_read_key ()
while (rl_event_hook && rl_get_char (&c) == 0)
{
(*rl_event_hook) ();
RL_CHECK_SIGNALS ();
if (rl_done) /* XXX - experimental */
return ('\n');
if (rl_gather_tyi () < 0) /* XXX - EIO */
@ -450,6 +452,7 @@ rl_read_key ()
{
if (rl_get_char (&c) == 0)
c = (*rl_getc_function) (rl_instream);
RL_CHECK_SIGNALS ();
}
}
@ -465,6 +468,8 @@ rl_getc (stream)
while (1)
{
RL_CHECK_SIGNALS ();
#if defined (__MINGW32__)
if (isatty (fileno (stream)))
return (getch ());

View file

@ -383,7 +383,7 @@ _rl_isearch_dispatch (cxt, c)
{
if (cxt->lastc >= 0 && (cxt->mb[0] && cxt->mb[1] == '\0') && ENDSRCH_CHAR (cxt->lastc))
{
/* This sets rl_pending_input to c; it will be picked up the next
/* This sets rl_pending_input to LASTC; it will be picked up the next
time rl_read_key is called. */
rl_execute_next (cxt->lastc);
return (0);

View file

@ -397,6 +397,8 @@ readline_internal_setup ()
if (rl_pre_input_hook)
(*rl_pre_input_hook) ();
RL_CHECK_SIGNALS ();
}
STATIC_CALLBACK char *
@ -406,6 +408,8 @@ readline_internal_teardown (eof)
char *temp;
HIST_ENTRY *entry;
RL_CHECK_SIGNALS ();
/* Restore the original of this history line, iff the line that we
are editing was originally in the history, AND the line has changed. */
entry = current_history ();
@ -542,6 +546,7 @@ readline_internal_charloop ()
lastc = c;
_rl_dispatch ((unsigned char)c, _rl_keymap);
RL_CHECK_SIGNALS ();
/* If there was no change in _rl_last_command_was_kill, then no kill
has taken place. Note that if input is pending we are reading
@ -662,7 +667,6 @@ _rl_dispatch_callback (cxt)
int nkey, r;
/* For now */
#if 1
/* The first time this context is used, we want to read input and dispatch
on it. When traversing the chain of contexts back `up', we want to use
the value from the next context down. We're simulating recursion using
@ -680,13 +684,11 @@ _rl_dispatch_callback (cxt)
}
else
r = cxt->childval;
#else
r = _rl_dispatch_subseq (nkey, cxt->dmap, cxt->subseq_arg);
#endif
/* For now */
r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ));
RL_CHECK_SIGNALS ();
if (r == 0) /* success! */
{
_rl_keyseq_chain_dispose ();
@ -773,6 +775,8 @@ _rl_dispatch_subseq (key, map, got_subseq)
remember the last command executed in this variable. */
if (rl_pending_input == 0 && map[key].function != rl_digit_argument)
rl_last_func = map[key].function;
RL_CHECK_SIGNALS ();
}
else if (map[ANYOTHERKEY].function)
{

View file

@ -37,6 +37,11 @@
#define VI_COMMAND_MODE() (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap)
#define VI_INSERT_MODE() (rl_editing_mode == vi_mode && _rl_keymap == vi_insertion_keymap)
#define RL_CHECK_SIGNALS() \
do { \
if (_rl_caught_signal) _rl_signal_handler (_rl_caught_signal); \
} while (0)
/*************************************************************************
* *
* Global structs undocumented in texinfo manual and not in readline.h *
@ -291,6 +296,8 @@ extern int _rl_restore_tty_signals PARAMS((void));
extern int _rl_nsearch_callback PARAMS((_rl_search_cxt *));
/* signals.c */
extern void _rl_signal_handler PARAMS((int));
extern void _rl_block_sigint PARAMS((void));
extern void _rl_release_sigint PARAMS((void));
@ -424,6 +431,9 @@ extern _rl_keyseq_cxt *_rl_kscxt;
extern _rl_search_cxt *_rl_nscxt;
/* signals.c */
extern int _rl_interrupt_immediately;
extern int volatile _rl_caught_signal;
extern int _rl_echoctl;
extern int _rl_intr_char;

View file

@ -81,6 +81,9 @@ typedef struct { SigHandler *sa_handler; int sa_mask, sa_flags; } sighandler_cxt
static SigHandler *rl_set_sighandler PARAMS((int, SigHandler *, sighandler_cxt *));
static void rl_maybe_set_sighandler PARAMS((int, SigHandler *, sighandler_cxt *));
static RETSIGTYPE rl_signal_handler PARAMS((int));
static RETSIGTYPE _rl_handle_signal PARAMS((int));
/* Exported variables for use by applications. */
/* If non-zero, readline will install its own signal handlers for
@ -95,6 +98,9 @@ int rl_catch_sigwinch = 0; /* for the readline state struct in readline.c */
#endif
/* Private variables. */
int _rl_interrupt_immediately = 0;
int volatile _rl_caught_signal = 0; /* should be sig_atomic_t, but that requires including <signal.h> everywhere */
/* If non-zero, print characters corresponding to received signals. */
int _rl_echoctl = 0;
@ -121,9 +127,33 @@ static sighandler_cxt old_winch;
/* Readline signal handler functions. */
/* Called from RL_CHECK_SIGNALS() macro */
RETSIGTYPE
_rl_signal_handler (sig)
{
_rl_caught_signal = 0; /* XXX */
_rl_handle_signal (sig);
SIGHANDLER_RETURN;
}
static RETSIGTYPE
rl_signal_handler (sig)
int sig;
{
if (_rl_interrupt_immediately)
{
_rl_interrupt_immediately = 0;
_rl_handle_signal (sig);
}
_rl_caught_signal = sig;
SIGHANDLER_RETURN;
}
static RETSIGTYPE
_rl_handle_signal (sig)
int sig;
{
#if defined (HAVE_POSIX_SIGNALS)
sigset_t set;

View file

@ -114,7 +114,7 @@ rl_free_undo_list ()
rl_undo_list = rl_undo_list->next;
if (release->what == UNDO_DELETE)
free (release->text);
xfree (release->text);
xfree (release);
}
@ -191,7 +191,7 @@ rl_do_undo ()
case UNDO_DELETE:
rl_point = start;
rl_insert_text (rl_undo_list->text);
free (rl_undo_list->text);
xfree (rl_undo_list->text);
break;
/* Undoing inserts means deleting some text. */

View file

@ -53,13 +53,17 @@
#endif
/* These must agree with the defines in externs.h */
#define CASE_NOOP 0x0
#define CASE_LOWER 0x01
#define CASE_UPPER 0x02
#define CASE_CAPITALIZE 0x04
#define CASE_UNCAP 0x08
#define CASE_TOGGLE 0x10
#define CASE_TOGGLEALL 0x20
#define CASE_NOOP 0x0000
#define CASE_LOWER 0x0001
#define CASE_UPPER 0x0002
#define CASE_CAPITALIZE 0x0004
#define CASE_UNCAP 0x0008
#define CASE_TOGGLE 0x0010
#define CASE_TOGGLEALL 0x0020
#define CASE_UPFIRST 0x0040
#define CASE_LOWFIRST 0x0080
#define CASE_USEWORDS 0x1000 /* modify behavior to act on words in passed string */
extern char *substring __P((char *, int, int));
@ -96,7 +100,7 @@ sh_modcase (string, pat, flags)
int flags;
{
int start, next, end;
int inword, c, nc, nop, match;
int inword, c, nc, nop, match, usewords;
char *ret, *s;
wchar_t wc;
#if defined (HANDLE_MULTIBYTE)
@ -116,6 +120,10 @@ sh_modcase (string, pat, flags)
ret = (char *)xmalloc (end + 1);
strcpy (ret, string);
/* See if we are supposed to split on alphanumerics and operate on each word */
usewords = (flags & CASE_USEWORDS);
flags &= ~CASE_USEWORDS;
inword = 0;
while (start < end)
{
@ -143,16 +151,41 @@ sh_modcase (string, pat, flags)
}
}
/* XXX - for now, the toggling operators work on the individual
words in the string, breaking on alphanumerics. Should I
leave the capitalization operators to do that also? */
if (flags == CASE_CAPITALIZE)
{
nop = inword ? CASE_LOWER : CASE_UPPER;
if (usewords)
nop = inword ? CASE_LOWER : CASE_UPPER;
else
nop = (start > 0) ? CASE_LOWER : CASE_UPPER;
inword = 1;
}
else if (flags == CASE_UNCAP)
{
nop = inword ? CASE_UPPER : CASE_LOWER;
if (usewords)
nop = inword ? CASE_UPPER : CASE_LOWER;
else
nop = (start > 0) ? CASE_UPPER : CASE_LOWER;
inword = 1;
}
else if (flags == CASE_UPFIRST)
{
if (usewords)
nop = inword ? CASE_NOOP : CASE_UPPER;
else
nop = (start > 0) ? CASE_NOOP : CASE_UPPER;
inword = 1;
}
else if (flags == CASE_LOWFIRST)
{
if (usewords)
nop = inword ? CASE_NOOP : CASE_LOWER;
else
nop = (start > 0) ? CASE_NOOP : CASE_LOWER;
inword = 1;
}
else if (flags == CASE_TOGGLE)
{
nop = inword ? CASE_NOOP : CASE_TOGGLE;

View file

@ -36,6 +36,11 @@ extern int errno;
extern ssize_t zread __P((int, char *, size_t));
extern ssize_t zreadc __P((int, char *));
extern ssize_t zreadintr __P((int, char *, size_t));
extern ssize_t zreadcintr __P((int, char *));
typedef ssize_t breadfunc_t __P((int, char *, size_t));
typedef ssize_t creadfunc_t __P((int, char *));
/* Initial memory allocation for automatic growing buffer in zreadlinec */
#define GET_LINE_INITIAL_ALLOCATION 16
@ -74,31 +79,32 @@ zgetline (fd, lineptr, n, unbuffered_read)
if (retval <= 0)
{
line[nr] = '\0';
if (line && nr > 0)
line[nr] = '\0';
break;
}
if (nr + 2 >= *n)
{
size_t new_size;
size_t new_size;
new_size = (*n == 0) ? GET_LINE_INITIAL_ALLOCATION : *n * 2;
line = xrealloc (*lineptr, new_size);
new_size = (*n == 0) ? GET_LINE_INITIAL_ALLOCATION : *n * 2;
line = (*n >= new_size) ? NULL : xrealloc (*lineptr, new_size);
if (line)
{
*lineptr = line;
*n = new_size;
}
else
{
if (*n > 0)
{
(*lineptr)[*n - 1] = '\0';
nr = *n - 2;
}
break;
}
if (line)
{
*lineptr = line;
*n = new_size;
}
else
{
if (*n > 0)
{
(*lineptr)[*n - 1] = '\0';
nr = *n - 2;
}
break;
}
}
line[nr] = c;

View file

@ -60,7 +60,7 @@ zread (fd, buf, len)
#define NUM_INTR 3
ssize_t
zreadintr (fd, buf, len)
zreadretry (fd, buf, len)
int fd;
char *buf;
size_t len;
@ -75,7 +75,7 @@ zreadintr (fd, buf, len)
return r;
if (r == -1 && errno == EINTR)
{
if (++nintr > NUM_INTR)
if (++nintr >= NUM_INTR)
return -1;
continue;
}
@ -83,6 +83,16 @@ zreadintr (fd, buf, len)
}
}
/* Call read(2) and allow it to be interrupted. Just a stub for now. */
ssize_t
zreadintr (fd, buf, len)
int fd;
char *buf;
size_t len;
{
return (read (fd, buf, len));
}
/* Read one character from FD and return it in CP. Return values are as
in read(2). This does some local buffering to avoid many one-character
calls to read(2), like those the `read' builtin performs. */
@ -113,6 +123,31 @@ zreadc (fd, cp)
return 1;
}
/* Don't mix calls to zreadc and zreadcintr in the same function, since they
use the same local buffer. */
ssize_t
zreadcintr (fd, cp)
int fd;
char *cp;
{
ssize_t nr;
if (lind == lused || lused == 0)
{
nr = zreadintr (fd, lbuf, sizeof (lbuf));
lind = 0;
if (nr <= 0)
{
lused = 0;
return nr;
}
lused = nr;
}
if (cp)
*cp = lbuf[lind++];
return 1;
}
void
zreset ()
{

View file

@ -187,7 +187,12 @@ set_locale_var (var, value)
#if defined (HAVE_SETLOCALE)
r = *lc_all ? ((x = setlocale (LC_ALL, lc_all)) != 0) : reset_locale_vars ();
if (x == 0)
internal_warning("setlocale: LC_ALL: cannot change locale (%s): %s", lc_all, strerror(errno));
{
if (errno == 0)
internal_warning(_("setlocale: LC_ALL: cannot change locale (%s)"), lc_all);
else
internal_warning(_("setlocale: LC_ALL: cannot change locale (%s): %s"), lc_all, strerror (errno));
}
locale_setblanks ();
return r;
#else
@ -237,7 +242,12 @@ set_locale_var (var, value)
#endif /* HAVE_SETLOCALE */
if (x == 0)
internal_warning("setlocale: %s: cannot change locale (%s): %s", var, get_locale_var (var), strerror(errno));
{
if (errno == 0)
internal_warning(_("setlocale: %s: cannot change locale (%s)"), var, get_locale_var (var));
else
internal_warning(_("setlocale: %s: cannot change locale (%s): %s"), var, get_locale_var (var), strerror (errno));
}
return (x != 0);
}

View file

@ -45,6 +45,7 @@
#include "shell.h"
#include "jobs.h"
#include "execute_cmd.h"
#include "builtins/builtext.h" /* for wait_builtin */
@ -256,6 +257,10 @@ set_pid_status (pid, status)
{
int slot;
#if defined (COPROCESS_SUPPORT)
coproc_pidchk (pid, status);
#endif
slot = find_index_by_pid (pid);
if (slot == NO_PID)
return;
@ -387,6 +392,10 @@ cleanup_dead_jobs ()
pid_list[i].pid = NO_PID;
}
#if defined (COPROCESS_SUPPORT)
coproc_reap ();
#endif
return 0;
}

View file

@ -941,11 +941,12 @@ unbind_compfunc_variables (exported)
$0 == function or command being invoked
$1 == command name
$2 = word to be completed (possibly null)
$3 = previous word
$2 == word to be completed (possibly null)
$3 == previous word
Functions can access all of the words in the current command line
with the COMP_WORDS array. External commands cannot. */
with the COMP_WORDS array. External commands cannot; they have to
make do with the COMP_LINE and COMP_POINT variables. */
static WORD_LIST *
build_arg_list (cmd, text, lwords, ind)
@ -1005,6 +1006,7 @@ gen_shell_function_matches (cs, text, line, ind, lwords, nw, cw)
WORD_LIST *cmdlist;
int fval;
sh_parser_state_t ps;
sh_parser_state_t * restrict pps;
#if defined (ARRAY_VARS)
ARRAY *a;
#endif
@ -1029,9 +1031,16 @@ gen_shell_function_matches (cs, text, line, ind, lwords, nw, cw)
cmdlist = build_arg_list (funcname, text, lwords, cw);
save_parser_state (&ps);
pps = &ps;
begin_unwind_frame ("gen-shell-function-matches");
add_unwind_protect (restore_parser_state, (char *)pps);
add_unwind_protect (dispose_words, (char *)cmdlist);
add_unwind_protect (unbind_compfunc_variables, (char *)0);
fval = execute_shell_function (f, cmdlist);
restore_parser_state (&ps);
discard_unwind_frame ("gen-shell-function-matches");
restore_parser_state (pps);
/* Now clean up and destroy everything. */
dispose_words (cmdlist);

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
po/af.gmo

Binary file not shown.

332
po/af.po

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

BIN
po/bg.gmo

Binary file not shown.

332
po/bg.po

File diff suppressed because it is too large Load diff

BIN
po/ca.gmo

Binary file not shown.

332
po/ca.po

File diff suppressed because it is too large Load diff

BIN
po/cs.gmo

Binary file not shown.

335
po/cs.po

File diff suppressed because it is too large Load diff

BIN
po/de.gmo

Binary file not shown.

332
po/de.po

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

BIN
po/eo.gmo

Binary file not shown.

332
po/eo.po

File diff suppressed because it is too large Load diff

BIN
po/es.gmo

Binary file not shown.

332
po/es.po

File diff suppressed because it is too large Load diff

BIN
po/et.gmo

Binary file not shown.

332
po/et.po

File diff suppressed because it is too large Load diff

BIN
po/fr.gmo

Binary file not shown.

332
po/fr.po

File diff suppressed because it is too large Load diff

BIN
po/hu.gmo

Binary file not shown.

332
po/hu.po

File diff suppressed because it is too large Load diff

BIN
po/id.gmo

Binary file not shown.

335
po/id.po

File diff suppressed because it is too large Load diff

BIN
po/ja.gmo

Binary file not shown.

332
po/ja.po

File diff suppressed because it is too large Load diff

BIN
po/lt.gmo

Binary file not shown.

408
po/lt.po

File diff suppressed because it is too large Load diff

BIN
po/nl.gmo

Binary file not shown.

335
po/nl.po

File diff suppressed because it is too large Load diff

BIN
po/pl.gmo

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more