mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-30 08:59:56 +02:00
commit bash-20080724 snapshot
This commit is contained in:
@@ -457,3 +457,5 @@ lib/sh/zread.c Chet Ramey
|
||||
lib/sh/zwrite.c Chet Ramey
|
||||
|
||||
tests/posix-ifs.sh Glenn Fowler
|
||||
|
||||
support/checkbashisms Julian Gilbey, Debian Linux team
|
||||
|
||||
@@ -1,3 +1,496 @@
|
||||
This document details the changes between this version, bash-4.0-alpha,
|
||||
and the previous version, bash-3.2-release.
|
||||
|
||||
1. Changes to Bash
|
||||
|
||||
a. Fixed several bugs in old-style `` command substitution parsing, including
|
||||
comment parsing and quoted string handling.
|
||||
|
||||
b. Fixed problems parsing arguments to the [[ command's =~ regular expression
|
||||
matching operator: metacharacter and whitespace parsing.
|
||||
|
||||
c. Fixed a bug that caused the shell to inappropriately reuse high-numbered
|
||||
file descriptors it used internally.
|
||||
|
||||
d. Fixed a bug in pattern replacement word expansions that caused a `/' as
|
||||
the first character of an expanded pattern to be mistaken for a global
|
||||
replacement specifier.
|
||||
|
||||
e. Fixed several problems with the asprintf and snprintf replacement functions
|
||||
that caused hangs and crashes.
|
||||
|
||||
f. Fixed a bug in the calculation of the current and previous job that caused
|
||||
it to refer to incorrect jobs.
|
||||
|
||||
g. Fixed a bug in the check for the validity of a hashed command pathname that
|
||||
caused unnecessary hash table deletions and additions.
|
||||
|
||||
h. Fixed a bug that caused child processes to inherit the wrong value for $!.
|
||||
|
||||
i. Fixed a bug that caused `.' to fail to read and execute commands from non-
|
||||
regular files such as devices or named pipes.
|
||||
|
||||
j. Fixed a bug in printf formatting for the %x and %X expansions that occurred
|
||||
on some systems.
|
||||
|
||||
k. Fixed a bug that caused the shell to crash when creating temporary files if
|
||||
$TMPDIR named a non-writable directory.
|
||||
|
||||
l. Fixed a bug that caused the shell to ignore $TMPDIR when creating temporary
|
||||
files under some circumstances.
|
||||
|
||||
m. Fixed a bug that caused named pipes created by process substitution to not
|
||||
be cleaned up.
|
||||
|
||||
n. Fixed a bug that caused HISTTIMEFORMAT to not be honored when it appeared
|
||||
in the initial shell environment.
|
||||
|
||||
o. Fixed several bugs in the expansion of $* and $@ (quoted and unquoted)
|
||||
when IFS is null or contains non-whitespace characters; the same changes
|
||||
apply to arrays subscripted with * or @.
|
||||
|
||||
p. Fixed several problems with pattern substitution expansions on the
|
||||
positional parameters and arrays subscripted with * or @.
|
||||
|
||||
q. Made a change to the default locale initialization code that should
|
||||
result in better behavior from the locale-aware library functions.
|
||||
|
||||
r. Fixed a bug that caused compacting the jobs list to drop jobs.
|
||||
|
||||
s. Fixed a bug that caused jumps back to the top-level processing loop from
|
||||
a builtin command to leave the shell in an inconsistent state.
|
||||
|
||||
t. Fixed a bug that caused characters that would be escaped internally to be
|
||||
doubled when escaped with a backslash.
|
||||
|
||||
u. Fixed the initialization of mailboxes to not cause maildirs to be read
|
||||
(and stat(2) called for every message file) at shell startup.
|
||||
|
||||
v. Fixed a bug that caused the shell to not display $PS2 when the read builtin
|
||||
reads a line continued with a backslash.
|
||||
|
||||
w. Fixed a bug that caused errors in word splitting when $IFS contained
|
||||
characters used for internal quoting.
|
||||
|
||||
x. Fixed bugs that caused problems with output from shell builtins not being
|
||||
completely displayed on some systems.
|
||||
|
||||
y. Fixed a bug that caused output to be lost when a redirection is acting on
|
||||
the shell's output file descriptor.
|
||||
|
||||
z. Fixed bugs caused by shell builtins not checking for all write errors.
|
||||
|
||||
aa. Fixed a problem that caused the shell to dump core if expansions on the
|
||||
pattern passed to the pattern removal word expansions resulted in expansion
|
||||
errors.
|
||||
|
||||
bb. Fixed a bug that caused bash to loop infinitely after creating and
|
||||
waiting for 4096 jobs.
|
||||
|
||||
cc. Fixed a bug that caused bash to lose the status of a background job under
|
||||
certain circumstances.
|
||||
|
||||
dd. Fixed a bug that caused bash to not look in the temporary environment
|
||||
when performing variable lookup under certain circumstances.
|
||||
|
||||
ee. Fixed a bug that caused bash to close file descriptors greater than 10
|
||||
when they were used in redirections.
|
||||
|
||||
ff. Fixed a problem that caused the shell to attempt to read from the standard
|
||||
input when called as `bash -i script'.
|
||||
|
||||
gg. Fixed a memory leak and variable initialization problems when the -v option
|
||||
was supplied to `printf' that could cause incorrect results.
|
||||
|
||||
hh. Fixed a bug that caused the `read' builtin to count bytes when the -n option
|
||||
was supplied, rather than (possibly multibyte) characters.
|
||||
|
||||
ii. Fixed a bug when displaying a function due to not converting the function
|
||||
to an external form.
|
||||
|
||||
jj. Changed job control initialization to ensure that the shell has a tty
|
||||
as its controlling terminal before enabling job control.
|
||||
|
||||
kk. Fixed a bug with the `test' builtin that caused it to misinterpret
|
||||
arguments beginning with `-' but containing more than one character.
|
||||
|
||||
ll. Fixed bug that could cause the shell to dump core in certain cases where
|
||||
a command sets the SIGINT disposition to the default.
|
||||
|
||||
mm. Fixed a bug in the pattern replacement word expansion that occurred when
|
||||
the pattern and replacement strings were empty.
|
||||
|
||||
nn. Fixed a bug that caused an arithmetic evaluation error to disable all
|
||||
further evaluation.
|
||||
|
||||
oo. Fixed a bug in pathname expansion that caused it to interpret backslashes
|
||||
in the pathname as quoting characters.
|
||||
|
||||
pp. Fixed a bug in the replacement getcwd() implementation that could cause
|
||||
memory to be overwritten.
|
||||
|
||||
qq. When in Posix mode, the `ulimit' builtin now uses a block size of 512 for
|
||||
the `-c' and `-f' options.
|
||||
|
||||
rr. Brace expansion now allows process substitutions to pass through unchanged.
|
||||
|
||||
ss. Fixed a problem in the command name completion code to avoid quoting
|
||||
escaped special characters twice when the command name begins with a tilde.
|
||||
|
||||
tt. Fixed a problem in the printf builtin that resulted in single-byte
|
||||
output for the "'" escape, even when using multibyte characters.
|
||||
|
||||
uu. Fixed a bug that caused the failure exit status to be lost when redirections
|
||||
attached to a compound command failed.
|
||||
|
||||
vv. Fixed a bug that caused the internal random number generator to not be
|
||||
re-seeded correctly when creating a subshell.
|
||||
|
||||
ww. Fixed a bug that could cause the bash replacement getcwd to overwrite
|
||||
memory.
|
||||
|
||||
xx. Fixed a bug that caused the shell to not receive SIGINT if it was sent
|
||||
while the shell was waiting for a command substitution to terminate, and
|
||||
make sure the exit status is correct when it does.
|
||||
|
||||
yy. Fixed a bug that resulted in the second and subsequent children spawned
|
||||
by a shell begun to run a command substitution being placed into the
|
||||
wrong process group.
|
||||
|
||||
zz. Fixed a bug that caused the results of successful tilde expansion to be
|
||||
subject to pathname expansion and word splitting.
|
||||
|
||||
aaa. Fixed a bug that could cause the shell to hang if it encountered an
|
||||
error that caused it to jump back to the top processing loop during a
|
||||
command substitution or `eval' command.
|
||||
|
||||
bbb. Fixed a bug that caused the `read' builtin to use the tty's attributes
|
||||
instead of those of the file descriptor passed with the -u option when
|
||||
processing the -n and -d options.
|
||||
|
||||
ccc. Fixed a bug that caused incorrect expansion of ${array[@]:foo} if the
|
||||
first character of $IFS was not whitespace.
|
||||
|
||||
ddd. Fixed a bug that occurred when scanning for the ending delimiter of a
|
||||
${parameter/pat/sub} expansion.
|
||||
|
||||
eee. Fixed a bug that caused the shell to inappropriately expand command
|
||||
substitutions in words when expanding directory names for completion.
|
||||
|
||||
fff. Fixed a bug that caused the `fc' builtin to look too far back in the
|
||||
history list under certain circumstances.
|
||||
|
||||
ggg. Fixed a bug that caused a shell running in Posix mode to search $PWD for
|
||||
a file specified as an argument to source/. when the file was not found
|
||||
in $PATH.
|
||||
|
||||
hhh. Fixed a bug that caused the shell to modify the case of a command word
|
||||
found via command completion when the shell was performing case-
|
||||
insensitive completion.
|
||||
|
||||
iii. Fixed a bug that caused the shell to search $PATH for an argument to
|
||||
source/. even when it contained a `/'.
|
||||
|
||||
jjj. Fixed a bug that caused brace expansion to misorder expansions when the
|
||||
locale did not have a collating order like aAbBcC...zZ.
|
||||
|
||||
kkk. Fixed a bug that did not allow `set +o history' to have any effect when
|
||||
run in a startup file or from a sourced file.
|
||||
|
||||
lll. Fixed a bug with the precedence of the ?: conditional arithmetic operator.
|
||||
|
||||
mmm. Fixed a bug that caused side effects of temporary variable assignments
|
||||
to persist in the shell environment.
|
||||
|
||||
nnn. Fixed a bug that caused the terminal to be left in non-canonical mode
|
||||
when using editing commands that invoke the an editor on the current
|
||||
command line.
|
||||
|
||||
ooo. Fixed a bug that caused globbing characters and characters in $IFS to not
|
||||
be quoted appropriately when displaying assignment statements.
|
||||
|
||||
ppp. Fixed a bug that caused the `-e' option to be inherited when sourcing a
|
||||
file or evaluating a command with `eval' even if the return value of the
|
||||
command was supposed to be ignored.
|
||||
|
||||
qqq. Fixed a bug that caused the shell to attempt to created variables with
|
||||
invalid names if such names appeared in the initial environment.
|
||||
|
||||
rrr. Fixed a bug with quote removal in strings where the final character is a
|
||||
backslash.
|
||||
|
||||
sss. Fixed a bug that caused the effects of special variables to persist even
|
||||
when the variables were unset as part of the shell reinitializing itself
|
||||
to execute a shell script.
|
||||
|
||||
ttt. Fixed a bug that caused the history to not be saved after `history -c' or
|
||||
`history -d' was executed until a sufficient number of commands had been
|
||||
saved to the history.
|
||||
|
||||
uuu. Bash now parses command substitutions according to Posix rules: parsing
|
||||
the command contained in $() to find the closing delimiter.
|
||||
|
||||
vvv. Fixed a bug that caused traps on SIGCHLD set in a SIGCHLD handler to
|
||||
not persist.
|
||||
|
||||
www. Fixed a bug that didn't allow SIGCHLD to interrupt the `wait' builtin
|
||||
as Posix specifies.
|
||||
|
||||
xxx. Invalid numeric arguments to shell builtins no longer cause the shell to
|
||||
short-circuit any executing compound command.
|
||||
|
||||
yyy. Fixed a bug that caused the exit status to be lost when `break' was
|
||||
used to short-circuit a loop's execution.
|
||||
|
||||
zzz. Fixed a bug that caused stray ^? characters to be left in expansions of
|
||||
"${array[*]}".
|
||||
|
||||
aaaa. Bash now prints better error messages for here documents terminated by
|
||||
EOF and for identifying the incorrect token in an invalid arithmetic
|
||||
expression.
|
||||
|
||||
bbbb. Fixed a bug in the variable length word expansion that caused it to
|
||||
incorrectly calculate the number of multibyte characters.
|
||||
|
||||
cccc. Fixed a race condition that could result in the top-level shell setting
|
||||
the terminal's process group to an incorrect value if the process
|
||||
group was changed by a child of a child of the shell.
|
||||
|
||||
dddd. Fixed a bug that caused here documents belonging to commands within a
|
||||
compound command to be displayed in a syntactially-incorrect form, which
|
||||
prevented them from being re-read as input.
|
||||
|
||||
eeee. The shell displays more warnings about failures to set the locale.
|
||||
|
||||
ffff. Fixed a bug that caused the body of a here-document to not be saved to
|
||||
the history list.
|
||||
|
||||
2. Changes to Readline
|
||||
|
||||
a. Fixed a number of redisplay errors in environments supporting multibyte
|
||||
characters.
|
||||
|
||||
b. Fixed bugs in vi command mode that caused motion commands to inappropriately
|
||||
set the mark.
|
||||
|
||||
c. When using the arrow keys in vi insertion mode, readline allows movement
|
||||
beyond the current end of the line (unlike command mode).
|
||||
|
||||
d. Fixed bugs that caused readline to loop when the terminal has been taken
|
||||
away and reads return -1/EIO.
|
||||
|
||||
e. Fixed bugs in redisplay occurring when displaying prompts containing
|
||||
invisible characters.
|
||||
|
||||
f. Fixed a bug that caused the completion append character to not be reset to
|
||||
the default after an application-specified completion function changed it.
|
||||
|
||||
g. Fixed a problem that caused incorrect positioning of the cursor in emacs
|
||||
mode when at the end of a line in a locale supporting multibyte characters.
|
||||
|
||||
h. Fixed an off-by-one error that caused readline to drop every 511th
|
||||
character of buffered input.
|
||||
|
||||
i. Fixed a bug that resulted in SIGTERM not being caught or cleaned up.
|
||||
|
||||
j. Fixed redisplay bugs caused by multiline prompts with invisible characters
|
||||
or no characters following the final newline.
|
||||
|
||||
k. Fixed redisplay bug caused by prompts consisting solely of invisible
|
||||
characters.
|
||||
|
||||
l. Fixed a bug in the code that buffers characters received very quickly in
|
||||
succession which caused characters to be dropped.
|
||||
|
||||
m. Fixed a bug that caused readline to reference uninitialized data structures
|
||||
if it received a SIGWINCH before completing initialzation.
|
||||
|
||||
n. Fixed a bug that caused the vi-mode `last command' to be set incorrectly
|
||||
and therefore unrepeatable.
|
||||
|
||||
o. Fixed a bug that caused readline to disable echoing when it was being used
|
||||
with an output file descriptor that was not a terminal.
|
||||
|
||||
p. Readline now blocks SIGINT while manipulating internal data structures
|
||||
during redisplay.
|
||||
|
||||
3. New Features in Bash
|
||||
|
||||
a. When using substring expansion on the positional parameters, a starting
|
||||
index of 0 now causes $0 to be prefixed to the list.
|
||||
|
||||
b. The `help' builtin now prints its columns with entries sorted vertically
|
||||
rather than horizontally.
|
||||
|
||||
c. There is a new variable, $BASHPID, which always returns the process id of
|
||||
the current shell.
|
||||
|
||||
d. There is a new `autocd' option that, when enabled, causes bash to attempt
|
||||
to `cd' to a directory name that is supplied as the first word of a
|
||||
simple command.
|
||||
|
||||
e. There is a new `checkjobs' option that causes the shell to check for and
|
||||
report any running or stopped jobs at exit.
|
||||
|
||||
f. The programmable completion code exports a new COMP_TYPE variable, set to
|
||||
a character describing the type of completion being attempted.
|
||||
|
||||
g. The programmable completion code exports a new COMP_KEY variable, set to
|
||||
the character that caused the completion to be invoked (e.g., TAB).
|
||||
|
||||
h. If creation of a child process fails due to insufficient resources, bash
|
||||
will try again several times before reporting failure.
|
||||
|
||||
i. The programmable completion code now uses the same set of characters as
|
||||
readline when breaking the command line into a list of words.
|
||||
|
||||
j. The block multiplier for the ulimit -c and -f options is now 512 when in
|
||||
Posix mode, as Posix specifies.
|
||||
|
||||
k. Changed the behavior of the read builtin to save any partial input received
|
||||
in the specified variable when the read builtin times out. This also
|
||||
results in variables specified as arguments to read to be set to the empty
|
||||
string when there is no input available. When the read builtin times out,
|
||||
it returns an exit status greater than 128.
|
||||
|
||||
l. The shell now has the notion of a `compatibility level', controlled by
|
||||
new variables settable by `shopt'. Setting this variable currently
|
||||
restores the bash-3.1 behavior when processing quoted strings on the rhs
|
||||
of the `=~' operator to the `[[' command.
|
||||
|
||||
m. The `ulimit' builtin now has new -b (socket buffer size) and -T (number
|
||||
of threads) options.
|
||||
|
||||
n. The -p option to `declare' now displays all variable values and attributes
|
||||
(or function values and attributes if used with -f).
|
||||
|
||||
o. There is a new `compopt' builtin that allows completion functions to modify
|
||||
completion options for existing completions or the completion currently
|
||||
being executed.
|
||||
|
||||
p. The `read' builtin has a new -i option which inserts text into the reply
|
||||
buffer when using readline.
|
||||
|
||||
q. A new `-E' option to the complete builtin allows control of the default
|
||||
behavior for completion on an empty line.
|
||||
|
||||
r. There is now limited support for completing command name words containing
|
||||
globbing characters.
|
||||
|
||||
s. Changed format of internal help documentation for all builtins to roughly
|
||||
follow man page format.
|
||||
|
||||
t. The `help' builtin now has a new -d option, to display a short description,
|
||||
and a -m option, to print help information in a man page-like format.
|
||||
|
||||
u. There is a new `mapfile' builtin to populate an array with lines from a
|
||||
given file.
|
||||
|
||||
v. If a command is not found, the shell attempts to execute a shell function
|
||||
named `command_not_found_handle', supplying the command words as the
|
||||
function arguments.
|
||||
|
||||
w. There is a new shell option: `globstar'. When enabled, the globbing code
|
||||
treats `**' specially -- it matches all directories (and files within
|
||||
them, when appropriate) recursively.
|
||||
|
||||
x. There is a new shell option: `dirspell'. When enabled, the filename
|
||||
completion code performs spelling correction on directory names during
|
||||
completion.
|
||||
|
||||
y. The `-t' option to the `read' builtin now supports fractional timeout
|
||||
values.
|
||||
|
||||
z. Brace expansion now allows zero-padding of expanded numeric values and
|
||||
will add the proper number of zeroes to make sure all values contain the
|
||||
same number of digits.
|
||||
|
||||
aa. There is a new bash-specific bindable readline function: `dabbrev-expand'.
|
||||
It uses menu completion on a set of words taken from the history list.
|
||||
|
||||
bb. The command assigned to a key sequence with `bind -x' now sets two new
|
||||
variables in the environment of the executed command: READLINE_LINE_BUFFER
|
||||
and READLINE_POINT. The command can change the current readline line
|
||||
and cursor position by modifying READLINE_LINE_BUFFER and READLINE_POINT,
|
||||
respectively.
|
||||
|
||||
cc. There is a new >>& redirection operator, which appends the standard output
|
||||
and standard error to the named file.
|
||||
|
||||
dd. The parser now understands `|&' as a synonym for `2>&1 |', which redirects
|
||||
the standard error for a command through a pipe.
|
||||
|
||||
ee. The new `;&' case statement action list terminator causes execution to
|
||||
continue with the action associated with the next pattern in the
|
||||
statement rather than terminating the command.
|
||||
|
||||
ff. The new `;;&' case statement action list terminator causes the shell to
|
||||
test the next set of patterns after completing execution of the current
|
||||
action, rather than terminating the command.
|
||||
|
||||
gg. The shell understands a new variable: PROMPT_DIRTRIM. When set to an
|
||||
integer value greater than zero, prompt expansion of \w and \W will
|
||||
retain only that number of trailing pathname components and replace
|
||||
the intervening characters with `...'.
|
||||
|
||||
hh. There are new case-modifying word expansions: uppercase (^[^]) and
|
||||
lowercase (,[,]). They can work on either the first character or
|
||||
array element, or globally. They accept an optional shell pattern
|
||||
that determines which characters to modify. There is an optionally-
|
||||
configured feature to include capitalization operators.
|
||||
|
||||
ii. The shell provides associative array variables, with the appropriate
|
||||
support to create, delete, assign values to, and expand them.
|
||||
|
||||
jj. The `declare' builtin now has new -l (convert value to lowercase upon
|
||||
assignment) and -u (convert value to uppercase upon assignment) options.
|
||||
There is an optionally-configurable -c option to capitalize a value at
|
||||
assignment.
|
||||
|
||||
kk. There is a new `coproc' reserved word that specifies a coprocess: an
|
||||
asynchronous command run with two pipes connected to the creating shell.
|
||||
Coprocs can be named. The input and output file descriptors and the
|
||||
PID of the coprocess are available to the calling shell in variables
|
||||
with coproc-specific names.
|
||||
|
||||
4. New Features in Readline
|
||||
|
||||
a. A new variable, rl_sort_completion_matches; allows applications to inhibit
|
||||
match list sorting (but beware: some things don't work right if
|
||||
applications do this).
|
||||
|
||||
b. A new variable, rl_completion_invoking_key; allows applications to discover
|
||||
the key that invoked rl_complete or rl_menu_complete.
|
||||
|
||||
c. The functions rl_block_sigint and rl_release_sigint are now public and
|
||||
available to calling applications who want to protect critical sections
|
||||
(like redisplay).
|
||||
|
||||
d. The functions rl_save_state and rl_restore_state are now public and
|
||||
available to calling applications; documented rest of readline's state
|
||||
flag values.
|
||||
|
||||
e. A new user-settable variable, `history-size', allows setting the maximum
|
||||
number of entries in the history list.
|
||||
|
||||
f. There is a new implementation of menu completion, with several improvements
|
||||
over the old; the most notable improvement is a better `completions
|
||||
browsing' mode.
|
||||
|
||||
g. The menu completion code now uses the rl_menu_completion_entry_function
|
||||
variable, allowing applications to provide their own menu completion
|
||||
generators.
|
||||
|
||||
h. There is support for replacing a prefix of a pathname with a `...' when
|
||||
displaying possible completions. This is controllable by setting the
|
||||
`completion-prefix-display-length' variable. Matches with a common prefix
|
||||
longer than this value have the common prefix replaced with `...'.
|
||||
|
||||
i. There is a new `revert-all-at-newline' variable. If enabled, readline will
|
||||
undo all outstanding changes to all history lines when `accept-line' is
|
||||
executed.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
This document details the changes between this version, bash-3.2-release,
|
||||
and the previous version, bash-3.2-beta.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
This document details the incompatibilities between this version of bash,
|
||||
bash-3.2, and the previous widely-available versions, bash-1.14 (which is
|
||||
bash-4.0, and the previous widely-available versions, bash-1.14 (which is
|
||||
still the `standard' version for a few Linux distributions) and bash-2.x.
|
||||
These were discovered by users of bash-2.x and 3.x, so this list is not
|
||||
comprehensive. Some of these incompatibilities occur between the current
|
||||
@@ -275,3 +275,35 @@ bash-2.0 were significant.)
|
||||
operators for the `[[' compound command, and matches any quoted portion
|
||||
of the right-hand-side argument to the =~ operator as a string rather
|
||||
than a regular expression.
|
||||
|
||||
34. Bash-4.0 allows the behavior in the previous item to be modified using
|
||||
the notion of a shell `compatibility level'.
|
||||
|
||||
35. Bash-3.2 (patched) and Bash-4.0 fix a bug that leaves the shell in an
|
||||
inconsistent internal state following an assignment error. One of the
|
||||
changes means that compound commands or { ... } grouping commands are
|
||||
aborted. This is what Posix specifies.
|
||||
|
||||
36. Bash-4.0 now allows process substitution constructs to pass unchanged
|
||||
through brace expansion, so any expansion of the contents will have to be
|
||||
separately specified, and each process subsitution will have to be
|
||||
separately entered.
|
||||
|
||||
37. Bash-4.0 now allows SIGCHLD to interrupt the wait builtin, as Posix
|
||||
specifies, so the SIGCHLD trap is no longer always invoked once per
|
||||
exiting child.
|
||||
|
||||
38. Since bash-4.0 now follows Posix rules for finding the closing delimiter
|
||||
of a $() command substitution, it will not behave as previous versions
|
||||
did, but will catch more syntax and parsing errors before spawning a
|
||||
subshell to evaluate the command substitution.
|
||||
|
||||
39. The programmable completion code uses the same set of delimiting characters
|
||||
as readline when breaking the command line into words, rather than the
|
||||
set of shell metacharacters, so programmable completion and readline
|
||||
should be more consistent.
|
||||
|
||||
40. When the read builtin times out, it attempts to assign any input read to
|
||||
specified variables, which also causes variables to be set to the empty
|
||||
string if there is not enough input. Previous versions discarded the
|
||||
characters read.
|
||||
|
||||
@@ -271,5 +271,7 @@ bash-2.0 were significant.)
|
||||
file permission bits obtained with stat(2). This obeys restrictions of
|
||||
the file system (e.g., read-only or noexec mounts) not available via stat.
|
||||
|
||||
33. Beginning with bash-3.1/readline-5.1, the readline key binding code obeys
|
||||
the current setting of the `convert-meta' variable.
|
||||
33. Bash-3.2 adopts the convention used by other string and pattern matching
|
||||
operators for the `[[' compound command, and matches any quoted portion
|
||||
of the right-hand-side argument to the =~ operator as a string rather
|
||||
than a regular expression.
|
||||
|
||||
+26
-1
@@ -4588,7 +4588,7 @@ doc/bashref.texi
|
||||
----
|
||||
subst.c
|
||||
- add call to sv_histtimefmt in initialize_variables so HISTTIMEFORMAT
|
||||
rom the environment is honored. Fix from Ark Submedes (heh)
|
||||
from the environment is honored. Fix from Ark Submedes (heh)
|
||||
<archimerged@gmail.com>
|
||||
|
||||
lib/readline/histfile.c
|
||||
@@ -6724,3 +6724,28 @@ locale.c
|
||||
support/shobj-conf
|
||||
- support for mingw32, contributed by Carlo Bramix
|
||||
<carlo.bramix@libero.it>
|
||||
|
||||
7/23
|
||||
----
|
||||
execute_cmd.c
|
||||
- added support (currently unused) to manage a list of coprocs
|
||||
|
||||
7/25
|
||||
----
|
||||
bashline.c
|
||||
- add extern declarations for literal_history and force_append_history
|
||||
|
||||
builtins/shopt.def
|
||||
- include "bashhist.h" instead of having extern declarations for the
|
||||
appropriate history variables
|
||||
|
||||
parser.h
|
||||
- new parser_state value: PST_HEREDOC, set when reading body of here-
|
||||
document in parse.y:read_secondary_line
|
||||
|
||||
parse.y
|
||||
- set PST_HEREDOC bit in parser_state when reading a secondary line
|
||||
for the body of a here-document
|
||||
- change read_secondary_line to save lines in the body of a here-
|
||||
document in the shell history list if remember_on_history is
|
||||
set. Fixes bug reported by Gene Golub <gene_golub@hotmail.com>
|
||||
|
||||
@@ -6718,3 +6718,34 @@ print_cmd.c
|
||||
locale.c
|
||||
- in set_locale_var, print a warning message if setlocale() fails any
|
||||
time it's called -- required some code restructuring
|
||||
|
||||
7/19
|
||||
----
|
||||
support/shobj-conf
|
||||
- support for mingw32, contributed by Carlo Bramix
|
||||
<carlo.bramix@libero.it>
|
||||
|
||||
7/23
|
||||
----
|
||||
execute_cmd.c
|
||||
- added support (currently unused) to manage a list of coprocs
|
||||
|
||||
7/25
|
||||
----
|
||||
bashline.c
|
||||
- add extern declarations for literal_history and force_append_history
|
||||
|
||||
builtins/shopt.def
|
||||
- include "bashhist.h" instead of having extern declarations for the
|
||||
appropriate history variables
|
||||
|
||||
parser.h
|
||||
- new parser_state value: PST_HEREDOC, set when reading body of here-
|
||||
document in parse.y:read_secondary_line
|
||||
|
||||
parse.y
|
||||
- set PST_HEREDOC bit in parser_state when reading a secondary line
|
||||
for the body of a here-document
|
||||
- change read_secondary_line to save lines in the body of a here-
|
||||
document in the shell history list if remember_on_history is
|
||||
set. Fixes bug reported by Gene Golub <gene_golub@hotmail.com>
|
||||
|
||||
@@ -275,7 +275,16 @@ does not provide the necessary support.
|
||||
|
||||
`--enable-brace-expansion'
|
||||
Include `csh'-like brace expansion ( `b{a,b}c' ==> `bac bbc' ).
|
||||
See *Note Brace Expansion::, for a complete description.
|
||||
See *note Brace Expansion::, for a complete description.
|
||||
|
||||
`--enable-casemod-attributes'
|
||||
Include support for case-modifying attributes in the `declare'
|
||||
builtin and assignment statements. Variables with the UPPERCASE
|
||||
attribute, for example, will have their values converted to
|
||||
uppercase upon assignment.
|
||||
|
||||
`--enable-casemod-expansion'
|
||||
Include support for case-modifying word expansions.
|
||||
|
||||
`--enable-command-timing'
|
||||
Include support for recognizing `time' as a reserved word and for
|
||||
@@ -292,6 +301,10 @@ does not provide the necessary support.
|
||||
`=~' binary operator in the `[[' conditional command. (*note
|
||||
Conditional Constructs::).
|
||||
|
||||
`--enable-coprocesses'
|
||||
Include support for coprocesses and the `coproc' reserved word
|
||||
(*note Pipelines::).
|
||||
|
||||
`--enable-debugger'
|
||||
Include support for the bash debugger (distributed separately).
|
||||
|
||||
@@ -301,7 +314,7 @@ does not provide the necessary support.
|
||||
|
||||
`--enable-disabled-builtins'
|
||||
Allow builtin commands to be invoked via `builtin xxx' even after
|
||||
`xxx' has been disabled using `enable -n xxx'. See *Note Bash
|
||||
`xxx' has been disabled using `enable -n xxx'. See *note Bash
|
||||
Builtins::, for details of the `builtin' and `enable' builtin
|
||||
commands.
|
||||
|
||||
@@ -311,7 +324,7 @@ does not provide the necessary support.
|
||||
|
||||
`--enable-extended-glob'
|
||||
Include support for the extended pattern matching features
|
||||
described above under *Note Pattern Matching::.
|
||||
described above under *note Pattern Matching::.
|
||||
|
||||
`--enable-help-builtin'
|
||||
Include the `help' builtin, which displays help on shell builtins
|
||||
@@ -346,7 +359,7 @@ does not provide the necessary support.
|
||||
`--enable-prompt-string-decoding'
|
||||
Turn on the interpretation of a number of backslash-escaped
|
||||
characters in the `$PS1', `$PS2', `$PS3', and `$PS4' prompt
|
||||
strings. See *Note Printing a Prompt::, for a complete list of
|
||||
strings. See *note Printing a Prompt::, for a complete list of
|
||||
prompt string escape sequences.
|
||||
|
||||
`--enable-readline'
|
||||
@@ -355,7 +368,7 @@ does not provide the necessary support.
|
||||
|
||||
`--enable-restricted'
|
||||
Include support for a "restricted shell". If this is enabled,
|
||||
Bash, when called as `rbash', enters a restricted mode. See *Note
|
||||
Bash, when called as `rbash', enters a restricted mode. See *note
|
||||
The Restricted Shell::, for a description of restricted mode.
|
||||
|
||||
`--enable-select'
|
||||
|
||||
@@ -856,6 +856,7 @@ tests/histexp.right f
|
||||
tests/history.tests f
|
||||
tests/history.right f
|
||||
tests/history.list f 444
|
||||
tests/history1.sub f
|
||||
tests/ifs.tests f
|
||||
tests/ifs.right f
|
||||
tests/ifs-posix.tests f
|
||||
|
||||
@@ -381,6 +381,7 @@ lib/sh/casemod.c f
|
||||
lib/sh/clktck.c f
|
||||
lib/sh/clock.c f
|
||||
lib/sh/eaccess.c f
|
||||
lib/sh/fdprintf.c f
|
||||
lib/sh/fmtullong.c f
|
||||
lib/sh/fmtulong.c f
|
||||
lib/sh/fmtumax.c f
|
||||
@@ -388,6 +389,7 @@ lib/sh/fpurge.c f
|
||||
lib/sh/getcwd.c f
|
||||
lib/sh/getenv.c f
|
||||
lib/sh/inet_aton.c f
|
||||
lib/sh/input_avail.c f
|
||||
lib/sh/itos.c f
|
||||
lib/sh/mailstat.c f
|
||||
lib/sh/makepath.c f
|
||||
|
||||
@@ -338,3 +338,10 @@ Platform-Specific Configuration and Operation Notes
|
||||
|
||||
18. I have received reports that using -O2 with the MIPSpro results in a
|
||||
binary that fails in strange ways. Using -O1 seems to work.
|
||||
|
||||
19. There is special handling to ensure the shell links against static
|
||||
versions of the included readline and history libraries on Mac OS X;
|
||||
Apple ships inadequate dynamic libreadline and libhistory "replacements"
|
||||
as standard libraries.
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,340 @@
|
||||
Platform-Specific Configuration and Operation Notes
|
||||
===================================================
|
||||
|
||||
1. configure --without-gnu-malloc on:
|
||||
|
||||
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
|
||||
|
||||
all machines running SunOS YP code: SunOS4, SunOS5, HP/UX, if you
|
||||
have problems with username completion or tilde expansion for
|
||||
usernames found via YP/NIS
|
||||
|
||||
linux (optional, but don't do it if you're using Doug Lea's malloc)
|
||||
|
||||
QNX 4.2
|
||||
other OSF/1 machines (KSR/1, HP, IBM AIX/ESA)
|
||||
AIX
|
||||
sparc SVR4, SVR4.2 (ICL reference port)
|
||||
DG/UX
|
||||
Cray
|
||||
|
||||
NetBSD/sparc (malloc needs 8-byte alignment; bash malloc has 8-byte
|
||||
alignment now, but I have no NetBSD machines to test on)
|
||||
|
||||
BSD/OS 2.1, 3.x if you want to use loadable builtins
|
||||
|
||||
Motorola m68k machines running System V.3. There is a file descriptor
|
||||
leak caused by using the bash malloc because closedir(3) needs to read
|
||||
freed memory to find the file descriptor to close
|
||||
|
||||
2. Configure using shlicc2 on BSD/OS 2.1 and BSD/OS 3.x to use loadable
|
||||
builtins
|
||||
|
||||
3. Bash cannot be built in a directory separate from the source directory
|
||||
using configure --srcdir=... unless the version of `make' you're using
|
||||
does $VPATH handling right. The script support/mkclone can be used to
|
||||
create a `build tree' using symlinks to get around this.
|
||||
|
||||
4. I've had reports that username completion (as well as tilde expansion
|
||||
and \u prompt expansion) does not work on IRIX 5.3 when linking with
|
||||
-lnsl. This is only a problem when you're running NIS, since
|
||||
apparently -lnsl supports only /etc/passwd and not the NIS functions
|
||||
for retrieving usernames and passwords. Editing the Makefile after
|
||||
configure runs and removing the `-lnsl' from the assignment to `LIBS'
|
||||
fixes the problem.
|
||||
|
||||
5. There is a problem with the `makewhatis' script in older (pre-7.0)
|
||||
versions of Red Hat Linux. Running `makewhatis' with bash-2.0 or
|
||||
later versions results in error messages like this:
|
||||
|
||||
/usr/sbin/makewhatis: cd: manpath: No such file or directory
|
||||
/usr/sbin/makewhatis: manpath/whatis: No such file or directory
|
||||
chmod: manpath/whatis: No such file or directory
|
||||
/usr/sbin/makewhatis: cd: catpath: No such file or directory
|
||||
/usr/sbin/makewhatis: catpath/whatis: No such file or directory
|
||||
chmod: catpath/whatis: No such file or directory
|
||||
|
||||
The problem is with `makewhatis'. Red Hat (and possibly other
|
||||
Linux distributors) uses a construct like this in the code:
|
||||
|
||||
eval path=$"$pages"path
|
||||
|
||||
to do indirect variable expansion. This `happened to work' in
|
||||
bash-1.14 and previous versions, but that was more an accident
|
||||
of implementation than anything else -- it was never supported
|
||||
and certainly is not portable.
|
||||
|
||||
Bash-2.0 has a new feature that gives a new meaning to $"...".
|
||||
This is explained more completely in item 1 in the COMPAT file.
|
||||
|
||||
The three lines in the `makewhatis' script that need to be changed
|
||||
look like this:
|
||||
|
||||
eval $topath=$"$topath":$name
|
||||
[...]
|
||||
eval path=$"$pages"path
|
||||
[...]
|
||||
eval path=$"$pages"path
|
||||
|
||||
The portable way to write this code is
|
||||
|
||||
eval $topath="\$$topath":$name
|
||||
eval path="\$$pages"path
|
||||
eval path="\$$pages"path
|
||||
|
||||
You could also experiment with another new bash feature: ${!var}.
|
||||
This does indirect variable expansion, making the use of eval
|
||||
unnecessary.
|
||||
|
||||
6. There is a problem with syslogd on many Linux distributions (Red Hat
|
||||
and Slackware are two that I have received reports about). syslogd
|
||||
sends a SIGINT to its parent process, which is waiting for the daemon
|
||||
to finish its initialization. The parent process then dies due to
|
||||
the SIGINT, and bash reports it, causing unexpected console output
|
||||
while the system is booting that looks something like
|
||||
|
||||
starting daemons: syslogd/etc/rc.d/rc.M: line 29: 38 Interrupt ${NET}/syslogd
|
||||
|
||||
Bash-2.0 reports events such as processes dying in scripts due to
|
||||
signals when the standard output is a tty. Bash-1.14.x and previous
|
||||
versions did not report such events.
|
||||
|
||||
This should probably be reported as a bug to whatever Linux distributor
|
||||
people see the problem on. In my opinion, syslogd should be changed to
|
||||
use some other method of communication, or the wrapper function (which
|
||||
appeared to be `daemon' when I looked at it some time ago) or script
|
||||
(which appeared to be `syslog') should catch SIGINT, since it's an
|
||||
expected event, and exit cleanly.
|
||||
|
||||
7. Several people have reported that `dip' (a program for SLIP/PPP
|
||||
on Linux) does not work with bash-2.0 installed as /bin/sh.
|
||||
|
||||
I don't run any Linux boxes myself, and do not have the dip
|
||||
code handy to look at, but the `problem' with bash-2.0, as
|
||||
it has been related to me, is that bash requires the `-p'
|
||||
option to be supplied at invocation if it is to run setuid
|
||||
or setgid.
|
||||
|
||||
This means, among other things, that setuid or setgid programs
|
||||
which call system(3) (a horrendously bad practice in any case)
|
||||
relinquish their setuid/setgid status in the child that's forked
|
||||
to execute /bin/sh.
|
||||
|
||||
The following is an *unofficial* patch to bash-2.0 that causes it
|
||||
to not require `-p' to run setuid or setgid if invoked as `sh'.
|
||||
It has been reported to work on Linux. It will make your system
|
||||
vulnerable to bogus system(3) calls in setuid executables.
|
||||
|
||||
--- ../bash-2.0.orig/shell.c Wed Dec 18 14:16:30 1996
|
||||
+++ shell.c Fri Mar 7 13:12:03 1997
|
||||
@@ -347,7 +347,7 @@
|
||||
if (posixly_correct)
|
||||
posix_initialize (posixly_correct);
|
||||
|
||||
- if (running_setuid && privileged_mode == 0)
|
||||
+ if (running_setuid && privileged_mode == 0 && act_like_sh == 0)
|
||||
disable_priv_mode ();
|
||||
|
||||
/* Need to get the argument to a -c option processed in the
|
||||
|
||||
8. Some people have asked about binding all of the keys in a PC-keyboard-
|
||||
style numeric keypad to readline functions. Here's something I
|
||||
received from the gnu-win32 list that may help. Insert the following
|
||||
lines into ~/.inputrc:
|
||||
|
||||
# home key
|
||||
"\e[1~":beginning-of-line
|
||||
# insert key
|
||||
"\e[2~":kill-whole-line
|
||||
# del key
|
||||
"\e[3~":delete-char
|
||||
# end key
|
||||
"\e[4~":end-of-line
|
||||
# pgup key
|
||||
"\e[5~":history-search-forward
|
||||
# pgdn key
|
||||
"\e[6~":history-search-backward
|
||||
|
||||
9. Hints for building under Minix 2.0 (Contributed by Terry R. McConnell,
|
||||
<tmc@barnyard.syr.edu>)
|
||||
|
||||
The version of /bin/sh distributed with Minix is not up to the job of
|
||||
running the configure script. The easiest solution is to swap /bin/sh
|
||||
with /usr/bin/ash. Then use chmem(1) to increase the memory allocated
|
||||
to /bin/sh. The following settings are known to work:
|
||||
|
||||
text data bss stack memory
|
||||
63552 9440 3304 65536 141832 /bin/sh
|
||||
|
||||
If you have problems with make or yacc it may be worthwhile first to
|
||||
install the GNU versions of these utilities before attempting to build
|
||||
bash. (As of this writing, all of these utilities are available for the
|
||||
i386 as pre-built binaries via anonymous ftp at math.syr.edu in the
|
||||
pub/mcconnell/minix directory. Note that the GNU version of yacc is called
|
||||
bison.)
|
||||
|
||||
Unless you want to see lots of warnings about old-style declarations,
|
||||
do LOCAL_CFLAGS=-wo; export LOCAL_CFLAGS before running configure.
|
||||
(These warnings are harmless, but annoying.)
|
||||
|
||||
configure will insist that you supply a host type. For example, do
|
||||
./configure --host=i386-pc-minix.
|
||||
|
||||
Minix does not support the system calls required for a proper
|
||||
implementation of ulimit(). The `ulimit' builtin will not be available.
|
||||
|
||||
Configure will fail to notice that many things like uid_t are indeed
|
||||
typedef'd in <sys/types.h>, because it uses egrep for this purpose
|
||||
and minix has no egrep. You could try making a link /usr/bin/egrep -->
|
||||
/usr/bin/grep. Better is to install the GNU version of grep in
|
||||
/usr/local/bin and make the link /usr/local/bin/egrep -->/usr/local/bin/grep.
|
||||
(These must be hard links, of course, since Minix does not support
|
||||
symbolic links.)
|
||||
|
||||
You will see many warnings of the form:
|
||||
warning: unknown s_type: 98
|
||||
I have no idea what this means, but it doesn't seem to matter.
|
||||
|
||||
10. If you do not have /usr/ccs/bin in your PATH when building on SunOS 5.x
|
||||
(Solaris 2), the configure script will be unable to find `ar' and
|
||||
`ranlib' (of course, ranlib is unnecessary). Make sure your $PATH
|
||||
includes /usr/ccs/bin on SunOS 5.x. This generally manifests itself
|
||||
with libraries not being built and make reporting errors like
|
||||
`cr: not found' when library construction is attempted.
|
||||
|
||||
11. Building a statically-linked bash on Solaris 2.5.x, 2.6, 7, or 8 is
|
||||
complicated.
|
||||
|
||||
It's not possible to build a completely statically-linked binary, since
|
||||
part of the C library depends on dynamic linking. The following recipe
|
||||
assumes that you're using gcc and the Solaris ld (/usr/ccs/bin/ld) on
|
||||
Solaris 2.5.x or 2.6:
|
||||
|
||||
configure --enable-static-link
|
||||
make STATIC_LD= LOCAL_LIBS='-Wl,-B,dynamic -ldl -Wl,-B,static'
|
||||
|
||||
This should result in a bash binary that depends only on libdl.so:
|
||||
|
||||
thor(2)$ ldd bash
|
||||
libdl.so.1 => /usr/lib/libdl.so.1
|
||||
|
||||
If you're using the Sun C Compiler (Sun WorkShop C Compiler version
|
||||
4.2 was what I used), you should be able to get away with using
|
||||
|
||||
configure --enable-static-link
|
||||
make STATIC_LD= LOCAL_LIBS='-B dynamic -ldl -B static'
|
||||
|
||||
If you want to completely remove any dependence on /usr, perhaps
|
||||
to put a copy of bash in /sbin and have it available when /usr is
|
||||
not mounted, force the build process to use the shared dl.so library
|
||||
in /etc/lib.
|
||||
|
||||
For gcc, this would be something like
|
||||
|
||||
configure --enable-static-link
|
||||
make STATIC_LD= LOCAL_LIBS='-Wl,-B,dynamic -Wl,-R/etc/lib -ldl -Wl,-B,static'
|
||||
|
||||
For Sun's WS4.2 cc
|
||||
|
||||
configure --enable-static-link
|
||||
make STATIC_LD= LOCAL_LIBS='-B dynamic -R/etc/lib -ldl -B static'
|
||||
|
||||
seems to work, at least on Solaris 2.5.1:
|
||||
|
||||
thor(2)$ ldd bash
|
||||
libdl.so.1 => /etc/lib/libdl.so.1
|
||||
|
||||
On Solaris 7 (Solaris 8, using the version of gcc on the free software
|
||||
CD-ROM), the following recipe appears to work for gcc:
|
||||
|
||||
configure --enable-static-link
|
||||
make STATIC_LD='-Wl,-Bstatic' LOCAL_LIBS='-Wl,-Bdynamic -Wl,-R/etc/lib -ldl -Wl,-Bstatic'
|
||||
|
||||
thor.ins.cwru.edu(2)$ ldd bash
|
||||
libdl.so.1 => /etc/lib/libdl.so.1
|
||||
|
||||
Make the analogous changes if you are running Sun's C Compiler.
|
||||
|
||||
I have received word that adding -L/etc/lib (or the equivalent
|
||||
-Wl,-L/etc/lib) might also be necessary, in addition to the -R/etc/lib.
|
||||
|
||||
On later versions of Solaris, it may be necessary to add -lnsl before
|
||||
-ldl; statically-linked versions of bash using libnsl are not guaranteed
|
||||
to work correctly on future versions of Solaris.
|
||||
|
||||
12. Configuring bash to build it in a cross environment. Currently only
|
||||
two native versions can be compiled this way, cygwin32 and x86 BeOS.
|
||||
For BeOS, you would configure it like this:
|
||||
|
||||
export RANLIB=i586-beos-ranlib
|
||||
export AR=i586-beos-ar
|
||||
export CC=i586-beos-gcc
|
||||
configure i586-beos
|
||||
|
||||
Similarly for cygwin32.
|
||||
|
||||
13. Bash-2.05 has reverted to the bash-2.03 behavior of honoring the current
|
||||
locale setting when processing ranges within pattern matching bracket
|
||||
expressions ([A-Z]). This is what POSIX.2 and SUSv2 specify.
|
||||
|
||||
The behavior of the matcher in bash-2.05 depends on the current LC_COLLATE
|
||||
setting. Setting this variable to `C' or `POSIX' will result in the
|
||||
traditional behavior ([A-Z] matches all uppercase ASCII characters).
|
||||
Many other locales, including the en_US locale (the default on many US
|
||||
versions of Linux) collate the upper and lower case letters like this:
|
||||
|
||||
AaBb...Zz
|
||||
|
||||
which means that [A-Z] matches every letter except `z'.
|
||||
|
||||
The portable way to specify upper case letters is [:upper:] instead of
|
||||
A-Z; lower case may be specified as [:lower:] instead of a-z.
|
||||
|
||||
Look at the manual pages for setlocale(3), strcoll(3), and, if it is
|
||||
present, locale(1). If you have locale(1), you can use it to find
|
||||
your current locale information even if you do not have any of the
|
||||
LC_ variables set.
|
||||
|
||||
My advice is to put
|
||||
|
||||
export LC_COLLATE=C
|
||||
|
||||
into /etc/profile and inspect any shell scripts run from cron for
|
||||
constructs like [A-Z]. This will prevent things like
|
||||
|
||||
rm [A-Z]*
|
||||
|
||||
from removing every file in the current directory except those beginning
|
||||
with `z' and still allow individual users to change the collation order.
|
||||
Users may put the above command into their own profiles as well, of course.
|
||||
|
||||
14. Building on Interix (nee OpenNT), which Microsoft bought from Softway
|
||||
Systems and has seemingly abandoned (thanks to Kevin Moore for this item).
|
||||
|
||||
1. cp cross-build/opennt.cache config.cache
|
||||
|
||||
2. If desired, edit pathnames.h to set the values of SYS_PROFILE and
|
||||
DEFAULT_HOSTS_FILE appropriately.
|
||||
|
||||
3. export CONFIG_SHELL=$INTERIX_ROOT/bin/sh
|
||||
|
||||
4. ./configure --prefix=$INTERIX_ROOT/usr/local (or wherever you
|
||||
want it).
|
||||
|
||||
5. make; make install; enjoy
|
||||
|
||||
15. Configure with `CC=xlc' if you don't have gcc on AIX 4.2 and later
|
||||
versions. `xlc' running in `cc' mode has trouble compiling error.c.
|
||||
|
||||
16. Configure --disable-multibyte on NetBSD versions (1.4 through at least
|
||||
1.6.1) that include wctype.h but do not define wctype_t.
|
||||
|
||||
17. Do NOT use bison-1.75. It builds a non-working parser. The most
|
||||
obvious effect is that constructs like "for i; do echo $i; done" don't
|
||||
loop over the positional parameters.
|
||||
|
||||
18. I have received reports that using -O2 with the MIPSpro results in a
|
||||
binary that fails in strange ways. Using -O1 seems to work.
|
||||
@@ -161,6 +161,9 @@ The following list is what's changed when `POSIX mode' is in effect:
|
||||
interpret any arguments to `echo' as options. Each argument is
|
||||
displayed, after escape characters are converted.
|
||||
|
||||
42. The `ulimit' builtin uses a block size of 512 bytes for the `-c'
|
||||
and `-f' options.
|
||||
|
||||
|
||||
There is other POSIX behavior that Bash does not implement by default
|
||||
even when in POSIX mode. Specifically:
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
|
||||
extern int remember_on_history;
|
||||
extern int enable_history_list; /* value for `set -o history' */
|
||||
extern int literal_history; /* controlled by `shopt lithist' */
|
||||
extern int force_append_history;
|
||||
extern int history_lines_this_session;
|
||||
extern int history_lines_in_file;
|
||||
extern int history_expansion;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
extern int remember_on_history;
|
||||
extern int enable_history_list; /* value for `set -o history' */
|
||||
extern int literal_history; /* controlled by `shopt lithist' */
|
||||
extern int history_lines_this_session;
|
||||
extern int history_lines_in_file;
|
||||
extern int history_expansion;
|
||||
@@ -51,6 +52,7 @@ extern void bash_history_disable __P((void));
|
||||
extern void bash_history_enable __P((void));
|
||||
extern void bash_clear_history __P((void));
|
||||
extern int bash_delete_histent __P((int));
|
||||
extern int bash_delete_last_history __P((void));
|
||||
extern void load_history __P((void));
|
||||
extern void save_history __P((void));
|
||||
extern int maybe_append_history __P((char *));
|
||||
|
||||
+4
-5
@@ -62,6 +62,10 @@ $END
|
||||
#include "common.h"
|
||||
#include "bashgetopt.h"
|
||||
|
||||
#if defined (HISTORY)
|
||||
# include "../bashhist.h"
|
||||
#endif
|
||||
|
||||
#define UNSETOPT 0
|
||||
#define SETOPT 1
|
||||
|
||||
@@ -86,11 +90,6 @@ extern int glob_star;
|
||||
extern int extended_glob;
|
||||
#endif
|
||||
|
||||
#if defined (HISTORY)
|
||||
extern int literal_history, command_oriented_history;
|
||||
extern int force_append_history;
|
||||
#endif
|
||||
|
||||
#if defined (READLINE)
|
||||
extern int hist_verify, history_reediting, perform_hostname_completion;
|
||||
extern int no_empty_command_completion;
|
||||
|
||||
@@ -62,6 +62,10 @@ $END
|
||||
#include "common.h"
|
||||
#include "bashgetopt.h"
|
||||
|
||||
#if defined (HISTORY)
|
||||
# include "../bashhist.h"
|
||||
#endif
|
||||
|
||||
#define UNSETOPT 0
|
||||
#define SETOPT 1
|
||||
|
||||
@@ -143,6 +147,7 @@ static struct {
|
||||
{ "cmdhist", &command_oriented_history, (shopt_set_func_t *)NULL },
|
||||
#endif
|
||||
{ "compat31", &shopt_compat31, set_compatibility_level },
|
||||
{ "dirspell", &dircomplete_spelling, (shopt_set_func_t *)NULL },
|
||||
{ "dotglob", &glob_dot_filenames, (shopt_set_func_t *)NULL },
|
||||
{ "execfail", &no_exit_on_failed_exec, (shopt_set_func_t *)NULL },
|
||||
{ "expand_aliases", &expand_aliases, (shopt_set_func_t *)NULL },
|
||||
|
||||
+340
-304
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -4321,7 +4321,7 @@ and typeahead to be discarded.
|
||||
There are a number of ways to refer to a job in the shell.
|
||||
The character
|
||||
.B %
|
||||
introduces a job name. Job number
|
||||
introduces a job specification (\fIjobspec\fP). Job number
|
||||
.I n
|
||||
may be referred to as
|
||||
.BR %n .
|
||||
|
||||
@@ -907,6 +907,8 @@ The file descriptors can be utilized as arguments to shell commands
|
||||
and redirections using standard word expansions.
|
||||
The process id of the shell spawned to execute the coprocess is
|
||||
available as the value of the variable \fINAME\fP_PID.
|
||||
The \fBwait\fP
|
||||
builtin command may be used to wait for the coprocess to terminate.
|
||||
.PP
|
||||
The return status of a coprocess is the exit status of \fIcommand\fP.
|
||||
.SS Shell Function Definitions
|
||||
|
||||
+214
-146
@@ -3,7 +3,7 @@
|
||||
</HEAD>
|
||||
<BODY><TABLE WIDTH=100%>
|
||||
<TR>
|
||||
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2008 June 29<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2008 July 6<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
</TR>
|
||||
</TABLE>
|
||||
<BR><A HREF="#index">Index</A>
|
||||
@@ -1115,6 +1115,58 @@ of the last <B>do</B> <I>list</I> command executed, or zero if
|
||||
none was executed.
|
||||
</DL>
|
||||
<A NAME="lbAP"> </A>
|
||||
<H4>Coprocesses</H4>
|
||||
|
||||
<P>
|
||||
|
||||
A <I>coprocess</I> is a shell command preceded by the <B>coproc</B> reserved
|
||||
word.
|
||||
A coprocess is executed asynchronously in a subshell, as if the command
|
||||
had been terminated with the <B>&</B> control operator, with a two-way pipe
|
||||
established between the executing shell and the coprocess.
|
||||
<P>
|
||||
|
||||
The format for a coprocess is:
|
||||
<DL COMPACT><DT><DD>
|
||||
<P>
|
||||
|
||||
<B>coproc</B> [<I>NAME</I>] <I>command</I> [<I>redirections</I>]
|
||||
</DL>
|
||||
|
||||
<P>
|
||||
|
||||
This creates a coprocess named <I>NAME</I>.
|
||||
If <I>NAME</I> is not supplied, the default name is <I>COPROC</I>.
|
||||
When the coproc is executed, the shell creates an array variable (see
|
||||
<B>Arrays</B>
|
||||
|
||||
below) named <I>NAME</I> in the context of the executing shell.
|
||||
The standard output of
|
||||
<I>command</I>
|
||||
|
||||
is connected via a pipe to a file descriptor in the executing shell,
|
||||
and that file descriptor is assigned to <I>NAME</I>[0].
|
||||
The standard input of
|
||||
<I>command</I>
|
||||
|
||||
is connected via a pipe to a file descriptor in the executing shell,
|
||||
and that file descriptor is assigned to <I>NAME</I>[1].
|
||||
This pipe is established before any redirections specified by the
|
||||
command (see
|
||||
<FONT SIZE=-1><B>REDIRECTION</B>
|
||||
|
||||
</FONT>
|
||||
below).
|
||||
The file descriptors can be utilized as arguments to shell commands
|
||||
and redirections using standard word expansions.
|
||||
The process id of the shell spawned to execute the coprocess is
|
||||
available as the value of the variable <I>NAME</I>_PID.
|
||||
The <B>wait</B>
|
||||
builtin command may be used to wait for the coprocess to terminate.
|
||||
<P>
|
||||
|
||||
The return status of a coprocess is the exit status of <I>command</I>.
|
||||
<A NAME="lbAQ"> </A>
|
||||
<H4>Shell Function Definitions</H4>
|
||||
|
||||
<P>
|
||||
@@ -1150,7 +1202,7 @@ last command executed in the body. (See
|
||||
</FONT>
|
||||
below.)
|
||||
</DL>
|
||||
<A NAME="lbAQ"> </A>
|
||||
<A NAME="lbAR"> </A>
|
||||
<H3>COMMENTS</H3>
|
||||
|
||||
In a non-interactive shell, or an interactive shell in which the
|
||||
@@ -1174,7 +1226,7 @@ option enabled does not allow comments. The
|
||||
<B>interactive_comments</B>
|
||||
|
||||
option is on by default in interactive shells.
|
||||
<A NAME="lbAR"> </A>
|
||||
<A NAME="lbAS"> </A>
|
||||
<H3>QUOTING</H3>
|
||||
|
||||
<I>Quoting</I> is used to remove the special meaning of certain
|
||||
@@ -1355,7 +1407,7 @@ If the current locale is <B>C</B> or <B>POSIX</B>, the dollar sign
|
||||
is ignored.
|
||||
If the string is translated and replaced, the replacement is
|
||||
double-quoted.
|
||||
<A NAME="lbAS"> </A>
|
||||
<A NAME="lbAT"> </A>
|
||||
<H3>PARAMETERS</H3>
|
||||
|
||||
A
|
||||
@@ -1472,7 +1524,7 @@ appended to the array beginning at one greater than the array's maximum index
|
||||
associative array.
|
||||
When applied to a string-valued variable, <I>value</I> is expanded and
|
||||
appended to the variable's value.
|
||||
<A NAME="lbAT"> </A>
|
||||
<A NAME="lbAU"> </A>
|
||||
<H4>Positional Parameters</H4>
|
||||
|
||||
<P>
|
||||
@@ -1501,7 +1553,7 @@ digit is expanded, it must be enclosed in braces (see
|
||||
|
||||
</FONT>
|
||||
below).
|
||||
<A NAME="lbAU"> </A>
|
||||
<A NAME="lbAV"> </A>
|
||||
<H4>Special Parameters</H4>
|
||||
|
||||
<P>
|
||||
@@ -1624,7 +1676,7 @@ When checking mail, this parameter holds the name of the mail file
|
||||
currently being checked.
|
||||
|
||||
</DL>
|
||||
<A NAME="lbAV"> </A>
|
||||
<A NAME="lbAW"> </A>
|
||||
<H4>Shell Variables</H4>
|
||||
|
||||
<P>
|
||||
@@ -2709,7 +2761,7 @@ remaining words on the line. It does not necessarily cause the shell
|
||||
parser to treat the rest of the line as a comment.
|
||||
|
||||
</DL>
|
||||
<A NAME="lbAW"> </A>
|
||||
<A NAME="lbAX"> </A>
|
||||
<H4>Arrays</H4>
|
||||
|
||||
<B>Bash</B>
|
||||
@@ -2853,7 +2905,7 @@ and
|
||||
|
||||
builtins display array values in a way that allows them to be
|
||||
reused as assignments.
|
||||
<A NAME="lbAX"> </A>
|
||||
<A NAME="lbAY"> </A>
|
||||
<H3>EXPANSION</H3>
|
||||
|
||||
Expansion is performed on the command line after it has been split into
|
||||
@@ -2895,7 +2947,7 @@ as explained above (see
|
||||
<FONT SIZE=-1><B>PARAMETERS</B>).
|
||||
|
||||
</FONT>
|
||||
<A NAME="lbAY"> </A>
|
||||
<A NAME="lbAZ"> </A>
|
||||
<H4>Brace Expansion</H4>
|
||||
|
||||
<P>
|
||||
@@ -3018,7 +3070,7 @@ command (see
|
||||
|
||||
</FONT>
|
||||
below).
|
||||
<A NAME="lbAZ"> </A>
|
||||
<A NAME="lbBA"> </A>
|
||||
<H4>Tilde Expansion</H4>
|
||||
|
||||
<P>
|
||||
@@ -3089,7 +3141,7 @@ and
|
||||
|
||||
</FONT>
|
||||
and the shell assigns the expanded value.
|
||||
<A NAME="lbBA"> </A>
|
||||
<A NAME="lbBB"> </A>
|
||||
<H4>Parameter Expansion</H4>
|
||||
|
||||
<P>
|
||||
@@ -3421,7 +3473,7 @@ or
|
||||
the case modification operation is applied to each member of the
|
||||
array in turn, and the expansion is the resultant list.
|
||||
</DL>
|
||||
<A NAME="lbBB"> </A>
|
||||
<A NAME="lbBC"> </A>
|
||||
<H4>Command Substitution</H4>
|
||||
|
||||
<P>
|
||||
@@ -3475,7 +3527,7 @@ escape the inner backquotes with backslashes.
|
||||
|
||||
If the substitution appears within double quotes, word splitting and
|
||||
pathname expansion are not performed on the results.
|
||||
<A NAME="lbBC"> </A>
|
||||
<A NAME="lbBD"> </A>
|
||||
<H4>Arithmetic Expansion</H4>
|
||||
|
||||
<P>
|
||||
@@ -3511,7 +3563,7 @@ is invalid,
|
||||
<B>bash</B>
|
||||
|
||||
prints a message indicating failure and no substitution occurs.
|
||||
<A NAME="lbBD"> </A>
|
||||
<A NAME="lbBE"> </A>
|
||||
<H4>Process Substitution</H4>
|
||||
|
||||
<P>
|
||||
@@ -3535,7 +3587,7 @@ When available, process substitution is performed
|
||||
simultaneously with parameter and variable expansion,
|
||||
command substitution,
|
||||
and arithmetic expansion.
|
||||
<A NAME="lbBE"> </A>
|
||||
<A NAME="lbBF"> </A>
|
||||
<H4>Word Splitting</H4>
|
||||
|
||||
<P>
|
||||
@@ -3635,7 +3687,7 @@ null argument results and is retained.
|
||||
|
||||
Note that if no expansion occurs, no splitting
|
||||
is performed.
|
||||
<A NAME="lbBF"> </A>
|
||||
<A NAME="lbBG"> </A>
|
||||
<H4>Pathname Expansion</H4>
|
||||
|
||||
<P>
|
||||
@@ -3916,7 +3968,7 @@ Matches anything except one of the given patterns
|
||||
</DL></DL>
|
||||
|
||||
|
||||
<A NAME="lbBG"> </A>
|
||||
<A NAME="lbBH"> </A>
|
||||
<H4>Quote Removal</H4>
|
||||
|
||||
<P>
|
||||
@@ -3929,7 +3981,7 @@ characters
|
||||
|
||||
and <B>"</B> that did not result from one of the above
|
||||
expansions are removed.
|
||||
<A NAME="lbBH"> </A>
|
||||
<A NAME="lbBI"> </A>
|
||||
<H3>REDIRECTION</H3>
|
||||
|
||||
Before a command is executed, its input and output
|
||||
@@ -4048,7 +4100,7 @@ A failure to open or create a file causes the redirection to fail.
|
||||
Redirections using file descriptors greater than 9 should be used with
|
||||
care, as they may conflict with file descriptors the shell uses
|
||||
internally.
|
||||
<A NAME="lbBI"> </A>
|
||||
<A NAME="lbBJ"> </A>
|
||||
<H4>Redirecting Input</H4>
|
||||
|
||||
<P>
|
||||
@@ -4073,7 +4125,7 @@ The general format for redirecting input is:
|
||||
[<I>n</I>]<B><</B><I>word</I>
|
||||
</DL>
|
||||
|
||||
<A NAME="lbBJ"> </A>
|
||||
<A NAME="lbBK"> </A>
|
||||
<H4>Redirecting Output</H4>
|
||||
|
||||
<P>
|
||||
@@ -4127,7 +4179,7 @@ option to the
|
||||
|
||||
builtin command is not enabled, the redirection is attempted even
|
||||
if the file named by <I>word</I> exists.
|
||||
<A NAME="lbBK"> </A>
|
||||
<A NAME="lbBL"> </A>
|
||||
<H4>Appending Redirected Output</H4>
|
||||
|
||||
<P>
|
||||
@@ -4155,7 +4207,7 @@ The general format for appending output is:
|
||||
|
||||
<P>
|
||||
|
||||
<A NAME="lbBL"> </A>
|
||||
<A NAME="lbBM"> </A>
|
||||
<H4>Redirecting Standard Output and Standard Error</H4>
|
||||
|
||||
<P>
|
||||
@@ -4194,7 +4246,7 @@ This is semantically equivalent to
|
||||
|
||||
<P>
|
||||
|
||||
<A NAME="lbBM"> </A>
|
||||
<A NAME="lbBN"> </A>
|
||||
<H4>Appending Standard Output and Standard Error</H4>
|
||||
|
||||
<P>
|
||||
@@ -4224,7 +4276,7 @@ This is semantically equivalent to
|
||||
<B>>></B><I>word</I> 2<B>>&</B>1
|
||||
</DL>
|
||||
|
||||
<A NAME="lbBN"> </A>
|
||||
<A NAME="lbBO"> </A>
|
||||
<H4>Here Documents</H4>
|
||||
|
||||
<P>
|
||||
@@ -4296,7 +4348,7 @@ line containing
|
||||
This allows
|
||||
here-documents within shell scripts to be indented in a
|
||||
natural fashion.
|
||||
<A NAME="lbBO"> </A>
|
||||
<A NAME="lbBP"> </A>
|
||||
<H4>Here Strings</H4>
|
||||
|
||||
A variant of here documents, the format is:
|
||||
@@ -4313,7 +4365,7 @@ A variant of here documents, the format is:
|
||||
|
||||
The <I>word</I> is expanded and supplied to the command on its standard
|
||||
input.
|
||||
<A NAME="lbBP"> </A>
|
||||
<A NAME="lbBQ"> </A>
|
||||
<H4>Duplicating File Descriptors</H4>
|
||||
|
||||
<P>
|
||||
@@ -4374,7 +4426,7 @@ do not specify a file descriptor open for output, a redirection error occurs.
|
||||
As a special case, if <I>n</I> is omitted, and <I>word</I> does not
|
||||
expand to one or more digits, the standard output and standard
|
||||
error are redirected as described previously.
|
||||
<A NAME="lbBQ"> </A>
|
||||
<A NAME="lbBR"> </A>
|
||||
<H4>Moving File Descriptors</H4>
|
||||
|
||||
<P>
|
||||
@@ -4408,7 +4460,7 @@ moves the file descriptor <I>digit</I> to file descriptor
|
||||
<I>n</I>,
|
||||
|
||||
or the standard output (file descriptor 1) if <I>n</I> is not specified.
|
||||
<A NAME="lbBR"> </A>
|
||||
<A NAME="lbBS"> </A>
|
||||
<H4>Opening File Descriptors for Reading and Writing</H4>
|
||||
|
||||
<P>
|
||||
@@ -4432,7 +4484,7 @@ or on file descriptor 0 if
|
||||
<I>n</I>
|
||||
|
||||
is not specified. If the file does not exist, it is created.
|
||||
<A NAME="lbBS"> </A>
|
||||
<A NAME="lbBT"> </A>
|
||||
<H3>ALIASES</H3>
|
||||
|
||||
<I>Aliases</I> allow a string to be substituted for a word when it is used
|
||||
@@ -4534,7 +4586,7 @@ in compound commands.
|
||||
|
||||
For almost every purpose, aliases are superseded by
|
||||
shell functions.
|
||||
<A NAME="lbBT"> </A>
|
||||
<A NAME="lbBU"> </A>
|
||||
<H3>FUNCTIONS</H3>
|
||||
|
||||
A shell function, defined as described above under
|
||||
@@ -4653,7 +4705,7 @@ Care should be taken in cases where this may cause a problem.
|
||||
|
||||
Functions may be recursive. No limit is imposed on the number
|
||||
of recursive calls.
|
||||
<A NAME="lbBU"> </A>
|
||||
<A NAME="lbBV"> </A>
|
||||
<H3>ARITHMETIC EVALUATION</H3>
|
||||
|
||||
The shell allows arithmetic expressions to be evaluated, under
|
||||
@@ -4776,7 +4828,7 @@ and 35.
|
||||
Operators are evaluated in order of precedence. Sub-expressions in
|
||||
parentheses are evaluated first and may override the precedence
|
||||
rules above.
|
||||
<A NAME="lbBV"> </A>
|
||||
<A NAME="lbBW"> </A>
|
||||
<H3>CONDITIONAL EXPRESSIONS</H3>
|
||||
|
||||
Conditional expressions are used by the <B>[[</B> compound command and
|
||||
@@ -4961,7 +5013,7 @@ and
|
||||
may be positive or negative integers.
|
||||
|
||||
</DL>
|
||||
<A NAME="lbBW"> </A>
|
||||
<A NAME="lbBX"> </A>
|
||||
<H3>SIMPLE COMMAND EXPANSION</H3>
|
||||
|
||||
When a simple command is executed, the shell performs the following
|
||||
@@ -5005,7 +5057,7 @@ described below. Otherwise, the command exits. If one of the expansions
|
||||
contained a command substitution, the exit status of the command is
|
||||
the exit status of the last command substitution performed. If there
|
||||
were no command substitutions, the command exits with a status of zero.
|
||||
<A NAME="lbBX"> </A>
|
||||
<A NAME="lbBY"> </A>
|
||||
<H3>COMMAND EXECUTION</H3>
|
||||
|
||||
After a command has been split into words, if it results in a
|
||||
@@ -5091,7 +5143,7 @@ interpreter consist of a single optional argument following the
|
||||
interpreter name on the first line of the program, followed
|
||||
by the name of the program, followed by the command
|
||||
arguments, if any.
|
||||
<A NAME="lbBY"> </A>
|
||||
<A NAME="lbBZ"> </A>
|
||||
<H3>COMMAND EXECUTION ENVIRONMENT</H3>
|
||||
|
||||
The shell has an <I>execution environment</I>, which consists of the
|
||||
@@ -5169,7 +5221,7 @@ If a command is followed by a <B>&</B> and job control is not active, the
|
||||
default standard input for the command is the empty file <I>/dev/null</I>.
|
||||
Otherwise, the invoked command inherits the file descriptors of the calling
|
||||
shell as modified by redirections.
|
||||
<A NAME="lbBZ"> </A>
|
||||
<A NAME="lbCA"> </A>
|
||||
<H3>ENVIRONMENT</H3>
|
||||
|
||||
When a program is invoked it is given an array of strings
|
||||
@@ -5246,7 +5298,7 @@ invokes an external command, the variable
|
||||
|
||||
is set to the full file name of the command and passed to that
|
||||
command in its environment.
|
||||
<A NAME="lbCA"> </A>
|
||||
<A NAME="lbCB"> </A>
|
||||
<H3>EXIT STATUS</H3>
|
||||
|
||||
<P>
|
||||
@@ -5286,7 +5338,7 @@ All builtins return an exit status of 2 to indicate incorrect usage.
|
||||
executed, unless a syntax error occurs, in which case it exits
|
||||
with a non-zero value. See also the <B>exit</B> builtin
|
||||
command below.
|
||||
<A NAME="lbCB"> </A>
|
||||
<A NAME="lbCC"> </A>
|
||||
<H3>SIGNALS</H3>
|
||||
|
||||
When <B>bash</B> is interactive, in the absence of any traps, it ignores
|
||||
@@ -5403,7 +5455,7 @@ When <B>bash</B> is waiting for an asynchronous command via the <B>wait</B>
|
||||
builtin, the reception of a signal for which a trap has been set will
|
||||
cause the <B>wait</B> builtin to return immediately with an exit status
|
||||
greater than 128, immediately after which the trap is executed.
|
||||
<A NAME="lbCC"> </A>
|
||||
<A NAME="lbCD"> </A>
|
||||
<H3>JOB CONTROL</H3>
|
||||
|
||||
<I>Job control</I>
|
||||
@@ -5633,7 +5685,7 @@ command may then be used to inspect their status.
|
||||
If a second attempt to exit is made without an intervening command,
|
||||
the shell does not print another warning, and any stopped
|
||||
jobs are terminated.
|
||||
<A NAME="lbCD"> </A>
|
||||
<A NAME="lbCE"> </A>
|
||||
<H3>PROMPTING</H3>
|
||||
|
||||
When executing interactively,
|
||||
@@ -5803,7 +5855,7 @@ command under
|
||||
|
||||
</FONT>
|
||||
below).
|
||||
<A NAME="lbCE"> </A>
|
||||
<A NAME="lbCF"> </A>
|
||||
<H3>READLINE</H3>
|
||||
|
||||
This is the library that handles reading input when using an interactive
|
||||
@@ -5827,7 +5879,7 @@ builtin (see
|
||||
|
||||
</FONT>
|
||||
below).
|
||||
<A NAME="lbCF"> </A>
|
||||
<A NAME="lbCG"> </A>
|
||||
<H4>Readline Notation</H4>
|
||||
|
||||
<P>
|
||||
@@ -5873,7 +5925,7 @@ deleted is saved for possible future retrieval
|
||||
accumulated into one unit, which can be yanked all at once.
|
||||
Commands which do not kill text separate the chunks of text
|
||||
on the kill ring.
|
||||
<A NAME="lbCG"> </A>
|
||||
<A NAME="lbCH"> </A>
|
||||
<H4>Readline Initialization</H4>
|
||||
|
||||
<P>
|
||||
@@ -5952,7 +6004,7 @@ and
|
||||
|
||||
In addition to command names, readline allows keys to be bound
|
||||
to a string that is inserted when the key is pressed (a <I>macro</I>).
|
||||
<A NAME="lbCH"> </A>
|
||||
<A NAME="lbCI"> </A>
|
||||
<H4>Readline Key Bindings</H4>
|
||||
|
||||
<P>
|
||||
@@ -6159,7 +6211,7 @@ builtin command (see
|
||||
|
||||
</FONT>
|
||||
below).
|
||||
<A NAME="lbCI"> </A>
|
||||
<A NAME="lbCJ"> </A>
|
||||
<H4>Readline Variables</H4>
|
||||
|
||||
<P>
|
||||
@@ -6404,7 +6456,7 @@ by <I>stat</I>(2) is appended to the filename when listing possible
|
||||
completions.
|
||||
|
||||
</DL>
|
||||
<A NAME="lbCJ"> </A>
|
||||
<A NAME="lbCK"> </A>
|
||||
<H4>Readline Conditional Constructs</H4>
|
||||
|
||||
<P>
|
||||
@@ -6488,7 +6540,7 @@ would read <A HREF="file:/etc/inputrc"><I>/etc/inputrc</I></A>:
|
||||
</DL>
|
||||
|
||||
</DL>
|
||||
<A NAME="lbCK"> </A>
|
||||
<A NAME="lbCL"> </A>
|
||||
<H4>Searching</H4>
|
||||
|
||||
<P>
|
||||
@@ -6541,7 +6593,7 @@ new search string, any remembered search string is used.
|
||||
Non-incremental searches read the entire search string before starting
|
||||
to search for matching history lines. The search string may be
|
||||
typed by the user or be part of the contents of the current line.
|
||||
<A NAME="lbCL"> </A>
|
||||
<A NAME="lbCM"> </A>
|
||||
<H4>Readline Command Names</H4>
|
||||
|
||||
<P>
|
||||
@@ -6553,7 +6605,7 @@ In the following descriptions, <I>point</I> refers to the current cursor
|
||||
position, and <I>mark</I> refers to a cursor position saved by the
|
||||
<B>set-mark</B> command.
|
||||
The text between the point and mark is referred to as the <I>region</I>.
|
||||
<A NAME="lbCM"> </A>
|
||||
<A NAME="lbCN"> </A>
|
||||
<H4>Commands for Moving</H4>
|
||||
|
||||
<P>
|
||||
@@ -6598,7 +6650,7 @@ screen.
|
||||
Refresh the current line.
|
||||
|
||||
</DL>
|
||||
<A NAME="lbCN"> </A>
|
||||
<A NAME="lbCO"> </A>
|
||||
<H4>Commands for Manipulating the History</H4>
|
||||
|
||||
<P>
|
||||
@@ -6755,7 +6807,7 @@ commands.
|
||||
and <I>emacs</I> as the editor, in that order.
|
||||
|
||||
</DL>
|
||||
<A NAME="lbCO"> </A>
|
||||
<A NAME="lbCP"> </A>
|
||||
<H4>Commands for Changing Text</H4>
|
||||
|
||||
<P>
|
||||
@@ -6840,7 +6892,7 @@ Characters bound to <B>backward-delete-char</B> replace the character
|
||||
before point with a space. By default, this command is unbound.
|
||||
|
||||
</DL>
|
||||
<A NAME="lbCP"> </A>
|
||||
<A NAME="lbCQ"> </A>
|
||||
<H4>Killing and Yanking</H4>
|
||||
|
||||
<P>
|
||||
@@ -6924,7 +6976,7 @@ or
|
||||
|
||||
|
||||
</DL>
|
||||
<A NAME="lbCQ"> </A>
|
||||
<A NAME="lbCR"> </A>
|
||||
<H4>Numeric Arguments</H4>
|
||||
|
||||
<P>
|
||||
@@ -6954,7 +7006,7 @@ first time makes the argument count four, a second time makes the
|
||||
argument count sixteen, and so on.
|
||||
|
||||
</DL>
|
||||
<A NAME="lbCR"> </A>
|
||||
<A NAME="lbCS"> </A>
|
||||
<H4>Completing</H4>
|
||||
|
||||
<P>
|
||||
@@ -7079,7 +7131,7 @@ enclosed within braces so the list is available to the shell (see
|
||||
above).
|
||||
|
||||
</DL>
|
||||
<A NAME="lbCS"> </A>
|
||||
<A NAME="lbCT"> </A>
|
||||
<H4>Keyboard Macros</H4>
|
||||
|
||||
<P>
|
||||
@@ -7102,7 +7154,7 @@ Re-execute the last keyboard macro defined, by making the characters
|
||||
in the macro appear as if typed at the keyboard.
|
||||
|
||||
</DL>
|
||||
<A NAME="lbCT"> </A>
|
||||
<A NAME="lbCU"> </A>
|
||||
<H4>Miscellaneous</H4>
|
||||
|
||||
<P>
|
||||
@@ -7242,7 +7294,7 @@ Display version information about the current instance of
|
||||
|
||||
|
||||
</DL>
|
||||
<A NAME="lbCU"> </A>
|
||||
<A NAME="lbCV"> </A>
|
||||
<H4>Programmable Completion</H4>
|
||||
|
||||
<P>
|
||||
@@ -7422,7 +7474,7 @@ the programmable completion functions force readline to append a slash
|
||||
to completed names which are symbolic links to directories, subject to
|
||||
the value of the <B>mark-directories</B> readline variable, regardless
|
||||
of the setting of the <B>mark-symlinked-directories</B> readline variable.
|
||||
<A NAME="lbCV"> </A>
|
||||
<A NAME="lbCW"> </A>
|
||||
<H3>HISTORY</H3>
|
||||
|
||||
When the
|
||||
@@ -7575,7 +7627,7 @@ builtin below under
|
||||
|
||||
</FONT>
|
||||
for information on setting and unsetting shell options.
|
||||
<A NAME="lbCW"> </A>
|
||||
<A NAME="lbCX"> </A>
|
||||
<H3>HISTORY EXPANSION</H3>
|
||||
|
||||
<P>
|
||||
@@ -7691,7 +7743,7 @@ above under
|
||||
The shell uses
|
||||
the history comment character to mark history timestamps when
|
||||
writing the history file.
|
||||
<A NAME="lbCX"> </A>
|
||||
<A NAME="lbCY"> </A>
|
||||
<H4>Event Designators</H4>
|
||||
|
||||
<P>
|
||||
@@ -7761,7 +7813,7 @@ Equivalent to
|
||||
The entire command line typed so far.
|
||||
|
||||
</DL>
|
||||
<A NAME="lbCY"> </A>
|
||||
<A NAME="lbCZ"> </A>
|
||||
<H4>Word Designators</H4>
|
||||
|
||||
<P>
|
||||
@@ -7838,7 +7890,7 @@ Abbreviates <I>x-$</I> like <B>x*</B>, but omits the last word.
|
||||
|
||||
If a word designator is supplied without an event specification, the
|
||||
previous command is used as the event.
|
||||
<A NAME="lbCZ"> </A>
|
||||
<A NAME="lbDA"> </A>
|
||||
<H4>Modifiers</H4>
|
||||
|
||||
<P>
|
||||
@@ -7943,7 +7995,7 @@ An <B>a</B> may be used as a synonym for <B>g</B>.
|
||||
Apply the following `<B>s</B>' modifier once to each word in the event line.
|
||||
|
||||
</DL>
|
||||
<A NAME="lbDA"> </A>
|
||||
<A NAME="lbDB"> </A>
|
||||
<H3>SHELL BUILTIN COMMANDS</H3>
|
||||
|
||||
|
||||
@@ -8617,9 +8669,9 @@ must be >= 1. If
|
||||
is greater than the number of enclosing loops, the last enclosing loop
|
||||
(the ``top-level'' loop) is resumed.
|
||||
The return value is 0 unless <I>n</I> is not greater than or equal to 1.
|
||||
<DT><B>declare</B> [<B>-aAfFirtx</B>] [<B>-p</B>] [<I>name</I>[=<I>value</I>] ...]<DD>
|
||||
<DT><B>declare</B> [<B>-aAfFilrtux</B>] [<B>-p</B>] [<I>name</I>[=<I>value</I>] ...]<DD>
|
||||
|
||||
<DT><B>typeset</B> [<B>-aAfFirtx</B>] [<B>-p</B>] [<I>name</I>[=<I>value</I>] ...]<DD>
|
||||
<DT><B>typeset</B> [<B>-aAfFilrtux</B>] [<B>-p</B>] [<I>name</I>[=<I>value</I>] ...]<DD>
|
||||
|
||||
Declare variables and/or give them attributes.
|
||||
If no <I>name</I>s are given then display the values of variables.
|
||||
@@ -8687,6 +8739,12 @@ The variable is treated as an integer; arithmetic evaluation (see
|
||||
|
||||
</FONT>
|
||||
is performed when the variable is assigned a value.
|
||||
<DT><B>-l</B>
|
||||
|
||||
<DD>
|
||||
When the variable is assigned a value, all upper-case characters are
|
||||
converted to lower-case.
|
||||
The upper-case attribute is disabled.
|
||||
<DT><B>-r</B>
|
||||
|
||||
<DD>
|
||||
@@ -8699,6 +8757,12 @@ Give each <I>name</I> the <I>trace</I> attribute.
|
||||
Traced functions inherit the <B>DEBUG</B> and <B>RETURN</B> traps from
|
||||
the calling shell.
|
||||
The trace attribute has no special meaning for variables.
|
||||
<DT><B>-u</B>
|
||||
|
||||
<DD>
|
||||
When the variable is assigned a value, all lower-case characters are
|
||||
converted to upper-case.
|
||||
The lower-case attribute is disabled.
|
||||
<DT><B>-x</B>
|
||||
|
||||
<DD>
|
||||
@@ -10045,8 +10109,8 @@ are supplied, the line read is assigned to the variable
|
||||
|
||||
</FONT>
|
||||
The return code is zero, unless end-of-file is encountered, <B>read</B>
|
||||
times out, or an invalid file descriptor is supplied as the argument to
|
||||
<B>-u</B>.
|
||||
times out (in which case the return code is greater than 128), or an
|
||||
invalid file descriptor is supplied as the argument to <B>-u</B>.
|
||||
</DL>
|
||||
|
||||
<DT><B>readonly</B> [<B>-aApf</B>] [<I>name</I>[=<I>word</I>] ...]<DD>
|
||||
@@ -11646,7 +11710,7 @@ process or job waited for.
|
||||
|
||||
|
||||
</DL>
|
||||
<A NAME="lbDB"> </A>
|
||||
<A NAME="lbDC"> </A>
|
||||
<H3>RESTRICTED SHELL</H3>
|
||||
|
||||
|
||||
@@ -11760,7 +11824,7 @@ turns off any restrictions in the shell spawned to execute the
|
||||
script.
|
||||
|
||||
|
||||
<A NAME="lbDC"> </A>
|
||||
<A NAME="lbDD"> </A>
|
||||
<H3>SEE ALSO</H3>
|
||||
|
||||
|
||||
@@ -11774,7 +11838,7 @@ script.
|
||||
<DT><I>readline</I>(3)<DD>
|
||||
|
||||
</DL>
|
||||
<A NAME="lbDD"> </A>
|
||||
<A NAME="lbDE"> </A>
|
||||
<H3>FILES</H3>
|
||||
|
||||
|
||||
@@ -11811,7 +11875,7 @@ The individual login shell cleanup file, executed when a login shell exits
|
||||
Individual <I>readline</I> initialization file
|
||||
|
||||
</DL>
|
||||
<A NAME="lbDE"> </A>
|
||||
<A NAME="lbDF"> </A>
|
||||
<H3>AUTHORS</H3>
|
||||
|
||||
Brian Fox, Free Software Foundation
|
||||
@@ -11824,7 +11888,7 @@ Chet Ramey, Case Western Reserve University
|
||||
<BR>
|
||||
|
||||
<A HREF="mailto:chet@po.cwru.edu">chet@po.cwru.edu</A>
|
||||
<A NAME="lbDF"> </A>
|
||||
<A NAME="lbDG"> </A>
|
||||
<H3>BUG REPORTS</H3>
|
||||
|
||||
If you find a bug in
|
||||
@@ -11875,7 +11939,7 @@ Comments and bug reports concerning
|
||||
this manual page should be directed to
|
||||
<I><A HREF="mailto:chet@po.cwru.edu">chet@po.cwru.edu</A></I>.
|
||||
|
||||
<A NAME="lbDG"> </A>
|
||||
<A NAME="lbDH"> </A>
|
||||
<H3>BUGS</H3>
|
||||
|
||||
<P>
|
||||
@@ -11919,13 +11983,16 @@ error messages while the construct is being read.
|
||||
<P>
|
||||
|
||||
Array variables may not (yet) be exported.
|
||||
<P>
|
||||
|
||||
There may be only one active coprocess at a time.
|
||||
|
||||
|
||||
|
||||
<HR>
|
||||
<TABLE WIDTH=100%>
|
||||
<TR>
|
||||
<TH ALIGN=LEFT width=33%>GNU Bash-4.0<TH ALIGN=CENTER width=33%>2008 June 29<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
<TH ALIGN=LEFT width=33%>GNU Bash-4.0<TH ALIGN=CENTER width=33%>2008 July 6<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
</TR>
|
||||
</TABLE>
|
||||
<HR>
|
||||
@@ -11946,90 +12013,91 @@ Array variables may not (yet) be exported.
|
||||
<DT><A HREF="#lbAM">Pipelines</A><DD>
|
||||
<DT><A HREF="#lbAN">Lists</A><DD>
|
||||
<DT><A HREF="#lbAO">Compound Commands</A><DD>
|
||||
<DT><A HREF="#lbAP">Shell Function Definitions</A><DD>
|
||||
<DT><A HREF="#lbAP">Coprocesses</A><DD>
|
||||
<DT><A HREF="#lbAQ">Shell Function Definitions</A><DD>
|
||||
</DL>
|
||||
<DT><A HREF="#lbAQ">COMMENTS</A><DD>
|
||||
<DT><A HREF="#lbAR">QUOTING</A><DD>
|
||||
<DT><A HREF="#lbAS">PARAMETERS</A><DD>
|
||||
<DT><A HREF="#lbAR">COMMENTS</A><DD>
|
||||
<DT><A HREF="#lbAS">QUOTING</A><DD>
|
||||
<DT><A HREF="#lbAT">PARAMETERS</A><DD>
|
||||
<DL>
|
||||
<DT><A HREF="#lbAT">Positional Parameters</A><DD>
|
||||
<DT><A HREF="#lbAU">Special Parameters</A><DD>
|
||||
<DT><A HREF="#lbAV">Shell Variables</A><DD>
|
||||
<DT><A HREF="#lbAW">Arrays</A><DD>
|
||||
<DT><A HREF="#lbAU">Positional Parameters</A><DD>
|
||||
<DT><A HREF="#lbAV">Special Parameters</A><DD>
|
||||
<DT><A HREF="#lbAW">Shell Variables</A><DD>
|
||||
<DT><A HREF="#lbAX">Arrays</A><DD>
|
||||
</DL>
|
||||
<DT><A HREF="#lbAX">EXPANSION</A><DD>
|
||||
<DT><A HREF="#lbAY">EXPANSION</A><DD>
|
||||
<DL>
|
||||
<DT><A HREF="#lbAY">Brace Expansion</A><DD>
|
||||
<DT><A HREF="#lbAZ">Tilde Expansion</A><DD>
|
||||
<DT><A HREF="#lbBA">Parameter Expansion</A><DD>
|
||||
<DT><A HREF="#lbBB">Command Substitution</A><DD>
|
||||
<DT><A HREF="#lbBC">Arithmetic Expansion</A><DD>
|
||||
<DT><A HREF="#lbBD">Process Substitution</A><DD>
|
||||
<DT><A HREF="#lbBE">Word Splitting</A><DD>
|
||||
<DT><A HREF="#lbBF">Pathname Expansion</A><DD>
|
||||
<DT><A HREF="#lbBG">Quote Removal</A><DD>
|
||||
<DT><A HREF="#lbAZ">Brace Expansion</A><DD>
|
||||
<DT><A HREF="#lbBA">Tilde Expansion</A><DD>
|
||||
<DT><A HREF="#lbBB">Parameter Expansion</A><DD>
|
||||
<DT><A HREF="#lbBC">Command Substitution</A><DD>
|
||||
<DT><A HREF="#lbBD">Arithmetic Expansion</A><DD>
|
||||
<DT><A HREF="#lbBE">Process Substitution</A><DD>
|
||||
<DT><A HREF="#lbBF">Word Splitting</A><DD>
|
||||
<DT><A HREF="#lbBG">Pathname Expansion</A><DD>
|
||||
<DT><A HREF="#lbBH">Quote Removal</A><DD>
|
||||
</DL>
|
||||
<DT><A HREF="#lbBH">REDIRECTION</A><DD>
|
||||
<DT><A HREF="#lbBI">REDIRECTION</A><DD>
|
||||
<DL>
|
||||
<DT><A HREF="#lbBI">Redirecting Input</A><DD>
|
||||
<DT><A HREF="#lbBJ">Redirecting Output</A><DD>
|
||||
<DT><A HREF="#lbBK">Appending Redirected Output</A><DD>
|
||||
<DT><A HREF="#lbBL">Redirecting Standard Output and Standard Error</A><DD>
|
||||
<DT><A HREF="#lbBM">Appending Standard Output and Standard Error</A><DD>
|
||||
<DT><A HREF="#lbBN">Here Documents</A><DD>
|
||||
<DT><A HREF="#lbBO">Here Strings</A><DD>
|
||||
<DT><A HREF="#lbBP">Duplicating File Descriptors</A><DD>
|
||||
<DT><A HREF="#lbBQ">Moving File Descriptors</A><DD>
|
||||
<DT><A HREF="#lbBR">Opening File Descriptors for Reading and Writing</A><DD>
|
||||
<DT><A HREF="#lbBJ">Redirecting Input</A><DD>
|
||||
<DT><A HREF="#lbBK">Redirecting Output</A><DD>
|
||||
<DT><A HREF="#lbBL">Appending Redirected Output</A><DD>
|
||||
<DT><A HREF="#lbBM">Redirecting Standard Output and Standard Error</A><DD>
|
||||
<DT><A HREF="#lbBN">Appending Standard Output and Standard Error</A><DD>
|
||||
<DT><A HREF="#lbBO">Here Documents</A><DD>
|
||||
<DT><A HREF="#lbBP">Here Strings</A><DD>
|
||||
<DT><A HREF="#lbBQ">Duplicating File Descriptors</A><DD>
|
||||
<DT><A HREF="#lbBR">Moving File Descriptors</A><DD>
|
||||
<DT><A HREF="#lbBS">Opening File Descriptors for Reading and Writing</A><DD>
|
||||
</DL>
|
||||
<DT><A HREF="#lbBS">ALIASES</A><DD>
|
||||
<DT><A HREF="#lbBT">FUNCTIONS</A><DD>
|
||||
<DT><A HREF="#lbBU">ARITHMETIC EVALUATION</A><DD>
|
||||
<DT><A HREF="#lbBV">CONDITIONAL EXPRESSIONS</A><DD>
|
||||
<DT><A HREF="#lbBW">SIMPLE COMMAND EXPANSION</A><DD>
|
||||
<DT><A HREF="#lbBX">COMMAND EXECUTION</A><DD>
|
||||
<DT><A HREF="#lbBY">COMMAND EXECUTION ENVIRONMENT</A><DD>
|
||||
<DT><A HREF="#lbBZ">ENVIRONMENT</A><DD>
|
||||
<DT><A HREF="#lbCA">EXIT STATUS</A><DD>
|
||||
<DT><A HREF="#lbCB">SIGNALS</A><DD>
|
||||
<DT><A HREF="#lbCC">JOB CONTROL</A><DD>
|
||||
<DT><A HREF="#lbCD">PROMPTING</A><DD>
|
||||
<DT><A HREF="#lbCE">READLINE</A><DD>
|
||||
<DT><A HREF="#lbBT">ALIASES</A><DD>
|
||||
<DT><A HREF="#lbBU">FUNCTIONS</A><DD>
|
||||
<DT><A HREF="#lbBV">ARITHMETIC EVALUATION</A><DD>
|
||||
<DT><A HREF="#lbBW">CONDITIONAL EXPRESSIONS</A><DD>
|
||||
<DT><A HREF="#lbBX">SIMPLE COMMAND EXPANSION</A><DD>
|
||||
<DT><A HREF="#lbBY">COMMAND EXECUTION</A><DD>
|
||||
<DT><A HREF="#lbBZ">COMMAND EXECUTION ENVIRONMENT</A><DD>
|
||||
<DT><A HREF="#lbCA">ENVIRONMENT</A><DD>
|
||||
<DT><A HREF="#lbCB">EXIT STATUS</A><DD>
|
||||
<DT><A HREF="#lbCC">SIGNALS</A><DD>
|
||||
<DT><A HREF="#lbCD">JOB CONTROL</A><DD>
|
||||
<DT><A HREF="#lbCE">PROMPTING</A><DD>
|
||||
<DT><A HREF="#lbCF">READLINE</A><DD>
|
||||
<DL>
|
||||
<DT><A HREF="#lbCF">Readline Notation</A><DD>
|
||||
<DT><A HREF="#lbCG">Readline Initialization</A><DD>
|
||||
<DT><A HREF="#lbCH">Readline Key Bindings</A><DD>
|
||||
<DT><A HREF="#lbCI">Readline Variables</A><DD>
|
||||
<DT><A HREF="#lbCJ">Readline Conditional Constructs</A><DD>
|
||||
<DT><A HREF="#lbCK">Searching</A><DD>
|
||||
<DT><A HREF="#lbCL">Readline Command Names</A><DD>
|
||||
<DT><A HREF="#lbCM">Commands for Moving</A><DD>
|
||||
<DT><A HREF="#lbCN">Commands for Manipulating the History</A><DD>
|
||||
<DT><A HREF="#lbCO">Commands for Changing Text</A><DD>
|
||||
<DT><A HREF="#lbCP">Killing and Yanking</A><DD>
|
||||
<DT><A HREF="#lbCQ">Numeric Arguments</A><DD>
|
||||
<DT><A HREF="#lbCR">Completing</A><DD>
|
||||
<DT><A HREF="#lbCS">Keyboard Macros</A><DD>
|
||||
<DT><A HREF="#lbCT">Miscellaneous</A><DD>
|
||||
<DT><A HREF="#lbCU">Programmable Completion</A><DD>
|
||||
<DT><A HREF="#lbCG">Readline Notation</A><DD>
|
||||
<DT><A HREF="#lbCH">Readline Initialization</A><DD>
|
||||
<DT><A HREF="#lbCI">Readline Key Bindings</A><DD>
|
||||
<DT><A HREF="#lbCJ">Readline Variables</A><DD>
|
||||
<DT><A HREF="#lbCK">Readline Conditional Constructs</A><DD>
|
||||
<DT><A HREF="#lbCL">Searching</A><DD>
|
||||
<DT><A HREF="#lbCM">Readline Command Names</A><DD>
|
||||
<DT><A HREF="#lbCN">Commands for Moving</A><DD>
|
||||
<DT><A HREF="#lbCO">Commands for Manipulating the History</A><DD>
|
||||
<DT><A HREF="#lbCP">Commands for Changing Text</A><DD>
|
||||
<DT><A HREF="#lbCQ">Killing and Yanking</A><DD>
|
||||
<DT><A HREF="#lbCR">Numeric Arguments</A><DD>
|
||||
<DT><A HREF="#lbCS">Completing</A><DD>
|
||||
<DT><A HREF="#lbCT">Keyboard Macros</A><DD>
|
||||
<DT><A HREF="#lbCU">Miscellaneous</A><DD>
|
||||
<DT><A HREF="#lbCV">Programmable Completion</A><DD>
|
||||
</DL>
|
||||
<DT><A HREF="#lbCV">HISTORY</A><DD>
|
||||
<DT><A HREF="#lbCW">HISTORY EXPANSION</A><DD>
|
||||
<DT><A HREF="#lbCW">HISTORY</A><DD>
|
||||
<DT><A HREF="#lbCX">HISTORY EXPANSION</A><DD>
|
||||
<DL>
|
||||
<DT><A HREF="#lbCX">Event Designators</A><DD>
|
||||
<DT><A HREF="#lbCY">Word Designators</A><DD>
|
||||
<DT><A HREF="#lbCZ">Modifiers</A><DD>
|
||||
<DT><A HREF="#lbCY">Event Designators</A><DD>
|
||||
<DT><A HREF="#lbCZ">Word Designators</A><DD>
|
||||
<DT><A HREF="#lbDA">Modifiers</A><DD>
|
||||
</DL>
|
||||
<DT><A HREF="#lbDA">SHELL BUILTIN COMMANDS</A><DD>
|
||||
<DT><A HREF="#lbDB">RESTRICTED SHELL</A><DD>
|
||||
<DT><A HREF="#lbDC">SEE ALSO</A><DD>
|
||||
<DT><A HREF="#lbDD">FILES</A><DD>
|
||||
<DT><A HREF="#lbDE">AUTHORS</A><DD>
|
||||
<DT><A HREF="#lbDF">BUG REPORTS</A><DD>
|
||||
<DT><A HREF="#lbDG">BUGS</A><DD>
|
||||
<DT><A HREF="#lbDB">SHELL BUILTIN COMMANDS</A><DD>
|
||||
<DT><A HREF="#lbDC">RESTRICTED SHELL</A><DD>
|
||||
<DT><A HREF="#lbDD">SEE ALSO</A><DD>
|
||||
<DT><A HREF="#lbDE">FILES</A><DD>
|
||||
<DT><A HREF="#lbDF">AUTHORS</A><DD>
|
||||
<DT><A HREF="#lbDG">BUG REPORTS</A><DD>
|
||||
<DT><A HREF="#lbDH">BUGS</A><DD>
|
||||
</DL>
|
||||
<HR>
|
||||
This document was created by man2html from bash.1.<BR>
|
||||
Time: 02 July 2008 09:08:29 EDT
|
||||
Time: 24 July 2008 09:12:48 EDT
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
Binary file not shown.
+5552
-5499
File diff suppressed because it is too large
Load Diff
+15
-12
@@ -64,17 +64,20 @@
|
||||
@xrdef{Command Grouping-title}{Grouping Commands}
|
||||
@xrdef{Command Grouping-pg}{13}
|
||||
@xrdef{Command Grouping-snt}{Section@tie 3.2.4.3}
|
||||
@xrdef{Coprocesses-title}{Coprocesses}
|
||||
@xrdef{Coprocesses-pg}{14}
|
||||
@xrdef{Coprocesses-snt}{Section@tie 3.2.5}
|
||||
@xrdef{Shell Functions-title}{Shell Functions}
|
||||
@xrdef{Shell Functions-pg}{14}
|
||||
@xrdef{Shell Functions-snt}{Section@tie 3.3}
|
||||
@xrdef{Shell Parameters-title}{Shell Parameters}
|
||||
@xrdef{Shell Parameters-pg}{15}
|
||||
@xrdef{Shell Parameters-pg}{16}
|
||||
@xrdef{Shell Parameters-snt}{Section@tie 3.4}
|
||||
@xrdef{Positional Parameters-title}{Positional Parameters}
|
||||
@xrdef{Positional Parameters-pg}{16}
|
||||
@xrdef{Positional Parameters-snt}{Section@tie 3.4.1}
|
||||
@xrdef{Special Parameters-title}{Special Parameters}
|
||||
@xrdef{Special Parameters-pg}{16}
|
||||
@xrdef{Special Parameters-pg}{17}
|
||||
@xrdef{Special Parameters-snt}{Section@tie 3.4.2}
|
||||
@xrdef{Shell Expansions-title}{Shell Expansions}
|
||||
@xrdef{Shell Expansions-pg}{17}
|
||||
@@ -83,13 +86,13 @@
|
||||
@xrdef{Brace Expansion-pg}{18}
|
||||
@xrdef{Brace Expansion-snt}{Section@tie 3.5.1}
|
||||
@xrdef{Tilde Expansion-title}{Tilde Expansion}
|
||||
@xrdef{Tilde Expansion-pg}{18}
|
||||
@xrdef{Tilde Expansion-pg}{19}
|
||||
@xrdef{Tilde Expansion-snt}{Section@tie 3.5.2}
|
||||
@xrdef{Shell Parameter Expansion-title}{Shell Parameter Expansion}
|
||||
@xrdef{Shell Parameter Expansion-pg}{19}
|
||||
@xrdef{Shell Parameter Expansion-pg}{20}
|
||||
@xrdef{Shell Parameter Expansion-snt}{Section@tie 3.5.3}
|
||||
@xrdef{Command Substitution-title}{Command Substitution}
|
||||
@xrdef{Command Substitution-pg}{22}
|
||||
@xrdef{Command Substitution-pg}{23}
|
||||
@xrdef{Command Substitution-snt}{Section@tie 3.5.4}
|
||||
@xrdef{Arithmetic Expansion-title}{Arithmetic Expansion}
|
||||
@xrdef{Arithmetic Expansion-pg}{23}
|
||||
@@ -98,25 +101,25 @@
|
||||
@xrdef{Process Substitution-pg}{23}
|
||||
@xrdef{Process Substitution-snt}{Section@tie 3.5.6}
|
||||
@xrdef{Word Splitting-title}{Word Splitting}
|
||||
@xrdef{Word Splitting-pg}{23}
|
||||
@xrdef{Word Splitting-pg}{24}
|
||||
@xrdef{Word Splitting-snt}{Section@tie 3.5.7}
|
||||
@xrdef{Filename Expansion-title}{Filename Expansion}
|
||||
@xrdef{Filename Expansion-pg}{24}
|
||||
@xrdef{Filename Expansion-snt}{Section@tie 3.5.8}
|
||||
@xrdef{Pattern Matching-title}{Pattern Matching}
|
||||
@xrdef{Pattern Matching-pg}{24}
|
||||
@xrdef{Pattern Matching-pg}{25}
|
||||
@xrdef{Pattern Matching-snt}{Section@tie 3.5.8.1}
|
||||
@xrdef{Quote Removal-title}{Quote Removal}
|
||||
@xrdef{Quote Removal-pg}{25}
|
||||
@xrdef{Quote Removal-pg}{26}
|
||||
@xrdef{Quote Removal-snt}{Section@tie 3.5.9}
|
||||
@xrdef{Redirections-title}{Redirections}
|
||||
@xrdef{Redirections-pg}{26}
|
||||
@xrdef{Redirections-snt}{Section@tie 3.6}
|
||||
@xrdef{Executing Commands-title}{Executing Commands}
|
||||
@xrdef{Executing Commands-pg}{29}
|
||||
@xrdef{Executing Commands-pg}{30}
|
||||
@xrdef{Executing Commands-snt}{Section@tie 3.7}
|
||||
@xrdef{Simple Command Expansion-title}{Simple Command Expansion}
|
||||
@xrdef{Simple Command Expansion-pg}{29}
|
||||
@xrdef{Simple Command Expansion-pg}{30}
|
||||
@xrdef{Simple Command Expansion-snt}{Section@tie 3.7.1}
|
||||
@xrdef{Command Search and Execution-title}{Command Search and Execution}
|
||||
@xrdef{Command Search and Execution-pg}{30}
|
||||
@@ -128,13 +131,13 @@
|
||||
@xrdef{Environment-pg}{32}
|
||||
@xrdef{Environment-snt}{Section@tie 3.7.4}
|
||||
@xrdef{Exit Status-title}{Exit Status}
|
||||
@xrdef{Exit Status-pg}{32}
|
||||
@xrdef{Exit Status-pg}{33}
|
||||
@xrdef{Exit Status-snt}{Section@tie 3.7.5}
|
||||
@xrdef{Signals-title}{Signals}
|
||||
@xrdef{Signals-pg}{33}
|
||||
@xrdef{Signals-snt}{Section@tie 3.7.6}
|
||||
@xrdef{Shell Scripts-title}{Shell Scripts}
|
||||
@xrdef{Shell Scripts-pg}{33}
|
||||
@xrdef{Shell Scripts-pg}{34}
|
||||
@xrdef{Shell Scripts-snt}{Section@tie 3.8}
|
||||
@xrdef{Shell Builtin Commands-title}{Shell Builtin Commands}
|
||||
@xrdef{Shell Builtin Commands-pg}{35}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
\entry{declare}{43}{\code {declare}}
|
||||
\entry{echo}{44}{\code {echo}}
|
||||
\entry{enable}{45}{\code {enable}}
|
||||
\entry{help}{45}{\code {help}}
|
||||
\entry{help}{46}{\code {help}}
|
||||
\entry{let}{46}{\code {let}}
|
||||
\entry{local}{46}{\code {local}}
|
||||
\entry{logout}{46}{\code {logout}}
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@
|
||||
\entry {\code {getopts}}{37}
|
||||
\initial {H}
|
||||
\entry {\code {hash}}{37}
|
||||
\entry {\code {help}}{45}
|
||||
\entry {\code {help}}{46}
|
||||
\entry {\code {history}}{120}
|
||||
\initial {J}
|
||||
\entry {\code {jobs}}{88}
|
||||
|
||||
+16
-15
@@ -36,40 +36,41 @@
|
||||
\entry{commands, looping}{10}{commands, looping}
|
||||
\entry{commands, conditional}{10}{commands, conditional}
|
||||
\entry{commands, grouping}{13}{commands, grouping}
|
||||
\entry{coprocess}{14}{coprocess}
|
||||
\entry{shell function}{14}{shell function}
|
||||
\entry{functions, shell}{14}{functions, shell}
|
||||
\entry{parameters}{15}{parameters}
|
||||
\entry{variable, shell}{15}{variable, shell}
|
||||
\entry{shell variable}{15}{shell variable}
|
||||
\entry{parameters}{16}{parameters}
|
||||
\entry{variable, shell}{16}{variable, shell}
|
||||
\entry{shell variable}{16}{shell variable}
|
||||
\entry{parameters, positional}{16}{parameters, positional}
|
||||
\entry{parameters, special}{16}{parameters, special}
|
||||
\entry{parameters, special}{17}{parameters, special}
|
||||
\entry{expansion}{17}{expansion}
|
||||
\entry{brace expansion}{18}{brace expansion}
|
||||
\entry{expansion, brace}{18}{expansion, brace}
|
||||
\entry{tilde expansion}{18}{tilde expansion}
|
||||
\entry{expansion, tilde}{18}{expansion, tilde}
|
||||
\entry{parameter expansion}{19}{parameter expansion}
|
||||
\entry{expansion, parameter}{19}{expansion, parameter}
|
||||
\entry{command substitution}{22}{command substitution}
|
||||
\entry{tilde expansion}{19}{tilde expansion}
|
||||
\entry{expansion, tilde}{19}{expansion, tilde}
|
||||
\entry{parameter expansion}{20}{parameter expansion}
|
||||
\entry{expansion, parameter}{20}{expansion, parameter}
|
||||
\entry{command substitution}{23}{command substitution}
|
||||
\entry{expansion, arithmetic}{23}{expansion, arithmetic}
|
||||
\entry{arithmetic expansion}{23}{arithmetic expansion}
|
||||
\entry{process substitution}{23}{process substitution}
|
||||
\entry{word splitting}{23}{word splitting}
|
||||
\entry{word splitting}{24}{word splitting}
|
||||
\entry{expansion, filename}{24}{expansion, filename}
|
||||
\entry{expansion, pathname}{24}{expansion, pathname}
|
||||
\entry{filename expansion}{24}{filename expansion}
|
||||
\entry{pathname expansion}{24}{pathname expansion}
|
||||
\entry{pattern matching}{24}{pattern matching}
|
||||
\entry{matching, pattern}{24}{matching, pattern}
|
||||
\entry{pattern matching}{25}{pattern matching}
|
||||
\entry{matching, pattern}{25}{matching, pattern}
|
||||
\entry{redirection}{26}{redirection}
|
||||
\entry{command expansion}{29}{command expansion}
|
||||
\entry{command expansion}{30}{command expansion}
|
||||
\entry{command execution}{30}{command execution}
|
||||
\entry{command search}{30}{command search}
|
||||
\entry{execution environment}{31}{execution environment}
|
||||
\entry{environment}{32}{environment}
|
||||
\entry{exit status}{32}{exit status}
|
||||
\entry{exit status}{33}{exit status}
|
||||
\entry{signal handling}{33}{signal handling}
|
||||
\entry{shell script}{33}{shell script}
|
||||
\entry{shell script}{34}{shell script}
|
||||
\entry{special builtin}{58}{special builtin}
|
||||
\entry{login shell}{71}{login shell}
|
||||
\entry{interactive shell}{71}{interactive shell}
|
||||
|
||||
+16
-15
@@ -14,10 +14,10 @@
|
||||
\initial {C}
|
||||
\entry {command editing}{91}
|
||||
\entry {command execution}{30}
|
||||
\entry {command expansion}{29}
|
||||
\entry {command expansion}{30}
|
||||
\entry {command history}{119}
|
||||
\entry {command search}{30}
|
||||
\entry {command substitution}{22}
|
||||
\entry {command substitution}{23}
|
||||
\entry {command timing}{8}
|
||||
\entry {commands, compound}{9}
|
||||
\entry {commands, conditional}{10}
|
||||
@@ -31,6 +31,7 @@
|
||||
\entry {completion builtins}{114}
|
||||
\entry {configuration}{125}
|
||||
\entry {control operator}{3}
|
||||
\entry {coprocess}{14}
|
||||
\initial {D}
|
||||
\entry {directory stack}{79}
|
||||
\initial {E}
|
||||
@@ -39,14 +40,14 @@
|
||||
\entry {evaluation, arithmetic}{76}
|
||||
\entry {event designators}{122}
|
||||
\entry {execution environment}{31}
|
||||
\entry {exit status}{3, 32}
|
||||
\entry {exit status}{3, 33}
|
||||
\entry {expansion}{17}
|
||||
\entry {expansion, arithmetic}{23}
|
||||
\entry {expansion, brace}{18}
|
||||
\entry {expansion, filename}{24}
|
||||
\entry {expansion, parameter}{19}
|
||||
\entry {expansion, parameter}{20}
|
||||
\entry {expansion, pathname}{24}
|
||||
\entry {expansion, tilde}{18}
|
||||
\entry {expansion, tilde}{19}
|
||||
\entry {expressions, arithmetic}{76}
|
||||
\entry {expressions, conditional}{75}
|
||||
\initial {F}
|
||||
@@ -78,7 +79,7 @@
|
||||
\entry {localization}{7}
|
||||
\entry {login shell}{71}
|
||||
\initial {M}
|
||||
\entry {matching, pattern}{24}
|
||||
\entry {matching, pattern}{25}
|
||||
\entry {metacharacter}{3}
|
||||
\initial {N}
|
||||
\entry {name}{3}
|
||||
@@ -87,12 +88,12 @@
|
||||
\initial {O}
|
||||
\entry {operator, shell}{3}
|
||||
\initial {P}
|
||||
\entry {parameter expansion}{19}
|
||||
\entry {parameters}{15}
|
||||
\entry {parameter expansion}{20}
|
||||
\entry {parameters}{16}
|
||||
\entry {parameters, positional}{16}
|
||||
\entry {parameters, special}{16}
|
||||
\entry {parameters, special}{17}
|
||||
\entry {pathname expansion}{24}
|
||||
\entry {pattern matching}{24}
|
||||
\entry {pattern matching}{25}
|
||||
\entry {pipeline}{8}
|
||||
\entry {POSIX}{3}
|
||||
\entry {POSIX Mode}{83}
|
||||
@@ -113,8 +114,8 @@
|
||||
\initial {S}
|
||||
\entry {shell arithmetic}{76}
|
||||
\entry {shell function}{14}
|
||||
\entry {shell script}{33}
|
||||
\entry {shell variable}{15}
|
||||
\entry {shell script}{34}
|
||||
\entry {shell variable}{16}
|
||||
\entry {shell, interactive}{73}
|
||||
\entry {signal}{4}
|
||||
\entry {signal handling}{33}
|
||||
@@ -122,14 +123,14 @@
|
||||
\entry {startup files}{71}
|
||||
\entry {suspending jobs}{87}
|
||||
\initial {T}
|
||||
\entry {tilde expansion}{18}
|
||||
\entry {tilde expansion}{19}
|
||||
\entry {token}{4}
|
||||
\entry {translation, native languages}{7}
|
||||
\initial {V}
|
||||
\entry {variable, shell}{15}
|
||||
\entry {variable, shell}{16}
|
||||
\entry {variables, readline}{95}
|
||||
\initial {W}
|
||||
\entry {word}{4}
|
||||
\entry {word splitting}{23}
|
||||
\entry {word splitting}{24}
|
||||
\initial {Y}
|
||||
\entry {yanking text}{93}
|
||||
|
||||
Binary file not shown.
+2080
-2000
File diff suppressed because it is too large
Load Diff
+202
-150
@@ -2,12 +2,12 @@ This is bashref.info, produced by makeinfo version 4.11 from
|
||||
/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.0, 29 June 2008).
|
||||
the Bash shell (version 4.0, 6 July 2008).
|
||||
|
||||
This is Edition 4.0, last updated 29 June 2008, of `The GNU Bash
|
||||
This is Edition 4.0, last updated 6 July 2008, of `The GNU Bash
|
||||
Reference Manual', for `Bash', Version 4.0.
|
||||
|
||||
Copyright (C) 1988-2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2008 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of this
|
||||
manual provided the copyright notice and this permission notice are
|
||||
@@ -38,9 +38,9 @@ Bash Features
|
||||
*************
|
||||
|
||||
This text is a brief description of the features that are present in
|
||||
the Bash shell (version 4.0, 29 June 2008).
|
||||
the Bash shell (version 4.0, 6 July 2008).
|
||||
|
||||
This is Edition 4.0, last updated 29 June 2008, of `The GNU Bash
|
||||
This is Edition 4.0, last updated 6 July 2008, of `The GNU Bash
|
||||
Reference Manual', for `Bash', Version 4.0.
|
||||
|
||||
Bash contains features that appear in other popular shells, and some
|
||||
@@ -532,6 +532,7 @@ construct, or in some other grouping.
|
||||
commands.
|
||||
* Lists:: How to execute commands sequentially.
|
||||
* Compound Commands:: Shell commands for control flow.
|
||||
* Coprocesses:: Two-way communication between commands.
|
||||
|
||||
|
||||
File: bashref.info, Node: Simple Commands, Next: Pipelines, Up: Shell Commands
|
||||
@@ -644,7 +645,7 @@ status.
|
||||
command executed in the list.
|
||||
|
||||
|
||||
File: bashref.info, Node: Compound Commands, Prev: Lists, Up: Shell Commands
|
||||
File: bashref.info, Node: Compound Commands, Next: Coprocesses, Prev: Lists, Up: Shell Commands
|
||||
|
||||
3.2.4 Compound Commands
|
||||
-----------------------
|
||||
@@ -937,6 +938,40 @@ they are not separated from the LIST by whitespace.
|
||||
The exit status of both of these constructs is the exit status of
|
||||
LIST.
|
||||
|
||||
|
||||
File: bashref.info, Node: Coprocesses, Prev: Compound Commands, Up: Shell Commands
|
||||
|
||||
3.2.5 Coprocesses
|
||||
-----------------
|
||||
|
||||
A `coprocess' is a shell command preceded by the `coproc' reserved word.
|
||||
A coprocess is executed asynchronously in a subshell, as if the command
|
||||
had been terminated with the `&' control operator, with a two-way pipe
|
||||
established between the executing shell and the coprocess.
|
||||
|
||||
The format for a coprocess is:
|
||||
`coproc' [NAME] COMMAND [REDIRECTIONS]
|
||||
|
||||
This creates a coprocess named NAME. If NAME is not supplied, the
|
||||
default name is COPROC.
|
||||
|
||||
When the coproc is executed, the shell creates an array variable
|
||||
(*note Arrays::) named NAME in the context of the executing shell. The
|
||||
standard output of COMMAND is connected via a pipe to a file descriptor
|
||||
in the executing shell, and that file descriptor is assigned to NAME[0].
|
||||
The standard input of COMMAND is connected via a pipe to a file
|
||||
descriptor in the executing shell, and that file descriptor is assigned
|
||||
to NAME[1]. This pipe is established before any redirections specified
|
||||
by the command (*note Redirections::). The file descriptors can be
|
||||
utilized as arguments to shell commands and redirections using standard
|
||||
word expansions.
|
||||
|
||||
The process id of the shell spawned to execute the coprocess is
|
||||
available as the value of the variable NAME_PID. The `wait' builtin
|
||||
command may be used to wait for the coprocess to terminate.
|
||||
|
||||
The return status of a coprocess is the exit status of COMMAND.
|
||||
|
||||
|
||||
File: bashref.info, Node: Shell Functions, Next: Shell Parameters, Prev: Shell Commands, Up: Basic Shell Features
|
||||
|
||||
@@ -2852,7 +2887,7 @@ POSIX standard.
|
||||
non-zero if not.
|
||||
|
||||
`declare'
|
||||
declare [-aAfFirtx] [-p] [NAME[=VALUE] ...]
|
||||
declare [-aAfFilrtux] [-p] [NAME[=VALUE] ...]
|
||||
|
||||
Declare variables and give them attributes. If no NAMEs are
|
||||
given, then display the values of variables instead.
|
||||
@@ -2890,6 +2925,11 @@ POSIX standard.
|
||||
evaluation (*note Shell Arithmetic::) is performed when the
|
||||
variable is assigned a value.
|
||||
|
||||
`-l'
|
||||
When the variable is assigned a value, all upper-case
|
||||
characters are converted to lower-case. The upper-case
|
||||
attribute is disabled.
|
||||
|
||||
`-r'
|
||||
Make NAMEs readonly. These names cannot then be assigned
|
||||
values by subsequent assignment statements or unset.
|
||||
@@ -2899,6 +2939,11 @@ POSIX standard.
|
||||
inherit the `DEBUG' and `RETURN' traps from the calling shell.
|
||||
The trace attribute has no special meaning for variables.
|
||||
|
||||
`-u'
|
||||
When the variable is assigned a value, all lower-case
|
||||
characters are converted to upper-case. The lower-case
|
||||
attribute is disabled.
|
||||
|
||||
`-x'
|
||||
Mark each NAME for export to subsequent commands via the
|
||||
environment.
|
||||
@@ -3121,9 +3166,10 @@ POSIX standard.
|
||||
next character read and for line continuation. If no names are
|
||||
supplied, the line read is assigned to the variable `REPLY'. The
|
||||
return code is zero, unless end-of-file is encountered, `read'
|
||||
times out, or an invalid file descriptor is supplied as the
|
||||
argument to `-u'. Options, if supplied, have the following
|
||||
meanings:
|
||||
times out (in which case the return code is greater than 128), or
|
||||
an invalid file descriptor is supplied as the argument to `-u'.
|
||||
|
||||
Options, if supplied, have the following meanings:
|
||||
|
||||
`-a ANAME'
|
||||
The words are assigned to sequential indices of the array
|
||||
@@ -8361,6 +8407,10 @@ does not provide the necessary support.
|
||||
`=~' binary operator in the `[[' conditional command. (*note
|
||||
Conditional Constructs::).
|
||||
|
||||
`--enable-coprocesses'
|
||||
Include support for coprocesses and the `coproc' reserved word
|
||||
(*note Pipelines::).
|
||||
|
||||
`--enable-debugger'
|
||||
Include support for the bash debugger (distributed separately).
|
||||
|
||||
@@ -9347,8 +9397,8 @@ D.1 Index of Shell Builtin Commands
|
||||
(line 7)
|
||||
* disown: Job Control Builtins.
|
||||
(line 83)
|
||||
* echo: Bash Builtins. (line 211)
|
||||
* enable: Bash Builtins. (line 263)
|
||||
* echo: Bash Builtins. (line 221)
|
||||
* enable: Bash Builtins. (line 273)
|
||||
* eval: Bourne Shell Builtins.
|
||||
(line 63)
|
||||
* exec: Bourne Shell Builtins.
|
||||
@@ -9365,25 +9415,25 @@ D.1 Index of Shell Builtin Commands
|
||||
(line 103)
|
||||
* hash: Bourne Shell Builtins.
|
||||
(line 145)
|
||||
* help: Bash Builtins. (line 291)
|
||||
* help: Bash Builtins. (line 301)
|
||||
* history: Bash History Builtins.
|
||||
(line 39)
|
||||
* jobs: Job Control Builtins.
|
||||
(line 25)
|
||||
* kill: Job Control Builtins.
|
||||
(line 57)
|
||||
* let: Bash Builtins. (line 311)
|
||||
* local: Bash Builtins. (line 318)
|
||||
* logout: Bash Builtins. (line 328)
|
||||
* mapfile: Bash Builtins. (line 332)
|
||||
* let: Bash Builtins. (line 321)
|
||||
* local: Bash Builtins. (line 328)
|
||||
* logout: Bash Builtins. (line 338)
|
||||
* mapfile: Bash Builtins. (line 342)
|
||||
* popd: Directory Stack Builtins.
|
||||
(line 37)
|
||||
* printf: Bash Builtins. (line 373)
|
||||
* printf: Bash Builtins. (line 383)
|
||||
* pushd: Directory Stack Builtins.
|
||||
(line 58)
|
||||
* pwd: Bourne Shell Builtins.
|
||||
(line 163)
|
||||
* read: Bash Builtins. (line 398)
|
||||
* read: Bash Builtins. (line 408)
|
||||
* readonly: Bourne Shell Builtins.
|
||||
(line 172)
|
||||
* return: Bourne Shell Builtins.
|
||||
@@ -9392,7 +9442,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* shift: Bourne Shell Builtins.
|
||||
(line 201)
|
||||
* shopt: The Shopt Builtin. (line 9)
|
||||
* source: Bash Builtins. (line 466)
|
||||
* source: Bash Builtins. (line 477)
|
||||
* suspend: Job Control Builtins.
|
||||
(line 94)
|
||||
* test: Bourne Shell Builtins.
|
||||
@@ -9401,12 +9451,12 @@ D.1 Index of Shell Builtin Commands
|
||||
(line 281)
|
||||
* trap: Bourne Shell Builtins.
|
||||
(line 286)
|
||||
* type: Bash Builtins. (line 470)
|
||||
* typeset: Bash Builtins. (line 501)
|
||||
* ulimit: Bash Builtins. (line 507)
|
||||
* type: Bash Builtins. (line 481)
|
||||
* typeset: Bash Builtins. (line 512)
|
||||
* ulimit: Bash Builtins. (line 518)
|
||||
* umask: Bourne Shell Builtins.
|
||||
(line 327)
|
||||
* unalias: Bash Builtins. (line 593)
|
||||
* unalias: Bash Builtins. (line 604)
|
||||
* unset: Bourne Shell Builtins.
|
||||
(line 344)
|
||||
* wait: Job Control Builtins.
|
||||
@@ -9777,6 +9827,7 @@ D.5 Concept Index
|
||||
(line 6)
|
||||
* configuration: Basic Installation. (line 6)
|
||||
* control operator: Definitions. (line 21)
|
||||
* coprocess: Coprocesses. (line 6)
|
||||
* directory stack: The Directory Stack. (line 6)
|
||||
* editing command lines: Readline Bare Essentials.
|
||||
(line 6)
|
||||
@@ -9888,131 +9939,132 @@ D.5 Concept Index
|
||||
|
||||
|
||||
Tag Table:
|
||||
Node: Top1344
|
||||
Node: Introduction3175
|
||||
Node: What is Bash?3403
|
||||
Node: What is a shell?4516
|
||||
Node: Definitions7056
|
||||
Node: Basic Shell Features9836
|
||||
Node: Shell Syntax11055
|
||||
Node: Shell Operation12085
|
||||
Node: Quoting13379
|
||||
Node: Escape Character14682
|
||||
Node: Single Quotes15167
|
||||
Node: Double Quotes15515
|
||||
Node: ANSI-C Quoting16640
|
||||
Node: Locale Translation17596
|
||||
Node: Comments18492
|
||||
Node: Shell Commands19110
|
||||
Node: Simple Commands19876
|
||||
Node: Pipelines20507
|
||||
Node: Lists22763
|
||||
Node: Compound Commands24492
|
||||
Node: Looping Constructs25276
|
||||
Node: Conditional Constructs27723
|
||||
Node: Command Grouping35729
|
||||
Node: Shell Functions37208
|
||||
Node: Shell Parameters41669
|
||||
Node: Positional Parameters44085
|
||||
Node: Special Parameters44985
|
||||
Node: Shell Expansions47949
|
||||
Node: Brace Expansion49874
|
||||
Node: Tilde Expansion52627
|
||||
Node: Shell Parameter Expansion54978
|
||||
Node: Command Substitution63809
|
||||
Node: Arithmetic Expansion65142
|
||||
Node: Process Substitution65992
|
||||
Node: Word Splitting67042
|
||||
Node: Filename Expansion68665
|
||||
Node: Pattern Matching70805
|
||||
Node: Quote Removal74444
|
||||
Node: Redirections74739
|
||||
Node: Executing Commands82882
|
||||
Node: Simple Command Expansion83552
|
||||
Node: Command Search and Execution85482
|
||||
Node: Command Execution Environment87819
|
||||
Node: Environment90618
|
||||
Node: Exit Status92278
|
||||
Node: Signals93899
|
||||
Node: Shell Scripts95867
|
||||
Node: Shell Builtin Commands98385
|
||||
Node: Bourne Shell Builtins100062
|
||||
Node: Bash Builtins117380
|
||||
Node: Modifying Shell Behavior140408
|
||||
Node: The Set Builtin140753
|
||||
Node: The Shopt Builtin149601
|
||||
Node: Special Builtins160463
|
||||
Node: Shell Variables161442
|
||||
Node: Bourne Shell Variables161882
|
||||
Node: Bash Variables163863
|
||||
Node: Bash Features186181
|
||||
Node: Invoking Bash187064
|
||||
Node: Bash Startup Files192873
|
||||
Node: Interactive Shells197842
|
||||
Node: What is an Interactive Shell?198252
|
||||
Node: Is this Shell Interactive?198901
|
||||
Node: Interactive Shell Behavior199716
|
||||
Node: Bash Conditional Expressions202996
|
||||
Node: Shell Arithmetic206575
|
||||
Node: Aliases209321
|
||||
Node: Arrays211893
|
||||
Node: The Directory Stack215735
|
||||
Node: Directory Stack Builtins216449
|
||||
Node: Printing a Prompt219341
|
||||
Node: The Restricted Shell222093
|
||||
Node: Bash POSIX Mode223925
|
||||
Node: Job Control231778
|
||||
Node: Job Control Basics232238
|
||||
Node: Job Control Builtins236832
|
||||
Node: Job Control Variables241196
|
||||
Node: Command Line Editing242354
|
||||
Node: Introduction and Notation243349
|
||||
Node: Readline Interaction244971
|
||||
Node: Readline Bare Essentials246162
|
||||
Node: Readline Movement Commands247951
|
||||
Node: Readline Killing Commands248916
|
||||
Node: Readline Arguments250836
|
||||
Node: Searching251880
|
||||
Node: Readline Init File254066
|
||||
Node: Readline Init File Syntax255213
|
||||
Node: Conditional Init Constructs268447
|
||||
Node: Sample Init File270980
|
||||
Node: Bindable Readline Commands274097
|
||||
Node: Commands For Moving275304
|
||||
Node: Commands For History276165
|
||||
Node: Commands For Text279320
|
||||
Node: Commands For Killing281993
|
||||
Node: Numeric Arguments284135
|
||||
Node: Commands For Completion285274
|
||||
Node: Keyboard Macros289041
|
||||
Node: Miscellaneous Commands289612
|
||||
Node: Readline vi Mode294923
|
||||
Node: Programmable Completion295837
|
||||
Node: Programmable Completion Builtins301670
|
||||
Node: Using History Interactively310053
|
||||
Node: Bash History Facilities310737
|
||||
Node: Bash History Builtins313651
|
||||
Node: History Interaction317508
|
||||
Node: Event Designators320213
|
||||
Node: Word Designators321228
|
||||
Node: Modifiers322867
|
||||
Node: Installing Bash324271
|
||||
Node: Basic Installation325408
|
||||
Node: Compilers and Options328100
|
||||
Node: Compiling For Multiple Architectures328841
|
||||
Node: Installation Names330505
|
||||
Node: Specifying the System Type331323
|
||||
Node: Sharing Defaults332039
|
||||
Node: Operation Controls332712
|
||||
Node: Optional Features333670
|
||||
Node: Reporting Bugs342954
|
||||
Node: Major Differences From The Bourne Shell344148
|
||||
Node: GNU Free Documentation License360835
|
||||
Node: Indexes383296
|
||||
Node: Builtin Index383750
|
||||
Node: Reserved Word Index390504
|
||||
Node: Variable Index392952
|
||||
Node: Function Index404758
|
||||
Node: Concept Index411490
|
||||
Node: Top1342
|
||||
Node: Introduction3171
|
||||
Node: What is Bash?3399
|
||||
Node: What is a shell?4512
|
||||
Node: Definitions7052
|
||||
Node: Basic Shell Features9832
|
||||
Node: Shell Syntax11051
|
||||
Node: Shell Operation12081
|
||||
Node: Quoting13375
|
||||
Node: Escape Character14678
|
||||
Node: Single Quotes15163
|
||||
Node: Double Quotes15511
|
||||
Node: ANSI-C Quoting16636
|
||||
Node: Locale Translation17592
|
||||
Node: Comments18488
|
||||
Node: Shell Commands19106
|
||||
Node: Simple Commands19930
|
||||
Node: Pipelines20561
|
||||
Node: Lists22817
|
||||
Node: Compound Commands24546
|
||||
Node: Looping Constructs25350
|
||||
Node: Conditional Constructs27797
|
||||
Node: Command Grouping35803
|
||||
Node: Coprocesses37282
|
||||
Node: Shell Functions38771
|
||||
Node: Shell Parameters43232
|
||||
Node: Positional Parameters45648
|
||||
Node: Special Parameters46548
|
||||
Node: Shell Expansions49512
|
||||
Node: Brace Expansion51437
|
||||
Node: Tilde Expansion54190
|
||||
Node: Shell Parameter Expansion56541
|
||||
Node: Command Substitution65372
|
||||
Node: Arithmetic Expansion66705
|
||||
Node: Process Substitution67555
|
||||
Node: Word Splitting68605
|
||||
Node: Filename Expansion70228
|
||||
Node: Pattern Matching72368
|
||||
Node: Quote Removal76007
|
||||
Node: Redirections76302
|
||||
Node: Executing Commands84445
|
||||
Node: Simple Command Expansion85115
|
||||
Node: Command Search and Execution87045
|
||||
Node: Command Execution Environment89382
|
||||
Node: Environment92181
|
||||
Node: Exit Status93841
|
||||
Node: Signals95462
|
||||
Node: Shell Scripts97430
|
||||
Node: Shell Builtin Commands99948
|
||||
Node: Bourne Shell Builtins101625
|
||||
Node: Bash Builtins118943
|
||||
Node: Modifying Shell Behavior142371
|
||||
Node: The Set Builtin142716
|
||||
Node: The Shopt Builtin151564
|
||||
Node: Special Builtins162426
|
||||
Node: Shell Variables163405
|
||||
Node: Bourne Shell Variables163845
|
||||
Node: Bash Variables165826
|
||||
Node: Bash Features188144
|
||||
Node: Invoking Bash189027
|
||||
Node: Bash Startup Files194836
|
||||
Node: Interactive Shells199805
|
||||
Node: What is an Interactive Shell?200215
|
||||
Node: Is this Shell Interactive?200864
|
||||
Node: Interactive Shell Behavior201679
|
||||
Node: Bash Conditional Expressions204959
|
||||
Node: Shell Arithmetic208538
|
||||
Node: Aliases211284
|
||||
Node: Arrays213856
|
||||
Node: The Directory Stack217698
|
||||
Node: Directory Stack Builtins218412
|
||||
Node: Printing a Prompt221304
|
||||
Node: The Restricted Shell224056
|
||||
Node: Bash POSIX Mode225888
|
||||
Node: Job Control233741
|
||||
Node: Job Control Basics234201
|
||||
Node: Job Control Builtins238795
|
||||
Node: Job Control Variables243159
|
||||
Node: Command Line Editing244317
|
||||
Node: Introduction and Notation245312
|
||||
Node: Readline Interaction246934
|
||||
Node: Readline Bare Essentials248125
|
||||
Node: Readline Movement Commands249914
|
||||
Node: Readline Killing Commands250879
|
||||
Node: Readline Arguments252799
|
||||
Node: Searching253843
|
||||
Node: Readline Init File256029
|
||||
Node: Readline Init File Syntax257176
|
||||
Node: Conditional Init Constructs270410
|
||||
Node: Sample Init File272943
|
||||
Node: Bindable Readline Commands276060
|
||||
Node: Commands For Moving277267
|
||||
Node: Commands For History278128
|
||||
Node: Commands For Text281283
|
||||
Node: Commands For Killing283956
|
||||
Node: Numeric Arguments286098
|
||||
Node: Commands For Completion287237
|
||||
Node: Keyboard Macros291004
|
||||
Node: Miscellaneous Commands291575
|
||||
Node: Readline vi Mode296886
|
||||
Node: Programmable Completion297800
|
||||
Node: Programmable Completion Builtins303633
|
||||
Node: Using History Interactively312016
|
||||
Node: Bash History Facilities312700
|
||||
Node: Bash History Builtins315614
|
||||
Node: History Interaction319471
|
||||
Node: Event Designators322176
|
||||
Node: Word Designators323191
|
||||
Node: Modifiers324830
|
||||
Node: Installing Bash326234
|
||||
Node: Basic Installation327371
|
||||
Node: Compilers and Options330063
|
||||
Node: Compiling For Multiple Architectures330804
|
||||
Node: Installation Names332468
|
||||
Node: Specifying the System Type333286
|
||||
Node: Sharing Defaults334002
|
||||
Node: Operation Controls334675
|
||||
Node: Optional Features335633
|
||||
Node: Reporting Bugs345035
|
||||
Node: Major Differences From The Bourne Shell346229
|
||||
Node: GNU Free Documentation License362916
|
||||
Node: Indexes385377
|
||||
Node: Builtin Index385831
|
||||
Node: Reserved Word Index392585
|
||||
Node: Variable Index395033
|
||||
Node: Function Index406839
|
||||
Node: Concept Index413571
|
||||
|
||||
End Tag Table
|
||||
|
||||
+17
-17
@@ -1,4 +1,4 @@
|
||||
This is TeX, Version 3.141592 (Web2C 7.5.4) (format=tex 2008.4.8) 2 JUL 2008 09:08
|
||||
This is TeX, Version 3.141592 (Web2C 7.5.4) (format=tex 2008.4.8) 24 JUL 2008 09:12
|
||||
**/usr/homes/chet/src/bash/src/doc/bashref.texi
|
||||
(/usr/homes/chet/src/bash/src/doc/bashref.texi (./texinfo.tex
|
||||
Loading texinfo [version 2003-02-03.16]: Basics,
|
||||
@@ -158,7 +158,7 @@ localization,
|
||||
|
||||
[1]
|
||||
Chapter 2 [2] [3] Chapter 3 [4] [5] [6] [7] [8] [9] [10]
|
||||
Overfull \hbox (43.33539pt too wide) in paragraph at lines 850--850
|
||||
Overfull \hbox (43.33539pt too wide) in paragraph at lines 851--851
|
||||
[]@texttt case @textttsl word @texttt in [ [(] @textttsl pat-tern @texttt [| @
|
||||
textttsl pat-tern@texttt ][]) @textttsl command-list @texttt ;;][] esac[][]
|
||||
|
||||
@@ -173,7 +173,7 @@ textttsl pat-tern@texttt ][]) @textttsl command-list @texttt ;;][] esac[][]
|
||||
[11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25]
|
||||
[26] [27] [28] [29] [30] [31] [32] [33] Chapter 4 [34] [35] [36] [37] [38]
|
||||
[39] [40] [41]
|
||||
Underfull \hbox (badness 5231) in paragraph at lines 3223--3236
|
||||
Underfull \hbox (badness 5231) in paragraph at lines 3264--3277
|
||||
@texttt emacs-meta[]@textrm , @texttt emacs-ctlx[]@textrm , @texttt vi[]@textr
|
||||
m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
|
||||
|
||||
@@ -186,7 +186,7 @@ m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
|
||||
.etc.
|
||||
|
||||
[42] [43] [44] [45] [46]
|
||||
Overfull \hbox (102.08961pt too wide) in paragraph at lines 3634--3634
|
||||
Overfull \hbox (102.08961pt too wide) in paragraph at lines 3685--3685
|
||||
[]@texttt read [-ers] [-a @textttsl aname@texttt ] [-d @textttsl de-lim@texttt
|
||||
] [-i @textttsl text@texttt ] [-n @textttsl nchars@texttt ] [-p @textttsl prom
|
||||
pt@texttt ] [-t @textttsl time-
|
||||
@@ -200,7 +200,7 @@ pt@texttt ] [-t @textttsl time-
|
||||
.etc.
|
||||
|
||||
[47] [48] [49] [50] [51] [52] [53] [54] [55]
|
||||
Underfull \hbox (badness 2573) in paragraph at lines 4285--4289
|
||||
Underfull \hbox (badness 2573) in paragraph at lines 4337--4341
|
||||
[] []@textrm Error trac-ing is en-abled: com-mand sub-sti-tu-tion, shell
|
||||
|
||||
@hbox(7.60416+2.12917)x433.62, glue set 2.95305
|
||||
@@ -217,7 +217,7 @@ Underfull \hbox (badness 2573) in paragraph at lines 4285--4289
|
||||
|
||||
[56] [57] Chapter 5 [58] [59] [60] [61] [62] [63] [64] [65] [66] Chapter 6
|
||||
[67] [68]
|
||||
Overfull \hbox (51.96864pt too wide) in paragraph at lines 5128--5128
|
||||
Overfull \hbox (51.96864pt too wide) in paragraph at lines 5180--5180
|
||||
[]@texttt bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@t
|
||||
exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
|
||||
|
||||
@@ -230,7 +230,7 @@ exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
|
||||
.etc.
|
||||
|
||||
|
||||
Overfull \hbox (76.23077pt too wide) in paragraph at lines 5129--5129
|
||||
Overfull \hbox (76.23077pt too wide) in paragraph at lines 5181--5181
|
||||
[]@texttt bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@texttt
|
||||
] [-O @textttsl shopt_option@texttt ] -c @textttsl string @texttt [@textttsl ar
|
||||
-
|
||||
@@ -244,7 +244,7 @@ Overfull \hbox (76.23077pt too wide) in paragraph at lines 5129--5129
|
||||
.etc.
|
||||
|
||||
|
||||
Overfull \hbox (34.72258pt too wide) in paragraph at lines 5130--5130
|
||||
Overfull \hbox (34.72258pt too wide) in paragraph at lines 5182--5182
|
||||
[]@texttt bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@text
|
||||
tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
|
||||
|
||||
@@ -257,7 +257,7 @@ tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
|
||||
.etc.
|
||||
|
||||
[69] [70]
|
||||
Underfull \hbox (badness 2245) in paragraph at lines 5304--5306
|
||||
Underfull \hbox (badness 2245) in paragraph at lines 5356--5358
|
||||
[]@textrm When a lo-gin shell ex-its, Bash reads and ex-e-cutes com-mands from
|
||||
the file
|
||||
|
||||
@@ -270,7 +270,7 @@ the file
|
||||
.etc.
|
||||
|
||||
[71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84]
|
||||
Underfull \hbox (badness 2521) in paragraph at lines 6441--6444
|
||||
Underfull \hbox (badness 2521) in paragraph at lines 6493--6496
|
||||
@textrm `@texttt --enable-strict-posix-default[]@textrm '[] to @texttt configur
|
||||
e[] @textrm when build-ing (see Sec-tion 10.8
|
||||
|
||||
@@ -326,7 +326,7 @@ Underfull \hbox (badness 2753) in paragraph at lines 1795--1798
|
||||
[116]) (/usr/homes/chet/src/bash/src/lib/readline/doc/hsuser.texi Chapter 9
|
||||
[117] [118] [119] [120] [121] [122]) Chapter 10 [123] [124] [125] [126]
|
||||
[127]
|
||||
Underfull \hbox (badness 2772) in paragraph at lines 7040--7044
|
||||
Underfull \hbox (badness 2772) in paragraph at lines 7092--7096
|
||||
[]@textrm Enable sup-port for large files (@texttt http://www.sas.com/standard
|
||||
s/large_
|
||||
|
||||
@@ -344,12 +344,12 @@ s/large_
|
||||
(./bashref.vrs [150] [151]) (./bashref.fns [152] [153]) (./bashref.cps [154])
|
||||
[155] [156] )
|
||||
Here is how much of TeX's memory you used:
|
||||
1732 strings out of 97980
|
||||
23667 string characters out of 1221006
|
||||
51886 words of memory out of 1500000
|
||||
2583 multiletter control sequences out of 10000+50000
|
||||
1735 strings out of 97980
|
||||
23716 string characters out of 1221006
|
||||
51916 words of memory out of 1500000
|
||||
2586 multiletter control sequences out of 10000+50000
|
||||
31953 words of font info for 111 fonts, out of 1200000 for 2000
|
||||
19 hyphenation exceptions out of 8191
|
||||
15i,8n,11p,273b,471s stack positions out of 5000i,500n,6000p,200000b,5000s
|
||||
15i,8n,11p,273b,474s stack positions out of 5000i,500n,6000p,200000b,5000s
|
||||
|
||||
Output written on bashref.dvi (162 pages, 629552 bytes).
|
||||
Output written on bashref.dvi (162 pages, 632652 bytes).
|
||||
|
||||
Binary file not shown.
+2358
-2297
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -6566,7 +6566,7 @@ takes effect immediately, and has the additional side effect of
|
||||
causing pending output and typeahead to be discarded.
|
||||
|
||||
There are a number of ways to refer to a job in the shell. The
|
||||
character @samp{%} introduces a job name.
|
||||
character @samp{%} introduces a job specification (@var{jobspec}).
|
||||
|
||||
Job number @code{n} may be referred to as @samp{%n}.
|
||||
The symbols @samp{%%} and @samp{%+} refer to the shell's notion of the
|
||||
|
||||
@@ -1110,6 +1110,8 @@ and redirections using standard word expansions.
|
||||
|
||||
The process id of the shell spawned to execute the coprocess is
|
||||
available as the value of the variable @var{NAME}_PID.
|
||||
The @code{wait}
|
||||
builtin command may be used to wait for the coprocess to terminate.
|
||||
|
||||
The return status of a coprocess is the exit status of @var{command}.
|
||||
|
||||
|
||||
+21
-20
@@ -20,40 +20,41 @@
|
||||
\subsubsecentry{Looping Constructs}{3}{2}{4}{1}{9}
|
||||
\subsubsecentry{Conditional Constructs}{3}{2}{4}{2}{10}
|
||||
\subsubsecentry{Grouping Commands}{3}{2}{4}{3}{13}
|
||||
\subsecentry{Coprocesses}{3}{2}{5}{14}
|
||||
\secentry{Shell Functions}{3}{3}{14}
|
||||
\secentry{Shell Parameters}{3}{4}{15}
|
||||
\secentry{Shell Parameters}{3}{4}{16}
|
||||
\subsecentry{Positional Parameters}{3}{4}{1}{16}
|
||||
\subsecentry{Special Parameters}{3}{4}{2}{16}
|
||||
\secentry{Shell Expansions}{3}{5}{17}
|
||||
\subsecentry{Brace Expansion}{3}{5}{1}{17}
|
||||
\subsecentry{Tilde Expansion}{3}{5}{2}{18}
|
||||
\subsecentry{Shell Parameter Expansion}{3}{5}{3}{19}
|
||||
\subsecentry{Brace Expansion}{3}{5}{1}{18}
|
||||
\subsecentry{Tilde Expansion}{3}{5}{2}{19}
|
||||
\subsecentry{Shell Parameter Expansion}{3}{5}{3}{20}
|
||||
\subsecentry{Command Substitution}{3}{5}{4}{22}
|
||||
\subsecentry{Arithmetic Expansion}{3}{5}{5}{22}
|
||||
\subsecentry{Arithmetic Expansion}{3}{5}{5}{23}
|
||||
\subsecentry{Process Substitution}{3}{5}{6}{23}
|
||||
\subsecentry{Word Splitting}{3}{5}{7}{23}
|
||||
\subsecentry{Word Splitting}{3}{5}{7}{24}
|
||||
\subsecentry{Filename Expansion}{3}{5}{8}{24}
|
||||
\subsubsecentry{Pattern Matching}{3}{5}{8}{1}{24}
|
||||
\subsecentry{Quote Removal}{3}{5}{9}{25}
|
||||
\secentry{Redirections}{3}{6}{25}
|
||||
\subsecentry{Redirecting Input}{3}{6}{1}{26}
|
||||
\subsubsecentry{Pattern Matching}{3}{5}{8}{1}{25}
|
||||
\subsecentry{Quote Removal}{3}{5}{9}{26}
|
||||
\secentry{Redirections}{3}{6}{26}
|
||||
\subsecentry{Redirecting Input}{3}{6}{1}{27}
|
||||
\subsecentry{Redirecting Output}{3}{6}{2}{27}
|
||||
\subsecentry{Appending Redirected Output}{3}{6}{3}{27}
|
||||
\subsecentry{Redirecting Standard Output and Standard Error}{3}{6}{4}{27}
|
||||
\subsecentry{Appending Standard Output and Standard Error}{3}{6}{5}{27}
|
||||
\subsecentry{Redirecting Standard Output and Standard Error}{3}{6}{4}{28}
|
||||
\subsecentry{Appending Standard Output and Standard Error}{3}{6}{5}{28}
|
||||
\subsecentry{Here Documents}{3}{6}{6}{28}
|
||||
\subsecentry{Here Strings}{3}{6}{7}{28}
|
||||
\subsecentry{Duplicating File Descriptors}{3}{6}{8}{28}
|
||||
\subsecentry{Here Strings}{3}{6}{7}{29}
|
||||
\subsecentry{Duplicating File Descriptors}{3}{6}{8}{29}
|
||||
\subsecentry{Moving File Descriptors}{3}{6}{9}{29}
|
||||
\subsecentry{Opening File Descriptors for Reading and Writing}{3}{6}{10}{29}
|
||||
\secentry{Executing Commands}{3}{7}{29}
|
||||
\subsecentry{Simple Command Expansion}{3}{7}{1}{29}
|
||||
\secentry{Executing Commands}{3}{7}{30}
|
||||
\subsecentry{Simple Command Expansion}{3}{7}{1}{30}
|
||||
\subsecentry{Command Search and Execution}{3}{7}{2}{30}
|
||||
\subsecentry{Command Execution Environment}{3}{7}{3}{30}
|
||||
\subsecentry{Environment}{3}{7}{4}{31}
|
||||
\subsecentry{Command Execution Environment}{3}{7}{3}{31}
|
||||
\subsecentry{Environment}{3}{7}{4}{32}
|
||||
\subsecentry{Exit Status}{3}{7}{5}{32}
|
||||
\subsecentry{Signals}{3}{7}{6}{32}
|
||||
\secentry{Shell Scripts}{3}{8}{33}
|
||||
\subsecentry{Signals}{3}{7}{6}{33}
|
||||
\secentry{Shell Scripts}{3}{8}{34}
|
||||
\chapentry{Shell Builtin Commands}{4}{35}
|
||||
\secentry{Bourne Shell Builtins}{4}{1}{35}
|
||||
\secentry{Bash Builtin Commands}{4}{2}{41}
|
||||
|
||||
+5
-5
@@ -1,11 +1,11 @@
|
||||
\entry{LC_MESSAGES}{7}{\code {LC_MESSAGES}}
|
||||
\entry{TEXTDOMAIN}{7}{\code {TEXTDOMAIN}}
|
||||
\entry{TEXTDOMAINDIR}{7}{\code {TEXTDOMAINDIR}}
|
||||
\entry{*}{16}{\code {*}}
|
||||
\entry{@}{16}{\code {@}}
|
||||
\entry{#}{16}{\code {#}}
|
||||
\entry{?}{16}{\code {?}}
|
||||
\entry{-}{16}{\code {-}}
|
||||
\entry{*}{17}{\code {*}}
|
||||
\entry{@}{17}{\code {@}}
|
||||
\entry{#}{17}{\code {#}}
|
||||
\entry{?}{17}{\code {?}}
|
||||
\entry{-}{17}{\code {-}}
|
||||
\entry{$}{17}{\code {$}}
|
||||
\entry{!}{17}{\code {!}}
|
||||
\entry{0}{17}{\code {0}}
|
||||
|
||||
+5
-5
@@ -1,17 +1,17 @@
|
||||
\initial {!}
|
||||
\entry {\code {!}}{17}
|
||||
\initial {#}
|
||||
\entry {\code {#}}{16}
|
||||
\entry {\code {#}}{17}
|
||||
\initial {$}
|
||||
\entry {\code {$}}{17}
|
||||
\initial {*}
|
||||
\entry {\code {*}}{16}
|
||||
\entry {\code {*}}{17}
|
||||
\initial {-}
|
||||
\entry {\code {-}}{16}
|
||||
\entry {\code {-}}{17}
|
||||
\initial {?}
|
||||
\entry {\code {?}}{16}
|
||||
\entry {\code {?}}{17}
|
||||
\initial {@}
|
||||
\entry {\code {@}}{16}
|
||||
\entry {\code {@}}{17}
|
||||
\initial {_}
|
||||
\entry {\code {_}}{17}
|
||||
\initial {0}
|
||||
|
||||
+284
-277
@@ -330,8 +330,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
loop) is resumed. The return value is 0 unless _n is not greater
|
||||
than or equal to 1.
|
||||
|
||||
ddeeccllaarree [--aaAAffFFiirrttxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...]
|
||||
ttyyppeesseett [--aaAAffFFiirrttxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...]
|
||||
ddeeccllaarree [--aaAAffFFiillrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...]
|
||||
ttyyppeesseett [--aaAAffFFiillrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...]
|
||||
Declare variables and/or give them attributes. If no _n_a_m_es are
|
||||
given then display the values of variables. The --pp option will
|
||||
display the attributes and values of each _n_a_m_e. When --pp is used
|
||||
@@ -356,12 +356,18 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
--ii The variable is treated as an integer; arithmetic evalua-
|
||||
tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN )) is performed when the
|
||||
variable is assigned a value.
|
||||
--ll When the variable is assigned a value, all upper-case
|
||||
characters are converted to lower-case. The upper-case
|
||||
attribute is disabled.
|
||||
--rr Make _n_a_m_es readonly. These names cannot then be assigned
|
||||
values by subsequent assignment statements or unset.
|
||||
--tt Give each _n_a_m_e the _t_r_a_c_e attribute. Traced functions
|
||||
inherit the DDEEBBUUGG and RREETTUURRNN traps from the calling
|
||||
shell. The trace attribute has no special meaning for
|
||||
variables.
|
||||
--uu When the variable is assigned a value, all lower-case
|
||||
characters are converted to upper-case. The lower-case
|
||||
attribute is disabled.
|
||||
--xx Mark _n_a_m_es for export to subsequent commands via the
|
||||
environment.
|
||||
|
||||
@@ -885,80 +891,81 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
|
||||
If no _n_a_m_e_s are supplied, the line read is assigned to the vari-
|
||||
able RREEPPLLYY. The return code is zero, unless end-of-file is
|
||||
encountered, rreeaadd times out, or an invalid file descriptor is
|
||||
supplied as the argument to --uu.
|
||||
encountered, rreeaadd times out (in which case the return code is
|
||||
greater than 128), or an invalid file descriptor is supplied as
|
||||
the argument to --uu.
|
||||
|
||||
rreeaaddoonnllyy [--aaAAppff] [_n_a_m_e[=_w_o_r_d] ...]
|
||||
The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s
|
||||
may not be changed by subsequent assignment. If the --ff option
|
||||
is supplied, the functions corresponding to the _n_a_m_e_s are so
|
||||
marked. The --aa option restricts the variables to indexed
|
||||
arrays; the --AA option restricts the variables to associative
|
||||
arrays. If no _n_a_m_e arguments are given, or if the --pp option is
|
||||
supplied, a list of all readonly names is printed. The --pp
|
||||
option causes output to be displayed in a format that may be
|
||||
reused as input. If a variable name is followed by =_w_o_r_d, the
|
||||
value of the variable is set to _w_o_r_d. The return status is 0
|
||||
The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s
|
||||
may not be changed by subsequent assignment. If the --ff option
|
||||
is supplied, the functions corresponding to the _n_a_m_e_s are so
|
||||
marked. The --aa option restricts the variables to indexed
|
||||
arrays; the --AA option restricts the variables to associative
|
||||
arrays. If no _n_a_m_e arguments are given, or if the --pp option is
|
||||
supplied, a list of all readonly names is printed. The --pp
|
||||
option causes output to be displayed in a format that may be
|
||||
reused as input. If a variable name is followed by =_w_o_r_d, the
|
||||
value of the variable is set to _w_o_r_d. The return status is 0
|
||||
unless an invalid option is encountered, one of the _n_a_m_e_s is not
|
||||
a valid shell variable name, or --ff is supplied with a _n_a_m_e that
|
||||
a valid shell variable name, or --ff is supplied with a _n_a_m_e that
|
||||
is not a function.
|
||||
|
||||
rreettuurrnn [_n]
|
||||
Causes a function to exit with the return value specified by _n.
|
||||
If _n is omitted, the return status is that of the last command
|
||||
executed in the function body. If used outside a function, but
|
||||
during execution of a script by the .. (ssoouurrccee) command, it
|
||||
Causes a function to exit with the return value specified by _n.
|
||||
If _n is omitted, the return status is that of the last command
|
||||
executed in the function body. If used outside a function, but
|
||||
during execution of a script by the .. (ssoouurrccee) command, it
|
||||
causes the shell to stop executing that script and return either
|
||||
_n or the exit status of the last command executed within the
|
||||
script as the exit status of the script. If used outside a
|
||||
function and not during execution of a script by .., the return
|
||||
_n or the exit status of the last command executed within the
|
||||
script as the exit status of the script. If used outside a
|
||||
function and not during execution of a script by .., the return
|
||||
status is false. Any command associated with the RREETTUURRNN trap is
|
||||
executed before execution resumes after the function or script.
|
||||
executed before execution resumes after the function or script.
|
||||
|
||||
sseett [----aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [--oo _o_p_t_i_o_n] [_a_r_g ...]
|
||||
sseett [++aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [++oo _o_p_t_i_o_n] [_a_r_g ...]
|
||||
Without options, the name and value of each shell variable are
|
||||
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.
|
||||
The output is sorted according to the current locale. When
|
||||
options are specified, they set or unset shell attributes. Any
|
||||
arguments remaining after the options are processed are treated
|
||||
as values for the positional parameters and are assigned, in
|
||||
not be reset. In _p_o_s_i_x _m_o_d_e, 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 the options are processed are treated
|
||||
as values for the positional parameters and are assigned, in
|
||||
order, to $$11, $$22, ...... $$_n. Options, if specified, have the fol-
|
||||
lowing meanings:
|
||||
--aa Automatically mark variables and functions which are
|
||||
modified or created for export to the environment of
|
||||
--aa Automatically mark variables and functions which are
|
||||
modified or created for export to the environment of
|
||||
subsequent commands.
|
||||
--bb Report the status of terminated background jobs immedi-
|
||||
--bb Report the status of terminated background jobs immedi-
|
||||
ately, rather than before the next primary prompt. This
|
||||
is effective only when job control is enabled.
|
||||
--ee Exit immediately if a _s_i_m_p_l_e _c_o_m_m_a_n_d (see SSHHEELLLL GGRRAAMMMMAARR
|
||||
--ee Exit immediately if a _s_i_m_p_l_e _c_o_m_m_a_n_d (see SSHHEELLLL GGRRAAMMMMAARR
|
||||
above) exits with a non-zero status. The shell does not
|
||||
exit if the command that fails is part of the command
|
||||
list immediately following a wwhhiillee or uunnttiill keyword,
|
||||
part of the test in an iiff statement, part of a command
|
||||
executed in a &&&& or |||| list, any command in a pipeline
|
||||
but the last, or if the command's return value is being
|
||||
inverted via !!. Failing simple commands that are part
|
||||
of shell functions or command lists enclosed in braces
|
||||
or parentheses satisfying the above conditions do not
|
||||
exit if the command that fails is part of the command
|
||||
list immediately following a wwhhiillee or uunnttiill keyword,
|
||||
part of the test in an iiff statement, part of a command
|
||||
executed in a &&&& or |||| list, any command in a pipeline
|
||||
but the last, or if the command's return value is being
|
||||
inverted via !!. Failing simple commands that are part
|
||||
of shell functions or command lists enclosed in braces
|
||||
or parentheses satisfying the above conditions do not
|
||||
cause the shell to exit. A trap on EERRRR, if set, is exe-
|
||||
cuted before the shell exits.
|
||||
--ff Disable pathname expansion.
|
||||
--hh Remember the location of commands as they are looked up
|
||||
--hh Remember the location of commands as they are looked up
|
||||
for execution. This is enabled by default.
|
||||
--kk All arguments in the form of assignment statements are
|
||||
placed in the environment for a command, not just those
|
||||
--kk All arguments in the form of assignment statements are
|
||||
placed in the environment for a command, not just those
|
||||
that precede the command name.
|
||||
--mm Monitor mode. Job control is enabled. This option is
|
||||
on by default for interactive shells on systems that
|
||||
support it (see JJOOBB CCOONNTTRROOLL above). Background pro-
|
||||
cesses run in a separate process group and a line con-
|
||||
taining their exit status is printed upon their comple-
|
||||
--mm Monitor mode. Job control is enabled. This option is
|
||||
on by default for interactive shells on systems that
|
||||
support it (see JJOOBB CCOONNTTRROOLL above). Background pro-
|
||||
cesses run in a separate process group and a line con-
|
||||
taining their exit status is printed upon their comple-
|
||||
tion.
|
||||
--nn Read commands but do not execute them. This may be used
|
||||
to check a shell script for syntax errors. This is
|
||||
to check a shell script for syntax errors. This is
|
||||
ignored by interactive shells.
|
||||
--oo _o_p_t_i_o_n_-_n_a_m_e
|
||||
The _o_p_t_i_o_n_-_n_a_m_e can be one of the following:
|
||||
@@ -966,7 +973,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
Same as --aa.
|
||||
bbrraacceeeexxppaanndd
|
||||
Same as --BB.
|
||||
eemmaaccss Use an emacs-style command line editing inter-
|
||||
eemmaaccss Use an emacs-style command line editing inter-
|
||||
face. This is enabled by default when the shell
|
||||
is interactive, unless the shell is started with
|
||||
the ----nnooeeddiittiinngg option.
|
||||
@@ -982,8 +989,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
HHIISSTTOORRYY. This option is on by default in inter-
|
||||
active shells.
|
||||
iiggnnoorreeeeooff
|
||||
The effect is as if the shell command
|
||||
``IGNOREEOF=10'' had been executed (see SShheellll
|
||||
The effect is as if the shell command
|
||||
``IGNOREEOF=10'' had been executed (see SShheellll
|
||||
VVaarriiaabblleess above).
|
||||
kkeeyywwoorrdd Same as --kk.
|
||||
mmoonniittoorr Same as --mm.
|
||||
@@ -997,13 +1004,13 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
pphhyyssiiccaall
|
||||
Same as --PP.
|
||||
ppiippeeffaaiill
|
||||
If set, the return value of a pipeline is the
|
||||
value of the last (rightmost) command to exit
|
||||
with a non-zero status, or zero if all commands
|
||||
in the pipeline exit successfully. This option
|
||||
If set, the return value of a pipeline is the
|
||||
value of the last (rightmost) command to exit
|
||||
with a non-zero status, or zero if all commands
|
||||
in the pipeline exit successfully. This option
|
||||
is disabled by default.
|
||||
ppoossiixx Change the behavior of bbaasshh where the default
|
||||
operation differs from the POSIX standard to
|
||||
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).
|
||||
pprriivviilleeggeedd
|
||||
Same as --pp.
|
||||
@@ -1011,197 +1018,197 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
vvii Use a vi-style command line editing interface.
|
||||
xxttrraaccee Same as --xx.
|
||||
If --oo is supplied with no _o_p_t_i_o_n_-_n_a_m_e, the values of the
|
||||
current options are printed. If ++oo is supplied with no
|
||||
_o_p_t_i_o_n_-_n_a_m_e, a series of sseett commands to recreate the
|
||||
current option settings is displayed on the standard
|
||||
current options are printed. If ++oo is supplied with no
|
||||
_o_p_t_i_o_n_-_n_a_m_e, a series of sseett commands to recreate the
|
||||
current option settings is displayed on the standard
|
||||
output.
|
||||
--pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the $$EENNVV and
|
||||
$$BBAASSHH__EENNVV files are not processed, shell functions are
|
||||
not inherited from the environment, and the SSHHEELLLLOOPPTTSS
|
||||
variable, if it appears in the environment, is ignored.
|
||||
If the shell is started with the effective user (group)
|
||||
id not equal to the real user (group) id, and the --pp
|
||||
option is not supplied, these actions are taken and the
|
||||
--pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the $$EENNVV and
|
||||
$$BBAASSHH__EENNVV files are not processed, shell functions are
|
||||
not inherited from the environment, and the SSHHEELLLLOOPPTTSS
|
||||
variable, if it appears in the environment, is ignored.
|
||||
If the shell is started with the effective user (group)
|
||||
id not equal to the real user (group) id, and the --pp
|
||||
option is not supplied, these actions are taken and the
|
||||
effective user id is set to the real user id. If the --pp
|
||||
option is supplied at startup, the effective user id is
|
||||
option is supplied at startup, the effective user id is
|
||||
not reset. Turning this option off causes the effective
|
||||
user and group ids to be set to the real user and group
|
||||
user and group ids to be set to the real user and group
|
||||
ids.
|
||||
--tt Exit after reading and executing one command.
|
||||
--uu Treat unset variables as an error when performing param-
|
||||
eter expansion. If expansion is attempted on an unset
|
||||
eter expansion. If expansion is attempted on an unset
|
||||
variable, the shell prints an error message, and, if not
|
||||
interactive, exits with a non-zero status.
|
||||
--vv Print shell input lines as they are read.
|
||||
--xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee
|
||||
--xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee
|
||||
command, sseelleecctt command, or arithmetic ffoorr command, dis-
|
||||
play the expanded value of PPSS44, followed by the command
|
||||
play the expanded value of PPSS44, followed by the command
|
||||
and its expanded arguments or associated word list.
|
||||
--BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn
|
||||
--BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn
|
||||
above). This is on by default.
|
||||
--CC If set, bbaasshh does not overwrite an existing file with
|
||||
the >>, >>&&, and <<>> redirection operators. This may be
|
||||
--CC If set, bbaasshh does not overwrite an existing file with
|
||||
the >>, >>&&, and <<>> redirection operators. This may be
|
||||
overridden when creating output files by using the redi-
|
||||
rection operator >>|| instead of >>.
|
||||
--EE If set, any trap on EERRRR is inherited by shell functions,
|
||||
command substitutions, and commands executed in a sub-
|
||||
shell environment. The EERRRR trap is normally not inher-
|
||||
command substitutions, and commands executed in a sub-
|
||||
shell environment. The EERRRR trap is normally not inher-
|
||||
ited in such cases.
|
||||
--HH Enable !! style history substitution. This option is on
|
||||
by default when the shell is interactive.
|
||||
--PP If set, the shell does not follow symbolic links when
|
||||
executing commands such as ccdd that change the current
|
||||
--PP If set, the shell does not follow symbolic links when
|
||||
executing commands such as ccdd that change the current
|
||||
working directory. It uses the physical directory
|
||||
structure instead. By default, bbaasshh follows the logical
|
||||
chain of directories when performing commands which
|
||||
chain of directories when performing commands which
|
||||
change the current directory.
|
||||
--TT If set, any traps on DDEEBBUUGG and RREETTUURRNN are inherited by
|
||||
shell functions, command substitutions, and commands
|
||||
executed in a subshell environment. The DDEEBBUUGG and
|
||||
--TT If set, any traps on DDEEBBUUGG and RREETTUURRNN are inherited by
|
||||
shell functions, command substitutions, and commands
|
||||
executed in a subshell environment. The DDEEBBUUGG and
|
||||
RREETTUURRNN traps are normally not inherited in such cases.
|
||||
---- If no arguments follow this option, then the positional
|
||||
---- If no arguments follow this option, then the positional
|
||||
parameters are unset. Otherwise, the positional parame-
|
||||
ters are set to the _a_r_gs, even if some of them begin
|
||||
ters are set to the _a_r_gs, even if some of them begin
|
||||
with a --.
|
||||
-- Signal the end of options, cause all remaining _a_r_gs to
|
||||
-- Signal the end of options, cause all remaining _a_r_gs to
|
||||
be assigned to the positional parameters. The --xx and --vv
|
||||
options are turned off. If there are no _a_r_gs, the posi-
|
||||
tional parameters remain unchanged.
|
||||
|
||||
The options are off by default unless otherwise noted. Using +
|
||||
rather than - causes these options to be turned off. The
|
||||
options can also be specified as arguments to an invocation of
|
||||
the shell. The current set of options may be found in $$--. The
|
||||
The options are off by default unless otherwise noted. Using +
|
||||
rather than - causes these options to be turned off. The
|
||||
options can also be specified as arguments to an invocation of
|
||||
the shell. The current set of options may be found in $$--. The
|
||||
return status is always true unless an invalid option is encoun-
|
||||
tered.
|
||||
|
||||
sshhiifftt [_n]
|
||||
The positional parameters from _n+1 ... are renamed to $$11 ........
|
||||
Parameters represented by the numbers $$## down to $$##-_n+1 are
|
||||
unset. _n must be a non-negative number less than or equal to
|
||||
$$##. If _n is 0, no parameters are changed. If _n is not given,
|
||||
it is assumed to be 1. If _n is greater than $$##, the positional
|
||||
parameters are not changed. The return status is greater than
|
||||
The positional parameters from _n+1 ... are renamed to $$11 ........
|
||||
Parameters represented by the numbers $$## down to $$##-_n+1 are
|
||||
unset. _n must be a non-negative number less than or equal to
|
||||
$$##. If _n is 0, no parameters are changed. If _n is not given,
|
||||
it is assumed to be 1. If _n is greater than $$##, the positional
|
||||
parameters are not changed. The return status is greater than
|
||||
zero if _n is greater than $$## or less than zero; otherwise 0.
|
||||
|
||||
sshhoopptt [--ppqqssuu] [--oo] [_o_p_t_n_a_m_e ...]
|
||||
Toggle the values of variables controlling optional shell behav-
|
||||
ior. With no options, or with the --pp option, a list of all set-
|
||||
table options is displayed, with an indication of whether or not
|
||||
each is set. The --pp option causes output to be displayed in a
|
||||
form that may be reused as input. Other options have the fol-
|
||||
each is set. The --pp option causes output to be displayed in a
|
||||
form that may be reused as input. Other options have the fol-
|
||||
lowing meanings:
|
||||
--ss Enable (set) each _o_p_t_n_a_m_e.
|
||||
--uu Disable (unset) each _o_p_t_n_a_m_e.
|
||||
--qq Suppresses normal output (quiet mode); the return status
|
||||
--qq Suppresses normal output (quiet mode); the return status
|
||||
indicates whether the _o_p_t_n_a_m_e is set or unset. If multi-
|
||||
ple _o_p_t_n_a_m_e arguments are given with --qq, the return sta-
|
||||
tus is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero other-
|
||||
ple _o_p_t_n_a_m_e arguments are given with --qq, the return sta-
|
||||
tus is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero other-
|
||||
wise.
|
||||
--oo Restricts the values of _o_p_t_n_a_m_e to be those defined for
|
||||
--oo Restricts the values of _o_p_t_n_a_m_e to be those defined for
|
||||
the --oo option to the sseett builtin.
|
||||
|
||||
If either --ss or --uu is used with no _o_p_t_n_a_m_e arguments, the dis-
|
||||
If either --ss or --uu is used with no _o_p_t_n_a_m_e arguments, the dis-
|
||||
play is limited to those options which are set or unset, respec-
|
||||
tively. Unless otherwise noted, the sshhoopptt options are disabled
|
||||
tively. Unless otherwise noted, the sshhoopptt options are disabled
|
||||
(unset) by default.
|
||||
|
||||
The return status when listing options is zero if all _o_p_t_n_a_m_e_s
|
||||
are enabled, non-zero otherwise. When setting or unsetting
|
||||
options, the return status is zero unless an _o_p_t_n_a_m_e is not a
|
||||
The return status when listing options is zero if all _o_p_t_n_a_m_e_s
|
||||
are enabled, non-zero otherwise. When setting or unsetting
|
||||
options, the return status is zero unless an _o_p_t_n_a_m_e is not a
|
||||
valid shell option.
|
||||
|
||||
The list of sshhoopptt options is:
|
||||
|
||||
aauuttooccdd If set, a command name that is the name of a directory
|
||||
is executed as if it were the argument to the ccdd com-
|
||||
aauuttooccdd If set, a command name that is the name of a directory
|
||||
is executed as if it were the argument to the ccdd com-
|
||||
mand. This option is only used by interactive shells.
|
||||
ccddaabbllee__vvaarrss
|
||||
If set, an argument to the ccdd builtin command that is
|
||||
not a directory is assumed to be the name of a variable
|
||||
If set, an argument to the ccdd builtin command that is
|
||||
not a directory is assumed to be the name of a variable
|
||||
whose value is the directory to change to.
|
||||
ccddssppeellll If set, minor errors in the spelling of a directory com-
|
||||
ponent in a ccdd command will be corrected. The errors
|
||||
ponent in a ccdd command will be corrected. The errors
|
||||
checked for are transposed characters, a missing charac-
|
||||
ter, and one character too many. If a correction is
|
||||
found, the corrected file name is printed, and the com-
|
||||
mand proceeds. This option is only used by interactive
|
||||
ter, and one character too many. If a correction is
|
||||
found, the corrected file name is printed, and the com-
|
||||
mand proceeds. This option is only used by interactive
|
||||
shells.
|
||||
cchheecckkhhaasshh
|
||||
If set, bbaasshh checks that a command found in the hash ta-
|
||||
ble exists before trying to execute it. If a hashed
|
||||
command no longer exists, a normal path search is per-
|
||||
ble exists before trying to execute it. If a hashed
|
||||
command no longer exists, a normal path search is per-
|
||||
formed.
|
||||
cchheecckkjjoobbss
|
||||
If set, bbaasshh lists the status of any stopped and running
|
||||
jobs before exiting an interactive shell. If any jobs
|
||||
jobs before exiting an interactive shell. If any jobs
|
||||
are running, this causes the exit to be deferred until a
|
||||
second exit is attempted without an intervening command
|
||||
(see JJOOBB CCOONNTTRROOLL above). The shell always postpones
|
||||
second exit is attempted without an intervening command
|
||||
(see JJOOBB CCOONNTTRROOLL above). The shell always postpones
|
||||
exiting if any jobs are stopped.
|
||||
cchheecckkwwiinnssiizzee
|
||||
If set, bbaasshh checks the window size after each command
|
||||
and, if necessary, updates the values of LLIINNEESS and CCOOLL--
|
||||
If set, bbaasshh checks the window size after each command
|
||||
and, if necessary, updates the values of LLIINNEESS and CCOOLL--
|
||||
UUMMNNSS.
|
||||
ccmmddhhiisstt If set, bbaasshh attempts to save all lines of a multiple-
|
||||
line command in the same history entry. This allows
|
||||
ccmmddhhiisstt If set, bbaasshh attempts to save all lines of a multiple-
|
||||
line command in the same history entry. This allows
|
||||
easy re-editing of multi-line commands.
|
||||
ccoommppaatt3311
|
||||
If set, bbaasshh changes its behavior to that of version 3.1
|
||||
with respect to quoted arguments to the conditional com-
|
||||
mand's =~ operator.
|
||||
ddiirrssppeellll
|
||||
If set, bbaasshh attempts spelling correction on directory
|
||||
names during word completion if the directory name ini-
|
||||
If set, bbaasshh attempts spelling correction on directory
|
||||
names during word completion if the directory name ini-
|
||||
tially supplied does not exist.
|
||||
ddoottgglloobb If set, bbaasshh includes filenames beginning with a `.' in
|
||||
ddoottgglloobb If set, bbaasshh includes filenames beginning with a `.' in
|
||||
the results of pathname expansion.
|
||||
eexxeeccffaaiill
|
||||
If set, a non-interactive shell will not exit if it can-
|
||||
not execute the file specified as an argument to the
|
||||
eexxeecc builtin command. An interactive shell does not
|
||||
not execute the file specified as an argument to the
|
||||
eexxeecc builtin command. An interactive shell does not
|
||||
exit if eexxeecc fails.
|
||||
eexxppaanndd__aalliiaasseess
|
||||
If set, aliases are expanded as described above under
|
||||
If set, aliases are expanded as described above under
|
||||
AALLIIAASSEESS. This option is enabled by default for interac-
|
||||
tive shells.
|
||||
eexxttddeebbuugg
|
||||
If set, behavior intended for use by debuggers is
|
||||
If set, behavior intended for use by debuggers is
|
||||
enabled:
|
||||
11.. The --FF option to the ddeeccllaarree builtin displays the
|
||||
source file name and line number corresponding to
|
||||
each function name supplied as an argument.
|
||||
22.. If the command run by the DDEEBBUUGG trap returns a
|
||||
non-zero value, the next command is skipped and
|
||||
22.. If the command run by the DDEEBBUUGG trap returns a
|
||||
non-zero value, the next command is skipped and
|
||||
not executed.
|
||||
33.. If the command run by the DDEEBBUUGG trap returns a
|
||||
value of 2, and the shell is executing in a sub-
|
||||
routine (a shell function or a shell script exe-
|
||||
cuted by the .. or ssoouurrccee builtins), a call to
|
||||
33.. If the command run by the DDEEBBUUGG trap returns a
|
||||
value of 2, and the shell is executing in a sub-
|
||||
routine (a shell function or a shell script exe-
|
||||
cuted by the .. or ssoouurrccee builtins), a call to
|
||||
rreettuurrnn is simulated.
|
||||
44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described
|
||||
44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described
|
||||
in their descriptions above.
|
||||
55.. Function tracing is enabled: command substitu-
|
||||
55.. Function tracing is enabled: command substitu-
|
||||
tion, shell functions, and subshells invoked with
|
||||
(( _c_o_m_m_a_n_d )) inherit the DDEEBBUUGG and RREETTUURRNN traps.
|
||||
66.. Error tracing is enabled: command substitution,
|
||||
shell functions, and subshells invoked with ((
|
||||
66.. Error tracing is enabled: command substitution,
|
||||
shell functions, and subshells invoked with ((
|
||||
_c_o_m_m_a_n_d )) inherit the EERRRROORR trap.
|
||||
eexxttgglloobb If set, the extended pattern matching features described
|
||||
above under PPaatthhnnaammee EExxppaannssiioonn are enabled.
|
||||
eexxttqquuoottee
|
||||
If set, $$'_s_t_r_i_n_g' and $$"_s_t_r_i_n_g" quoting is performed
|
||||
within $${{_p_a_r_a_m_e_t_e_r}} expansions enclosed in double
|
||||
If set, $$'_s_t_r_i_n_g' and $$"_s_t_r_i_n_g" quoting is performed
|
||||
within $${{_p_a_r_a_m_e_t_e_r}} expansions enclosed in double
|
||||
quotes. This option is enabled by default.
|
||||
ffaaiillgglloobb
|
||||
If set, patterns which fail to match filenames during
|
||||
If set, patterns which fail to match filenames during
|
||||
pathname expansion result in an expansion error.
|
||||
ffoorrccee__ffiiggnnoorree
|
||||
If set, the suffixes specified by the FFIIGGNNOORREE shell
|
||||
variable cause words to be ignored when performing word
|
||||
If set, the suffixes specified by the FFIIGGNNOORREE shell
|
||||
variable cause words to be ignored when performing word
|
||||
completion even if the ignored words are the only possi-
|
||||
ble completions. See SSHHEELLLL VVAARRIIAABBLLEESS above for a
|
||||
description of FFIIGGNNOORREE. This option is enabled by
|
||||
description of FFIIGGNNOORREE. This option is enabled by
|
||||
default.
|
||||
gglloobbssttaarr
|
||||
If set, the pattern **** used in a filename expansion con-
|
||||
@@ -1212,58 +1219,58 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
If set, shell error messages are written in the standard
|
||||
GNU error message format.
|
||||
hhiissttaappppeenndd
|
||||
If set, the history list is appended to the file named
|
||||
by the value of the HHIISSTTFFIILLEE variable when the shell
|
||||
If set, the history list is appended to the file named
|
||||
by the value of the HHIISSTTFFIILLEE variable when the shell
|
||||
exits, rather than overwriting the file.
|
||||
hhiissttrreeeeddiitt
|
||||
If set, and rreeaaddlliinnee is being used, a user is given the
|
||||
If set, and rreeaaddlliinnee is being used, a user is given the
|
||||
opportunity to re-edit a failed history substitution.
|
||||
hhiissttvveerriiffyy
|
||||
If set, and rreeaaddlliinnee is being used, the results of his-
|
||||
tory substitution are not immediately passed to the
|
||||
shell parser. Instead, the resulting line is loaded
|
||||
If set, and rreeaaddlliinnee is being used, the results of his-
|
||||
tory substitution are not immediately passed to the
|
||||
shell parser. Instead, the resulting line is loaded
|
||||
into the rreeaaddlliinnee editing buffer, allowing further modi-
|
||||
fication.
|
||||
hhoossttccoommpplleettee
|
||||
If set, and rreeaaddlliinnee is being used, bbaasshh will attempt to
|
||||
perform hostname completion when a word containing a @@
|
||||
is being completed (see CCoommpplleettiinngg under RREEAADDLLIINNEE
|
||||
perform hostname completion when a word containing a @@
|
||||
is being completed (see CCoommpplleettiinngg under RREEAADDLLIINNEE
|
||||
above). This is enabled by default.
|
||||
hhuuppoonneexxiitt
|
||||
If set, bbaasshh will send SSIIGGHHUUPP to all jobs when an inter-
|
||||
active login shell exits.
|
||||
iinntteerraaccttiivvee__ccoommmmeennttss
|
||||
If set, allow a word beginning with ## to cause that word
|
||||
and all remaining characters on that line to be ignored
|
||||
in an interactive shell (see CCOOMMMMEENNTTSS above). This
|
||||
and all remaining characters on that line to be ignored
|
||||
in an interactive shell (see CCOOMMMMEENNTTSS above). This
|
||||
option is enabled by default.
|
||||
lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line
|
||||
lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line
|
||||
commands are saved to the history with embedded newlines
|
||||
rather than using semicolon separators where possible.
|
||||
llooggiinn__sshheellll
|
||||
The shell sets this option if it is started as a login
|
||||
shell (see IINNVVOOCCAATTIIOONN above). The value may not be
|
||||
The shell sets this option if it is started as a login
|
||||
shell (see IINNVVOOCCAATTIIOONN above). The value may not be
|
||||
changed.
|
||||
mmaaiillwwaarrnn
|
||||
If set, and a file that bbaasshh is checking for mail has
|
||||
been accessed since the last time it was checked, the
|
||||
message ``The mail in _m_a_i_l_f_i_l_e has been read'' is dis-
|
||||
If set, and a file that bbaasshh is checking for mail has
|
||||
been accessed since the last time it was checked, the
|
||||
message ``The mail in _m_a_i_l_f_i_l_e has been read'' is dis-
|
||||
played.
|
||||
nnoo__eemmppttyy__ccmmdd__ccoommpplleettiioonn
|
||||
If set, and rreeaaddlliinnee is being used, bbaasshh will not
|
||||
If set, and rreeaaddlliinnee is being used, bbaasshh will not
|
||||
attempt to search the PPAATTHH for possible completions when
|
||||
completion is attempted on an empty line.
|
||||
nnooccaasseegglloobb
|
||||
If set, bbaasshh matches filenames in a case-insensitive
|
||||
If set, bbaasshh matches filenames in a case-insensitive
|
||||
fashion when performing pathname expansion (see PPaatthhnnaammee
|
||||
EExxppaannssiioonn above).
|
||||
nnooccaasseemmaattcchh
|
||||
If set, bbaasshh matches patterns in a case-insensitive
|
||||
If set, bbaasshh matches patterns in a case-insensitive
|
||||
fashion when performing matching while executing ccaassee or
|
||||
[[[[ conditional commands.
|
||||
nnuullllgglloobb
|
||||
If set, bbaasshh allows patterns which match no files (see
|
||||
PPaatthhnnaammee EExxppaannssiioonn above) to expand to a null string,
|
||||
If set, bbaasshh allows patterns which match no files (see
|
||||
PPaatthhnnaammee EExxppaannssiioonn above) to expand to a null string,
|
||||
rather than themselves.
|
||||
pprrooggccoommpp
|
||||
If set, the programmable completion facilities (see PPrroo--
|
||||
@@ -1271,47 +1278,47 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
enabled by default.
|
||||
pprroommppttvvaarrss
|
||||
If set, prompt strings undergo parameter expansion, com-
|
||||
mand substitution, arithmetic expansion, and quote
|
||||
removal after being expanded as described in PPRROOMMPPTTIINNGG
|
||||
mand substitution, arithmetic expansion, and quote
|
||||
removal after being expanded as described in PPRROOMMPPTTIINNGG
|
||||
above. This option is enabled by default.
|
||||
rreessttrriicctteedd__sshheellll
|
||||
The shell sets this option if it is started in
|
||||
The shell sets this option if it is started in
|
||||
restricted mode (see RREESSTTRRIICCTTEEDD SSHHEELLLL below). The value
|
||||
may not be changed. This is not reset when the startup
|
||||
files are executed, allowing the startup files to dis-
|
||||
may not be changed. This is not reset when the startup
|
||||
files are executed, allowing the startup files to dis-
|
||||
cover whether or not a shell is restricted.
|
||||
sshhiifftt__vveerrbboossee
|
||||
If set, the sshhiifftt builtin prints an error message when
|
||||
If set, the sshhiifftt builtin prints an error message when
|
||||
the shift count exceeds the number of positional parame-
|
||||
ters.
|
||||
ssoouurrcceeppaatthh
|
||||
If set, the ssoouurrccee (..) builtin uses the value of PPAATTHH to
|
||||
find the directory containing the file supplied as an
|
||||
find the directory containing the file supplied as an
|
||||
argument. This option is enabled by default.
|
||||
xxppgg__eecchhoo
|
||||
If set, the eecchhoo builtin expands backslash-escape
|
||||
If set, the eecchhoo builtin expands backslash-escape
|
||||
sequences by default.
|
||||
ssuussppeenndd [--ff]
|
||||
Suspend the execution of this shell until it receives a SSIIGGCCOONNTT
|
||||
Suspend the execution of this shell until it receives a SSIIGGCCOONNTT
|
||||
signal. A login shell cannot be suspended; the --ff option can be
|
||||
used to override this and force the suspension. The return sta-
|
||||
tus is 0 unless the shell is a login shell and --ff is not sup-
|
||||
tus is 0 unless the shell is a login shell and --ff is not sup-
|
||||
plied, or if job control is not enabled.
|
||||
tteesstt _e_x_p_r
|
||||
[[ _e_x_p_r ]]
|
||||
Return a status of 0 or 1 depending on the evaluation of the
|
||||
conditional expression _e_x_p_r. Each operator and operand must be
|
||||
a separate argument. Expressions are composed of the primaries
|
||||
described above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. tteesstt does not
|
||||
Return a status of 0 or 1 depending on the evaluation of the
|
||||
conditional expression _e_x_p_r. Each operator and operand must be
|
||||
a separate argument. Expressions are composed of the primaries
|
||||
described above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. tteesstt does not
|
||||
accept any options, nor does it accept and ignore an argument of
|
||||
---- as signifying the end of options.
|
||||
|
||||
Expressions may be combined using the following operators,
|
||||
Expressions may be combined using the following operators,
|
||||
listed in decreasing order of precedence. The evaluation
|
||||
depends on the number of arguments; see below.
|
||||
!! _e_x_p_r True if _e_x_p_r is false.
|
||||
(( _e_x_p_r ))
|
||||
Returns the value of _e_x_p_r. This may be used to override
|
||||
Returns the value of _e_x_p_r. This may be used to override
|
||||
the normal precedence of operators.
|
||||
_e_x_p_r_1 -aa _e_x_p_r_2
|
||||
True if both _e_x_p_r_1 and _e_x_p_r_2 are true.
|
||||
@@ -1328,108 +1335,108 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
null.
|
||||
2 arguments
|
||||
If the first argument is !!, the expression is true if and
|
||||
only if the second argument is null. If the first argu-
|
||||
ment is one of the unary conditional operators listed
|
||||
above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is
|
||||
only if the second argument is null. If the first argu-
|
||||
ment is one of the unary conditional operators listed
|
||||
above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is
|
||||
true if the unary test is true. If the first argument is
|
||||
not a valid unary conditional operator, the expression is
|
||||
false.
|
||||
3 arguments
|
||||
If the second argument is one of the binary conditional
|
||||
If the second argument is one of the binary conditional
|
||||
operators listed above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the
|
||||
result of the expression is the result of the binary test
|
||||
using the first and third arguments as operands. The --aa
|
||||
and --oo operators are considered binary operators when
|
||||
there are three arguments. If the first argument is !!,
|
||||
the value is the negation of the two-argument test using
|
||||
using the first and third arguments as operands. The --aa
|
||||
and --oo operators are considered binary operators when
|
||||
there are three arguments. If the first argument is !!,
|
||||
the value is the negation of the two-argument test using
|
||||
the second and third arguments. If the first argument is
|
||||
exactly (( and the third argument is exactly )), the result
|
||||
is the one-argument test of the second argument. Other-
|
||||
is the one-argument test of the second argument. Other-
|
||||
wise, the expression is false.
|
||||
4 arguments
|
||||
If the first argument is !!, the result is the negation of
|
||||
the three-argument expression composed of the remaining
|
||||
the three-argument expression composed of the remaining
|
||||
arguments. Otherwise, the expression is parsed and eval-
|
||||
uated according to precedence using the rules listed
|
||||
uated according to precedence using the rules listed
|
||||
above.
|
||||
5 or more arguments
|
||||
The expression is parsed and evaluated according to
|
||||
The expression is parsed and evaluated according to
|
||||
precedence using the rules listed above.
|
||||
|
||||
ttiimmeess Print the accumulated user and system times for the shell and
|
||||
ttiimmeess Print the accumulated user and system times for the shell and
|
||||
for processes run from the shell. The return status is 0.
|
||||
|
||||
ttrraapp [--llpp] [[_a_r_g] _s_i_g_s_p_e_c ...]
|
||||
The command _a_r_g is to be read and executed when the shell
|
||||
receives signal(s) _s_i_g_s_p_e_c. If _a_r_g is absent (and there is a
|
||||
single _s_i_g_s_p_e_c) or --, each specified signal is reset to its
|
||||
original disposition (the value it had upon entrance to the
|
||||
shell). If _a_r_g is the null string the signal specified by each
|
||||
_s_i_g_s_p_e_c is ignored by the shell and by the commands it invokes.
|
||||
If _a_r_g is not present and --pp has been supplied, then the trap
|
||||
commands associated with each _s_i_g_s_p_e_c are displayed. If no
|
||||
arguments are supplied or if only --pp is given, ttrraapp prints the
|
||||
list of commands associated with each signal. The --ll option
|
||||
causes the shell to print a list of signal names and their cor-
|
||||
responding numbers. Each _s_i_g_s_p_e_c is either a signal name
|
||||
defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are
|
||||
case insensitive and the SIG prefix is optional. If a _s_i_g_s_p_e_c
|
||||
is EEXXIITT (0) the command _a_r_g is executed on exit from the shell.
|
||||
If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_r_g is executed before every
|
||||
The command _a_r_g is to be read and executed when the shell
|
||||
receives signal(s) _s_i_g_s_p_e_c. If _a_r_g is absent (and there is a
|
||||
single _s_i_g_s_p_e_c) or --, each specified signal is reset to its
|
||||
original disposition (the value it had upon entrance to the
|
||||
shell). If _a_r_g is the null string the signal specified by each
|
||||
_s_i_g_s_p_e_c is ignored by the shell and by the commands it invokes.
|
||||
If _a_r_g is not present and --pp has been supplied, then the trap
|
||||
commands associated with each _s_i_g_s_p_e_c are displayed. If no
|
||||
arguments are supplied or if only --pp is given, ttrraapp prints the
|
||||
list of commands associated with each signal. The --ll option
|
||||
causes the shell to print a list of signal names and their cor-
|
||||
responding numbers. Each _s_i_g_s_p_e_c is either a signal name
|
||||
defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are
|
||||
case insensitive and the SIG prefix is optional. If a _s_i_g_s_p_e_c
|
||||
is EEXXIITT (0) the command _a_r_g is executed on exit from the shell.
|
||||
If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_r_g is executed before every
|
||||
_s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command, _s_e_l_e_c_t command, every
|
||||
arithmetic _f_o_r command, and before the first command executes in
|
||||
a shell function (see SSHHEELLLL GGRRAAMMMMAARR above). Refer to the
|
||||
description of the eexxttddeebbuugg option to the sshhoopptt builtin for
|
||||
details of its effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is EERRRR,
|
||||
the command _a_r_g is executed whenever a simple command has a
|
||||
non-zero exit status, subject to the following conditions. The
|
||||
EERRRR trap is not executed if the failed command is part of the
|
||||
command list immediately following a wwhhiillee or uunnttiill keyword,
|
||||
part of the test in an _i_f statement, part of a command executed
|
||||
in a &&&& or |||| list, or if the command's return value is being
|
||||
inverted via !!. These are the same conditions obeyed by the
|
||||
a shell function (see SSHHEELLLL GGRRAAMMMMAARR above). Refer to the
|
||||
description of the eexxttddeebbuugg option to the sshhoopptt builtin for
|
||||
details of its effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is EERRRR,
|
||||
the command _a_r_g is executed whenever a simple command has a
|
||||
non-zero exit status, subject to the following conditions. The
|
||||
EERRRR trap is not executed if the failed command is part of the
|
||||
command list immediately following a wwhhiillee or uunnttiill keyword,
|
||||
part of the test in an _i_f statement, part of a command executed
|
||||
in a &&&& or |||| list, or if the command's return value is being
|
||||
inverted via !!. These are the same conditions obeyed by the
|
||||
eerrrreexxiitt option. If a _s_i_g_s_p_e_c is RREETTUURRNN, the command _a_r_g is exe-
|
||||
cuted each time a shell function or a script executed with the ..
|
||||
or ssoouurrccee builtins finishes executing. Signals ignored upon
|
||||
entry to the shell cannot be trapped or reset. Trapped signals
|
||||
or ssoouurrccee builtins finishes executing. Signals ignored upon
|
||||
entry to the shell cannot be trapped or reset. Trapped signals
|
||||
that are not being ignored are reset to their original values in
|
||||
a child process when it is created. The return status is false
|
||||
a child process when it is created. The return status is false
|
||||
if any _s_i_g_s_p_e_c is invalid; otherwise ttrraapp returns true.
|
||||
|
||||
ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...]
|
||||
With no options, indicate how each _n_a_m_e would be interpreted if
|
||||
With no options, indicate how each _n_a_m_e would be interpreted if
|
||||
used as a command name. If the --tt option is used, ttyyppee prints a
|
||||
string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or
|
||||
_f_i_l_e if _n_a_m_e is an alias, shell reserved word, function,
|
||||
builtin, or disk file, respectively. If the _n_a_m_e is not found,
|
||||
then nothing is printed, and an exit status of false is
|
||||
returned. If the --pp option is used, ttyyppee either returns the
|
||||
string which is one of _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or
|
||||
_f_i_l_e if _n_a_m_e is an alias, shell reserved word, function,
|
||||
builtin, or disk file, respectively. If the _n_a_m_e is not found,
|
||||
then nothing is printed, and an exit status of false is
|
||||
returned. If the --pp option is used, ttyyppee either returns the
|
||||
name of the disk file that would be executed if _n_a_m_e were speci-
|
||||
fied as a command name, or nothing if ``type -t name'' would not
|
||||
return _f_i_l_e. The --PP option forces a PPAATTHH search for each _n_a_m_e,
|
||||
return _f_i_l_e. The --PP option forces a PPAATTHH search for each _n_a_m_e,
|
||||
even if ``type -t name'' would not return _f_i_l_e. If a command is
|
||||
hashed, --pp and --PP print the hashed value, not necessarily the
|
||||
hashed, --pp and --PP print the hashed value, not necessarily the
|
||||
file that appears first in PPAATTHH. If the --aa option is used, ttyyppee
|
||||
prints all of the places that contain an executable named _n_a_m_e.
|
||||
This includes aliases and functions, if and only if the --pp
|
||||
option is not also used. The table of hashed commands is not
|
||||
consulted when using --aa. The --ff option suppresses shell func-
|
||||
tion lookup, as with the ccoommmmaanndd builtin. ttyyppee returns true if
|
||||
prints all of the places that contain an executable named _n_a_m_e.
|
||||
This includes aliases and functions, if and only if the --pp
|
||||
option is not also used. The table of hashed commands is not
|
||||
consulted when using --aa. The --ff option suppresses shell func-
|
||||
tion lookup, as with the ccoommmmaanndd builtin. ttyyppee returns true if
|
||||
all of the arguments are found, false if any are not found.
|
||||
|
||||
uulliimmiitt [--HHSSTTaabbccddeeffiillmmnnppqqrrssttuuvvxx [_l_i_m_i_t]]
|
||||
Provides control over the resources available to the shell and
|
||||
to processes started by it, on systems that allow such control.
|
||||
Provides control over the resources available to the shell and
|
||||
to processes started by it, on systems that allow such control.
|
||||
The --HH and --SS options specify that the hard or soft limit is set
|
||||
for the given resource. A hard limit cannot be increased by a
|
||||
non-root user once it is set; a soft limit may be increased up
|
||||
to the value of the hard limit. If neither --HH nor --SS is speci-
|
||||
for the given resource. A hard limit cannot be increased by a
|
||||
non-root user once it is set; a soft limit may be increased up
|
||||
to the value of the hard limit. If neither --HH nor --SS is speci-
|
||||
fied, both the soft and hard limits are set. The value of _l_i_m_i_t
|
||||
can be a number in the unit specified for the resource or one of
|
||||
the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd, which stand for the
|
||||
current hard limit, the current soft limit, and no limit,
|
||||
respectively. If _l_i_m_i_t is omitted, the current value of the
|
||||
soft limit of the resource is printed, unless the --HH option is
|
||||
current hard limit, the current soft limit, and no limit,
|
||||
respectively. If _l_i_m_i_t is omitted, the current value of the
|
||||
soft limit of the resource is printed, unless the --HH option is
|
||||
given. When more than one resource is specified, the limit name
|
||||
and unit are printed before the value. Other options are inter-
|
||||
preted as follows:
|
||||
@@ -1438,7 +1445,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
--cc The maximum size of core files created
|
||||
--dd The maximum size of a process's data segment
|
||||
--ee The maximum scheduling priority ("nice")
|
||||
--ff The maximum size of files written by the shell and its
|
||||
--ff The maximum size of files written by the shell and its
|
||||
children
|
||||
--ii The maximum number of pending signals
|
||||
--ll The maximum size that may be locked into memory
|
||||
@@ -1450,58 +1457,58 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
--rr The maximum real-time scheduling priority
|
||||
--ss The maximum stack size
|
||||
--tt The maximum amount of cpu time in seconds
|
||||
--uu The maximum number of processes available to a single
|
||||
--uu The maximum number of processes available to a single
|
||||
user
|
||||
--vv The maximum amount of virtual memory available to the
|
||||
--vv The maximum amount of virtual memory available to the
|
||||
shell
|
||||
--xx The maximum number of file locks
|
||||
--TT The maximum number of threads
|
||||
|
||||
If _l_i_m_i_t is given, it is the new value of the specified resource
|
||||
(the --aa option is display only). If no option is given, then --ff
|
||||
is assumed. Values are in 1024-byte increments, except for --tt,
|
||||
which is in seconds, --pp, which is in units of 512-byte blocks,
|
||||
and --TT, --bb, --nn, and --uu, which are unscaled values. The return
|
||||
is assumed. Values are in 1024-byte increments, except for --tt,
|
||||
which is in seconds, --pp, which is in units of 512-byte blocks,
|
||||
and --TT, --bb, --nn, and --uu, which are unscaled values. The return
|
||||
status is 0 unless an invalid option or argument is supplied, or
|
||||
an error occurs while setting a new limit.
|
||||
|
||||
uummaasskk [--pp] [--SS] [_m_o_d_e]
|
||||
The user file-creation mask is set to _m_o_d_e. If _m_o_d_e begins with
|
||||
a digit, it is interpreted as an octal number; otherwise it is
|
||||
interpreted as a symbolic mode mask similar to that accepted by
|
||||
_c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is
|
||||
printed. The --SS option causes the mask to be printed in sym-
|
||||
bolic form; the default output is an octal number. If the --pp
|
||||
a digit, it is interpreted as an octal number; otherwise it is
|
||||
interpreted as a symbolic mode mask similar to that accepted by
|
||||
_c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is
|
||||
printed. The --SS option causes the mask to be printed in sym-
|
||||
bolic form; the default output is an octal number. If the --pp
|
||||
option is supplied, and _m_o_d_e is omitted, the output is in a form
|
||||
that may be reused as input. The return status is 0 if the mode
|
||||
was successfully changed or if no _m_o_d_e argument was supplied,
|
||||
was successfully changed or if no _m_o_d_e argument was supplied,
|
||||
and false otherwise.
|
||||
|
||||
uunnaalliiaass [-aa] [_n_a_m_e ...]
|
||||
Remove each _n_a_m_e from the list of defined aliases. If --aa is
|
||||
supplied, all alias definitions are removed. The return value
|
||||
Remove each _n_a_m_e from the list of defined aliases. If --aa is
|
||||
supplied, all alias definitions are removed. The return value
|
||||
is true unless a supplied _n_a_m_e is not a defined alias.
|
||||
|
||||
uunnsseett [-ffvv] [_n_a_m_e ...]
|
||||
For each _n_a_m_e, remove the corresponding variable or function.
|
||||
For each _n_a_m_e, remove the corresponding variable or function.
|
||||
If no options are supplied, or the --vv option is given, each _n_a_m_e
|
||||
refers to a shell variable. Read-only variables may not be
|
||||
unset. If --ff is specified, each _n_a_m_e refers to a shell func-
|
||||
tion, and the function definition is removed. Each unset vari-
|
||||
able or function is removed from the environment passed to sub-
|
||||
sequent commands. If any of RRAANNDDOOMM, SSEECCOONNDDSS, LLIINNEENNOO, HHIISSTTCCMMDD,
|
||||
refers to a shell variable. Read-only variables may not be
|
||||
unset. If --ff is specified, each _n_a_m_e refers to a shell func-
|
||||
tion, and the function definition is removed. Each unset vari-
|
||||
able or function is removed from the environment passed to sub-
|
||||
sequent commands. If any of RRAANNDDOOMM, SSEECCOONNDDSS, LLIINNEENNOO, HHIISSTTCCMMDD,
|
||||
FFUUNNCCNNAAMMEE, GGRROOUUPPSS, or DDIIRRSSTTAACCKK are unset, they lose their special
|
||||
properties, even if they are subsequently reset. The exit sta-
|
||||
properties, even if they are subsequently reset. The exit sta-
|
||||
tus is true unless a _n_a_m_e is readonly.
|
||||
|
||||
wwaaiitt [_n _._._.]
|
||||
Wait for each specified process and return its termination sta-
|
||||
tus. Each _n may be a process ID or a job specification; if a
|
||||
job spec is given, all processes in that job's pipeline are
|
||||
waited for. If _n is not given, all currently active child pro-
|
||||
cesses are waited for, and the return status is zero. If _n
|
||||
specifies a non-existent process or job, the return status is
|
||||
127. Otherwise, the return status is the exit status of the
|
||||
Wait for each specified process and return its termination sta-
|
||||
tus. Each _n may be a process ID or a job specification; if a
|
||||
job spec is given, all processes in that job's pipeline are
|
||||
waited for. If _n is not given, all currently active child pro-
|
||||
cesses are waited for, and the return status is zero. If _n
|
||||
specifies a non-existent process or job, the return status is
|
||||
127. Otherwise, the return status is the exit status of the
|
||||
last process or job waited for.
|
||||
|
||||
SSEEEE AALLSSOO
|
||||
|
||||
+1186
-1176
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
||||
%!PS-Adobe-3.0
|
||||
%%Creator: groff version 1.19.2
|
||||
%%CreationDate: Wed Jul 2 09:08:26 2008
|
||||
%%CreationDate: Thu Jul 24 09:12:42 2008
|
||||
%%DocumentNeededResources: font Times-Roman
|
||||
%%+ font Times-Bold
|
||||
%%DocumentSuppliedResources: procset grops 1.19 2
|
||||
|
||||
+204
-10
@@ -1312,7 +1312,7 @@ execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close)
|
||||
do_piping (pipe_in, pipe_out);
|
||||
|
||||
#if defined (COPROCESS_SUPPORT)
|
||||
coproc_close (&sh_coproc);
|
||||
coproc_closeall ();
|
||||
#endif
|
||||
|
||||
/* If this is a user subshell, set a flag if stdin was redirected.
|
||||
@@ -1404,10 +1404,183 @@ execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close)
|
||||
}
|
||||
|
||||
#if defined (COPROCESS_SUPPORT)
|
||||
#define COPROC_MAX 16
|
||||
|
||||
typedef struct cpelement
|
||||
{
|
||||
struct cpelement *next;
|
||||
struct coproc *coproc;
|
||||
}
|
||||
cpelement_t;
|
||||
|
||||
typedef struct cplist
|
||||
{
|
||||
struct cpelement *head;
|
||||
struct cpelement *tail;
|
||||
int ncoproc;
|
||||
}
|
||||
cplist_t;
|
||||
|
||||
static struct cpelement *cpe_alloc __P((struct coproc *));
|
||||
static void cpe_dispose __P((struct cpelement *));
|
||||
static struct cpelement *cpl_add __P((struct coproc *));
|
||||
static struct cpelement *cpl_delete __P((pid_t));
|
||||
static void cpl_flush __P((void));
|
||||
static struct cpelement *cpl_search __P((pid_t));
|
||||
static struct cpelement *cpl_searchbyname __P((char *));
|
||||
static void cpl_prune __P((void));
|
||||
|
||||
Coproc sh_coproc = { 0, NO_PID, -1, -1, 0, 0 };
|
||||
|
||||
cplist_t coproc_list = {0, 0, 0};
|
||||
|
||||
/* Functions to manage the list of exited background pids whose status has
|
||||
been saved. */
|
||||
|
||||
static struct cpelement *
|
||||
cpe_alloc (cp)
|
||||
Coproc *cp;
|
||||
{
|
||||
struct cpelement *cpe;
|
||||
|
||||
cpe = (struct cpelement *)xmalloc (sizeof (struct cpelement));
|
||||
cpe->coproc = cp;
|
||||
cpe->next = (struct cpelement *)0;
|
||||
return cpe;
|
||||
}
|
||||
|
||||
static void
|
||||
cpe_dispose (cpe)
|
||||
struct cpelement *cpe;
|
||||
{
|
||||
free (cpe);
|
||||
}
|
||||
|
||||
static struct cpelement *
|
||||
cpl_add (cp)
|
||||
Coproc *cp;
|
||||
{
|
||||
struct cpelement *cpe;
|
||||
|
||||
cpe = cpe_alloc (cp);
|
||||
|
||||
if (coproc_list.head == 0)
|
||||
{
|
||||
coproc_list.head = coproc_list.tail = cpe;
|
||||
coproc_list.ncoproc = 0; /* just to make sure */
|
||||
}
|
||||
else
|
||||
{
|
||||
coproc_list.tail->next = cpe;
|
||||
coproc_list.tail = cpe;
|
||||
}
|
||||
coproc_list.ncoproc++;
|
||||
|
||||
return cpe;
|
||||
}
|
||||
|
||||
static struct cpelement *
|
||||
cpl_delete (pid)
|
||||
pid_t pid;
|
||||
{
|
||||
struct cpelement *prev, *p;
|
||||
|
||||
for (prev = p = coproc_list.head; p; prev = p, p = p->next)
|
||||
if (p->coproc->c_pid == pid)
|
||||
{
|
||||
prev->next = p->next; /* remove from list */
|
||||
break;
|
||||
}
|
||||
|
||||
if (p == 0)
|
||||
return 0; /* not found */
|
||||
|
||||
#if defined (DEBUG)
|
||||
itrace("cpl_delete: deleting %d", pid);
|
||||
#endif
|
||||
|
||||
/* Housekeeping in the border cases. */
|
||||
if (p == coproc_list.head)
|
||||
coproc_list.head = coproc_list.head->next;
|
||||
else if (p == coproc_list.tail)
|
||||
coproc_list.tail = prev;
|
||||
|
||||
coproc_list.ncoproc--;
|
||||
if (coproc_list.ncoproc == 0)
|
||||
coproc_list.head = coproc_list.tail = 0;
|
||||
else if (coproc_list.ncoproc == 1)
|
||||
coproc_list.tail = coproc_list.head; /* just to make sure */
|
||||
|
||||
return (p);
|
||||
}
|
||||
|
||||
/* Clear out the list of saved statuses */
|
||||
static void
|
||||
cpl_flush ()
|
||||
{
|
||||
struct cpelement *cpe, *p;
|
||||
|
||||
for (cpe = coproc_list.head; cpe; )
|
||||
{
|
||||
p = cpe;
|
||||
cpe = cpe->next;
|
||||
|
||||
coproc_dispose (p->coproc);
|
||||
cpe_dispose (p);
|
||||
}
|
||||
|
||||
coproc_list.head = coproc_list.tail = 0;
|
||||
coproc_list.ncoproc = 0;
|
||||
}
|
||||
|
||||
/* Search for PID in the list of coprocs; return the cpelement struct if
|
||||
found. If not found, return NULL. */
|
||||
static struct cpelement *
|
||||
cpl_search (pid)
|
||||
pid_t pid;
|
||||
{
|
||||
struct cpelement *cp;
|
||||
|
||||
for (cp = coproc_list.head ; cp; cp = cp->next)
|
||||
if (cp->coproc->c_pid == pid)
|
||||
return cp;
|
||||
return (struct cpelement *)NULL;
|
||||
}
|
||||
|
||||
/* Search for the coproc named NAME in the list of coprocs; return the
|
||||
cpelement struct if found. If not found, return NULL. */
|
||||
static struct cpelement *
|
||||
cpl_searchbyname (name)
|
||||
char *name;
|
||||
{
|
||||
struct cpelement *cp;
|
||||
|
||||
for (cp = coproc_list.head ; cp; cp = cp->next)
|
||||
if (STREQ (cp->coproc->c_name, name))
|
||||
return cp;
|
||||
return (struct cpelement *)NULL;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
cpl_prune ()
|
||||
{
|
||||
struct cpelement *cp;
|
||||
|
||||
while (coproc_list.head && coproc_list.ncoproc > COPROC_MAX)
|
||||
{
|
||||
cp = coproc_list.head;
|
||||
coproc_list.head = coproc_list.head->next;
|
||||
coproc_dispose (cp->coproc);
|
||||
cpe_dispose (cp);
|
||||
coproc_list.ncoproc--;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* These currently use a single global "shell coproc" but are written in a
|
||||
way to not preclude additional coprocs later */
|
||||
way to not preclude additional coprocs later (using the list management
|
||||
package above). */
|
||||
|
||||
struct coproc *
|
||||
getcoprocbypid (pid)
|
||||
@@ -1441,7 +1614,7 @@ coproc_alloc (name, pid)
|
||||
{
|
||||
struct coproc *cp;
|
||||
|
||||
cp = &sh_coproc;
|
||||
cp = &sh_coproc; /* XXX */
|
||||
coproc_init (cp);
|
||||
|
||||
cp->c_name = savestring (name);
|
||||
@@ -1463,6 +1636,13 @@ coproc_dispose (cp)
|
||||
coproc_init (cp);
|
||||
}
|
||||
|
||||
/* Placeholder for now. */
|
||||
void
|
||||
coproc_flush ()
|
||||
{
|
||||
coproc_dispose (&sh_coproc);
|
||||
}
|
||||
|
||||
void
|
||||
coproc_close (cp)
|
||||
struct coproc *cp;
|
||||
@@ -1480,6 +1660,12 @@ coproc_close (cp)
|
||||
cp->c_rsave = cp->c_wsave = -1;
|
||||
}
|
||||
|
||||
void
|
||||
coproc_closeall ()
|
||||
{
|
||||
coproc_close (&sh_coproc);
|
||||
}
|
||||
|
||||
void
|
||||
coproc_rclose (cp, fd)
|
||||
struct coproc *cp;
|
||||
@@ -1505,7 +1691,7 @@ coproc_wclose (cp, fd)
|
||||
}
|
||||
|
||||
void
|
||||
coproc_fdchk (cp, fd)
|
||||
coproc_checkfd (cp, fd)
|
||||
struct coproc *cp;
|
||||
int fd;
|
||||
{
|
||||
@@ -1520,6 +1706,13 @@ coproc_fdchk (cp, fd)
|
||||
coproc_setvars (cp);
|
||||
}
|
||||
|
||||
void
|
||||
coproc_fdchk (fd)
|
||||
int fd;
|
||||
{
|
||||
coproc_checkfd (&sh_coproc, fd);
|
||||
}
|
||||
|
||||
void
|
||||
coproc_fdclose (cp, fd)
|
||||
struct coproc *cp;
|
||||
@@ -1530,7 +1723,6 @@ coproc_fdclose (cp, fd)
|
||||
coproc_setvars (cp);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
coproc_fdsave (cp)
|
||||
struct coproc *cp;
|
||||
@@ -1554,12 +1746,13 @@ coproc_pidchk (pid)
|
||||
struct coproc *cp;
|
||||
|
||||
cp = getcoprocbypid (pid);
|
||||
#if defined (DEBUG)
|
||||
if (cp)
|
||||
itrace("coproc_pidchk: pid %d has died", pid);
|
||||
#endif
|
||||
if (cp)
|
||||
{
|
||||
itrace("coproc_pidchk: pid %d has died", pid);
|
||||
coproc_dispose (cp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
coproc_setvars (cp)
|
||||
@@ -1652,6 +1845,7 @@ execute_coproc (command, pipe_in, pipe_out, fds_to_close)
|
||||
Coproc *cp;
|
||||
char *tcmd;
|
||||
|
||||
/* XXX -- will require changes to handle multiple coprocs */
|
||||
if (sh_coproc.c_pid != NO_PID)
|
||||
{
|
||||
#if 0
|
||||
@@ -3017,7 +3211,7 @@ execute_null_command (redirects, pipe_in, pipe_out, async)
|
||||
do_piping (pipe_in, pipe_out);
|
||||
|
||||
#if defined (COPROCESS_SUPPORT)
|
||||
coproc_close (&sh_coproc);
|
||||
coproc_closeall ();
|
||||
#endif
|
||||
|
||||
subshell_environment = 0;
|
||||
@@ -3223,7 +3417,7 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
|
||||
do_piping (pipe_in, pipe_out);
|
||||
pipe_in = pipe_out = NO_PIPE;
|
||||
#if defined (COPROCESS_SUPPORT)
|
||||
coproc_close (&sh_coproc);
|
||||
coproc_closeall ();
|
||||
#endif
|
||||
|
||||
last_asynchronous_pid = old_last_async_pid;
|
||||
|
||||
+5
-1
@@ -41,13 +41,17 @@ extern struct coproc *getcoprocbyname __P((const char *));
|
||||
extern void coproc_init __P((struct coproc *));
|
||||
extern struct coproc *coproc_alloc __P((char *, pid_t));
|
||||
extern void coproc_dispose __P((struct coproc *));
|
||||
extern void coproc_flush __P((void));
|
||||
extern void coproc_close __P((struct coproc *));
|
||||
extern void coproc_closeall __P((void));
|
||||
|
||||
extern void coproc_rclose __P((struct coproc *, int));
|
||||
extern void coproc_wclose __P((struct coproc *, int));
|
||||
extern void coproc_fdclose __P((struct coproc *, int));
|
||||
|
||||
extern void coproc_fdchk __P((struct coproc *, int));
|
||||
extern void coproc_checkfd __P((struct coproc *, int));
|
||||
extern void coproc_fdchk __P((int));
|
||||
|
||||
extern void coproc_pidchk __P((pid_t));
|
||||
|
||||
extern void coproc_fdsave __P((struct coproc *));
|
||||
|
||||
@@ -476,14 +476,8 @@ check_binary_file (sample, sample_len)
|
||||
c = sample[i];
|
||||
if (c == '\n')
|
||||
return (0);
|
||||
|
||||
#if 0
|
||||
if (ISSPACE (c) == 0 && ISPRINT (c) == 0)
|
||||
#else
|
||||
if (c == '\0')
|
||||
#endif
|
||||
return (1);
|
||||
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
||||
+66
@@ -677,6 +677,72 @@ polite_directory_format (name)
|
||||
return (name);
|
||||
}
|
||||
|
||||
/* Trim NAME. If NAME begins with `~/', skip over tilde prefix. Trim to
|
||||
keep any tilde prefix and PROMPT_DIRTRIM trailing directory components
|
||||
and replace the intervening characters with `...' */
|
||||
char *
|
||||
trim_pathname (name, maxlen)
|
||||
char *name;
|
||||
int maxlen;
|
||||
{
|
||||
int nlen, ndirs;
|
||||
intmax_t nskip;
|
||||
char *nbeg, *nend, *ntail, *v;
|
||||
|
||||
if (name == 0 || (nlen = strlen (name)) == 0)
|
||||
return name;
|
||||
nend = name + nlen;
|
||||
|
||||
v = get_string_value ("PROMPT_DIRTRIM");
|
||||
if (v == 0 || *v == 0)
|
||||
return name;
|
||||
if (legal_number (v, &nskip) == 0 || nskip <= 0)
|
||||
return name;
|
||||
|
||||
/* Skip over tilde prefix */
|
||||
nbeg = name;
|
||||
if (name[0] == '~')
|
||||
for (nbeg = name; *nbeg; nbeg++)
|
||||
if (*nbeg == '/')
|
||||
{
|
||||
nbeg++;
|
||||
break;
|
||||
}
|
||||
if (*nbeg == 0)
|
||||
return name;
|
||||
|
||||
for (ndirs = 0, ntail = nbeg; *ntail; ntail++)
|
||||
if (*ntail == '/')
|
||||
ndirs++;
|
||||
if (ndirs <= nskip)
|
||||
return name;
|
||||
|
||||
for (ntail = (*nend == '/') ? nend : nend - 1; ntail > nbeg; ntail--)
|
||||
{
|
||||
if (*ntail == '/')
|
||||
nskip--;
|
||||
if (nskip == 0)
|
||||
break;
|
||||
}
|
||||
if (ntail == nbeg)
|
||||
return name;
|
||||
|
||||
/* Now we want to return name[0..nbeg]+"..."+ntail, modifying name in place */
|
||||
nlen = ntail - nbeg;
|
||||
if (nlen <= 3)
|
||||
return name;
|
||||
|
||||
*nbeg++ = '.';
|
||||
*nbeg++ = '.';
|
||||
*nbeg++ = '.';
|
||||
|
||||
nlen = nend - ntail;
|
||||
memcpy (nbeg, ntail, nlen);
|
||||
nbeg[nlen] = '\0';
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/* Given a string containing units of information separated by colons,
|
||||
return the next one pointed to by (P_INDEX), or NULL if there are no more.
|
||||
Advance (P_INDEX) to the character after the colon. */
|
||||
|
||||
@@ -769,7 +769,7 @@ bgp_prune ()
|
||||
bgpids.npid--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Reset the values of js.j_lastj and js.j_firstj after one or both have
|
||||
been deleted. The caller should check whether js.j_njobs is 0 before
|
||||
calling this. This wraps around, but the rest of the code does not. At
|
||||
|
||||
+15
@@ -35,6 +35,7 @@ Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
|
||||
#include "bashintl.h"
|
||||
|
||||
#include "syntax.h"
|
||||
#include "parser.h"
|
||||
#include "command.h"
|
||||
#include "general.h"
|
||||
#include "error.h"
|
||||
@@ -796,6 +797,20 @@ make_subshell_command (command)
|
||||
return (make_command (cm_subshell, (SIMPLE_COM *)temp));
|
||||
}
|
||||
|
||||
COMMAND *
|
||||
make_coproc_command (name, command)
|
||||
char *name;
|
||||
COMMAND *command;
|
||||
{
|
||||
COPROC_COM *temp;
|
||||
|
||||
temp = (COPROC_COM *)xmalloc (sizeof (COPROC_COM));
|
||||
temp->name = savestring (name);
|
||||
temp->command = command;
|
||||
temp->flags = CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL;
|
||||
return (make_command (cm_coproc, (SIMPLE_COM *)temp));
|
||||
}
|
||||
|
||||
/* Reverse the word list and redirection list in the simple command
|
||||
has just been parsed. It seems simpler to do this here the one
|
||||
time then by any other method that I can think of. */
|
||||
|
||||
@@ -1867,10 +1867,25 @@ char *
|
||||
read_secondary_line (remove_quoted_newline)
|
||||
int remove_quoted_newline;
|
||||
{
|
||||
char *ret;
|
||||
int n, c;
|
||||
|
||||
prompt_string_pointer = &ps2_prompt;
|
||||
if (SHOULD_PROMPT())
|
||||
prompt_again ();
|
||||
return (read_a_line (remove_quoted_newline));
|
||||
ret = read_a_line (remove_quoted_newline);
|
||||
if (remember_on_history && (parser_state & PST_HEREDOC))
|
||||
{
|
||||
/* To make adding the the here-document body right, we need to rely
|
||||
on history_delimiting_chars() returning \n for the first line of
|
||||
the here-document body and the null string for the second and
|
||||
subsequent lines, so we avoid double newlines.
|
||||
current_command_line_count == 2 for the first line of the body. */
|
||||
|
||||
current_command_line_count++;
|
||||
maybe_add_history (ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* **************************************************************** */
|
||||
@@ -2358,10 +2373,14 @@ static int esacs_needed_count;
|
||||
void
|
||||
gather_here_documents ()
|
||||
{
|
||||
int r = 0;
|
||||
int r;
|
||||
|
||||
r = 0;
|
||||
while (need_here_doc)
|
||||
{
|
||||
parser_state |= PST_HEREDOC;
|
||||
make_here_document (redir_stack[r++], line_number);
|
||||
parser_state &= ~PST_HEREDOC;
|
||||
need_here_doc--;
|
||||
}
|
||||
}
|
||||
@@ -2939,7 +2958,7 @@ parse_matched_pair (qc, open, close, lenp, flags)
|
||||
char *ret, *nestret, *ttrans;
|
||||
int retind, retsize, rflags;
|
||||
|
||||
/* itrace("parse_matched_pair: open = %c close = %c", open, close); */
|
||||
/* itrace("parse_matched_pair: open = %c close = %c flags = %d", open, close, flags); */
|
||||
count = 1;
|
||||
tflags = 0;
|
||||
|
||||
@@ -3038,6 +3057,15 @@ parse_matched_pair (qc, open, close, lenp, flags)
|
||||
if MBTEST(ch == '\\') /* backslashes */
|
||||
tflags |= LEX_PASSNEXT;
|
||||
|
||||
#if 0
|
||||
/* The big hammer. Single quotes aren't special in double quotes. The
|
||||
problem is that Posix says the single quotes are semi-special:
|
||||
within a double-quoted ${...} construct "an even number of
|
||||
unescaped double-quotes or single-quotes, if any, shall occur." */
|
||||
if MBTEST(open == '{' && (flags & P_DQUOTE) && ch == '\'') /* } */
|
||||
continue;
|
||||
#endif
|
||||
|
||||
/* Could also check open == '`' if we want to parse grouping constructs
|
||||
inside old-style command substitution. */
|
||||
if (open != close) /* a grouping construct */
|
||||
@@ -4499,7 +4527,13 @@ history_delimiting_chars ()
|
||||
|
||||
if (dstack.delimiter_depth != 0)
|
||||
return ("\n");
|
||||
|
||||
|
||||
/* We look for current_command_line_count == 2 because we are looking to
|
||||
add the first line of the body of the here document (the second line
|
||||
of the command). */
|
||||
if (parser_state & PST_HEREDOC)
|
||||
return (current_command_line_count == 2 ? "\n" : "");
|
||||
|
||||
/* First, handle some special cases. */
|
||||
/*(*/
|
||||
/* If we just read `()', assume it's a function definition, and don't
|
||||
|
||||
@@ -1867,10 +1867,25 @@ char *
|
||||
read_secondary_line (remove_quoted_newline)
|
||||
int remove_quoted_newline;
|
||||
{
|
||||
char *ret;
|
||||
int n, c;
|
||||
|
||||
prompt_string_pointer = &ps2_prompt;
|
||||
if (SHOULD_PROMPT())
|
||||
prompt_again ();
|
||||
return (read_a_line (remove_quoted_newline));
|
||||
ret = read_a_line (remove_quoted_newline);
|
||||
if (remember_on_history && (parser_state & PST_HEREDOC))
|
||||
{
|
||||
/* To make adding the the here-document body right, we need to rely
|
||||
on history_delimiting_chars() returning \n for the first line of
|
||||
the here-document body and the null string for the second and
|
||||
subsequent lines, so we avoid double newlines.
|
||||
current_command_line_count == 2 for the first line of the body. */
|
||||
|
||||
current_command_line_count++;
|
||||
maybe_add_history (ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* **************************************************************** */
|
||||
@@ -2342,7 +2357,6 @@ yylex ()
|
||||
|
||||
if ((parser_state & PST_EOFTOKEN) && current_token == shell_eof_token)
|
||||
{
|
||||
itrace("shell_eof_token == ')'; setting current_token == yacc_EOF");
|
||||
current_token = yacc_EOF;
|
||||
if (bash_input.type == st_string)
|
||||
rewind_input_string ();
|
||||
@@ -2359,10 +2373,14 @@ static int esacs_needed_count;
|
||||
void
|
||||
gather_here_documents ()
|
||||
{
|
||||
int r = 0;
|
||||
int r;
|
||||
|
||||
r = 0;
|
||||
while (need_here_doc)
|
||||
{
|
||||
parser_state |= PST_HEREDOC;
|
||||
make_here_document (redir_stack[r++], line_number);
|
||||
parser_state &= ~PST_HEREDOC;
|
||||
need_here_doc--;
|
||||
}
|
||||
}
|
||||
@@ -2940,7 +2958,7 @@ parse_matched_pair (qc, open, close, lenp, flags)
|
||||
char *ret, *nestret, *ttrans;
|
||||
int retind, retsize, rflags;
|
||||
|
||||
/* itrace("parse_matched_pair: open = %c close = %c", open, close); */
|
||||
/* itrace("parse_matched_pair: open = %c close = %c flags = %d", open, close, flags); */
|
||||
count = 1;
|
||||
tflags = 0;
|
||||
|
||||
@@ -3039,6 +3057,14 @@ parse_matched_pair (qc, open, close, lenp, flags)
|
||||
if MBTEST(ch == '\\') /* backslashes */
|
||||
tflags |= LEX_PASSNEXT;
|
||||
|
||||
#if 0
|
||||
/* The big hammer. Single quotes aren't special in double quotes, even
|
||||
double-quoted parameter expansions. XXX - do the same thing for
|
||||
command substitution/arithmetic expansion? */
|
||||
if MBTEST(open == '{' && (flags & P_DQUOTE) && ch == '\'') /* } */
|
||||
continue;
|
||||
#endif
|
||||
|
||||
/* Could also check open == '`' if we want to parse grouping constructs
|
||||
inside old-style command substitution. */
|
||||
if (open != close) /* a grouping construct */
|
||||
@@ -4500,7 +4526,13 @@ history_delimiting_chars ()
|
||||
|
||||
if (dstack.delimiter_depth != 0)
|
||||
return ("\n");
|
||||
|
||||
|
||||
/* We look for current_command_line_count == 2 because we are looking to
|
||||
add the first line of the body of the here document (the second line
|
||||
of the command). */
|
||||
if (parser_state & PST_HEREDOC)
|
||||
return (current_command_line_count == 2 ? "\n" : "");
|
||||
|
||||
/* First, handle some special cases. */
|
||||
/*(*/
|
||||
/* If we just read `()', assume it's a function definition, and don't
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#define PST_ASSIGNOK 0x04000 /* assignment statement ok in this context */
|
||||
#define PST_EOFTOKEN 0x08000 /* yylex checks against shell_eof_token */
|
||||
#define PST_REGEXP 0x10000 /* parsing an ERE/BRE as a single word */
|
||||
#define PST_HEREDOC 0x20000 /* reading body of here-document */
|
||||
|
||||
/* Definition of the delimiter stack. Needed by parse.y and bashhist.c. */
|
||||
struct dstack {
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
#define PST_CMDTOKEN 0x01000 /* command token OK - unused */
|
||||
#define PST_COMPASSIGN 0x02000 /* parsing x=(...) compound assignment */
|
||||
#define PST_ASSIGNOK 0x04000 /* assignment statement ok in this context */
|
||||
#define PST_REGEXP 0x08000 /* parsing an ERE/BRE as a single word */
|
||||
#define PST_EOFTOKEN 0x08000 /* yylex checks against shell_eof_token */
|
||||
#define PST_REGEXP 0x10000 /* parsing an ERE/BRE as a single word */
|
||||
|
||||
/* Definition of the delimiter stack. Needed by parse.y and bashhist.c. */
|
||||
struct dstack {
|
||||
|
||||
@@ -939,7 +939,7 @@ do_redirection_internal (redirect, flags)
|
||||
{
|
||||
close (redir_fd);
|
||||
#if defined (COPROCESS_SUPPORT)
|
||||
coproc_fdchk (&sh_coproc, redir_fd); /* XXX - loses coproc fds */
|
||||
coproc_fdchk (redir_fd); /* XXX - loses coproc fds */
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -952,7 +952,7 @@ do_redirection_internal (redirect, flags)
|
||||
add_undo_redirect (redirector, ri);
|
||||
|
||||
#if defined (COPROCESS_SUPPORT)
|
||||
coproc_fdchk (&sh_coproc, redirector);
|
||||
coproc_fdchk (redirector);
|
||||
#endif
|
||||
|
||||
#if defined (BUFFERED_INPUT)
|
||||
|
||||
@@ -906,7 +906,7 @@ exit_shell (s)
|
||||
#endif /* HISTORY */
|
||||
|
||||
#if defined (COPROCESS_SUPPORT)
|
||||
coproc_dispose (&sh_coproc);
|
||||
coproc_flush ();
|
||||
#endif
|
||||
|
||||
#if defined (JOB_CONTROL)
|
||||
|
||||
@@ -816,7 +816,7 @@ skip_double_quoted (string, slen, sind)
|
||||
if (string[i + 1] == LPAREN)
|
||||
ret = extract_command_subst (string, &si, SX_NOALLOC);
|
||||
else
|
||||
ret = extract_dollar_brace_string (string, &si, 0, SX_NOALLOC);
|
||||
ret = extract_dollar_brace_string (string, &si, 1, SX_NOALLOC);
|
||||
|
||||
i = si + 1;
|
||||
continue;
|
||||
|
||||
@@ -199,10 +199,8 @@ static WORD_LIST *expand_string_leave_quoted __P((char *, int));
|
||||
static WORD_LIST *expand_string_for_rhs __P((char *, int, int *, int *));
|
||||
|
||||
static WORD_LIST *list_quote_escapes __P((WORD_LIST *));
|
||||
static char *dequote_escapes __P((char *));
|
||||
static char *make_quoted_char __P((int));
|
||||
static WORD_LIST *quote_list __P((WORD_LIST *));
|
||||
static char *remove_quoted_nulls __P((char *));
|
||||
|
||||
static int unquoted_substring __P((char *, char *));
|
||||
static int unquoted_member __P((int, char *));
|
||||
@@ -269,7 +267,7 @@ static int valid_length_expression __P((char *));
|
||||
static intmax_t parameter_brace_expand_length __P((char *));
|
||||
|
||||
static char *skiparith __P((char *, int));
|
||||
static int verify_substring_values __P((char *, char *, int, intmax_t *, intmax_t *));
|
||||
static int verify_substring_values __P((SHELL_VAR *, char *, char *, int, intmax_t *, intmax_t *));
|
||||
static int get_var_and_type __P((char *, char *, int, SHELL_VAR **, char **));
|
||||
static char *mb_substring __P((char *, int, int));
|
||||
static char *parameter_brace_substring __P((char *, char *, char *, int));
|
||||
@@ -278,6 +276,9 @@ static char *pos_params_pat_subst __P((char *, char *, char *, int));
|
||||
|
||||
static char *parameter_brace_patsub __P((char *, char *, char *, int));
|
||||
|
||||
static char *pos_params_casemod __P((char *, char *, int, int));
|
||||
static char *parameter_brace_casemod __P((char *, char *, int, char *, int));
|
||||
|
||||
static WORD_DESC *parameter_brace_expand __P((char *, int *, int, int *, int *));
|
||||
static WORD_DESC *param_expand __P((char *, int *, int, int *, int *, int *, int *, int));
|
||||
|
||||
@@ -815,7 +816,7 @@ skip_double_quoted (string, slen, sind)
|
||||
if (string[i + 1] == LPAREN)
|
||||
ret = extract_command_subst (string, &si, SX_NOALLOC);
|
||||
else
|
||||
ret = extract_dollar_brace_string (string, &si, 0, SX_NOALLOC);
|
||||
ret = extract_dollar_brace_string (string, &si, 1, SX_NOALLOC);
|
||||
|
||||
i = si + 1;
|
||||
continue;
|
||||
@@ -1277,7 +1278,11 @@ extract_dollar_brace_string (string, sindex, quoted, flags)
|
||||
|
||||
/* Pass the contents of single-quoted and double-quoted strings
|
||||
through verbatim. */
|
||||
#if 0
|
||||
if ((c == '\'' && quoted == 0) || c == '"')
|
||||
#else
|
||||
if (c == '\'' || c == '"')
|
||||
#endif
|
||||
{
|
||||
si = i + 1;
|
||||
i = (c == '\'') ? skip_single_quoted (string, slen, si)
|
||||
@@ -2341,16 +2346,19 @@ do_compound_assignment (name, value, flags)
|
||||
int flags;
|
||||
{
|
||||
SHELL_VAR *v;
|
||||
int mklocal;
|
||||
int mklocal, mkassoc;
|
||||
WORD_LIST *list;
|
||||
|
||||
mklocal = flags & ASS_MKLOCAL;
|
||||
mkassoc = flags & ASS_MKASSOC;
|
||||
|
||||
if (mklocal && variable_context)
|
||||
{
|
||||
v = find_variable (name);
|
||||
list = expand_compound_array_assignment (v, value, flags);
|
||||
if (v == 0 || array_p (v) == 0 || v->context != variable_context)
|
||||
if (mkassoc)
|
||||
v = make_local_assoc_variable (name);
|
||||
else if (v == 0 || (array_p (v) == 0 && assoc_p (v) == 0) || v->context != variable_context)
|
||||
v = make_local_array_variable (name);
|
||||
assign_compound_array_list (v, list, flags);
|
||||
}
|
||||
@@ -2454,6 +2462,8 @@ do_assignment_internal (word, expand)
|
||||
{
|
||||
if (word->flags & W_ASSIGNARG)
|
||||
aflags |= ASS_MKLOCAL;
|
||||
if (word->flags & W_ASSIGNASSOC)
|
||||
aflags |= ASS_MKASSOC;
|
||||
entry = do_compound_assignment (name, value, aflags);
|
||||
}
|
||||
else
|
||||
@@ -2473,10 +2483,11 @@ do_assignment_internal (word, expand)
|
||||
}
|
||||
else
|
||||
retval = 1;
|
||||
ASSIGN_RETURN (retval);
|
||||
|
||||
if (entry && retval != 0)
|
||||
if (entry && retval != 0 && noassign_p (entry) == 0)
|
||||
VUNSETATTR (entry, att_invisible);
|
||||
|
||||
ASSIGN_RETURN (retval);
|
||||
#else
|
||||
if (entry)
|
||||
VUNSETATTR (entry, att_invisible);
|
||||
@@ -3120,7 +3131,7 @@ list_quote_escapes (list)
|
||||
characters.
|
||||
|
||||
Also used by parts of the pattern substitution code. */
|
||||
static char *
|
||||
char *
|
||||
dequote_escapes (string)
|
||||
char *string;
|
||||
{
|
||||
@@ -3322,7 +3333,7 @@ remove_quoted_escapes (string)
|
||||
of how expand_word_internal works. remove_quoted_nulls () turns
|
||||
STRING into an empty string iff it only consists of a quoted null,
|
||||
and removes all unquoted CTLNUL characters. */
|
||||
static char *
|
||||
char *
|
||||
remove_quoted_nulls (string)
|
||||
char *string;
|
||||
{
|
||||
@@ -4966,7 +4977,7 @@ array_length_reference (s)
|
||||
if (assoc_p (var))
|
||||
{
|
||||
t[len - 1] = '\0';
|
||||
akey = expand_assignment_string_to_string (t, 0); /* [ */
|
||||
akey = expand_assignment_string_to_string (t, 0); /* [ */
|
||||
t[len - 1] = ']';
|
||||
if (akey == 0 || *akey == 0)
|
||||
{
|
||||
@@ -4989,7 +5000,7 @@ array_length_reference (s)
|
||||
t = (ind == 0) ? value_cell (var) : (char *)NULL;
|
||||
}
|
||||
|
||||
len = STRLEN (t);
|
||||
len = MB_STRLEN (t);
|
||||
return (len);
|
||||
}
|
||||
#endif /* ARRAY_VARS */
|
||||
@@ -5504,7 +5515,8 @@ skiparith (substr, delim)
|
||||
Return value is 1 if both values were OK, 0 if there was a problem
|
||||
with an invalid expression, or -1 if the values were out of range. */
|
||||
static int
|
||||
verify_substring_values (value, substr, vtype, e1p, e2p)
|
||||
verify_substring_values (v, value, substr, vtype, e1p, e2p)
|
||||
SHELL_VAR *v;
|
||||
char *value, *substr;
|
||||
int vtype;
|
||||
intmax_t *e1p, *e2p;
|
||||
@@ -5514,6 +5526,7 @@ verify_substring_values (value, substr, vtype, e1p, e2p)
|
||||
int expok;
|
||||
#if defined (ARRAY_VARS)
|
||||
ARRAY *a;
|
||||
HASH_TABLE *h;
|
||||
#endif
|
||||
|
||||
/* duplicate behavior of strchr(3) */
|
||||
@@ -5543,10 +5556,19 @@ verify_substring_values (value, substr, vtype, e1p, e2p)
|
||||
break;
|
||||
#if defined (ARRAY_VARS)
|
||||
case VT_ARRAYVAR:
|
||||
a = (ARRAY *)value;
|
||||
/* For arrays, the first value deals with array indices. Negative
|
||||
offsets count from one past the array's maximum index. */
|
||||
len = array_max_index (a) + (*e1p < 0); /* arrays index from 0 to n - 1 */
|
||||
offsets count from one past the array's maximum index. Associative
|
||||
arrays treat the number of elements as the maximum index. */
|
||||
if (assoc_p (v))
|
||||
{
|
||||
h = assoc_cell (v);
|
||||
len = assoc_num_elements (h) + (*e1p < 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
a = (ARRAY *)value;
|
||||
len = array_max_index (a) + (*e1p < 0); /* arrays index from 0 to n - 1 */
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
@@ -5750,7 +5772,7 @@ parameter_brace_substring (varname, value, substr, quoted)
|
||||
starsub = vtype & VT_STARSUB;
|
||||
vtype &= ~VT_STARSUB;
|
||||
|
||||
r = verify_substring_values (val, substr, vtype, &e1, &e2);
|
||||
r = verify_substring_values (v, val, substr, vtype, &e1, &e2);
|
||||
this_command_name = oname;
|
||||
if (r <= 0)
|
||||
return ((r == 0) ? &expand_param_error : (char *)NULL);
|
||||
@@ -5787,7 +5809,9 @@ parameter_brace_substring (varname, value, substr, quoted)
|
||||
#if defined (ARRAY_VARS)
|
||||
case VT_ARRAYVAR:
|
||||
if (assoc_p (v))
|
||||
tt = (char *)NULL;
|
||||
/* we convert to list and take first e2 elements starting at e1th
|
||||
element -- officially undefined for now */
|
||||
temp = assoc_subrange (assoc_cell (v), e1, e2, starsub, quoted);
|
||||
else
|
||||
/* We want E2 to be the number of elements desired (arrays can be sparse,
|
||||
so verify_substring_values just returns the numbers specified and we
|
||||
@@ -6083,6 +6107,149 @@ parameter_brace_patsub (varname, value, patsub, quoted)
|
||||
return temp;
|
||||
}
|
||||
|
||||
/****************************************************************/
|
||||
/* */
|
||||
/* Functions to perform case modification on variable values */
|
||||
/* */
|
||||
/****************************************************************/
|
||||
|
||||
/* Do case modification on the positional parameters. */
|
||||
|
||||
static char *
|
||||
pos_params_modcase (string, pat, modop, mflags)
|
||||
char *string, *pat;
|
||||
int modop;
|
||||
int mflags;
|
||||
{
|
||||
WORD_LIST *save, *params;
|
||||
WORD_DESC *w;
|
||||
char *ret;
|
||||
int pchar, qflags;
|
||||
|
||||
save = params = list_rest_of_args ();
|
||||
if (save == 0)
|
||||
return ((char *)NULL);
|
||||
|
||||
for ( ; params; params = params->next)
|
||||
{
|
||||
ret = sh_modcase (params->word->word, pat, modop);
|
||||
w = alloc_word_desc ();
|
||||
w->word = ret ? ret : savestring ("");
|
||||
dispose_word (params->word);
|
||||
params->word = w;
|
||||
}
|
||||
|
||||
pchar = (mflags & MATCH_STARSUB) == MATCH_STARSUB ? '*' : '@';
|
||||
qflags = (mflags & MATCH_QUOTED) == MATCH_QUOTED ? Q_DOUBLE_QUOTES : 0;
|
||||
|
||||
ret = string_list_pos_params (pchar, save, qflags);
|
||||
dispose_words (save);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/* Perform case modification on VALUE, which is the expansion of
|
||||
VARNAME. MODSPEC is an expression supplying the type of modification
|
||||
to perform. QUOTED is a flags word containing the type of quoting
|
||||
currently in effect. */
|
||||
static char *
|
||||
parameter_brace_casemod (varname, value, modspec, patspec, quoted)
|
||||
char *varname, *value;
|
||||
int modspec;
|
||||
char *patspec;
|
||||
int quoted;
|
||||
{
|
||||
int vtype, starsub, modop, mflags, x;
|
||||
char *val, *temp, *pat, *p, *lpat, *tt;
|
||||
SHELL_VAR *v;
|
||||
|
||||
if (value == 0)
|
||||
return ((char *)NULL);
|
||||
|
||||
this_command_name = varname;
|
||||
|
||||
vtype = get_var_and_type (varname, value, quoted, &v, &val);
|
||||
if (vtype == -1)
|
||||
return ((char *)NULL);
|
||||
|
||||
starsub = vtype & VT_STARSUB;
|
||||
vtype &= ~VT_STARSUB;
|
||||
|
||||
modop = 0;
|
||||
mflags = 0;
|
||||
if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
|
||||
mflags |= MATCH_QUOTED;
|
||||
if (starsub)
|
||||
mflags |= MATCH_STARSUB;
|
||||
|
||||
p = patspec;
|
||||
if (modspec == '^')
|
||||
{
|
||||
x = p && p[0] == modspec;
|
||||
modop = x ? CASE_UPPER : CASE_CAPITALIZE;
|
||||
p += x;
|
||||
}
|
||||
else if (modspec == ',')
|
||||
{
|
||||
x = p && p[0] == modspec;
|
||||
modop = x ? CASE_LOWER : CASE_UNCAP;
|
||||
p += x;
|
||||
}
|
||||
else if (modspec == '~')
|
||||
{
|
||||
x = p && p[0] == modspec;
|
||||
modop = x ? CASE_TOGGLEALL : CASE_TOGGLE;
|
||||
p += x;
|
||||
}
|
||||
|
||||
lpat = p ? savestring (p) : 0;
|
||||
/* Perform the same expansions on the pattern as performed by the
|
||||
pattern removal expansions. FOR LATER */
|
||||
pat = lpat ? getpattern (lpat, quoted, 1) : 0;
|
||||
|
||||
/* OK, now we do the case modification. */
|
||||
switch (vtype)
|
||||
{
|
||||
case VT_VARIABLE:
|
||||
case VT_ARRAYMEMBER:
|
||||
temp = sh_modcase (val, pat, modop);
|
||||
if (vtype == VT_VARIABLE)
|
||||
FREE (val);
|
||||
if (temp)
|
||||
{
|
||||
tt = (mflags & MATCH_QUOTED) ? quote_string (temp) : quote_escapes (temp);
|
||||
free (temp);
|
||||
temp = tt;
|
||||
}
|
||||
break;
|
||||
|
||||
case VT_POSPARMS:
|
||||
temp = pos_params_modcase (val, pat, modop, mflags);
|
||||
if (temp && (mflags & MATCH_QUOTED) == 0)
|
||||
{
|
||||
tt = quote_escapes (temp);
|
||||
free (temp);
|
||||
temp = tt;
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined (ARRAY_VARS)
|
||||
case VT_ARRAYVAR:
|
||||
temp = assoc_p (v) ? assoc_modcase (assoc_cell (v), pat, modop, mflags)
|
||||
: array_modcase (array_cell (v), pat, modop, mflags);
|
||||
/* Don't call quote_escapes; array_modcase calls array_quote_escapes
|
||||
as appropriate before adding the space separators; ditto for
|
||||
assoc_modcase. */
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
FREE (pat);
|
||||
free (lpat);
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
/* Check for unbalanced parens in S, which is the contents of $(( ... )). If
|
||||
any occur, this must be a nested command substitution, so return 0.
|
||||
Otherwise, return 1. A valid arithmetic expression must always have a
|
||||
@@ -6140,22 +6307,22 @@ chk_arithsub (s, len)
|
||||
/* */
|
||||
/****************************************************************/
|
||||
|
||||
/* ${[#][!]name[[:]#[#]%[%]-=?+[word][:e1[:e2]]]} */
|
||||
/* ${[#][!]name[[:][^[^]][,[,]]#[#]%[%]-=?+[word][:e1[:e2]]]} */
|
||||
static WORD_DESC *
|
||||
parameter_brace_expand (string, indexp, quoted, quoted_dollar_atp, contains_dollar_at)
|
||||
char *string;
|
||||
int *indexp, quoted, *quoted_dollar_atp, *contains_dollar_at;
|
||||
{
|
||||
int check_nullness, var_is_set, var_is_null, var_is_special;
|
||||
int want_substring, want_indir, want_patsub;
|
||||
int want_substring, want_indir, want_patsub, want_casemod;
|
||||
char *name, *value, *temp, *temp1;
|
||||
WORD_DESC *tdesc, *ret;
|
||||
int t_index, sindex, c, tflag;
|
||||
int t_index, sindex, c, tflag, modspec;
|
||||
intmax_t number;
|
||||
|
||||
temp = temp1 = value = (char *)NULL;
|
||||
var_is_set = var_is_null = var_is_special = check_nullness = 0;
|
||||
want_substring = want_indir = want_patsub = 0;
|
||||
want_substring = want_indir = want_patsub = want_casemod = 0;
|
||||
|
||||
sindex = *indexp;
|
||||
t_index = ++sindex;
|
||||
@@ -6163,7 +6330,17 @@ parameter_brace_expand (string, indexp, quoted, quoted_dollar_atp, contains_doll
|
||||
if (string[t_index] == '#' && legal_variable_starter (string[t_index+1])) /* {{ */
|
||||
name = string_extract (string, &t_index, "}", SX_VARNAME);
|
||||
else
|
||||
#if defined (CASEMOD_EXPANSIONS)
|
||||
/* To enable case-toggling expansions using the `~' operator character
|
||||
change the 1 to 0. */
|
||||
# if defined (CASEMOD_CAPCASE)
|
||||
name = string_extract (string, &t_index, "#%^,~:-=?+/}", SX_VARNAME);
|
||||
# else
|
||||
name = string_extract (string, &t_index, "#%^,:-=?+/}", SX_VARNAME);
|
||||
# endif /* CASEMOD_CAPCASE */
|
||||
#else
|
||||
name = string_extract (string, &t_index, "#%:-=?+/}", SX_VARNAME);
|
||||
#endif /* CASEMOD_EXPANSIONS */
|
||||
|
||||
ret = 0;
|
||||
tflag = 0;
|
||||
@@ -6217,6 +6394,13 @@ parameter_brace_expand (string, indexp, quoted, quoted_dollar_atp, contains_doll
|
||||
want_substring = 1;
|
||||
else if (c == '/' && string[sindex] != RBRACE)
|
||||
want_patsub = 1;
|
||||
#if defined (CASEMOD_EXPANSIONS)
|
||||
else if (c == '^' || c == ',' || c == '~')
|
||||
{
|
||||
modspec = c;
|
||||
want_casemod = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Catch the valid and invalid brace expressions that made it through the
|
||||
tests above. */
|
||||
@@ -6437,6 +6621,24 @@ parameter_brace_expand (string, indexp, quoted, quoted_dollar_atp, contains_doll
|
||||
ret->word = temp1;
|
||||
return ret;
|
||||
}
|
||||
#if defined (CASEMOD_EXPANSIONS)
|
||||
else if (want_casemod)
|
||||
{
|
||||
temp1 = parameter_brace_casemod (name, temp, modspec, value, quoted);
|
||||
FREE (name);
|
||||
FREE (value);
|
||||
FREE (temp);
|
||||
|
||||
if (temp1 == &expand_param_error)
|
||||
return (&expand_wdesc_error);
|
||||
else if (temp1 == &expand_param_fatal)
|
||||
return (&expand_wdesc_fatal);
|
||||
|
||||
ret = alloc_word_desc ();
|
||||
ret->word = temp1;
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Do the right thing based on which character ended the variable name. */
|
||||
switch (c)
|
||||
@@ -8261,6 +8463,7 @@ shell_expand_word_list (tlist, eflags)
|
||||
if (tlist->word->flags & W_ASSIGNASSOC)
|
||||
make_internal_declare (tlist->word->word, "-A");
|
||||
|
||||
t = do_word_assignment (tlist->word);
|
||||
if (t == 0)
|
||||
{
|
||||
last_command_exit_value = EXECUTION_FAILURE;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
BUILD_DIR=/usr/local/build/chet/bash/bash-current
|
||||
BUILD_DIR=/usr/local/build/bash/bash-current
|
||||
THIS_SH=$BUILD_DIR/bash
|
||||
PATH=$PATH:$BUILD_DIR
|
||||
|
||||
|
||||
@@ -121,3 +121,21 @@ echo cc
|
||||
echo cc
|
||||
cc
|
||||
1
|
||||
one
|
||||
two
|
||||
three
|
||||
1 cat <<!
|
||||
one
|
||||
two
|
||||
three
|
||||
!
|
||||
|
||||
cat <<!
|
||||
one
|
||||
two
|
||||
three
|
||||
!
|
||||
|
||||
one
|
||||
two
|
||||
three
|
||||
|
||||
@@ -107,3 +107,5 @@ set +o history
|
||||
|
||||
shopt -q -o history
|
||||
echo $?
|
||||
|
||||
${THIS_SH} ./history1.sub
|
||||
|
||||
@@ -92,6 +92,17 @@ r cc
|
||||
unalias -a
|
||||
alias
|
||||
|
||||
# these two blocks had better both result in the same output
|
||||
echo aa
|
||||
echo bb
|
||||
echo cc
|
||||
fc -e cat
|
||||
|
||||
echo aa
|
||||
echo bb
|
||||
echo cc
|
||||
fc -e cat -1
|
||||
|
||||
set +o history
|
||||
|
||||
shopt -q -o history
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
set -o history
|
||||
|
||||
history -c
|
||||
cat <<!
|
||||
one
|
||||
two
|
||||
three
|
||||
!
|
||||
|
||||
history
|
||||
fc -s cat
|
||||
@@ -0,0 +1,11 @@
|
||||
set -o history
|
||||
|
||||
history -c
|
||||
cat <<!
|
||||
one
|
||||
two
|
||||
three
|
||||
!
|
||||
|
||||
history
|
||||
fc -s 2
|
||||
Reference in New Issue
Block a user