commit bash-20130322 snapshot

This commit is contained in:
Chet Ramey
2013-04-26 15:18:45 -04:00
parent f8fa1b65b9
commit c2fa658335
124 changed files with 28875 additions and 21638 deletions
+558
View File
@@ -1,3 +1,561 @@
This document details the changes between this version, bash-4.3-alpha,
and the previous version, bash-4.2-release.
1. Changes to Bash
a. Fixed several bugs concerning incomplete bracket expressions in filename
generation (globbing) patterns.
b. Fixed a bug with single quotes and WORD in ${param op WORD} when running
in Posix mode.
c. Fixed a bug that caused the pattern removal and pattern substitution word
expansions and case statement word expansion to not match the empty string.
d. Fixed a bug that caused the tzset() function to not work after changing
the TZ enviroment variable.
e. Fixed a bug that caused the RHS of an assignment statement to undergo
word splitting when it contained an unquoted $@.
f. Fixed bugs that caused the shell to not react to a SIGINT sent while
waiting for a child process to exit.
g. Bash doesn't try to run things in a signal handler context when it gets a
signal (SIGINT/SIGHUP/etc) while reading input using readline but still
be responsive to terminating signals.
h. Fixed a bug that caused bash to go into an infinite loop if a filename
to be matched contained an invalid multibyte character.
i. Fixed a bug that caused PS4 to end up being truncated if it is longer
than 128 bytes.
j. Fixed a bug that caused brace expansion to not skip over double-quoted
command substitution.
k. System-specific updates for: DJGPP, HP/UX, Mac OS X
l. Fixed a bug in displaying commands that caused redirections to be associated
with the wrong part of the command.
m. Fixed the coproc cleanup to unset the appropriate shell variables when a
coproc terminates.
n. Fixed a bug that caused `fc' to dump core due to incorrect calculation of
the last history entry.
o. Added workarounds for FreeBSD's implementation of faccessat/eaccess and
`test -x'.
p. Fixed a bug that caused the shell to not match patterns containing
control-A.
q. Fixed a bug that could result in doubled error messages when the `printf'
builtin got a write error.
r. Fixed a bug that caused the shell to not correctly expand words containing
multiple consecutive quoted empty strings (""""""aa).
s. Fixed a bug that caused the shell to not correctly parse multi-line
process substitutions containing comments and quoted strings.
t. Fixed a problem with the bash malloc's internal idea of the top of the
memory heap that resulted in incorrect decisions to try to reduce the
break and give memory back to the kernel.
u. There are changes to the expansions peformed on compound array assignments,
in an effort to make foo=( [ind1]=bar [ind2]=baz ) identical to
foo[ind1]=bar foo[ind2]=baz.
v. Bash now reports an error if `read -a name' is used when `name' is an
existing associative array.
w. Fixed a bug that allowed an attempted assignment to a readonly variable
in an arithmetic expression to not return failure.
x. Fixed several bugs that caused completion functions to be invoked even when
the cursor was before the first word in the command.
y. Fixed a bug that caused parsing a command substitution to overwrite the
parsing state associated with the complete input line.
z. Fixed several bugs with the built-in snprintf replacement and field widths
and floating point.
aa. Fixed a bug that caused incorrect offset calculations and input buffer
corruption when reading files longer than 2^31 bytes.
bb. Fixed several bugs where bash performed arithmetic evaluation in contexts
where evaluation is suppressed.
cc. Fixed a bug that caused bash to close FIFOs used for process substitution
too early when a shell function was executing, but protect against using
all file descriptors when the shell functions are invoked inside loops.
dd. Added checks for printable (and non-printable) multibyte characters for
use in error messages.
ee. Fixed a bug that caused ^O (operate-and-get-next) to not work correctly
at the end of the history list.
ff. Fixed a bug that caused command-oriented history to incorrectly combine
here documents into one line.
gg. Fixed a bug that caused importing SHELLOPTS from the environment into a
Posix-mode shell to print an error message and refuse to parse it.
hh. Fixed a bug that caused the shell to delete an extra history entry when
using `history -s'.
ii. Fixed a bug that caused floating-point exceptions and overflow errors
for the / and % arithmetic operators when using INTMAX_MIN and -1.
jj. Fixed a bug that caused parsing errors when reading an arithmetic for
loop inside a command substitution.
kk. Fixed a bug that caused a readonly function to be unset when unset was
called without the -f or -v option.
ll. Fixed several bugs in the code that quotes characters special to regular
expressions when used in a quoted string on the RHS of the =~ operator
to the [[ command.
mm. Fixed a bug that caused redirections to fail because the file descriptor
limit was set to a value less than 10.
nn. Fixed a bug that caused the `read' builtin to execute code in a signal
handler context if read timed out.
oo. Fixed a bug that caused extended globbing patterns to not match files
beginning with `.' correctly when a `.' was explicitly supplied in the
pattern.
pp. Fixed a bug that caused key sequences longer than two characters to not
work when used with `bind -x'.
qq. Fixed a bug that resulted in redefined functions having the wrong source
file names in BASH_SOURCE.
rr. Fixed a bug that caused the read builtin to assign null strings to variables
when using `read -N', which caused core dumps when referenced
ss. Fixed a bug that caused `bash -m script' to not enable job control while
running the script.
tt. Fixed a bug that caused `printf -v var' to dump core when used with the
%b format code.
uu. Fixed a bug that caused the shell to exit with the wrong status if -e was
active and the shell exited on a substitution error.
vv. Fixed a bug that caused the shell to seg fault if an array variable with
the same name as an existing associative array was implicitly created by
an assignment (declare a[n]=b).
ww. Fixed a bug that caused a redirection to misbehave if the number specified
for a file descriptor overflows an intmax_t.
xx. Fixed several bugs with the handling of valid and invalid unicode character
values when used with the \u and \U escape sequences to printf and $'...'.
yy. Fixed a bug that caused tildes to not be escaped in expanded filenames,
making them subject to later expansion.
zz. When using the pattern substitution word expansion, bash now runs the
replacement string through quote removal, since it allows quotes in that
string to act as escape characters. This is not backwards compatible, so
it can be disabled by setting the bash compatibility mode to 4.2.
aaa. Fixed the rest of the cases where the shell runs non-allowed code in a
signal handler context.
bbb. Fixed a bug that caused spurious DEL characters (\177) to appear in
double-quoted expansion where the RHS is evaluated to the empty string.
ccc. Fixed a bug that caused the use of the shell's internal random number
generator for temporary file names to perturb the random number
sequence.
ddd. Fixed several bugs that caused `declare -g' to not set the right global
variables or to misbehave when declaring global indexed arrays.
eee. Fixed a logic bug that caused extended globbing in a multibyte locale to
cause failures when using the pattern substititution word expansions.
fff. Fixed a bug that caused the `lastpipe' option to corrupt the file
descriptor used to read the script.
ggg. Fixed a bug that causes the shell to delete DEL characters in the
expanded value of variables used in the same quoted string as variables
that expand to nothing.
hhh. Fixed a bug that caused the shell to assign the wrong value from an
assignment like (( x=7 )) when `x' was an existing array variable.
iii. Fixed a bug that caused the shell to misbehave when generating sequences
and the boundary values overflow an intmax_t.
jjj. Fixed a bug caused expansion errors if an expansion of "$@" appeared
next to another expansion (e.g.. "${@}${x}").
kkk. Fixed a potential buffer overflow bug when performing /dev/fd expansion.
lll. Fixed a bug that resulted in an extra semicolon being added to compound
assignments when they were added to the history list.
mmm. Fixed a bug that caused mapfile to read one extra line from the input.
nnn. Fixed a bug that caused the mail checking code to use uninitialized
values.
ooo. Fixed a bug that prevented history timestamps from being saved if the
history comment character is unset.
ppp. Fixed a bug that caused the case-modifying expansions to not work with
multibyte characters.
qqq. Fixed a bug that caused the edit-and-execute bindable readline command
to see the wrong data if invoked in the middle of a multi-line quoted
string.
rrr. Fixed a bug that resulted in the shell returning the wrong exit status
for a background command on systems that recycle PIDs very quickly.
sss. Fixed a bug that caused asynchronous group commands to not run any EXIT
trap defined in the body of the command.
ttt. Fixed a bug that caused `eval "... ; return"' to not clean up properly.
uuu. Fixed a bug that caused the shell to dump core if `read' reads an escaped
IFS whitespace character.
vvv. Fixed a bug that caused BASH_COMMAND to be set to an incorrect value when
executing a (...) subshell.
www. Fixed a couple of pointer aliasing bugs with the token string in arithmetic
evaluation.
xxx. Fixed a bug with parsing multi-line command substitutions when reading
the `do' keyword followed by whitespace.
yyy. Fixed a bug that caused the shell to seg fault if the time given to the
printf %(...)T format overflowed the value accepted by localtime(3).
zzz. Fixed a problem with displaying help topics in two columns when the
translated text contained multibyte characters.
aaaa. Fixed a bug with the extended globbing pattern matcher where a `*' was
followed by a negated extended glob pattern.
bbbb. Fixed a race condition with short-lived coproc creation and reaping that
caused the child process to be reaped before the various coproc shell
variables were initialized.
cccc. Fixed a bug where turning off `errexit' in command substitution subshells
was not reflected in $SHELLOPTS.
dddd. Partially fixed an inconsistency in how the shell treated shell
functions run from an EXIT trap.
eeee. Fixed a bug in how the shell invalidated FIFOs used for process
substitution when executing a pipeline (once rather than in every child).
ffff. Fixed a bug that occurred when expanding a special variable ($@, $*)
within double quotes and the expansion resulted in an empty string.
gggg. Fixed bugs with executing a SIGCHLD trap handler to make sure that it's
executed once per exited child.
hhhh. Fixed a bug that caused `declare' and `test' to find variables that
had been given attributes but not assigned values. Such variables are
not set.
iiii. Fixed a bug that caused commands in process substitutions to not look in
the local temporary environment when performing word expansions.
jjjj. Fixed several problems with globstar expansions (**/**) returning null
filenames and multiple instances of the same pathname.
kkkk. Fixed an oversight that did not allow the exit status of `coproc' to
be inverted using `!'.
llll. Fixed a bug that caused the -e option to be re-enabled using `set -e'
even when executing in a context where -e is ignored.
mmmm. Fixed a (mostly theoretical) bug with input lines longer than SIZE_MAX.
nnnn. Fixed a bug that could result in double evaluation of command
substitutions when they appear in failed redirections.
oooo. Fixed a bug that could cause seg faults during `mapfile' callbacks if
the callback unsets the array variable mapfile is using.
pppp. Fixed several problems with variable assignments using ${var:=value}
when the variable assignment is supposed to have side effects.
qqqq. Fixed a bug that caused a failure of an assignment statement preceding a
builtin caused the next invocation of a special builtin to exit the shell.
rrrr. Fixed several problems with IFS when it appears in the temporary environment
and is used in redirections.
ssss. Fixed a problem that caused IFS changes using ${IFS:=value} to modify
how preceding expansions were split.
tttt. Fixed a problem that caused subshells to not run an EXIT trap they set.
uuuu. Fixed a problem that caused shells started in posix mode to attempt to
import shell functions with invalid names from the environment. We now
print a warning.
vvvv. Worked around a kernel problem that caused SIGCHLD to interrupt open(2)
on a FIFO used for process substitution, even if the SIGCHLD handler was
installed with the SA_RESTART flag.
wwww. Fixed a problem that resulted in inconsistent expansion of $* and ${a[*]}.
xxxx. Fixed a problem that caused `read -t' to crash when interrupted by
SIGINT.
yyyy. Fixed a problem that caused pattern removal to fail randomly because the
pattern matcher read beyond the end of a string.
zzzz. Fixed a bug that caused core dumps when shell functions tried to create
local shadow copies of special variables like GROUPS.
aaaaa. Fixed a bug that caused SIGTERM to be occasionally lost by children of
interactive shells when it arrived before the child process reset the
handler from SIG_DFL.
bbbbb. Fixed a bug that caused redirections like <&n- to leave file descriptor
n closed if executed with a builtin command.
ccccc. Fixed a bug that caused incorrect completion quoting when completing a
word containing a globbing character with `show-all-if-ambiguous' set.
2. Changes to Readline
a. Fixed a bug that did not allow the `dd', `cc', or `yy' vi editing mode
commands to work on the entire line.
b. Fixed a bug that caused redisplay problems with prompts longer than 128
characters and history searches.
c. Fixed a bug that caused readline to try and run code to modify its idea
of the screen size in a signal handler context upon receiving a SIGWINCH.
d. Fixed a bug that caused the `meta' key to be enabled beyond the duration
of an individual call top readline().
e. Added a workaround for a wcwidth bug in Mac OS X that caused readline's
redisplay to mishandle zero-width combining characters.
f. Fixed a bug that caused readline to `forget' part of a key sequence when
a multiple-key sequence caused it to break out of an incremental search.
g. Fixed bugs that caused readline to execute code in a signal handler
context if interrupted while reading from the file system during completion.
h. Fixed a bug that caused readline to `forget' part of a key sequence when
reading an unbound multi-character key sequence.
i. Fixed a bug that caused Readline's signal handlers to be installed beyond
the bounds of a single call to readline().
j. Fixed a bug that caused the `.' command to not redo the most recent `R'
command in vi mode.
k. Fixed a bug that caused ignoring case in completion matches to result in
readline using the wrong match.
l. Paren matching now works in vi insert mode.
m. Fix menu-completion to make show-all-if-ambiguous and menu-complete-display-prefix
work together.
n. Fixed a bug that didn't allow the `cc', `dd', or `yy' commands to be redone
in vi editing mode.
o. Fixed a bug that caused the filename comparison code to not compare
multibyte characters correctly when using case-sensitive or case-mapping
comparisons.
p. Fixed the input reading loop to call the input hook function only when there
is no terminal input available.
q. Fixed a bug that caused binding a macro to a multi-character key sequence
where the sequence and macro value share a common prefix to not perform
the macro replacement.
r. Fixed several redisplay errors with multibyte characters and prompts
containing invisible characters when using horizontal scrolling.
s. Fixed a bug that caused redisplay errors when trying to overwrite
existing characters using multibyte characters.
3. New Features in Bash
a. The `helptopic' completion action now maps to all the help topics, not just
the shell builtins.
b. The `help' builtin no longer does prefix substring matching, so `help read'
does not match `readonly'.
c. The shell can be compiled to not display a message about processes that
terminate due to SIGTERM.
d. Non-interactive shells now react to the setting of checkwinsize and set
LINES and COLUMNS after a foreground job exits.
e. There is a new shell option, `globasciiranges', which, when set to on,
forces globbing range comparisons to use character ordering as if they
were run in the C locale.
f. There is a new shell option, `direxpand', which makes filename completion
expand variables in directory names in the way bash-4.1 did.
g. In Posix mode, the `command' builtin does not change whether or not a
builtin it shadows is treated as an assignment builtin.
h. The `return' and `exit' builtins accept negative exit status arguments.
i. The word completion code checks whether or not a filename containing a
shell variable expands to a directory name and appends `/' to the word
as appropriate. The same code expands shell variables in command names
when performing command completion.
j. In Posix mode, it is now an error to attempt to define a shell function
with the same name as a Posix special builtin.
k. When compiled for strict Posix conformance, history expansion is disabled
by default.
l. The history expansion character (!) does not cause history expansion when
followed by the closing quote in a double-quoted string.
m. `complete' and its siblings compgen/compopt now takes a new `-o noquote'
option to inhibit quoting of the completions.
n. Setting HISTSIZE to a value less than zero causes the history list to be
unlimited (setting it 0 zero disables the history list).
o. Setting HISTFILESIZE to a value less than zero causes the history file size
to be unlimited (setting it to 0 causes the history file to be truncated
to zero size).
p. The `read' builtin now skips NUL bytes in the input.
q. There is a new `bind -X' option to print all key sequences bound to Unix
commands.
r. When in Posix mode, `read' is interruptible by a trapped signal. After
running the trap handler, read returns 128+signal and throws away any
partially-read input.
s. The command completion code skips whitespace and assignment statements
before looking for the command name word to be completed.
t. The build process has a new mechanism for constructing separate help files
that better reflects the current set of compilation options.
u. The -nt and -ot options to test now work with files with nanosecond
timestamp resolution.
v. The shell saves the command history in any shell for which history is
enabled and HISTFILE is set, not just interactive shells.
w. The shell has `nameref' variables and new -n(/+n) options to declare and
unset to use them, and a `test -R' option to test for them.
x. The shell now allows assigning, referencing, and unsetting elements of
indexed arrays using negative subscripts (a[-1]=2, echo ${a[-1]}) which
count back from the last element of the array.
y. The {x}<word redirection feature now allows words like {array[ind]} and
can use variables with special meanings to the shell (e.g., BASH_XTRACEFD).
z. There is a new CHILD_MAX special shell variable; its value controls the
number of exited child statues the shell remembers.
aa. There is a new configuration option (--enable-direxpand-default) that
causes the `direxpand' shell option to be enabled by default.
bb. Bash does not do anything special to ensure that the file descriptor
assigned to X in {x}<foo remains open after the block containing it
completes.
cc. The `wait' builtin has a new `-n' option to wait for the next child to
change status.
dd. The `printf' %(...)T format specifier now uses the current time if no
argument is supplied.
ee. There is a new variable, BASH_COMPAT, that controls the current shell
compatibility level.
ff. The `popd' builtin now treats additional arguments as errors.
gg. The brace expansion code now treats a failed sequence expansion as a
simple string and will continue to expand brace terms in the remainder
of the word.
4. New Features in Readline
a. Readline is now more responsive to SIGHUP and other fatal signals when
reading input from the terminal or performing word completion but no
longer attempts to run any not-allowable functions from a signal handler
context.
b. There are new bindable commands to search the history for the string of
characters between the beginning of the line and the point
(history-substring-search-forward, history-substring-search-backward)
c. Readline allows quoted strings as the values of variables when setting
them with `set'. As a side effect, trailing spaces and tabs are ignored
when setting a string variable's value.
d. The history library creates a backup of the history file when writing it
and restores the backup on a write error.
e. New application-settable variable: rl_filename_stat_hook: a function called
with a filename before using it in a call to stat(2). Bash uses it to
expand shell variables so things like $HOME/Downloads have a slash
appended.
f. New bindable function `print-last-kbd-macro', prints the most-recently-
defined keyboard macro in a reusable format.
g. New user-settable variable `colored-stats', enables use of colored text
to denote file types when displaying possible completions (colored analog
of visible-stats).
h. New user-settable variable `keyseq-timout', acts as an inter-character
timeout when reading input or incremental search strings.
i. New application-callable function: rl_clear_history. Clears the history list
and frees all readline-associated private data.
j. New user-settable variable, show-mode-in-prompt, adds a characters to the
beginning of the prompt indicating the current editing mode.
k. New application-settable variable: rl_input_available_hook; function to be
called when readline detects there is data available on its input file
descriptor.
l. Readline calls an application-set event hook (rl_event_hook) after it gets
a signal while reading input (read returns -1/EINTR but readline does not
handle the signal immediately) to allow the application to handle or
otherwise note it.
m. If the user-settable variable `history-size' is set to a value less than
0, the history list size is unlimited.
n. New application-settable variable: rl_signal_event_hook; function that is
called when readline is reading terminal input and read(2) is interrupted
by a signal. Currently not called for SIGHUP or SIGTERM.
------------------------------------------------------------------------------
This document details the changes between this version, bash-4.2-release,
and the previous version, bash-4.2-rc2.
+3
View File
@@ -331,6 +331,9 @@ aaaaa. Fixed a bug that caused SIGTERM to be occasionally lost by children of
bbbbb. Fixed a bug that caused redirections like <&n- to leave file descriptor
n closed if executed with a builtin command.
ccccc. Fixed a bug that caused incorrect completion quoting when completing a
word containing a globbing character with `show-all-if-ambiguous' set.
2. Changes to Readline
a. Fixed a bug that did not allow the `dd', `cc', or `yy' vi editing mode
+3 -3
View File
@@ -2,9 +2,9 @@ Compatibility with previous versions
====================================
This document details the incompatibilities between this version of bash,
bash-4.2, and the previous widely-available versions, bash-2.x (which is
still the `standard' version for a few Linux distributions) and bash-3.x.
These were discovered by users of bash-2.x through 4.x, so this list is not
bash-4.3, and the previous widely-available version, bash-3.x (which is
still the `standard' version for a few Linux distributions). These were
discovered by users of bash-2.x through 4.x, so this list is not
comprehensive. Some of these incompatibilities occur between the current
version and versions 2.0 and above.
+27 -2
View File
@@ -4725,8 +4725,6 @@ builtins/setattr.def
functions aren't changed or displayed unless the -f option is given.
Report from <gotmynick@gmail.com>
[bash-4.3-alpha frozen]
3/9
---
include/typemax.h
@@ -4748,3 +4746,30 @@ bashline.c
get inserted by `quoting' the completion. We can't kill all the
matches because show-all-if-ambiguous needs them. Bug report from
Marcel (Felix) Giannelia <info@skeena.net>
[bash-4.3-alpha frozen]
3/14
----
general.c
- trim_pathname: use memmove instead of memcpy since the source and
destination pathnames may overlap. Report and fix from Matthew
Riley <mattdr@google.com>
3/18
----
configure.ac
- socklen_t is defined as `unsigned int' if configure can't find it
3/20
----
lib/readline/complete.c
- S_ISVTX: since it's not defined on all platforms (Minix), make sure
its use is protected with #ifdef
3/21
----
doc/{bash.1,bashref.texi}
- Added mention of ${!name[@]} and ${!name[*]} expansions to get all
indices of an array. Suggested by Jonathan Leffler
<jonathan.leffler@gmail.com>
+82
View File
@@ -0,0 +1,82 @@
Starting bash with the `--posix' command-line option or executing
`set -o posix' while bash is running will cause bash to conform more
closely to the Posix.2 standard by changing the behavior to match that
specified by Posix.2 in areas where the bash default differs.
The following list is what's changed when `posix mode' is in effect:
1. When a command in the hash table no longer exists, bash will re-search
$PATH to find the new location. This is also available with
`shopt -s checkhash'.
2. The >& redirection does not redirect stdout and stderr.
3. The message printed by the job control code and builtins when a job
exits with a non-zero status is `Done(status)'.
4. Reserved words may not be aliased.
5. The Posix.2 PS1 and PS2 expansions of `!' -> history number and
`!!' -> `!' are enabled, and parameter expansion is performed on
the value regardless of the setting of the `promptvars' option.
6. Interactive comments are enabled by default. (Note that bash has
them on by default anyway.)
7. The Posix.2 startup files are executed ($ENV) rather than the normal
bash files.
8. Tilde expansion is only performed on assignments preceding a command
name, rather than on all assignment statements on the line.
9. The default history file is ~/.sh_history (default value of $HISTFILE).
10. The output of `kill -l' prints all the signal names on a single line,
separated by spaces.
11. Non-interactive shells exit if `file' in `. file' is not found.
12. Redirection operators do not perform pathname expansion on the word
in the redirection unless the shell is interactive
13. Function names must be valid shell identifiers. That is, they may not
contain characters other than letters, digits, and underscores, and
may not start with a digit. Declaring a function with an illegal name
causes a fatal syntax error in non-interactive shells.
14. Posix.2 `special' builtins are found before shell functions during command
lookup.
15. If a Posix.2 special builtin returns an error status, a non-interactive
shell exits. The fatal errors are those listed in the POSIX.2 standard,
and include things like passing incorrect options, redirection errors,
variable assignment errors for assignments preceding the command name,
and so on.
16. The environment passed to executed commands is not sorted. Neither is
the output of `set'. This is not strictly Posix.2 behavior, but sh
does it this way. Ksh does not. It's not necessary to sort the
environment; no program should rely on it being sorted.
17. If the `cd' builtin finds a directory to change to using $CDPATH, the
value it assigns to $PWD does not contain any symbolic links, as if
`cd -P' had been executed.
18. A non-interactive shell exits with an error status if a variable
assignment error occurs when no command name follows the assignment
statements. A variable assignment error occurs, for example, when
trying to assign a value to a read-only variable.
19. A non-interactive shell exits with an error status if the iteration
variable in a for statement or the selection variable in a select
statement is a read-only variable.
20. Process substitution is not available.
21. Assignment statements preceding POSIX.2 `special' builtins persist in
the shell environment after the builtin completes.
There is other Posix.2 behavior that bash does not implement. Specifically:
1. Assignment statements affect the execution environment of all builtins,
not just special ones.
+544
View File
@@ -0,0 +1,544 @@
This file is set.def, from which is created set.c.
It implements the "set" and "unset" builtins in Bash.
Copyright (C) 1987, 1989, 1991 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
$PRODUCES set.c
#include <stdio.h>
#include "../shell.h"
#include "../flags.h"
#include "bashgetopt.h"
extern int interactive;
extern int noclobber, posixly_correct;
#if defined (READLINE)
extern int rl_editing_mode, no_line_editing;
#endif /* READLINE */
$BUILTIN set
$FUNCTION set_builtin
$SHORT_DOC set [--abefhkmnptuvxldBCHP] [-o option] [arg ...]
-a Mark variables which are modified or created for export.
-b Notify of job termination immediately.
-e Exit immediately if a command exits with a non-zero status.
-f Disable file name generation (globbing).
-h Locate and remember function commands as functions are
defined. Function commands are normally looked up when
the function is executed.
-i Force the shell to be an "interactive" one. Interactive shells
always read `~/.bashrc' on startup.
-k All keyword arguments are placed in the environment for a
command, not just those that precede the command name.
-m Job control is enabled.
-n Read commands but do not execute them.
-o option-name
Set the variable corresponding to option-name:
allexport same as -a
braceexpand same as -B
#if defined (READLINE)
emacs use an emacs-style line editing interface
#endif /* READLINE */
errexit same as -e
histexpand same as -H
ignoreeof the shell will not exit upon reading EOF
interactive-comments
allow comments to appear in interactive commands
monitor same as -m
noclobber disallow redirection to existing files
noexec same as -n
noglob same as -f
nohash same as -d
notify save as -b
nounset same as -u
physical same as -P
posix change the behavior of bash where the default
operation differs from the 1003.2 standard to
match the standard
privileged same as -p
verbose same as -v
#if defined (READLINE)
vi use a vi-style line editing interface
#endif /* READLINE */
xtrace same as -x
-p Turned on whenever the real and effective user ids do not match.
Disables processing of the $ENV file and importing of shell
functions. Turning this option off causes the effective uid and
gid to be set to the real uid and gid.
-t Exit after reading and executing one command.
-u Treat unset variables as an error when substituting.
-v Print shell input lines as they are read.
-x Print commands and their arguments as they are executed.
-l Save and restore the binding of the NAME in a FOR command.
-d Disable the hashing of commands that are looked up for execution.
Normally, commands are remembered in a hash table, and once
found, do not have to be looked up again.
#if defined (BRACE_EXPANSION)
-B the shell will perform brace expansion
#endif /* BRACE_EXPANSION */
#if defined (BANG_HISTORY)
-H Enable ! style history substitution. This flag is on
by default.
#endif /* BANG_HISTORY */
-C If set, disallow existing regular files to be overwritten
by redirection of output.
-P If set, do not follow symbolic links when executing commands
such as cd which change the current directory.
Using + rather than - causes these flags to be turned off. The
flags can also be used upon invocation of the shell. The current
set of flags may be found in $-. The remaining n ARGs are positional
parameters and are assigned, in order, to $1, $2, .. $n. If no
ARGs are given, all shell variables are printed.
$END
/* An a-list used to match long options for set -o to the corresponding
option letter. */
struct {
char *name;
int letter;
} o_options[] = {
{ "allexport", 'a' },
#if defined (BRACE_EXPANSION)
{ "braceexpand",'B' },
#endif
{ "errexit", 'e' },
{ "histexpand", 'H' },
{ "monitor", 'm' },
{ "noexec", 'n' },
{ "noglob", 'f' },
{ "nohash", 'd' },
#if defined (JOB_CONTROL)
{ "notify", 'b' },
#endif /* JOB_CONTROL */
{"nounset", 'u' },
{"physical", 'P' },
{"privileged", 'p' },
{"verbose", 'v' },
{"xtrace", 'x' },
{(char *)NULL, 0},
};
#define MINUS_O_FORMAT "%-15s\t%s\n"
void
list_minus_o_opts ()
{
register int i;
char *on = "on", *off = "off";
printf (MINUS_O_FORMAT, "noclobber", (noclobber == 1) ? on : off);
if (find_variable ("ignoreeof") || find_variable ("IGNOREEOF"))
printf (MINUS_O_FORMAT, "ignoreeof", on);
else
printf (MINUS_O_FORMAT, "ignoreeof", off);
printf (MINUS_O_FORMAT, "interactive-comments",
interactive_comments ? on : off);
printf (MINUS_O_FORMAT, "posix", posixly_correct ? on : off);
#if defined (READLINE)
if (no_line_editing)
{
printf (MINUS_O_FORMAT, "emacs", off);
printf (MINUS_O_FORMAT, "vi", off);
}
else
{
/* Magic. This code `knows' how readline handles rl_editing_mode. */
printf (MINUS_O_FORMAT, "emacs", (rl_editing_mode == 1) ? on : off);
printf (MINUS_O_FORMAT, "vi", (rl_editing_mode == 0) ? on : off);
}
#endif /* READLINE */
for (i = 0; o_options[i].name; i++)
{
int *on_or_off, zero = 0;
on_or_off = find_flag (o_options[i].letter);
if (on_or_off == FLAG_UNKNOWN)
on_or_off = &zero;
printf (MINUS_O_FORMAT, o_options[i].name, (*on_or_off == 1) ? on : off);
}
}
set_minus_o_option (on_or_off, option_name)
int on_or_off;
char *option_name;
{
int option_char = -1;
if (STREQ (option_name, "noclobber"))
{
if (on_or_off == FLAG_ON)
bind_variable ("noclobber", "");
else
unbind_variable ("noclobber");
stupidly_hack_special_variables ("noclobber");
}
else if (STREQ (option_name, "ignoreeof"))
{
unbind_variable ("ignoreeof");
unbind_variable ("IGNOREEOF");
if (on_or_off == FLAG_ON)
bind_variable ("IGNOREEOF", "10");
stupidly_hack_special_variables ("IGNOREEOF");
}
#if defined (READLINE)
else if ((STREQ (option_name, "emacs")) || (STREQ (option_name, "vi")))
{
if (on_or_off == FLAG_ON)
{
rl_variable_bind ("editing-mode", option_name);
if (interactive)
with_input_from_stdin ();
no_line_editing = 0;
}
else
{
int isemacs = (rl_editing_mode == 1);
if ((isemacs && STREQ (option_name, "emacs")) ||
(!isemacs && STREQ (option_name, "vi")))
{
if (interactive)
with_input_from_stream (stdin, "stdin");
no_line_editing = 1;
}
else
builtin_error ("not in %s editing mode", option_name);
}
}
#endif /* READLINE */
else if (STREQ (option_name, "interactive-comments"))
interactive_comments = (on_or_off == FLAG_ON);
else if (STREQ (option_name, "posix"))
{
posixly_correct = (on_or_off == FLAG_ON);
unbind_variable ("POSIXLY_CORRECT");
unbind_variable ("POSIX_PEDANTIC");
if (on_or_off == FLAG_ON)
{
bind_variable ("POSIXLY_CORRECT", "");
stupidly_hack_special_variables ("POSIXLY_CORRECT");
}
}
else
{
register int i;
for (i = 0; o_options[i].name; i++)
{
if (STREQ (option_name, o_options[i].name))
{
option_char = o_options[i].letter;
break;
}
}
if (option_char == -1)
{
builtin_error ("%s: unknown option name", option_name);
return (EXECUTION_FAILURE);
}
if (change_flag (option_char, on_or_off) == FLAG_ERROR)
{
bad_option (option_name);
return (EXECUTION_FAILURE);
}
}
return (EXECUTION_SUCCESS);
}
/* Set some flags from the word values in the input list. If LIST is empty,
then print out the values of the variables instead. If LIST contains
non-flags, then set $1 - $9 to the successive words of LIST. */
set_builtin (list)
WORD_LIST *list;
{
int on_or_off, flag_name, force_assignment = 0;
if (!list)
{
SHELL_VAR **vars;
vars = all_shell_variables ();
if (vars)
{
print_var_list (vars);
free (vars);
}
vars = all_shell_functions ();
if (vars)
{
print_var_list (vars);
free (vars);
}
return (EXECUTION_SUCCESS);
}
/* Check validity of flag arguments. */
if (*list->word->word == '-' || *list->word->word == '+')
{
register char *arg;
WORD_LIST *save_list = list;
while (list && (arg = list->word->word))
{
char c;
if (arg[0] != '-' && arg[0] != '+')
break;
/* `-' or `--' signifies end of flag arguments. */
if (arg[0] == '-' &&
(!arg[1] || (arg[1] == '-' && !arg[2])))
break;
while (c = *++arg)
{
if (find_flag (c) == FLAG_UNKNOWN && c != 'o')
{
char s[2];
s[0] = c; s[1] = '\0';
bad_option (s);
if (c == '?')
builtin_usage ();
return (c == '?' ? EXECUTION_SUCCESS : EXECUTION_FAILURE);
}
}
list = list->next;
}
list = save_list;
}
/* Do the set command. While the list consists of words starting with
'-' or '+' treat them as flags, otherwise, start assigning them to
$1 ... $n. */
while (list)
{
char *string = list->word->word;
/* If the argument is `--' or `-' then signal the end of the list
and remember the remaining arguments. */
if (string[0] == '-' && (!string[1] || (string[1] == '-' && !string[2])))
{
list = list->next;
/* `set --' unsets the positional parameters. */
if (string[1] == '-')
force_assignment = 1;
/* Until told differently, the old shell behaviour of
`set - [arg ...]' being equivalent to `set +xv [arg ...]'
stands. Posix.2 says the behaviour is marked as obsolescent. */
else
{
change_flag ('x', '+');
change_flag ('v', '+');
}
break;
}
if ((on_or_off = *string) &&
(on_or_off == '-' || on_or_off == '+'))
{
int i = 1;
while (flag_name = string[i++])
{
if (flag_name == '?')
{
builtin_usage ();
return (EXECUTION_SUCCESS);
}
else if (flag_name == 'o') /* -+o option-name */
{
char *option_name;
WORD_LIST *opt;
opt = list->next;
if (!opt)
{
list_minus_o_opts ();
continue;
}
option_name = opt->word->word;
if (!option_name || !*option_name || (*option_name == '-'))
{
list_minus_o_opts ();
continue;
}
list = list->next; /* Skip over option name. */
if (set_minus_o_option (on_or_off, option_name) != EXECUTION_SUCCESS)
return (EXECUTION_FAILURE);
}
else
{
if (change_flag (flag_name, on_or_off) == FLAG_ERROR)
{
char opt[3];
opt[0] = on_or_off;
opt[1] = flag_name;
opt[2] = '\0';
bad_option (opt);
builtin_usage ();
return (EXECUTION_FAILURE);
}
}
}
}
else
{
break;
}
list = list->next;
}
/* Assigning $1 ... $n */
if (list || force_assignment)
remember_args (list, 1);
return (EXECUTION_SUCCESS);
}
$BUILTIN unset
$FUNCTION unset_builtin
$SHORT_DOC unset [-f] [-v] [name ...]
For each NAME, remove the corresponding variable or function. Given
the `-v', unset will only act on variables. Given the `-f' flag,
unset will only act on functions. With neither flag, unset first
tries to unset a variable, and if that fails, then tries to unset a
function. Some variables (such as PATH and IFS) cannot be unset; also
see readonly.
$END
#define NEXT_VARIABLE() any_failed++; list = list->next; continue;
unset_builtin (list)
WORD_LIST *list;
{
int unset_function, unset_variable, unset_array, opt, any_failed;
char *name;
unset_function = unset_variable = unset_array = any_failed = 0;
reset_internal_getopt ();
while ((opt = internal_getopt (list, "fv")) != -1)
{
switch (opt)
{
case 'f':
unset_function = 1;
break;
case 'v':
unset_variable = 1;
break;
default:
builtin_usage ();
return (EXECUTION_FAILURE);
}
}
list = loptend;
if (unset_function && unset_variable)
{
builtin_error ("cannot simultaneously unset a function and a variable");
return (EXECUTION_FAILURE);
}
while (list)
{
SHELL_VAR *var;
int tem;
#if defined (ARRAY_VARS)
char *t;
#endif
name = list->word->word;
#if defined (ARRAY_VARS)
if (!unset_function && valid_array_reference (name))
{
t = strchr (name, '[');
*t++ = '\0';
unset_array++;
}
#endif
var = unset_function ? find_function (name) : find_variable (name);
if (var && !unset_function && non_unsettable_p (var))
{
builtin_error ("%s: cannot unset", name);
NEXT_VARIABLE ();
}
/* Posix.2 says that unsetting readonly variables is an error. */
if (var && readonly_p (var))
{
builtin_error ("%s: cannot unset: readonly %s",
name, unset_function ? "function" : "variable");
NEXT_VARIABLE ();
}
/* Unless the -f option is supplied, the name refers to a variable. */
#if defined (ARRAY_VARS)
if (var && unset_array)
{
if (array_p (var) == 0)
{
builtin_error ("%s: not an array variable", name);
NEXT_VARIABLE ();
}
else
tem = unbind_array_element (var, t);
}
else
#endif /* ARRAY_VARS */
tem = makunbound (name, unset_function ? shell_functions : shell_variables);
/* This is what Posix.2 draft 11+ says. ``If neither -f nor -v
is specified, the name refers to a variable; if a variable by
that name does not exist, a function by that name, if any,
shall be unset.'' */
if ((tem == -1) && !unset_function && !unset_variable)
tem = makunbound (name, shell_functions);
if (tem == -1)
any_failed++;
else if (!unset_function)
stupidly_hack_special_variables (name);
list = list->next;
}
if (any_failed)
return (EXECUTION_FAILURE);
else
return (EXECUTION_SUCCESS);
}
+50
View File
@@ -0,0 +1,50 @@
/* unwind_prot.h - Macros and functions for hacking unwind protection. */
/* Copyright (C) 1993 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (_UNWIND_PROT_H)
#define _UNWIND_PROT_H
/* Run a function without interrupts. */
extern void begin_unwind_frame ();
extern void discard_unwind_frame ();
extern void run_unwind_frame ();
extern void add_unwind_protect ();
extern void remove_unwind_protect ();
extern void run_unwind_protects ();
extern void unwind_protect_var ();
/* Define for people who like their code to look a certain way. */
#define end_unwind_frame()
/* How to protect an integer. */
#define unwind_protect_int(X) unwind_protect_var (&(X), (char *)(X), sizeof (int))
/* How to protect a pointer to a string. */
#define unwind_protect_string(X) \
unwind_protect_var ((int *)&(X), (X), sizeof (char *))
/* How to protect any old pointer. */
#define unwind_protect_pointer(X) unwind_protect_string (X)
/* How to protect the contents of a jmp_buf. */
#define unwind_protect_jmp_buf(X) \
unwind_protect_var ((int *)(X), (char *)(X), sizeof (procenv_t))
#endif /* _UNWIND_PROT_H */
+1 -1
View File
@@ -1,4 +1,4 @@
# Makefile for bash-4.2, version 4.9
# Makefile for bash-4.3, version 4.10
#
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+166
View File
@@ -1,3 +1,169 @@
This is a terse description of the new features added to bash-4.3 since
the release of bash-4.2. As always, the manual page (doc/bash.1) is
the place to look for complete descriptions.
1. New Features in Bash
a. The `helptopic' completion action now maps to all the help topics, not just
the shell builtins.
b. The `help' builtin no longer does prefix substring matching, so `help read'
does not match `readonly'.
c. The shell can be compiled to not display a message about processes that
terminate due to SIGTERM.
d. Non-interactive shells now react to the setting of checkwinsize and set
LINES and COLUMNS after a foreground job exits.
e. There is a new shell option, `globasciiranges', which, when set to on,
forces globbing range comparisons to use character ordering as if they
were run in the C locale.
f. There is a new shell option, `direxpand', which makes filename completion
expand variables in directory names in the way bash-4.1 did.
g. In Posix mode, the `command' builtin does not change whether or not a
builtin it shadows is treated as an assignment builtin.
h. The `return' and `exit' builtins accept negative exit status arguments.
i. The word completion code checks whether or not a filename containing a
shell variable expands to a directory name and appends `/' to the word
as appropriate. The same code expands shell variables in command names
when performing command completion.
j. In Posix mode, it is now an error to attempt to define a shell function
with the same name as a Posix special builtin.
k. When compiled for strict Posix conformance, history expansion is disabled
by default.
l. The history expansion character (!) does not cause history expansion when
followed by the closing quote in a double-quoted string.
m. `complete' and its siblings compgen/compopt now takes a new `-o noquote'
option to inhibit quoting of the completions.
n. Setting HISTSIZE to a value less than zero causes the history list to be
unlimited (setting it 0 zero disables the history list).
o. Setting HISTFILESIZE to a value less than zero causes the history file size
to be unlimited (setting it to 0 causes the history file to be truncated
to zero size).
p. The `read' builtin now skips NUL bytes in the input.
q. There is a new `bind -X' option to print all key sequences bound to Unix
commands.
r. When in Posix mode, `read' is interruptible by a trapped signal. After
running the trap handler, read returns 128+signal and throws away any
partially-read input.
s. The command completion code skips whitespace and assignment statements
before looking for the command name word to be completed.
t. The build process has a new mechanism for constructing separate help files
that better reflects the current set of compilation options.
u. The -nt and -ot options to test now work with files with nanosecond
timestamp resolution.
v. The shell saves the command history in any shell for which history is
enabled and HISTFILE is set, not just interactive shells.
w. The shell has `nameref' variables and new -n(/+n) options to declare and
unset to use them, and a `test -R' option to test for them.
x. The shell now allows assigning, referencing, and unsetting elements of
indexed arrays using negative subscripts (a[-1]=2, echo ${a[-1]}) which
count back from the last element of the array.
y. The {x}<word redirection feature now allows words like {array[ind]} and
can use variables with special meanings to the shell (e.g., BASH_XTRACEFD).
z. There is a new CHILD_MAX special shell variable; its value controls the
number of exited child statues the shell remembers.
aa. There is a new configuration option (--enable-direxpand-default) that
causes the `direxpand' shell option to be enabled by default.
bb. Bash does not do anything special to ensure that the file descriptor
assigned to X in {x}<foo remains open after the block containing it
completes.
cc. The `wait' builtin has a new `-n' option to wait for the next child to
change status.
dd. The `printf' %(...)T format specifier now uses the current time if no
argument is supplied.
ee. There is a new variable, BASH_COMPAT, that controls the current shell
compatibility level.
ff. The `popd' builtin now treats additional arguments as errors.
gg. The brace expansion code now treats a failed sequence expansion as a
simple string and will continue to expand brace terms in the remainder
of the word.
2. New Features in Readline
a. Readline is now more responsive to SIGHUP and other fatal signals when
reading input from the terminal or performing word completion but no
longer attempts to run any not-allowable functions from a signal handler
context.
b. There are new bindable commands to search the history for the string of
characters between the beginning of the line and the point
(history-substring-search-forward, history-substring-search-backward)
c. Readline allows quoted strings as the values of variables when setting
them with `set'. As a side effect, trailing spaces and tabs are ignored
when setting a string variable's value.
d. The history library creates a backup of the history file when writing it
and restores the backup on a write error.
e. New application-settable variable: rl_filename_stat_hook: a function called
with a filename before using it in a call to stat(2). Bash uses it to
expand shell variables so things like $HOME/Downloads have a slash
appended.
f. New bindable function `print-last-kbd-macro', prints the most-recently-
defined keyboard macro in a reusable format.
g. New user-settable variable `colored-stats', enables use of colored text
to denote file types when displaying possible completions (colored analog
of visible-stats).
h. New user-settable variable `keyseq-timout', acts as an inter-character
timeout when reading input or incremental search strings.
i. New application-callable function: rl_clear_history. Clears the history list
and frees all readline-associated private data.
j. New user-settable variable, show-mode-in-prompt, adds a characters to the
beginning of the prompt indicating the current editing mode.
k. New application-settable variable: rl_input_available_hook; function to be
called when readline detects there is data available on its input file
descriptor.
l. Readline calls an application-set event hook (rl_event_hook) after it gets
a signal while reading input (read returns -1/EINTR but readline does not
handle the signal immediately) to allow the application to handle or
otherwise note it.
m. If the user-settable variable `history-size' is set to a value less than
0, the history list size is unlimited.
n. New application-settable variable: rl_signal_event_hook; function that is
called when readline is reading terminal input and read(2) is interrupted
by a signal. Currently not called for SIGHUP or SIGTERM.
-------------------------------------------------------------------------------
This is a terse description of the new features added to bash-4.2 since
the release of bash-4.1. As always, the manual page (doc/bash.1) is
the place to look for complete descriptions.
+2 -1
View File
@@ -6,7 +6,7 @@ Platform-Specific Configuration and Operation Notes
alpha running OSF/1, Linux, or NetBSD (malloc needs 8-byte alignment;
bash malloc has 8-byte alignment now, but I have no alphas to test on)
next running NeXT/OS
next running NeXT/OS; machines running Openstep
all machines running SunOS YP code: SunOS4, SunOS5, HP/UX, if you
have problems with username completion or tilde expansion for
@@ -20,6 +20,7 @@ Platform-Specific Configuration and Operation Notes
sparc SVR4, SVR4.2 (ICL reference port)
DG/UX
Cray
Haiku OS
NetBSD/sparc (malloc needs 8-byte alignment; bash malloc has 8-byte
alignment now, but I have no NetBSD machines to test on)
+1 -1
View File
@@ -13380,7 +13380,7 @@ if test $bash_cv_type_socklen_t = yes; then
fi
if test $bash_cv_type_socklen_t = no; then
cat >>confdefs.h <<_ACEOF
@%:@define socklen_t int
@%:@define socklen_t unsigned int
_ACEOF
fi
+71 -71
View File
@@ -15,55 +15,55 @@
'configure.in'
],
{
'AM_PROG_F77_C_O' => 1,
'_LT_AC_TAGCONFIG' => 1,
'm4_pattern_forbid' => 1,
'AM_PROG_F77_C_O' => 1,
'AC_INIT' => 1,
'AC_CANONICAL_TARGET' => 1,
'm4_pattern_forbid' => 1,
'_AM_COND_IF' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_CANONICAL_TARGET' => 1,
'AC_SUBST' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_FC_SRCEXT' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_PROG_LIBTOOL' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_PATH_GUILE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'LT_SUPPORTED_TAG' => 1,
'AC_CONFIG_LINKS' => 1,
'm4_sinclude' => 1,
'LT_SUPPORTED_TAG' => 1,
'AM_MAINTAINER_MODE' => 1,
'AM_NLS' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'_m4_warn' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'_m4_warn' => 1,
'AM_PROG_CXX_C_O' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'_AM_COND_ENDIF' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_SILENT_RULES' => 1,
'AM_PROG_MOC' => 1,
'AC_CONFIG_FILES' => 1,
'LT_INIT' => 1,
'include' => 1,
'AM_GNU_GETTEXT' => 1,
'LT_INIT' => 1,
'AM_PROG_AR' => 1,
'AM_GNU_GETTEXT' => 1,
'AC_LIBSOURCE' => 1,
'AC_CANONICAL_BUILD' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_CANONICAL_BUILD' => 1,
'AC_FC_FREEFORM' => 1,
'AH_OUTPUT' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'm4_pattern_allow' => 1,
'AM_PROG_CC_C_O' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'sinclude' => 1,
'AM_CONDITIONAL' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_PROG_CC_C_O' => 1,
'm4_pattern_allow' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_CONDITIONAL' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AM_POT_TOOLS' => 1,
@@ -84,55 +84,55 @@
'configure.in'
],
{
'_LT_AC_TAGCONFIG' => 1,
'AM_PROG_F77_C_O' => 1,
'AC_INIT' => 1,
'_LT_AC_TAGCONFIG' => 1,
'm4_pattern_forbid' => 1,
'_AM_COND_IF' => 1,
'AC_INIT' => 1,
'AC_CANONICAL_TARGET' => 1,
'AC_SUBST' => 1,
'_AM_COND_IF' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_FC_SRCEXT' => 1,
'AC_SUBST' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_FC_SRCEXT' => 1,
'AC_PROG_LIBTOOL' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AM_PATH_GUILE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_PATH_GUILE' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'AC_CONFIG_LINKS' => 1,
'm4_sinclude' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'LT_SUPPORTED_TAG' => 1,
'm4_sinclude' => 1,
'AM_MAINTAINER_MODE' => 1,
'AM_NLS' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'_m4_warn' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'AM_PROG_CXX_C_O' => 1,
'_AM_COND_ENDIF' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'_AM_COND_ENDIF' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_SILENT_RULES' => 1,
'AM_PROG_MOC' => 1,
'AC_CONFIG_FILES' => 1,
'include' => 1,
'LT_INIT' => 1,
'AM_PROG_AR' => 1,
'include' => 1,
'AM_GNU_GETTEXT' => 1,
'AM_PROG_AR' => 1,
'AC_LIBSOURCE' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_CANONICAL_BUILD' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_FC_FREEFORM' => 1,
'AH_OUTPUT' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'sinclude' => 1,
'AM_PROG_CC_C_O' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'm4_pattern_allow' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_PROG_CC_C_O' => 1,
'sinclude' => 1,
'AM_CONDITIONAL' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AM_POT_TOOLS' => 1,
@@ -155,19 +155,19 @@
{
'm4_pattern_forbid' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_TYPE_OFF_T' => 1,
'AC_C_VOLATILE' => 1,
'AC_TYPE_OFF_T' => 1,
'AC_FUNC_CLOSEDIR_VOID' => 1,
'AC_REPLACE_FNMATCH' => 1,
'AC_PROG_LIBTOOL' => 1,
'AC_FUNC_STAT' => 1,
'AC_HEADER_TIME' => 1,
'AC_FUNC_WAIT3' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AC_STRUCT_TM' => 1,
'AC_HEADER_TIME' => 1,
'AC_FUNC_LSTAT' => 1,
'AC_TYPE_MODE_T' => 1,
'AC_STRUCT_TM' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AC_FUNC_GETMNTENT' => 1,
'AC_TYPE_MODE_T' => 1,
'AC_FUNC_STRTOD' => 1,
'AC_CHECK_HEADERS' => 1,
'AC_FUNC_STRNLEN' => 1,
@@ -186,17 +186,17 @@
'AC_STRUCT_ST_BLOCKS' => 1,
'AC_TYPE_SIGNAL' => 1,
'AC_TYPE_UID_T' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'AC_PROG_MAKE_SET' => 1,
'sinclude' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'm4_pattern_allow' => 1,
'sinclude' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AC_FUNC_STRERROR_R' => 1,
'AC_PROG_CC' => 1,
'AC_FUNC_FORK' => 1,
'AC_DECL_SYS_SIGLIST' => 1,
'AC_FUNC_VPRINTF' => 1,
'AC_FUNC_FORK' => 1,
'AC_FUNC_STRCOLL' => 1,
'AC_FUNC_VPRINTF' => 1,
'AC_PROG_YACC' => 1,
'AC_INIT' => 1,
'AC_STRUCT_TIMEZONE' => 1,
@@ -218,33 +218,33 @@
'AM_MAINTAINER_MODE' => 1,
'AC_FUNC_UTIME_NULL' => 1,
'AC_FUNC_SELECT_ARGTYPES' => 1,
'AC_FUNC_STRFTIME' => 1,
'AC_HEADER_STAT' => 1,
'AC_C_INLINE' => 1,
'AC_FUNC_STRFTIME' => 1,
'AC_PROG_CPP' => 1,
'AC_TYPE_PID_T' => 1,
'AC_C_CONST' => 1,
'AC_C_INLINE' => 1,
'AC_PROG_LEX' => 1,
'AC_C_CONST' => 1,
'AC_TYPE_PID_T' => 1,
'AC_CONFIG_FILES' => 1,
'include' => 1,
'AC_FUNC_SETVBUF_REVERSED' => 1,
'AC_PROG_INSTALL' => 1,
'AM_GNU_GETTEXT' => 1,
'AC_FUNC_OBSTACK' => 1,
'AC_CHECK_LIB' => 1,
'AC_FUNC_OBSTACK' => 1,
'AC_FUNC_MALLOC' => 1,
'AC_FUNC_GETGROUPS' => 1,
'AC_FUNC_GETLOADAVG' => 1,
'AH_OUTPUT' => 1,
'AC_FUNC_FSEEKO' => 1,
'AM_PROG_CC_C_O' => 1,
'AM_CONDITIONAL' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AC_FUNC_MKTIME' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_CONDITIONAL' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_HEADER_SYS_WAIT' => 1,
'AC_FUNC_MEMCMP' => 1,
'AC_PROG_LN_S' => 1,
'AC_FUNC_MEMCMP' => 1,
'm4_include' => 1,
'AC_HEADER_DIRENT' => 1,
'AC_CHECK_FUNCS' => 1
@@ -262,55 +262,55 @@
'configure.ac'
],
{
'_LT_AC_TAGCONFIG' => 1,
'AM_PROG_F77_C_O' => 1,
'AC_INIT' => 1,
'_LT_AC_TAGCONFIG' => 1,
'm4_pattern_forbid' => 1,
'_AM_COND_IF' => 1,
'AC_INIT' => 1,
'AC_CANONICAL_TARGET' => 1,
'AC_SUBST' => 1,
'_AM_COND_IF' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_FC_SRCEXT' => 1,
'AC_SUBST' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_FC_SRCEXT' => 1,
'AC_PROG_LIBTOOL' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AM_PATH_GUILE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_PATH_GUILE' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'AC_CONFIG_LINKS' => 1,
'm4_sinclude' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'LT_SUPPORTED_TAG' => 1,
'm4_sinclude' => 1,
'AM_MAINTAINER_MODE' => 1,
'AM_NLS' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'_m4_warn' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'AM_PROG_CXX_C_O' => 1,
'_AM_COND_ENDIF' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'_AM_COND_ENDIF' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_SILENT_RULES' => 1,
'AM_PROG_MOC' => 1,
'AC_CONFIG_FILES' => 1,
'include' => 1,
'LT_INIT' => 1,
'AM_PROG_AR' => 1,
'include' => 1,
'AM_GNU_GETTEXT' => 1,
'AM_PROG_AR' => 1,
'AC_LIBSOURCE' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_CANONICAL_BUILD' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_FC_FREEFORM' => 1,
'AH_OUTPUT' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'sinclude' => 1,
'AM_PROG_CC_C_O' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'm4_pattern_allow' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_PROG_CC_C_O' => 1,
'sinclude' => 1,
'AM_CONDITIONAL' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AM_POT_TOOLS' => 1,
+6 -1
View File
@@ -306,13 +306,16 @@ declare_internal (list, local_var)
that is specific to nameref variables. */
if (flags_on & att_nameref)
{
#if defined (ARRAY_VARIABLES)
if (valid_array_reference (name))
{
builtin_error (_("%s: reference variable cannot be an array"), name);
assign_error++;
NEXT_VARIABLE ();
}
else if (STREQ (name, value))
else
#endif
if (STREQ (name, value))
{
builtin_error (_("%s: nameref variable self references not allowed"), name);
assign_error++;
@@ -600,10 +603,12 @@ declare_internal (list, local_var)
using a single typeset command. */
onref = (flags_on & att_nameref);
flags_on &= ~att_nameref;
#if defined (ARRAY_VARS)
if (array_p (var) || assoc_p (var)
|| (offset && compound_array_assign)
|| simple_array_assign)
onref = 0; /* array variables may not be namerefs */
#endif
/* ksh93 seems to do this */
offref = (flags_off & att_nameref);
Vendored
+1 -1
View File
@@ -13380,7 +13380,7 @@ if test $bash_cv_type_socklen_t = yes; then
fi
if test $bash_cv_type_socklen_t = no; then
cat >>confdefs.h <<_ACEOF
#define socklen_t int
#define socklen_t unsigned int
_ACEOF
fi
+1 -1
View File
@@ -933,7 +933,7 @@ BASH_CHECK_TYPE(quad_t, , long, HAVE_QUAD_T)
BASH_CHECK_TYPE(intmax_t, , $bash_cv_type_long_long)
BASH_CHECK_TYPE(uintmax_t, , $bash_cv_type_unsigned_long_long)
if test "$ac_cv_header_sys_socket_h" = "yes"; then
BASH_CHECK_TYPE(socklen_t, [#include <sys/socket.h>], int, HAVE_SOCKLEN_T)
BASH_CHECK_TYPE(socklen_t, [#include <sys/socket.h>], [unsigned int], HAVE_SOCKLEN_T)
fi
BASH_TYPE_RLIMIT
+42
View File
@@ -0,0 +1,42 @@
# This file is a shell script that caches the results of configure
# tests for CYGWIN32 so they don't need to be done when cross-compiling.
# AC_FUNC_GETPGRP should also define GETPGRP_VOID
ac_cv_func_getpgrp_void=${ac_cv_func_getpgrp_void='yes'}
# AC_FUNC_SETVBUF_REVERSED should not define anything else
ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed='no'}
# on CYGWIN32, system calls do not restart
ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls='no'}
bash_cv_sys_restartable_syscalls=${bash_cv_sys_restartable_syscalls='no'}
# these may be necessary, but they are currently commented out
#ac_cv_c_bigendian=${ac_cv_c_bigendian='no'}
ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p='4'}
ac_cv_sizeof_int=${ac_cv_sizeof_int='4'}
ac_cv_sizeof_long=${ac_cv_sizeof_long='4'}
ac_cv_sizeof_double=${ac_cv_sizeof_double='8'}
bash_cv_dup2_broken=${bash_cv_dup2_broken='no'}
bash_cv_pgrp_pipe=${bash_cv_pgrp_pipe='no'}
bash_cv_type_rlimit=${bash_cv_type_rlimit='long'}
bash_cv_decl_under_sys_siglist=${bash_cv_decl_under_sys_siglist='no'}
bash_cv_under_sys_siglist=${bash_cv_under_sys_siglist='no'}
bash_cv_sys_siglist=${bash_cv_sys_siglist='no'}
bash_cv_opendir_not_robust=${bash_cv_opendir_not_robust='no'}
bash_cv_getenv_redef=${bash_cv_getenv_redef='yes'}
bash_cv_printf_declared=${bash_cv_printf_declared='yes'}
bash_cv_ulimit_maxfds=${bash_cv_ulimit_maxfds='no'}
bash_cv_getcwd_calls_popen=${bash_cv_getcwd_calls_popen='no'}
bash_cv_must_reinstall_sighandlers=${bash_cv_must_reinstall_sighandlers='no'}
bash_cv_job_control_missing=${bash_cv_job_control_missing='present'}
bash_cv_sys_named_pipes=${bash_cv_sys_named_pipes='missing'}
bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp='missing'}
bash_cv_mail_dir=${bash_cv_mail_dir='unknown'}
bash_cv_func_strcoll_broken=${bash_cv_func_strcoll_broken='no'}
bash_cv_type_int32_t=${bash_cv_type_int32_t='int'}
bash_cv_type_u_int32_t=${bash_cv_type_u_int32_t='int'}
ac_cv_type_bits64_t=${ac_cv_type_bits64_t='no'}
# end of cross-build/cygwin32.cache
+1745
View File
File diff suppressed because it is too large Load Diff
+11 -6
View File
@@ -97,7 +97,9 @@ OOPPTTIIOONNSS
----ppoossiixx
Change the behavior of bbaasshh where the default operation differs
from the POSIX standard to match the standard (_p_o_s_i_x _m_o_d_e).
from the POSIX standard to match the standard (_p_o_s_i_x _m_o_d_e). See
SSEEEE AALLSSOO below for a reference to a document that details how
posix mode affects bash's behavior.
----rreessttrriicctteedd
The shell becomes restricted (see RREESSTTRRIICCTTEEDD SSHHEELLLL below).
@@ -1025,7 +1027,7 @@ PPAARRAAMMEETTEERRSS
CCHHIILLDD__MMAAXX
Set the number of exited child status values for the shell to
remember. Bash will not allow this value to be decreased below
a Posix-mandated minimum, and there is a maximum value (cur-
a POSIX-mandated minimum, and there is a maximum value (cur-
rently 8192) that this may not exceed. The minimum value is
system-dependent.
CCOOLLUUMMNNSS
@@ -4874,7 +4876,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS
Without options, the name and value of each shell variable are
displayed in a format that can be reused as input for setting or
resetting the currently-set variables. Read-only variables can-
not be reset. In _p_o_s_i_x _m_o_d_e, only shell variables are listed.
not be reset. In _p_o_s_i_x mode, only shell variables are listed.
The output is sorted according to the current locale. When
options are specified, they set or unset shell attributes. Any
arguments remaining after option processing are treated as val-
@@ -4976,7 +4978,9 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS
is disabled by default.
ppoossiixx Change the behavior of bbaasshh where the default
operation differs from the POSIX standard to
match the standard (_p_o_s_i_x _m_o_d_e).
match the standard (_p_o_s_i_x _m_o_d_e). See SSEEEE AALLSSOO
below for a reference to a document that details
how posix mode affects bash's behavior.
pprriivviilleeggeedd
Same as --pp.
vveerrbboossee Same as --vv.
@@ -5145,7 +5149,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS
rupt; previous versions continue with the next command
in the list.
ccoommppaatt4411
If set, bbaasshh, when in posix mode, treats a single quote
If set, bbaasshh, when in _p_o_s_i_x mode, treats a single quote
in a double-quoted parameter expansion as a special
character. The single quotes must match (an even num-
ber) and the characters between the single quotes are
@@ -5618,6 +5622,7 @@ SSEEEE AALLSSOO
_T_h_e _G_n_u _H_i_s_t_o_r_y _L_i_b_r_a_r_y, Brian Fox and Chet Ramey
_P_o_r_t_a_b_l_e _O_p_e_r_a_t_i_n_g _S_y_s_t_e_m _I_n_t_e_r_f_a_c_e _(_P_O_S_I_X_) _P_a_r_t _2_: _S_h_e_l_l _a_n_d _U_t_i_l_i_-
_t_i_e_s, IEEE
http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode
_s_h(1), _k_s_h(1), _c_s_h(1)
_e_m_a_c_s(1), _v_i(1)
_r_e_a_d_l_i_n_e(3)
@@ -5693,4 +5698,4 @@ BBUUGGSS
GNU Bash 4.2 2013 January 8 BASH(1)
GNU Bash 4.2 2013 March 4 BASH(1)
+11 -4
View File
@@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
.\" Last Change: Sun Mar 10 12:10:16 EDT 2013
.\" Last Change: Thu Mar 21 10:09:25 EDT 2013
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2013 March 10" "GNU Bash 4.3"
.TH BASH 1 "2013 March 21" "GNU Bash 4.3"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -1871,8 +1871,9 @@ below.
.TP
.B BASH_COMPAT
The value is used to set the shell's compatibility level.
See the description of the \fBshopt\fB builtin below under
\fBSHELL BUILTIN COMMANDS\fP for a description of the various compatibility
See the description of the \fBshopt\fP builtin below under
\fBSHELL BUILTIN COMMANDS\fP
for a description of the various compatibility
levels and their effects.
The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42)
corresponding to the desired compatibility level.
@@ -2536,6 +2537,12 @@ array, and an index of \-1 references the last element.
An array variable is considered set if a subscript has been assigned a
value. The null string is a valid value.
.PP
It is possible to obtain the keys (indices) of an array as well as the values.
${\fB!\fP\fIname\fP[\fI@\fP]} and ${\fB!\fP\fIname\fP[\fI*\fP]}
expand to the indices assigned in array variable \fIname\fP.
The treatment when in double quotes is similar to the expansion of the
special parameters \fI@\fP and \fI*\fP within double quotes.
.PP
The
.B unset
builtin is used to destroy arrays. \fBunset\fP \fIname\fP[\fIsubscript\fP]
+19 -6
View File
@@ -3,7 +3,7 @@
</HEAD>
<BODY><TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2013 January 8<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2013 March 4<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<BR><A HREF="#index">Index</A>
@@ -275,6 +275,12 @@ This option is on by default if the shell is invoked as
<DD>
Change the behavior of <B>bash</B> where the default operation differs
from the POSIX standard to match the standard (<I>posix mode</I>).
See
<FONT SIZE=-1><B>SEE ALSO</B>
</FONT>
below for a reference to a document that details how posix mode affects
bash's behavior.
<DT><B>--restricted</B>
<DD>
@@ -2467,7 +2473,7 @@ A sample value is
<DD>
Set the number of exited child status values for the shell to remember.
Bash will not allow this value to be decreased below a Posix-mandated
Bash will not allow this value to be decreased below a POSIX-mandated
minimum, and there is a maximum value (currently 8192) that this may
not exceed.
The minimum value is system-dependent.
@@ -11086,7 +11092,7 @@ Without options, the name and value of each shell variable are displayed
in a format that can be reused as input
for setting or resetting the currently-set variables.
Read-only variables cannot be reset.
In <I>posix mode</I>, only shell variables are listed.
In <I>posix</I> mode, only shell variables are listed.
The output is sorted according to the current locale.
When options are specified, they set or unset shell attributes.
Any arguments remaining after option processing are treated
@@ -11359,6 +11365,12 @@ Change the behavior of
where the default operation differs
from the POSIX standard to match the standard (<I>posix mode</I>).
See
<FONT SIZE=-1><B>SEE ALSO</B>
</FONT>
below for a reference to a document that details how posix mode affects
bash's behavior.
<DT><B>privileged</B>
<DD>
@@ -11774,7 +11786,7 @@ interrupt; previous versions continue with the next command in the list.
If set,
<B>bash</B>,
when in posix mode, treats a single quote in a double-quoted
when in <I>posix</I> mode, treats a single quote in a double-quoted
parameter expansion as a special character. The single quotes must match
(an even number) and the characters between the single quotes are considered
quoted. This is the behavior of posix mode through version 4.1.
@@ -12959,6 +12971,7 @@ script.
<DT><I>The Gnu Readline Library</I>, Brian Fox and Chet Ramey<DD>
<DT><I>The Gnu History Library</I>, Brian Fox and Chet Ramey<DD>
<DT><I>Portable Operating System Interface (POSIX) Part 2: Shell and Utilities</I>, IEEE<DD>
<DT><A HREF="http://tiswww.case.edu/~chet/bash/POSIX">http://tiswww.case.edu/~chet/bash/POSIX</A> -- a description of posix mode<DD>
<DT><I>sh</I>(1), <I>ksh</I>(1), <I>csh</I>(1)<DD>
<DT><I>emacs</I>(1), <I>vi</I>(1)<DD>
<DT><I>readline</I>(3)<DD>
@@ -13111,7 +13124,7 @@ There may be only one active coprocess at a time.
<HR>
<TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>GNU Bash 4.2<TH ALIGN=CENTER width=33%>2013 January 8<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>GNU Bash 4.2<TH ALIGN=CENTER width=33%>2013 March 4<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<HR>
@@ -13217,6 +13230,6 @@ There may be only one active coprocess at a time.
</DL>
<HR>
This document was created by man2html from bash.1.<BR>
Time: 11 January 2013 16:34:33 EST
Time: 08 March 2013 15:57:13 EST
</BODY>
</HTML>
BIN
View File
Binary file not shown.
+4577 -4569
View File
File diff suppressed because it is too large Load Diff
+19 -19
View File
@@ -72,7 +72,7 @@
@xrdef{GNU Parallel-pg}{15}
@xrdef{Shell Functions-title}{Shell Functions}
@xrdef{Shell Functions-snt}{Section@tie 3.3}
@xrdef{Shell Functions-pg}{16}
@xrdef{Shell Functions-pg}{17}
@xrdef{Shell Parameters-title}{Shell Parameters}
@xrdef{Shell Parameters-snt}{Section@tie 3.4}
@xrdef{Shell Parameters-pg}{18}
@@ -81,37 +81,37 @@
@xrdef{Special Parameters-title}{Special Parameters}
@xrdef{Special Parameters-snt}{Section@tie 3.4.2}
@xrdef{Positional Parameters-pg}{19}
@xrdef{Special Parameters-pg}{19}
@xrdef{Shell Expansions-title}{Shell Expansions}
@xrdef{Shell Expansions-snt}{Section@tie 3.5}
@xrdef{Special Parameters-pg}{20}
@xrdef{Shell Expansions-pg}{20}
@xrdef{Brace Expansion-title}{Brace Expansion}
@xrdef{Brace Expansion-snt}{Section@tie 3.5.1}
@xrdef{Shell Expansions-pg}{20}
@xrdef{Brace Expansion-pg}{21}
@xrdef{Tilde Expansion-title}{Tilde Expansion}
@xrdef{Tilde Expansion-snt}{Section@tie 3.5.2}
@xrdef{Brace Expansion-pg}{21}
@xrdef{Tilde Expansion-pg}{21}
@xrdef{Tilde Expansion-pg}{22}
@xrdef{Shell Parameter Expansion-title}{Shell Parameter Expansion}
@xrdef{Shell Parameter Expansion-snt}{Section@tie 3.5.3}
@xrdef{Shell Parameter Expansion-pg}{22}
@xrdef{Shell Parameter Expansion-pg}{23}
@xrdef{Command Substitution-title}{Command Substitution}
@xrdef{Command Substitution-snt}{Section@tie 3.5.4}
@xrdef{Command Substitution-pg}{27}
@xrdef{Arithmetic Expansion-title}{Arithmetic Expansion}
@xrdef{Arithmetic Expansion-snt}{Section@tie 3.5.5}
@xrdef{Process Substitution-title}{Process Substitution}
@xrdef{Process Substitution-snt}{Section@tie 3.5.6}
@xrdef{Command Substitution-pg}{28}
@xrdef{Arithmetic Expansion-pg}{28}
@xrdef{Word Splitting-title}{Word Splitting}
@xrdef{Word Splitting-snt}{Section@tie 3.5.7}
@xrdef{Arithmetic Expansion-pg}{28}
@xrdef{Process Substitution-pg}{28}
@xrdef{Word Splitting-pg}{28}
@xrdef{Filename Expansion-title}{Filename Expansion}
@xrdef{Filename Expansion-snt}{Section@tie 3.5.8}
@xrdef{Process Substitution-pg}{29}
@xrdef{Word Splitting-pg}{29}
@xrdef{Filename Expansion-pg}{29}
@xrdef{Pattern Matching-title}{Pattern Matching}
@xrdef{Pattern Matching-snt}{Section@tie 3.5.8.1}
@xrdef{Filename Expansion-pg}{29}
@xrdef{Pattern Matching-pg}{29}
@xrdef{Pattern Matching-pg}{30}
@xrdef{Quote Removal-title}{Quote Removal}
@xrdef{Quote Removal-snt}{Section@tie 3.5.9}
@xrdef{Redirections-title}{Redirections}
@@ -122,26 +122,26 @@
@xrdef{Executing Commands-snt}{Section@tie 3.7}
@xrdef{Simple Command Expansion-title}{Simple Command Expansion}
@xrdef{Simple Command Expansion-snt}{Section@tie 3.7.1}
@xrdef{Executing Commands-pg}{34}
@xrdef{Simple Command Expansion-pg}{34}
@xrdef{Command Search and Execution-title}{Command Search and Execution}
@xrdef{Command Search and Execution-snt}{Section@tie 3.7.2}
@xrdef{Command Search and Execution-pg}{35}
@xrdef{Executing Commands-pg}{35}
@xrdef{Simple Command Expansion-pg}{35}
@xrdef{Command Execution Environment-title}{Command Execution Environment}
@xrdef{Command Execution Environment-snt}{Section@tie 3.7.3}
@xrdef{Command Search and Execution-pg}{36}
@xrdef{Command Execution Environment-pg}{36}
@xrdef{Environment-title}{Environment}
@xrdef{Environment-snt}{Section@tie 3.7.4}
@xrdef{Environment-pg}{37}
@xrdef{Exit Status-title}{Exit Status}
@xrdef{Exit Status-snt}{Section@tie 3.7.5}
@xrdef{Environment-pg}{37}
@xrdef{Exit Status-pg}{37}
@xrdef{Signals-title}{Signals}
@xrdef{Signals-snt}{Section@tie 3.7.6}
@xrdef{Exit Status-pg}{38}
@xrdef{Signals-pg}{38}
@xrdef{Shell Scripts-title}{Shell Scripts}
@xrdef{Shell Scripts-snt}{Section@tie 3.8}
@xrdef{Signals-pg}{38}
@xrdef{Shell Scripts-pg}{38}
@xrdef{Shell Scripts-pg}{39}
@xrdef{Shell Builtin Commands-title}{Shell Builtin Commands}
@xrdef{Shell Builtin Commands-snt}{Chapter@tie 4}
@xrdef{Bourne Shell Builtins-title}{Bourne Shell Builtins}
+17 -17
View File
@@ -37,40 +37,40 @@
\entry{commands, conditional}{10}{commands, conditional}
\entry{commands, grouping}{14}{commands, grouping}
\entry{coprocess}{15}{coprocess}
\entry{shell function}{16}{shell function}
\entry{functions, shell}{16}{functions, shell}
\entry{shell function}{17}{shell function}
\entry{functions, shell}{17}{functions, shell}
\entry{parameters}{18}{parameters}
\entry{variable, shell}{18}{variable, shell}
\entry{shell variable}{18}{shell variable}
\entry{parameters, positional}{19}{parameters, positional}
\entry{parameters, special}{19}{parameters, special}
\entry{parameters, special}{20}{parameters, special}
\entry{expansion}{20}{expansion}
\entry{brace expansion}{21}{brace expansion}
\entry{expansion, brace}{21}{expansion, brace}
\entry{tilde expansion}{21}{tilde expansion}
\entry{expansion, tilde}{21}{expansion, tilde}
\entry{parameter expansion}{22}{parameter expansion}
\entry{expansion, parameter}{22}{expansion, parameter}
\entry{command substitution}{27}{command substitution}
\entry{tilde expansion}{22}{tilde expansion}
\entry{expansion, tilde}{22}{expansion, tilde}
\entry{parameter expansion}{23}{parameter expansion}
\entry{expansion, parameter}{23}{expansion, parameter}
\entry{command substitution}{28}{command substitution}
\entry{expansion, arithmetic}{28}{expansion, arithmetic}
\entry{arithmetic expansion}{28}{arithmetic expansion}
\entry{process substitution}{28}{process substitution}
\entry{word splitting}{28}{word splitting}
\entry{process substitution}{29}{process substitution}
\entry{word splitting}{29}{word splitting}
\entry{expansion, filename}{29}{expansion, filename}
\entry{expansion, pathname}{29}{expansion, pathname}
\entry{filename expansion}{29}{filename expansion}
\entry{pathname expansion}{29}{pathname expansion}
\entry{pattern matching}{29}{pattern matching}
\entry{matching, pattern}{29}{matching, pattern}
\entry{pattern matching}{30}{pattern matching}
\entry{matching, pattern}{30}{matching, pattern}
\entry{redirection}{31}{redirection}
\entry{command expansion}{34}{command expansion}
\entry{command execution}{35}{command execution}
\entry{command search}{35}{command search}
\entry{command expansion}{35}{command expansion}
\entry{command execution}{36}{command execution}
\entry{command search}{36}{command search}
\entry{execution environment}{36}{execution environment}
\entry{environment}{37}{environment}
\entry{exit status}{37}{exit status}
\entry{exit status}{38}{exit status}
\entry{signal handling}{38}{signal handling}
\entry{shell script}{38}{shell script}
\entry{shell script}{39}{shell script}
\entry{special builtin}{67}{special builtin}
\entry{login shell}{81}{login shell}
\entry{interactive shell}{81}{interactive shell}
+17 -17
View File
@@ -13,11 +13,11 @@
\entry {builtin}{3}
\initial {C}
\entry {command editing}{102}
\entry {command execution}{35}
\entry {command expansion}{34}
\entry {command execution}{36}
\entry {command expansion}{35}
\entry {command history}{133}
\entry {command search}{35}
\entry {command substitution}{27}
\entry {command search}{36}
\entry {command substitution}{28}
\entry {command timing}{8}
\entry {commands, compound}{9}
\entry {commands, conditional}{10}
@@ -40,14 +40,14 @@
\entry {evaluation, arithmetic}{86}
\entry {event designators}{136}
\entry {execution environment}{36}
\entry {exit status}{3, 37}
\entry {exit status}{3, 38}
\entry {expansion}{20}
\entry {expansion, arithmetic}{28}
\entry {expansion, brace}{21}
\entry {expansion, filename}{29}
\entry {expansion, parameter}{22}
\entry {expansion, parameter}{23}
\entry {expansion, pathname}{29}
\entry {expansion, tilde}{21}
\entry {expansion, tilde}{22}
\entry {expressions, arithmetic}{86}
\entry {expressions, conditional}{84}
\initial {F}
@@ -55,7 +55,7 @@
\entry {filename}{3}
\entry {filename expansion}{29}
\entry {foreground}{97}
\entry {functions, shell}{16}
\entry {functions, shell}{17}
\initial {H}
\entry {history builtins}{133}
\entry {history events}{136}
@@ -79,7 +79,7 @@
\entry {localization}{7}
\entry {login shell}{81}
\initial {M}
\entry {matching, pattern}{29}
\entry {matching, pattern}{30}
\entry {metacharacter}{3}
\initial {N}
\entry {name}{3}
@@ -88,18 +88,18 @@
\initial {O}
\entry {operator, shell}{3}
\initial {P}
\entry {parameter expansion}{22}
\entry {parameter expansion}{23}
\entry {parameters}{18}
\entry {parameters, positional}{19}
\entry {parameters, special}{19}
\entry {parameters, special}{20}
\entry {pathname expansion}{29}
\entry {pattern matching}{29}
\entry {pattern matching}{30}
\entry {pipeline}{8}
\entry {POSIX}{3}
\entry {POSIX Mode}{93}
\entry {process group}{3}
\entry {process group ID}{3}
\entry {process substitution}{28}
\entry {process substitution}{29}
\entry {programmable completion}{124}
\entry {prompting}{91}
\initial {Q}
@@ -113,8 +113,8 @@
\entry {return status}{4}
\initial {S}
\entry {shell arithmetic}{86}
\entry {shell function}{16}
\entry {shell script}{38}
\entry {shell function}{17}
\entry {shell script}{39}
\entry {shell variable}{18}
\entry {shell, interactive}{82}
\entry {signal}{4}
@@ -123,7 +123,7 @@
\entry {startup files}{81}
\entry {suspending jobs}{97}
\initial {T}
\entry {tilde expansion}{21}
\entry {tilde expansion}{22}
\entry {token}{4}
\entry {translation, native languages}{7}
\initial {V}
@@ -131,6 +131,6 @@
\entry {variables, readline}{105}
\initial {W}
\entry {word}{4}
\entry {word splitting}{28}
\entry {word splitting}{29}
\initial {Y}
\entry {yanking text}{103}
BIN
View File
Binary file not shown.
+64 -26
View File
@@ -1,6 +1,6 @@
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on January, 11 2013 by texi2html 1.64 -->
<!-- Created on March, 8 2013 by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
@@ -33,11 +33,11 @@ Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
<H1>Bash Reference Manual</H1></P><P>
This text is a brief description of the features that are present in
the Bash shell (version 4.2, 8 January 2013 ).
the Bash shell (version 4.2, 2 March 2013 ).
The Bash home page is <A HREF="http://www.gnu.org/software/bash/">http://www.gnu.org/software/bash/</A>.
</P><P>
This is Edition 4.2, last updated 8 January 2013 ,
This is Edition 4.2, last updated 2 March 2013 ,
of <CITE>The GNU Bash Reference Manual</CITE>,
for <CODE>Bash</CODE>, Version 4.2.
</P><P>
@@ -1622,43 +1622,59 @@ The return status of a coprocess is the exit status of <VAR>command</VAR>.
<!--docid::SEC24::-->
<P>
There are ways to run commands in parallel that are not built into Bash.
GNU Parallel is a tool to do just that.
</P><P>
GNU Parallel, as its name suggests, can be used to build and run commands
in parallel. You may run the same command with different arguments, whether
they are filenames, usernames, hostnames, or lines read from files.
they are filenames, usernames, hostnames, or lines read from files. GNU
Parallel provides shorthand references to many of the most common operations
(input lines, various portions of the input line, different ways to specify
the input source, and so on). Parallel can replace <CODE>xargs</CODE> or feed
commands from its input sources to several different instances of Bash.
</P><P>
For a complete description, refer to the GNU Parallel documentation. A few
examples should provide a brief introduction to its use.
</P><P>
For example, it is easy to prefix each line in a text file with a specified
string:
<TABLE><tr><td>&nbsp;</td><td class=example><pre>cat file | parallel -k echo prefix_string
</pre></td></tr></table>The <SAMP>`-k'</SAMP> option is required to preserve the lines' order.
For example, it is easy to replace <CODE>xargs</CODE> to gzip all html files in the
current directory and its subdirectories:
<TABLE><tr><td>&nbsp;</td><td class=example><pre>find . -type f -name '*.html' -print | parallel gzip
</pre></td></tr></table>If you need to protect special characters such as newlines in file names,
use find's <SAMP>`-print0'</SAMP> option and parallel's <SAMP>`-0'</SAMP> option.
</P><P>
Similarly, you can append a specified string to each line in a text file:
<TABLE><tr><td>&nbsp;</td><td class=example><pre>cat file | parallel -k echo {} append_string
</pre></td></tr></table></P><P>
You can use Parallel to move files from the current directory when the
number of files is too large to process with one <CODE>mv</CODE> invocation:
<TABLE><tr><td>&nbsp;</td><td class=example><pre>ls | parallel mv {} destdir
</pre></td></tr></table></P><P>
As you can see, the {} is replaced with each line read from standard input.
While using <CODE>ls</CODE> will work in most instances, it is not sufficient to
deal with all filenames.
If you need to accommodate special characters in filenames, you can use
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre>find . -depth 1 \! -name '.*' -print0 | parallel -0 mv {} destdir
</pre></td></tr></table></P><P>
as alluded to above.
</P><P>
This will run as many <CODE>mv</CODE> commands as there are files in the current
directory. You can emulate a parallel <CODE>xargs</CODE> by adding the <SAMP>`-X'</SAMP>
option:
<TABLE><tr><td>&nbsp;</td><td class=example><pre>ls | parallel -X mv {} destdir
directory.
You can emulate a parallel <CODE>xargs</CODE> by adding the <SAMP>`-X'</SAMP> option:
<TABLE><tr><td>&nbsp;</td><td class=example><pre>find . -depth 1 \! -name '.*' -print0 | parallel -0 -X mv {} destdir
</pre></td></tr></table></P><P>
GNU Parallel can replace certain common idioms that operate on lines read
from a file (in this case, filenames):
<TABLE><tr><td>&nbsp;</td><td class=example><pre> for x in $(cat list); do
do-something1 $x config-$x
do-something2 &#60; $x
done | process-output
from a file (in this case, filenames listed one per line):
<TABLE><tr><td>&nbsp;</td><td class=example><pre> while read -r x; do
do-something1 "$x" "config-$x"
do-something2 &#60; "$x"
done &#60; file | process-output
</pre></td></tr></table></P><P>
with a more compact syntax reminiscent of lambdas:
@@ -1669,18 +1685,40 @@ Parallel provides a built-in mechanism to remove filename extensions, which
lends itself to batch file transformations or renaming:
<TABLE><tr><td>&nbsp;</td><td class=example><pre>ls *.gz | parallel -j+0 "zcat {} | bzip2 >{.}.bz2 &&#38; rm {}"
</pre></td></tr></table>This will recompress all files in the current directory with names ending
in .gz using bzip2, running one job per CPU (-j+0) in parallel.
in .gz using bzip2, running one job per CPU (-j+0) in parallel.
(We use <CODE>ls</CODE> for brevity here; using <CODE>find</CODE> as above is more
robust in the face of filenames containing unexpected characters.)
Parallel can take arguments from the command line; the above can also be
written as
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre>parallel "zcat {} | bzip2 >{.}.bz2 &&#38; rm {}" ::: *.gz
</pre></td></tr></table></P><P>
If a command generates output, you may want to preserve the input order in
the output. For instance, the following command
<TABLE><tr><td>&nbsp;</td><td class=example><pre>{ echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel traceroute
</pre></td></tr></table>will display as output the traceroute invocation that finishes first. Using
the <SAMP>`-k'</SAMP> option, as we saw above
</pre></td></tr></table>will display as output the traceroute invocation that finishes first.
Adding the <SAMP>`-k'</SAMP> option
<TABLE><tr><td>&nbsp;</td><td class=example><pre>{ echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel -k traceroute
</pre></td></tr></table>will ensure that the output of <CODE>traceroute foss.org.my</CODE> is displayed first.
</P><P>
Finally, Parallel can be used to run a sequence of shell commands in parallel,
similar to <SAMP>`cat file | bash'</SAMP>.
It is not uncommon to take a list of filenames, create a series of shell
commands to operate on them, and feed that list of commnds to a shell.
Parallel can speed this up. Assuming that <TT>`file'</TT> contains a list of
shell commands, one per line,
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre>parallel -j 10 &#60; file
</pre></td></tr></table></P><P>
will evaluate the commands using the shell (since no explicit command is
supplied as an argument), in blocks of ten shell jobs at a time.
</P><P>
<A NAME="Shell Functions"></A>
<HR SIZE="6">
<A NAME="SEC25"></A>
@@ -6223,7 +6261,7 @@ interrupt; previous versions continue with the next command in the list.
<P>
<DT><CODE>compat41</CODE>
<DD>If set, Bash, when in posix mode, treats a single quote in a double-quoted
<DD>If set, Bash, when in POSIX mode, treats a single quote in a double-quoted
parameter expansion as a special character. The single quotes must match
(an even number) and the characters between the single quotes are considered
quoted. This is the behavior of POSIX mode through version 4.1.
@@ -17202,7 +17240,7 @@ to permit their use in free software.
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1>About this document</H1>
This document was generated by <I>Chet Ramey</I> on <I>January, 11 2013</I>
This document was generated by <I>Chet Ramey</I> on <I>March, 8 2013</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
<P></P>
@@ -17364,7 +17402,7 @@ the following structure:
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Chet Ramey</I> on <I>January, 11 2013</I>
by <I>Chet Ramey</I> on <I>March, 8 2013</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
+185 -156
View File
@@ -1,10 +1,10 @@
This is bashref.info, produced by makeinfo version 4.13 from
/Users/chet/src/bash/src/doc/bashref.texi.
/usr/homes/chet/src/bash/src/doc/bashref.texi.
This text is a brief description of the features that are present in
the Bash shell (version 4.2, 8 January 2013).
the Bash shell (version 4.2, 2 March 2013).
This is Edition 4.2, last updated 8 January 2013, of `The GNU Bash
This is Edition 4.2, last updated 2 March 2013, of `The GNU Bash
Reference Manual', for `Bash', Version 4.2.
Copyright (C) 1988-2013 Free Software Foundation, Inc.
@@ -28,10 +28,10 @@ Bash Features
*************
This text is a brief description of the features that are present in
the Bash shell (version 4.2, 8 January 2013). The Bash home page is
the Bash shell (version 4.2, 2 March 2013). The Bash home page is
`http://www.gnu.org/software/bash/'.
This is Edition 4.2, last updated 8 January 2013, of `The GNU Bash
This is Edition 4.2, last updated 2 March 2013, of `The GNU Bash
Reference Manual', for `Bash', Version 4.2.
Bash contains features that appear in other popular shells, and some
@@ -1060,39 +1060,51 @@ File: bashref.info, Node: GNU Parallel, Prev: Coprocesses, Up: Shell Commands
3.2.6 GNU Parallel
------------------
GNU Parallel, as its name suggests, can be used to build and run
There are ways to run commands in parallel that are not built into Bash.
GNU Parallel is a tool to do just that.
GNU Parallel, as its name suggests, can be used to build and run
commands in parallel. You may run the same command with different
arguments, whether they are filenames, usernames, hostnames, or lines
read from files.
read from files. GNU Parallel provides shorthand references to many of
the most common operations (input lines, various portions of the input
line, different ways to specify the input source, and so on). Parallel
can replace `xargs' or feed commands from its input sources to several
different instances of Bash.
For a complete description, refer to the GNU Parallel documentation.
A few examples should provide a brief introduction to its use.
For example, it is easy to prefix each line in a text file with a
specified string:
cat file | parallel -k echo prefix_string
The `-k' option is required to preserve the lines' order.
Similarly, you can append a specified string to each line in a text
file:
cat file | parallel -k echo {} append_string
For example, it is easy to replace `xargs' to gzip all html files in
the current directory and its subdirectories:
find . -type f -name '*.html' -print | parallel gzip
If you need to protect special characters such as newlines in file
names, use find's `-print0' option and parallel's `-0' option.
You can use Parallel to move files from the current directory when
the number of files is too large to process with one `mv' invocation:
ls | parallel mv {} destdir
As you can see, the {} is replaced with each line read from standard
input. This will run as many `mv' commands as there are files in the
current directory. You can emulate a parallel `xargs' by adding the
`-X' option:
ls | parallel -X mv {} destdir
input. While using `ls' will work in most instances, it is not
sufficient to deal with all filenames. If you need to accommodate
special characters in filenames, you can use
find . -depth 1 \! -name '.*' -print0 | parallel -0 mv {} destdir
as alluded to above.
This will run as many `mv' commands as there are files in the current
directory. You can emulate a parallel `xargs' by adding the `-X'
option:
find . -depth 1 \! -name '.*' -print0 | parallel -0 -X mv {} destdir
GNU Parallel can replace certain common idioms that operate on lines
read from a file (in this case, filenames):
for x in $(cat list); do
do-something1 $x config-$x
do-something2 < $x
done | process-output
read from a file (in this case, filenames listed one per line):
while read -r x; do
do-something1 "$x" "config-$x"
do-something2 < "$x"
done < file | process-output
with a more compact syntax reminiscent of lambdas:
cat list | parallel "do-something1 {} config-{} ; do-something2 < {}" | process-output
@@ -1102,17 +1114,34 @@ extensions, which lends itself to batch file transformations or
renaming:
ls *.gz | parallel -j+0 "zcat {} | bzip2 >{.}.bz2 && rm {}"
This will recompress all files in the current directory with names
ending in .gz using bzip2, running one job per CPU (-j+0) in parallel.
ending in .gz using bzip2, running one job per CPU (-j+0) in parallel.
(We use `ls' for brevity here; using `find' as above is more robust in
the face of filenames containing unexpected characters.) Parallel can
take arguments from the command line; the above can also be written as
parallel "zcat {} | bzip2 >{.}.bz2 && rm {}" ::: *.gz
If a command generates output, you may want to preserve the input
order in the output. For instance, the following command
{ echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel traceroute
will display as output the traceroute invocation that finishes
first. Using the `-k' option, as we saw above
will display as output the traceroute invocation that finishes first.
Adding the `-k' option
{ echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel -k traceroute
will ensure that the output of `traceroute foss.org.my' is displayed
first.
Finally, Parallel can be used to run a sequence of shell commands in
parallel, similar to `cat file | bash'. It is not uncommon to take a
list of filenames, create a series of shell commands to operate on
them, and feed that list of commnds to a shell. Parallel can speed
this up. Assuming that `file' contains a list of shell commands, one
per line,
parallel -j 10 < file
will evaluate the commands using the shell (since no explicit command is
supplied as an argument), in blocks of ten shell jobs at a time.

File: bashref.info, Node: Shell Functions, Next: Shell Parameters, Prev: Shell Commands, Up: Basic Shell Features
@@ -4248,7 +4277,7 @@ This builtin allows you to change additional shell optional behavior.
continue with the next command in the list.
`compat41'
If set, Bash, when in posix mode, treats a single quote in a
If set, Bash, when in POSIX mode, treats a single quote in a
double-quoted parameter expansion as a special character.
The single quotes must match (an even number) and the
characters between the single quotes are considered quoted.
@@ -11082,133 +11111,133 @@ D.5 Concept Index

Tag Table:
Node: Top924
Node: Introduction2840
Node: What is Bash?3068
Node: What is a shell?4181
Node: Definitions6720
Node: Basic Shell Features9638
Node: Shell Syntax10857
Node: Shell Operation11887
Node: Quoting13181
Node: Escape Character14484
Node: Single Quotes14969
Node: Double Quotes15317
Node: ANSI-C Quoting16442
Node: Locale Translation17686
Node: Comments18582
Node: Shell Commands19200
Node: Simple Commands20072
Node: Pipelines20703
Node: Lists23402
Node: Compound Commands25131
Node: Looping Constructs26137
Node: Conditional Constructs28600
Node: Command Grouping39478
Node: Coprocesses40957
Node: GNU Parallel42790
Node: Shell Functions45258
Node: Shell Parameters50342
Node: Positional Parameters54471
Node: Special Parameters55371
Node: Shell Expansions58335
Node: Brace Expansion60261
Node: Tilde Expansion63042
Node: Shell Parameter Expansion65391
Node: Command Substitution77685
Node: Arithmetic Expansion79018
Node: Process Substitution79868
Node: Word Splitting80918
Node: Filename Expansion82541
Node: Pattern Matching84706
Node: Quote Removal88406
Node: Redirections88701
Node: Executing Commands97865
Node: Simple Command Expansion98535
Node: Command Search and Execution100465
Node: Command Execution Environment102802
Node: Environment105788
Node: Exit Status107447
Node: Signals109069
Node: Shell Scripts111037
Node: Shell Builtin Commands113555
Node: Bourne Shell Builtins115583
Node: Bash Builtins135359
Node: Modifying Shell Behavior162686
Node: The Set Builtin163031
Node: The Shopt Builtin173357
Node: Special Builtins187561
Node: Shell Variables188540
Node: Bourne Shell Variables188980
Node: Bash Variables191011
Node: Bash Features217886
Node: Invoking Bash218785
Node: Bash Startup Files224563
Node: Interactive Shells229582
Node: What is an Interactive Shell?229992
Node: Is this Shell Interactive?230641
Node: Interactive Shell Behavior231456
Node: Bash Conditional Expressions234744
Node: Shell Arithmetic238746
Node: Aliases241522
Node: Arrays244078
Node: The Directory Stack248767
Node: Directory Stack Builtins249486
Node: Controlling the Prompt252442
Node: The Restricted Shell255214
Node: Bash POSIX Mode257051
Node: Job Control266438
Node: Job Control Basics266898
Node: Job Control Builtins271617
Node: Job Control Variables276079
Node: Command Line Editing277237
Node: Introduction and Notation278909
Node: Readline Interaction280531
Node: Readline Bare Essentials281722
Node: Readline Movement Commands283511
Node: Readline Killing Commands284476
Node: Readline Arguments286396
Node: Searching287440
Node: Readline Init File289626
Node: Readline Init File Syntax290773
Node: Conditional Init Constructs307610
Node: Sample Init File310143
Node: Bindable Readline Commands313260
Node: Commands For Moving314467
Node: Commands For History315611
Node: Commands For Text319796
Node: Commands For Killing322469
Node: Numeric Arguments324926
Node: Commands For Completion326065
Node: Keyboard Macros330257
Node: Miscellaneous Commands330945
Node: Readline vi Mode336751
Node: Programmable Completion337658
Node: Programmable Completion Builtins344908
Node: A Programmable Completion Example354654
Node: Using History Interactively359904
Node: Bash History Facilities360588
Node: Bash History Builtins363587
Node: History Interaction367515
Node: Event Designators370220
Node: Word Designators371442
Node: Modifiers373081
Node: Installing Bash374485
Node: Basic Installation375622
Node: Compilers and Options378314
Node: Compiling For Multiple Architectures379055
Node: Installation Names380719
Node: Specifying the System Type381537
Node: Sharing Defaults382253
Node: Operation Controls382926
Node: Optional Features383884
Node: Reporting Bugs393672
Node: Major Differences From The Bourne Shell394870
Node: GNU Free Documentation License411729
Node: Indexes436925
Node: Builtin Index437379
Node: Reserved Word Index444206
Node: Variable Index446654
Node: Function Index460177
Node: Concept Index467405
Node: Introduction2836
Node: What is Bash?3064
Node: What is a shell?4177
Node: Definitions6716
Node: Basic Shell Features9634
Node: Shell Syntax10853
Node: Shell Operation11883
Node: Quoting13177
Node: Escape Character14480
Node: Single Quotes14965
Node: Double Quotes15313
Node: ANSI-C Quoting16438
Node: Locale Translation17682
Node: Comments18578
Node: Shell Commands19196
Node: Simple Commands20068
Node: Pipelines20699
Node: Lists23398
Node: Compound Commands25127
Node: Looping Constructs26133
Node: Conditional Constructs28596
Node: Command Grouping39474
Node: Coprocesses40953
Node: GNU Parallel42786
Node: Shell Functions46767
Node: Shell Parameters51851
Node: Positional Parameters55980
Node: Special Parameters56880
Node: Shell Expansions59844
Node: Brace Expansion61770
Node: Tilde Expansion64551
Node: Shell Parameter Expansion66900
Node: Command Substitution79194
Node: Arithmetic Expansion80527
Node: Process Substitution81377
Node: Word Splitting82427
Node: Filename Expansion84050
Node: Pattern Matching86215
Node: Quote Removal89915
Node: Redirections90210
Node: Executing Commands99374
Node: Simple Command Expansion100044
Node: Command Search and Execution101974
Node: Command Execution Environment104311
Node: Environment107297
Node: Exit Status108956
Node: Signals110578
Node: Shell Scripts112546
Node: Shell Builtin Commands115064
Node: Bourne Shell Builtins117092
Node: Bash Builtins136868
Node: Modifying Shell Behavior164195
Node: The Set Builtin164540
Node: The Shopt Builtin174866
Node: Special Builtins189070
Node: Shell Variables190049
Node: Bourne Shell Variables190489
Node: Bash Variables192520
Node: Bash Features219395
Node: Invoking Bash220294
Node: Bash Startup Files226072
Node: Interactive Shells231091
Node: What is an Interactive Shell?231501
Node: Is this Shell Interactive?232150
Node: Interactive Shell Behavior232965
Node: Bash Conditional Expressions236253
Node: Shell Arithmetic240255
Node: Aliases243031
Node: Arrays245587
Node: The Directory Stack250276
Node: Directory Stack Builtins250995
Node: Controlling the Prompt253951
Node: The Restricted Shell256723
Node: Bash POSIX Mode258560
Node: Job Control267947
Node: Job Control Basics268407
Node: Job Control Builtins273126
Node: Job Control Variables277588
Node: Command Line Editing278746
Node: Introduction and Notation280418
Node: Readline Interaction282040
Node: Readline Bare Essentials283231
Node: Readline Movement Commands285020
Node: Readline Killing Commands285985
Node: Readline Arguments287905
Node: Searching288949
Node: Readline Init File291135
Node: Readline Init File Syntax292282
Node: Conditional Init Constructs309119
Node: Sample Init File311652
Node: Bindable Readline Commands314769
Node: Commands For Moving315976
Node: Commands For History317120
Node: Commands For Text321305
Node: Commands For Killing323978
Node: Numeric Arguments326435
Node: Commands For Completion327574
Node: Keyboard Macros331766
Node: Miscellaneous Commands332454
Node: Readline vi Mode338260
Node: Programmable Completion339167
Node: Programmable Completion Builtins346417
Node: A Programmable Completion Example356163
Node: Using History Interactively361413
Node: Bash History Facilities362097
Node: Bash History Builtins365096
Node: History Interaction369024
Node: Event Designators371729
Node: Word Designators372951
Node: Modifiers374590
Node: Installing Bash375994
Node: Basic Installation377131
Node: Compilers and Options379823
Node: Compiling For Multiple Architectures380564
Node: Installation Names382228
Node: Specifying the System Type383046
Node: Sharing Defaults383762
Node: Operation Controls384435
Node: Optional Features385393
Node: Reporting Bugs395181
Node: Major Differences From The Bourne Shell396379
Node: GNU Free Documentation License413238
Node: Indexes438434
Node: Builtin Index438888
Node: Reserved Word Index445715
Node: Variable Index448163
Node: Function Index461686
Node: Concept Index468914

End Tag Table
+21 -21
View File
@@ -1,6 +1,6 @@
This is TeX, Version 3.1415926 (TeX Live 2011/Fink) (format=tex 2012.4.18) 11 JAN 2013 16:34
**/Users/chet/src/bash/src/doc/bashref.texi
(/Users/chet/src/bash/src/doc/bashref.texi (./texinfo.tex
This is TeX, Version 3.1415926 (TeX Live 2011/Fink) (format=tex 2012.4.18) 8 MAR 2013 15:57
**/usr/homes/chet/src/bash/src/doc/bashref.texi
(/usr/homes/chet/src/bash/src/doc/bashref.texi (./texinfo.tex
Loading texinfo [version 2009-01-18.17]:
\bindingoffset=\dimen16
\normaloffset=\dimen17
@@ -191,7 +191,7 @@ textttsl pat-tern@texttt ][]) @textttsl command-list @texttt ;;][] esac[]
.etc.
[11] [12] [13] [14] [15]
Overfull \hbox (89.6747pt too wide) in paragraph at lines 1253--1253
Overfull \hbox (89.6747pt too wide) in paragraph at lines 1267--1267
[]@texttt cat list | parallel "do-something1 {} config-{} ; do-something2 < {}
" | process-output[]
@@ -204,7 +204,7 @@ Overfull \hbox (89.6747pt too wide) in paragraph at lines 1253--1253
.etc.
Overfull \hbox (89.6747pt too wide) in paragraph at lines 1268--1268
Overfull \hbox (89.6747pt too wide) in paragraph at lines 1290--1290
[]@texttt { echo foss.org.my ; echo debian.org; echo freenetproject.org; } | p
arallel traceroute[]
@@ -217,7 +217,7 @@ arallel traceroute[]
.etc.
Overfull \hbox (106.92076pt too wide) in paragraph at lines 1274--1274
Overfull \hbox (106.92076pt too wide) in paragraph at lines 1296--1296
[]@texttt { echo foss.org.my ; echo debian.org; echo freenetproject.org; } | p
arallel -k traceroute[]
@@ -232,7 +232,7 @@ arallel -k traceroute[]
[16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30]
[31] [32] [33] [34] [35] [36] [37] [38] Chapter 4 [39] [40] [41] [42] [43]
[44] [45] [46]
Underfull \hbox (badness 5231) in paragraph at lines 3723--3736
Underfull \hbox (badness 5231) in paragraph at lines 3760--3773
@texttt emacs-meta[]@textrm , @texttt emacs-ctlx[]@textrm , @texttt vi[]@textr
m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
@@ -246,7 +246,7 @@ m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
[47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61]
[62] [63] [64]
Underfull \hbox (badness 5460) in paragraph at lines 5010--5016
Underfull \hbox (badness 5460) in paragraph at lines 5047--5053
[]@textrm If set, range ex-pres-sions used in pat-tern match-ing (see
@hbox(8.2125+2.73749)x433.62, glue set 3.79674
@@ -259,7 +259,7 @@ Underfull \hbox (badness 5460) in paragraph at lines 5010--5016
[65] [66] Chapter 5 [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77]
Chapter 6 [78]
Overfull \hbox (51.96864pt too wide) in paragraph at lines 5935--5935
Overfull \hbox (51.96864pt too wide) in paragraph at lines 5972--5972
[]@texttt bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@t
exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
@@ -272,7 +272,7 @@ exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
.etc.
Overfull \hbox (76.23077pt too wide) in paragraph at lines 5936--5936
Overfull \hbox (76.23077pt too wide) in paragraph at lines 5973--5973
[]@texttt bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@texttt
] [-O @textttsl shopt_option@texttt ] -c @textttsl string @texttt [@textttsl ar
-
@@ -286,7 +286,7 @@ Overfull \hbox (76.23077pt too wide) in paragraph at lines 5936--5936
.etc.
Overfull \hbox (34.72258pt too wide) in paragraph at lines 5937--5937
Overfull \hbox (34.72258pt too wide) in paragraph at lines 5974--5974
[]@texttt bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@text
tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
@@ -299,7 +299,7 @@ tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
.etc.
[79] [80]
Underfull \hbox (badness 2245) in paragraph at lines 6109--6111
Underfull \hbox (badness 2245) in paragraph at lines 6146--6148
[]@textrm When a lo-gin shell ex-its, Bash reads and ex-e-cutes com-mands from
the file
@@ -312,7 +312,7 @@ the file
.etc.
[81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94]
Underfull \hbox (badness 2521) in paragraph at lines 7321--7324
Underfull \hbox (badness 2521) in paragraph at lines 7358--7361
@textrm `@texttt --enable-strict-posix-default[]@textrm '[] to @texttt configur
e[] @textrm when build-ing (see Sec-tion 10.8
@@ -325,8 +325,8 @@ e[] @textrm when build-ing (see Sec-tion 10.8
.etc.
Chapter 7 [95] [96] [97] [98] [99]
(/Users/chet/src/bash/src/lib/readline/doc/rluser.texi Chapter 8 [100] [101]
[102] [103] [104] [105] [106]
(/usr/homes/chet/src/bash/src/lib/readline/doc/rluser.texi Chapter 8 [100]
[101] [102] [103] [104] [105] [106]
Underfull \hbox (badness 5231) in paragraph at lines 565--581
@texttt emacs-meta[]@textrm , @texttt emacs-ctlx[]@textrm , @texttt vi[]@textr
m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
@@ -391,9 +391,9 @@ athname[]
.@penalty 10000
.etc.
[131]) (/Users/chet/src/bash/src/lib/readline/doc/hsuser.texi Chapter 9
[131]) (/usr/homes/chet/src/bash/src/lib/readline/doc/hsuser.texi Chapter 9
[132] [133] [134] [135] [136]) Chapter 10 [137] [138] [139] [140]
Underfull \hbox (badness 2772) in paragraph at lines 7929--7933
Underfull \hbox (badness 2772) in paragraph at lines 7966--7970
[]@textrm Enable sup-port for large files (@texttt http://www.sas.com/standard
s/large_
@@ -411,11 +411,11 @@ Appendix D [159] (./bashref.bts) [160] (./bashref.rws) (./bashref.vrs [161]
[162]) (./bashref.fns [163] [164]) (./bashref.cps [165]) [166] )
Here is how much of TeX's memory you used:
2085 strings out of 497974
28613 string characters out of 3220833
65396 words of memory out of 3000000
28645 string characters out of 3220833
66392 words of memory out of 3000000
2901 multiletter control sequences out of 15000+200000
32127 words of font info for 112 fonts, out of 3000000 for 9000
51 hyphenation exceptions out of 8191
16i,6n,14p,315b,705s stack positions out of 5000i,500n,10000p,200000b,50000s
16i,6n,14p,319b,705s stack positions out of 5000i,500n,10000p,200000b,50000s
Output written on bashref.dvi (172 pages, 715952 bytes).
Output written on bashref.dvi (172 pages, 717824 bytes).
BIN
View File
Binary file not shown.
+1631 -1598
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -18,4 +18,4 @@
\entry{]]}{12}{\code {]]}}
\entry{{\tt \char 123}}{14}{\code {{\tt \char 123}}}
\entry{{\tt \char 125}}{14}{\code {{\tt \char 125}}}
\entry{function}{16}{\code {function}}
\entry{function}{17}{\code {function}}
+1 -1
View File
@@ -20,7 +20,7 @@
\initial {F}
\entry {\code {fi}}{10}
\entry {\code {for}}{10}
\entry {\code {function}}{16}
\entry {\code {function}}{17}
\initial {I}
\entry {\code {if}}{10}
\entry {\code {in}}{11}
+6
View File
@@ -6813,6 +6813,12 @@ and an index of -1 refers to the last element.
An array variable is considered set if a subscript has been assigned a
value. The null string is a valid value.
It is possible to obtain the keys (indices) of an array as well as the values.
$@{!@var{name}[@@]@} and $@{!@var{name}[*]@} expand to the indices
assigned in array variable @var{name}.
The treatment when in double quotes is similar to the expansion of the
special parameters @samp{@@} and @samp{*} within double quotes.
The @code{unset} builtin is used to destroy arrays.
@code{unset @var{name}[@var{subscript}]}
destroys the array element at index @var{subscript}.
+20 -20
View File
@@ -22,40 +22,40 @@
@numsubsubsecentry{Grouping Commands}{3.2.4.3}{Command Grouping}{14}
@numsubsecentry{Coprocesses}{3.2.5}{Coprocesses}{15}
@numsubsecentry{GNU Parallel}{3.2.6}{GNU Parallel}{15}
@numsecentry{Shell Functions}{3.3}{Shell Functions}{16}
@numsecentry{Shell Functions}{3.3}{Shell Functions}{17}
@numsecentry{Shell Parameters}{3.4}{Shell Parameters}{18}
@numsubsecentry{Positional Parameters}{3.4.1}{Positional Parameters}{19}
@numsubsecentry{Special Parameters}{3.4.2}{Special Parameters}{19}
@numsubsecentry{Special Parameters}{3.4.2}{Special Parameters}{20}
@numsecentry{Shell Expansions}{3.5}{Shell Expansions}{20}
@numsubsecentry{Brace Expansion}{3.5.1}{Brace Expansion}{21}
@numsubsecentry{Tilde Expansion}{3.5.2}{Tilde Expansion}{21}
@numsubsecentry{Shell Parameter Expansion}{3.5.3}{Shell Parameter Expansion}{22}
@numsubsecentry{Command Substitution}{3.5.4}{Command Substitution}{27}
@numsubsecentry{Tilde Expansion}{3.5.2}{Tilde Expansion}{22}
@numsubsecentry{Shell Parameter Expansion}{3.5.3}{Shell Parameter Expansion}{23}
@numsubsecentry{Command Substitution}{3.5.4}{Command Substitution}{28}
@numsubsecentry{Arithmetic Expansion}{3.5.5}{Arithmetic Expansion}{28}
@numsubsecentry{Process Substitution}{3.5.6}{Process Substitution}{28}
@numsubsecentry{Word Splitting}{3.5.7}{Word Splitting}{28}
@numsubsecentry{Process Substitution}{3.5.6}{Process Substitution}{29}
@numsubsecentry{Word Splitting}{3.5.7}{Word Splitting}{29}
@numsubsecentry{Filename Expansion}{3.5.8}{Filename Expansion}{29}
@numsubsubsecentry{Pattern Matching}{3.5.8.1}{Pattern Matching}{29}
@numsubsubsecentry{Pattern Matching}{3.5.8.1}{Pattern Matching}{30}
@numsubsecentry{Quote Removal}{3.5.9}{Quote Removal}{31}
@numsecentry{Redirections}{3.6}{Redirections}{31}
@numsubsecentry{Redirecting Input}{3.6.1}{}{32}
@numsubsecentry{Redirecting Output}{3.6.2}{}{32}
@numsubsecentry{Appending Redirected Output}{3.6.3}{}{32}
@numsubsecentry{Redirecting Standard Output and Standard Error}{3.6.4}{}{32}
@numsubsecentry{Redirecting Output}{3.6.2}{}{33}
@numsubsecentry{Appending Redirected Output}{3.6.3}{}{33}
@numsubsecentry{Redirecting Standard Output and Standard Error}{3.6.4}{}{33}
@numsubsecentry{Appending Standard Output and Standard Error}{3.6.5}{}{33}
@numsubsecentry{Here Documents}{3.6.6}{}{33}
@numsubsecentry{Here Strings}{3.6.7}{}{33}
@numsubsecentry{Here Documents}{3.6.6}{}{34}
@numsubsecentry{Here Strings}{3.6.7}{}{34}
@numsubsecentry{Duplicating File Descriptors}{3.6.8}{}{34}
@numsubsecentry{Moving File Descriptors}{3.6.9}{}{34}
@numsubsecentry{Opening File Descriptors for Reading and Writing}{3.6.10}{}{34}
@numsecentry{Executing Commands}{3.7}{Executing Commands}{34}
@numsubsecentry{Simple Command Expansion}{3.7.1}{Simple Command Expansion}{34}
@numsubsecentry{Command Search and Execution}{3.7.2}{Command Search and Execution}{35}
@numsubsecentry{Moving File Descriptors}{3.6.9}{}{35}
@numsubsecentry{Opening File Descriptors for Reading and Writing}{3.6.10}{}{35}
@numsecentry{Executing Commands}{3.7}{Executing Commands}{35}
@numsubsecentry{Simple Command Expansion}{3.7.1}{Simple Command Expansion}{35}
@numsubsecentry{Command Search and Execution}{3.7.2}{Command Search and Execution}{36}
@numsubsecentry{Command Execution Environment}{3.7.3}{Command Execution Environment}{36}
@numsubsecentry{Environment}{3.7.4}{Environment}{37}
@numsubsecentry{Exit Status}{3.7.5}{Exit Status}{37}
@numsubsecentry{Exit Status}{3.7.5}{Exit Status}{38}
@numsubsecentry{Signals}{3.7.6}{Signals}{38}
@numsecentry{Shell Scripts}{3.8}{Shell Scripts}{38}
@numsecentry{Shell Scripts}{3.8}{Shell Scripts}{39}
@numchapentry{Shell Builtin Commands}{4}{Shell Builtin Commands}{40}
@numsecentry{Bourne Shell Builtins}{4.1}{Bourne Shell Builtins}{40}
@numsecentry{Bash Builtin Commands}{4.2}{Bash Builtins}{47}
+3 -3
View File
@@ -1,9 +1,9 @@
\entry{LC_MESSAGES}{7}{\code {LC_MESSAGES}}
\entry{TEXTDOMAIN}{7}{\code {TEXTDOMAIN}}
\entry{TEXTDOMAINDIR}{7}{\code {TEXTDOMAINDIR}}
\entry{*}{19}{\code {*}}
\entry{@}{19}{\code {@}}
\entry{#}{19}{\code {#}}
\entry{*}{20}{\code {*}}
\entry{@}{20}{\code {@}}
\entry{#}{20}{\code {#}}
\entry{?}{20}{\code {?}}
\entry{-}{20}{\code {-}}
\entry{$}{20}{\code {$}}
+3 -3
View File
@@ -1,17 +1,17 @@
\initial {!}
\entry {\code {!}}{20}
\initial {#}
\entry {\code {#}}{19}
\entry {\code {#}}{20}
\initial {$}
\entry {\code {$}}{20}
\initial {*}
\entry {\code {*}}{19}
\entry {\code {*}}{20}
\initial {-}
\entry {\code {-}}{20}
\initial {?}
\entry {\code {?}}{20}
\initial {@}
\entry {\code {@}}{19}
\entry {\code {@}}{20}
\initial {_}
\entry {\code {_}}{20}
\initial {0}
+5 -3
View File
@@ -1028,7 +1028,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
Without options, the name and value of each shell variable are
displayed in a format that can be reused as input for setting or
resetting the currently-set variables. Read-only variables can-
not be reset. In _p_o_s_i_x _m_o_d_e, only shell variables are listed.
not be reset. In _p_o_s_i_x mode, only shell variables are listed.
The output is sorted according to the current locale. When
options are specified, they set or unset shell attributes. Any
arguments remaining after option processing are treated as val-
@@ -1130,7 +1130,9 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
is disabled by default.
ppoossiixx Change the behavior of bbaasshh where the default
operation differs from the POSIX standard to
match the standard (_p_o_s_i_x _m_o_d_e).
match the standard (_p_o_s_i_x _m_o_d_e). See SSEEEE AALLSSOO
below for a reference to a document that details
how posix mode affects bash's behavior.
pprriivviilleeggeedd
Same as --pp.
vveerrbboossee Same as --vv.
@@ -1299,7 +1301,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
rupt; previous versions continue with the next command
in the list.
ccoommppaatt4411
If set, bbaasshh, when in posix mode, treats a single quote
If set, bbaasshh, when in _p_o_s_i_x mode, treats a single quote
in a double-quoted parameter expansion as a special
character. The single quotes must match (an even num-
ber) and the characters between the single quotes are
+481 -475
View File
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -1,12 +1,12 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Fri Jan 11 16:34:25 2013
%%CreationDate: Fri Mar 8 15:56:21 2013
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%DocumentSuppliedResources: procset grops 1.19 2
%%Pages: 1
%%PageOrder: Ascend
%%DocumentMedia: Default 595 842 0 () ()
%%DocumentMedia: Default 612 792 0 () ()
%%Orientation: Portrait
%%EndComments
%%BeginDefaults
@@ -188,16 +188,16 @@ setpacking
%%EndProlog
%%BeginSetup
%%BeginFeature: *PageSize Default
<< /PageSize [ 595 842 ] /ImagingBBox null >> setpagedevice
<< /PageSize [ 612 792 ] /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
def/PL 792 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/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
/.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
+2 -2
View File
@@ -2,9 +2,9 @@
Copyright (C) 1988-2013 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Sun Mar 10 12:10:36 EDT 2013
@set LASTCHANGE Thu Mar 21 10:09:44 EDT 2013
@set EDITION 4.3
@set VERSION 4.3
@set UPDATED 10 March 2013
@set UPDATED 21 March 2013
@set UPDATED-MONTH March 2013
+238
View File
@@ -0,0 +1,238 @@
#
# Simple makefile for the sample loadable builtins
#
# Copyright (C) 1996 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
# Include some boilerplate Gnu makefile definitions.
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
infodir = @infodir@
includedir = @includedir@
topdir = @top_srcdir@
BUILD_DIR = @BUILD_DIR@
srcdir = @srcdir@
VPATH = .:@srcdir@
@SET_MAKE@
CC = @CC@
RM = rm -f
SHELL = @MAKE_SHELL@
host_os = @host_os@
host_cpu = @host_cpu@
host_vendor = @host_vendor@
CFLAGS = @CFLAGS@
LOCAL_CFLAGS = @LOCAL_CFLAGS@
DEFS = @DEFS@
LOCAL_DEFS = @LOCAL_DEFS@
CPPFLAGS = @CPPFLAGS@
BASHINCDIR = ${topdir}/include
LIBBUILD = ${BUILD_DIR}/lib
INTL_LIBSRC = ${topdir}/lib/intl
INTL_BUILDDIR = ${LIBBUILD}/intl
INTL_INC = @INTL_INC@
LIBINTL_H = @LIBINTL_H@
CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(LOCAL_CFLAGS) $(CFLAGS)
#
# These values are generated for configure by ${topdir}/support/shobj-conf.
# If your system is not supported by that script, but includes facilities for
# dynamic loading of shared objects, please update the script and send the
# changes to bash-maintainers@gnu.org.
#
SHOBJ_CC = @SHOBJ_CC@
SHOBJ_CFLAGS = @SHOBJ_CFLAGS@
SHOBJ_LD = @SHOBJ_LD@
SHOBJ_LDFLAGS = @SHOBJ_LDFLAGS@
SHOBJ_XLDFLAGS = @SHOBJ_XLDFLAGS@
SHOBJ_LIBS = @SHOBJ_LIBS@
SHOBJ_STATUS = @SHOBJ_STATUS@
INC = -I. -I.. -I$(topdir) -I$(topdir)/lib -I$(topdir)/builtins \
-I$(BASHINCDIR) -I$(BUILD_DIR) -I$(LIBBUILD) \
-I$(BUILD_DIR)/builtins $(INTL_INC)
.c.o:
$(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CCFLAGS) $(INC) -c -o $@ $<
ALLPROG = print truefalse sleep pushd finfo logname basename dirname \
tty pathchk tee head mkdir rmdir printenv id whoami \
uname sync push ln unlink cut realpath getconf strftime
OTHERPROG = necho hello cat
all: $(SHOBJ_STATUS)
supported: $(ALLPROG)
others: $(OTHERPROG)
unsupported:
@echo "Your system (${host_os}) is not supported by the"
@echo "${topdir}/support/shobj-conf script."
@echo "If your operating system provides facilities for dynamic"
@echo "loading of shared objects using the dlopen(3) interface,"
@echo "please update the script and re-run configure.
@echo "Please send the changes you made to bash-maintainers@gnu.org"
@echo "for inclusion in future bash releases."
everything: supported others
print: print.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ print.o $(SHOBJ_LIBS)
necho: necho.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ necho.o $(SHOBJ_LIBS)
getconf: getconf.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ getconf.o $(SHOBJ_LIBS)
hello: hello.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ hello.o $(SHOBJ_LIBS)
truefalse: truefalse.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ truefalse.o $(SHOBJ_LIBS)
sleep: sleep.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ sleep.o $(SHOBJ_LIBS)
finfo: finfo.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ finfo.o $(SHOBJ_LIBS)
cat: cat.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ cat.o $(SHOBJ_LIBS)
logname: logname.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ logname.o $(SHOBJ_LIBS)
basename: basename.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ basename.o $(SHOBJ_LIBS)
dirname: dirname.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ dirname.o $(SHOBJ_LIBS)
tty: tty.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ tty.o $(SHOBJ_LIBS)
pathchk: pathchk.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ pathchk.o $(SHOBJ_LIBS)
tee: tee.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ tee.o $(SHOBJ_LIBS)
mkdir: mkdir.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ mkdir.o $(SHOBJ_LIBS)
rmdir: rmdir.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ rmdir.o $(SHOBJ_LIBS)
head: head.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ head.o $(SHOBJ_LIBS)
printenv: printenv.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ printenv.o $(SHOBJ_LIBS)
id: id.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ id.o $(SHOBJ_LIBS)
whoami: whoami.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ whoami.o $(SHOBJ_LIBS)
uname: uname.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ uname.o $(SHOBJ_LIBS)
sync: sync.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ sync.o $(SHOBJ_LIBS)
push: push.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ push.o $(SHOBJ_LIBS)
ln: ln.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ ln.o $(SHOBJ_LIBS)
unlink: unlink.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ unlink.o $(SHOBJ_LIBS)
cut: cut.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ cut.o $(SHOBJ_LIBS)
realpath: realpath.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ realpath.o $(SHOBJ_LIBS)
strftime: strftime.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ strftime.o $(SHOBJ_LIBS)
# pushd is a special case. We use the same source that the builtin version
# uses, with special compilation options.
#
pushd.c: ${topdir}/builtins/pushd.def
$(RM) $@
${BUILD_DIR}/builtins/mkbuiltins -D ${topdir}/builtins ${topdir}/builtins/pushd.def
pushd.o: pushd.c
$(RM) $@
$(SHOBJ_CC) -DHAVE_CONFIG_H -DPUSHD_AND_POPD -DLOADABLE_BUILTIN $(SHOBJ_CFLAGS) $(CFLAGS) $(CPPFLAGS) $(INC) -c -o $@ $<
pushd: pushd.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ pushd.o $(SHOBJ_LIBS)
clean:
$(RM) $(ALLPROG) $(OTHERPROG) *.o
-( cd perl && ${MAKE} ${MFLAGS} $@ )
mostlyclean: clean
-( cd perl && ${MAKE} ${MFLAGS} $@ )
distclean maintainer-clean: clean
$(RM) Makefile pushd.c
-( cd perl && ${MAKE} ${MFLAGS} $@ )
print.o: print.c
truefalse.o: truefalse.c
sleep.o: sleep.c
finfo.o: finfo.c
logname.o: logname.c
basename.o: basename.c
dirname.o: dirname.c
tty.o: tty.c
pathchk.o: pathchk.c
tee.o: tee.c
head.o: head.c
rmdir.o: rmdir.c
necho.o: necho.c
getconf.o: getconf.c
hello.o: hello.c
cat.o: cat.c
printenv.o: printenv.c
id.o: id.c
whoami.o: whoami.c
uname.o: uname.c
sync.o: sync.c
push.o: push.c
mkdir.o: mkdir.c
realpath.o: realpath.c
strftime.o: strftime.c
+561
View File
@@ -0,0 +1,561 @@
#! /bin/bash
# bashdb - Bash shell debugger
#
# Adapted from an idea in O'Reilly's `Learning the Korn Shell'
# Copyright (C) 1993-1994 O'Reilly and Associates, Inc.
# Copyright (C) 1998, 1999, 2001 Gary V. Vaughan <gvv@techie.com>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# NOTE:
#
# This program requires bash 2.x.
# If bash 2.x is installed as "bash2", you can invoke bashdb like this:
#
# DEBUG_SHELL=/bin/bash2 /bin/bash2 bashdb script.sh
# TODO:
#
# break [regexp]
# cond [break] [condition]
# tbreak [regexp|+lines]
# restart
# Variable watchpoints
# Output colourization
# History with csh ^ substitution? Or write a readline frontend?
# Instrument shell functions with the _steptrap in $_potbelliedpig
# Instrument `source' and `.' files in $_potbelliedpig
# be cleverer about lines we allow breakpoints to be set on
# break [function_name]
echo 'Bash Debugger version 1.2.4'
export _dbname=$(echo "X$0"|sed -e 's,^X,,' -e 's,^.*/,,')
if test $# -lt 1; then
echo "$_dbname: Usage: $_dbname <filename>" >&2
exit 1
fi
_guineapig=$1
if test ! -r $1; then
echo "$_dbname: Cannot read file '$_guineapig'." >&2
exit 1
fi
shift
__debug=${TMPDIR-/tmp}/bashdb.$$
sed -e '/^# bashdb - Bash shell debugger/,/^# -- DO NOT DELETE THIS LINE -- /d' "$0" > $__debug
cat $_guineapig >> $__debug
exec ${DEBUG_SHELL-bash} $__debug $_guineapig "$@"
exit 1
# -- DO NOT DELETE THIS LINE -- The program depends on it
#bashdb preamble
# $1 name of the original guinea pig script
__debug=$0
_guineapig=$1
shift
function _steptrap
{
local i=0
_curline=$1
if [ -n "$_disps" ]
then
while (( $i < ${#_disps[@]} ))
do
if [ -n "${_disps[$i]}" ]
then
_msg "${_disps[$i]}: \c"
eval _msg ${_disps[$i]}
fi
let i=$i+1
done
fi
if (( $_trace )); then
_showline $_curline
fi
if (( $_steps >= 0 )); then
let _steps="$_steps - 1"
fi
if _at_linenumbp ; then
_msg "Reached breakpoint at line $_curline"
_showline $_curline
_cmdloop
elif [ -n "$_brcond" ] && eval $_brcond; then
_msg "Break condition $_brcond true at line $_curline"
_showline $_curline
_cmdloop
elif (( $_steps == 0 && $_curline > 1)); then
# Assuming a real script will have the "#! /bin/sh" at line 1,
# assume that when $_curline == 1 we are inside backticks.
if (( ! $_trace )); then
_msg "Stopped at line $_curline"
_showline $_curline
fi
_cmdloop
fi
}
function _setbp
{
local i f line
if [ -z "$1" ]
then
_listbp
elif [ $(echo $1 | grep '^\+*[1-9][0-9]*') ]
then
case $1 in
+*)
let f="$1 + `expr $1 : '+*\([1-9][0-9]*\)'`"
;;
*)
let f=$1
;;
esac
# find the next valid line
line="${_lines[$f]}"
while _invalidbreakp $f
do
let f="$f + 1"
line="${_lines[$f]}"
done
if (( $f != $1 ))
then
_msg "Line $1 is not a valid breakpoint"
fi
if [ -n "${_lines[$f]}" ]
then
_linebp=($(echo $( (for i in ${_linebp[*]} $1; do
echo $i; done) | sort -n) ))
_msg "Breakpoint set at line $f"
else
_msg "Breakpoints can only be set on executable lines"
fi
else
_msg "Please specify a numeric line number"
fi
}
function _listbp
{
local i
if [ -n "$_linebp" ]
then
_msg "Breakpoints:"
for i in ${_linebp[*]}; do
_showline $i
done
else
_msg "No breakpoints have been set"
fi
}
function _clearbp
{
local i
if [ -z "$1" ]; then
read -e -p "Delete all breakpoints? "
case $REPLY in
y*)
unset _linebp[*]
_msg "All breakpoints have been cleared"
;;
esac
elif [ $(echo $1 | grep '^[0-9]*') ]; then
_linebp=($(echo $(for i in ${_linebp[*]}; do
if (( $1 != $i )); then echo $1; fi; done) ))
_msg "Breakpoint cleared at line $1"
else
_msg "Please specify a numeric line number"
fi
}
function _setbc
{
if [ -n "$*" ]
then
_brcond=$args
_msg "Break when true: $_brcond"
else
_brcond=
_msg "Break condition cleared"
fi
}
function _setdisp
{
if [ -z "$1" ]
then
_listdisp
else
_disps[${#_disps[@]}]="$1"
if (( ${#_disps[@]} < 10 ))
then
_msg " ${#_disps[@]}: $1"
else
_msg "${#_disps[@]}: $1"
fi
fi
}
function _listdisp
{
local i=0 j
if [ -n "$_disps" ]
then
while (( $i < ${#_disps[@]} ))
do
let j=$i+1
if (( ${#_disps[@]} < 10 ))
then
_msg " $j: ${_disps[$i]}"
else
_msg "$j: ${_disps[$i]}"
fi
let i=$j
done
else
_msg "No displays have been set"
fi
}
function _cleardisp
{
if (( $# < 1 ))
then
read -e -p "Delete all display expressions? "
case $REPLY in
y*)
unset _disps[*]
_msg "All breakpoints have been cleared"
;;
esac
elif [ $(echo $1 | grep '^[0-9]*') ]
then
unset _disps[$1]
_msg "Display $i has been cleared"
else
_listdisp
_msg "Please specify a numeric display number"
fi
}
function _cmdloop
{
local cmd args
while read -e -p "bashdb> " cmd args; do
test -n "$cmd" || { set $_lastcmd; cmd=$1; shift; args=$*; }
if [ -n "$cmd" ]
then
case $cmd in
b|br|bre|brea|break)
_setbp $args
_lastcmd="break $args"
;;
co|con)
_msg "ambiguous command: '$cmd', condition, continue?"
;;
cond|condi|condit|conditi|conditio|condition)
_setbc $args
_lastcmd="condition $args"
;;
c|cont|conti|contin|continu|continue)
_lastcmd="continue"
return
;;
d)
_msg "ambiguous command: '$cmd', delete, display?"
;;
de|del|dele|delet|delete)
_clearbp $args
_lastcmd="delete $args"
;;
di|dis|disp|displ|displa|display)
_setdisp $args
_lastcmd="display $args"
;;
\?|h|he|hel|help)
_menu
_lastcmd="help"
;;
l|li|lis|list)
_displayscript $args
# _lastcmd is set in the _displayscript function
;;
p|pr|pri|prin|print)
_examine $args
_lastcmd="print $args"
;;
q|qu|qui|quit)
exit
;;
s|st|ste|step|n|ne|nex|next)
let _steps=${args:-1}
_lastcmd="next $args"
return
;;
t|tr|tra|trac|trace)
_xtrace
;;
u|un|und|undi|undis|undisp|undispl|undispla|undisplay)
_cleardisp $args
_lastcmd="undisplay $args"
;;
!*)
eval ${cmd#!} $args
_lastcmd="$cmd $args"
;;
*)
_msg "Invalid command: '$cmd'"
;;
esac
fi
done
}
function _at_linenumbp
{
local i=0
if [ "$_linebp" ]
then
while (( $i < ${#_linebp[@]} )); do
if (( ${_linebp[$i]} == $_curline )); then
return 0
fi
let i=$i+1
done
fi
return 1
}
function _invalidbreakp
{
local line=${_lines[$1]}
if test -z "$line" \
|| expr "$line" : '[ \t]*#.*' > /dev/null \
|| expr "$line" : '[ \t]*;;[ \t]*$' > /dev/null \
|| expr "$line" : '[ \t]*[^)]*)[ \t]*$' > /dev/null \
|| expr "$line" : '[ \t]*;;[ \t]*#.**$' > /dev/null \
|| expr "$line" : '[ \t]*[^)]*)[ \t]*;;[ \t]*$' > /dev/null \
|| expr "$line" : '[ \t]*[^)]*)[ \t]*;;*[ \t]*#.*$' > /dev/null
then
return 0
fi
return 1
}
function _examine
{
if [ -n "$*" ]
then
_msg "$args: \c"
eval _msg $args
else
_msg "Nothing to print"
fi
}
function _displayscript
{
local i j start end bp cl
if (( $# == 1 ))
then
if test $1 = "%"
then
let start=1
let end=${#_lines[@]}
else
let start=$1-5
let end=$1+5
fi
elif (( $# > 1 ))
then
if test $1 = "^"
then
let start=1
else
let start=$1
fi
if test $2 = "\$"
then
let end=${#_lines[@]}
else
let end=$2
fi
else
let start=$_curline-5
let end=$_curline+5
fi
if (( $start < 1 ))
then
start=1
fi
if (( $end > ${#_lines[@]} ))
then
end=${#_lines[@]}
fi
let cl=$end-$start
if (( $cl > ${LINES-24} ))
then
pager=${PAGER-more}
else
pager=cat
fi
i=$start
( while (( $i <= $end )); do
_showline $i
let i=$i+1
done ) 2>&1 | $pager
# calculate the next block of lines
let start=$end+1
let end=$start+11
if (( $end > ${#_lines[@]} ))
then
end=${#_lines[@]}
fi
_lastcmd="list $start $end"
}
function _xtrace
{
let _trace="! $_trace"
if (( $_trace )); then
_msg "Execution trace on"
else
_msg "Execution trace off"
fi
}
function _msg
{
echo -e "$@" >&2
}
function _showline
{
local i=0 bp=' ' line=$1
while (( $i < ${#_linebp[@]} ))
do
if [ ${_linebp[$i]} ] && (( ${_linebp[$i]} == $line ))
then
bp='*'
fi
let i=$i+1
done
if (( $_curline == $line )); then
cl=">"
else
cl=" "
fi
if (( $line < 100 )); then
_msg "$_guineapig:$line $bp $cl${_lines[$line]}"
elif (( $line < 10 )); then
_msg "$_guineapig:$line $bp $cl${_lines[$line]}"
elif (( $line > 0 )); then
_msg "$_guineapig:$line $bp $cl${_lines[$line]}"
fi
}
function _cleanup
{
rm -f $__debug $_potbelliedpig 2> /dev/null
}
function _menu
{
_msg 'bashdb commands:
break N set breakpoint at line N
break list breakpoints & break condition
condition foo set break condition to foo
condition clear break condition
delete N clear breakpoint at line N
delete clear all breakpoints
display EXP evaluate and display EXP for each debug step
display show a list of display expressions
undisplay N remove display expression N
list N M display all lines of script between N and M
list N display 5 lines of script either side of line N
list display 5 lines if script either side of current line
continue continue execution upto next breakpoint
next [N] execute [N] statements (default 1)
print expr prints the value of an expression
trace toggle execution trace on/off
help print this menu
! string passes string to a shell
quit quit'
}
_linebp=
let _trace=0
let _i=1
# Be careful about quoted newlines
_potbelliedpig=${TMPDIR-/tmp}/$_guineapig.$$
sed 's,\\$,\\\\,' $_guineapig > $_potbelliedpig
_msg "Reading source from file: $_guineapig"
while read; do
_lines[$_i]=$REPLY
let _i=$_i+1
done < $_potbelliedpig
trap _cleanup EXIT
# Assuming a real script will have the "#! /bin/sh" at line 1,
# don't stop at line 1 on the first run
let _steps=2
LINENO=-2
trap '_steptrap $LINENO' DEBUG
:
+2
View File
@@ -4930,8 +4930,10 @@ execute_disk_command (words, redirects, command_line, pipe_in, pipe_out,
exit (EX_NOTFOUND); /* Posix.2 says the exit status is 127 */
}
#if defined (JOB_CONTROL)
/* May need to reinitialize more of the job control state here. */
kill_current_pipeline ();
#endif
wl = make_word_list (make_word (NOTFOUND_HOOK), words);
exit (execute_shell_function (hookf, wl));
+1 -1
View File
@@ -770,7 +770,7 @@ trim_pathname (name, maxlen)
*nbeg++ = '.';
nlen = nend - ntail;
memcpy (nbeg, ntail, nlen);
memmove (nbeg, ntail, nlen);
nbeg[nlen] = '\0';
return name;
+6 -1
View File
@@ -167,13 +167,18 @@ _rl_print_color_indicator (char *f)
{
colored_filetype = C_DIR;
#if defined (S_ISVTX)
if ((mode & S_ISVTX) && (mode & S_IWOTH)
&& is_colored (C_STICKY_OTHER_WRITABLE))
colored_filetype = C_STICKY_OTHER_WRITABLE;
else if ((mode & S_IWOTH) != 0 && is_colored (C_OTHER_WRITABLE))
else
#endif
if ((mode & S_IWOTH) != 0 && is_colored (C_OTHER_WRITABLE))
colored_filetype = C_OTHER_WRITABLE;
#if defined (S_ISVTX)
else if ((mode & S_ISVTX) != 0 && is_colored (C_STICKY))
colored_filetype = C_STICKY;
#endif
}
else if (S_ISLNK (mode))
colored_filetype = ((linkok == 0
+76
View File
@@ -0,0 +1,76 @@
# This makefile for Readline library documentation is in -*- text -*- mode.
# Emacs likes it that way.
RM = rm -f
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
TEXI2HTML = texi2html
QUIETPS = #set this to -q to shut up dvips
DVIPS = dvips -D 300 $(QUIETPS) -o $@ # tricky
INSTALL_DATA = cp
infodir = /usr/local/info
RLSRC = rlman.texinfo rluser.texinfo rltech.texinfo
HISTSRC = hist.texinfo hsuser.texinfo hstech.texinfo
DVIOBJ = readline.dvi history.dvi
INFOOBJ = readline.info history.info
PSOBJ = readline.ps history.ps
HTMLOBJ = readline.html history.html
all: info dvi html ps
nodvi: info html
readline.dvi: $(RLSRC)
$(TEXI2DVI) rlman.texinfo
mv rlman.dvi readline.dvi
readline.info: $(RLSRC)
$(MAKEINFO) --no-split -o $@ rlman.texinfo
history.dvi: ${HISTSRC}
$(TEXI2DVI) hist.texinfo
mv hist.dvi history.dvi
history.info: ${HISTSRC}
$(MAKEINFO) --no-split -o $@ hist.texinfo
readline.ps: readline.dvi
$(RM) $@
$(DVIPS) readline.dvi
history.ps: history.dvi
$(RM) $@
$(DVIPS) history.dvi
readline.html: ${RLSRC}
$(TEXI2HTML) rlman.texinfo
sed -e 's:rlman.html:readline.html:' -e 's:rlman_toc.html:readline_toc.html:' rlman.html > readline.html
sed -e 's:rlman.html:readline.html:' -e 's:rlman_toc.html:readline_toc.html:' rlman_toc.html > readline_toc.html
$(RM) rlman.html rlman_toc.html
history.html: ${HISTSRC}
$(TEXI2HTML) hist.texinfo
sed -e 's:hist.html:history.html:' -e 's:hist_toc.html:history_toc.html:' hist.html > history.html
sed -e 's:hist.html:history.html:' -e 's:hist_toc.html:history_toc.html:' hist_toc.html > history_toc.html
$(RM) hist.html hist_toc.html
info: $(INFOOBJ)
dvi: $(DVIOBJ)
ps: $(PSOBJ)
html: $(HTMLOBJ)
clean:
$(RM) *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps *.pgs \
*.fns *.kys *.tps *.vrs *.o core
distclean: clean
mostlyclean: clean
maintainer-clean: clean
$(RM) *.dvi *.info *.info-* *.ps *.html
install: info
${INSTALL_DATA} readline.info $(infodir)/readline.info
${INSTALL_DATA} history.info $(infodir)/history.info
+2
View File
@@ -59,6 +59,8 @@
#include "rlstdc.h"
#include "rlshell.h"
#include "rldefs.h"
#include "xmalloc.h"
#if defined (HAVE_GETPWUID) && !defined (HAVE_GETPW_DECLS)
+2 -2
View File
@@ -83,8 +83,8 @@ extern sigset_t top_level_mask;
extern procenv_t wait_intr_buf;
extern int wait_signal_received;
pid_t last_made_pid = NO_PID;
pid_t last_asynchronous_pid = NO_PID;
volatile pid_t last_made_pid = NO_PID;
volatile pid_t last_asynchronous_pid = NO_PID;
/* Call this when you start making children. */
int already_making_children = 0;
+1 -1
View File
@@ -2264,7 +2264,7 @@ shell_getc (remove_quoted_newline)
if (n <= 2) /* we have to save 1 for the newline added below */
{
if (truncating == 0)
internal_warning("shell_getc: shell_input_line_size (%llu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, SIZE_MAX);
internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, SIZE_MAX);
shell_input_line[i] = '\0';
truncating = 1;
}
BIN
View File
Binary file not shown.
+353 -317
View File
File diff suppressed because it is too large Load Diff
+369 -338
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+356 -319
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+356 -319
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+375 -320
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+373 -320
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+794 -529
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.
+386 -341
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+386 -341
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+718 -495
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+379 -324
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+375 -341
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+373 -320
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1884 -1055
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+371 -320
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+376 -324
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+686 -489
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+371 -320
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+377 -326
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+375 -320
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+543 -850
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+372 -322
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+377 -322
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+377 -322
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+354 -317
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.

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