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

This commit is contained in:
Jari Aalto 2000-03-17 21:46:59 +00:00
commit bb70624e96
387 changed files with 28522 additions and 9334 deletions

606
CHANGES
View file

@ -1,3 +1,609 @@
This document details the changes between this version, bash-2.04-release,
and the previous version, bash-2.04-beta5.
1. Changes to Bash
a. Better compile-time and configure-time checks for the necessity of
inet_aton().
b. A bug was fixed in the expansion of "${@:-}" when there are positional
parameters.
c. A typo was fixed in the output of `complete'.
d. The matches generated for a word by the `-W' argument to complete and
compgen are now matched against the word being completed, and only
matches are returned as the result.
e. Some fixes were made for systems which do not restart read(2) when a
signal caught by bash is received.
f. A bug was fixed which caused the umask to be set to 0 when an invalid
symbolic mode mask was parsed.
g. Fixed a bug that could cause a core dump if a SIGCHLD was received while
performing an assignment statement using command substitution.
h. Changed the word splitting function for programmable completion so cases
in which the cursor is between words are handled a bit better.
2. Changes to Readline
a. rl_funmap_names() is now documented.
3. New Features in Bash
a. The LC_NUMERIC variable is now treated specially, and used to set the
LC_NUMERIC locale category for number formatting, e.g., when `printf'
displays floating-point numbers.
------------------------------------------------------------------------------
This document details the changes between this version, bash-2.04-beta5,
and the previous version, bash-2.04-beta4.
1. Changes to Bash
a. A couple of changes were made to the Makefiles for easier building on
non-Unix systems.
b. Fixed a bug where the current prompt would be set to $PS2 at startup.
c. The shell script that tests an already-installed version was changed to
remove the directory it created its test programs in at exit.
d. Several changes were made to the code that tokenizes an input line for
the programmable completion code. Shell metacharacters will now appear
as individual words in the word list passed to the completion functions.
Some of the example completion shell functions were changed to understand
redirection operators.
e. A bug was fixed that, under obscure circumstances, could confuse the
parser when a shell function was run by the programmable completion code.
f. A bug was fixed in the ulimit builtin for systems not using getrlimit().
g. The execution code now propagates the correct exit status back to the rest
of the code if the return value of a subshell command was being inverted.
Some new test cases for inverting return values with the `!' reserved
word have been added.
h. Negative exponents in the arithmetic evaluation of v**e now return an
evaluation error.
i. A bug that caused bash to check the wrong process in a pipeline for
abnormal termination (and consequently resetting the terminal attributes)
was fixed.
j. Fixed a bug that caused $PS2 to be displayed after PROMPT_COMMAND was
executed.
2. Changes to Readline
1. Fixed a bug in a C preprocessor define that caused the keypad control
functions to be compiled out for all platforms except DJGPP.
------------------------------------------------------------------------------
This document details the changes between this version, bash-2.04-beta4,
and the previous version, bash-2.04-beta3.
1. Changes to Bash
a. A couple of changes were made to the redirection to attempt to avoid
race conditions and malicious file replacement.
2. A change was made to the string evaluation code (used for command
substitution, `eval', and the `.' builtin) to fix an obscure core
dump on alpha machines.
3. A bug that caused $LINENO to be wrong when executing arithmetic for
commands was fixed.
4. A couple of memory leaks in the programmable completion code were fixed.
5. A bug that could cause a core dump by freeing memory twice during a call
to `eval' if `set -u' had been enabled and an undefined variable was
referenced was fixed.
------------------------------------------------------------------------------
This document details the changes between this version, bash-2.04-beta3,
and the previous version, bash-2.04-beta2.
1. Changes to Bash
a. Bash should run the appropriate startup files when invoked by ssh2.
b. Fixed a bug in the parsing of conditional commands that could cause a
core dump.
c. Fixed a bug in parsing job specifications that occasionally caused
core dumps when an out-of-range job was referenced.
d. Fixed the `type' and `command' builtins to do better reporting of
commands that are not found in $PATH or the hash table.
e. Fixed a POSIX.2 compliance problem in the command builtin -- commands
are supposed to be reported as full pathnames.
f. The `echo' builtin now returns failure if a write error occurs.
g. Fixed a bug which caused the locale to not be reset correctly when
LC_ALL was unset.
h. Changed description of `getopts' in man page and reference manual to make
it clear that option characters may be characters other than letters.
i. If the shell exits while in a function, make sure that any trap on EXIT
doesn't think the function is still executing.
j. Bashbug now tries harder to find a usable editor if $EDITOR is not set,
rather than simply defaulting to `emacs'.
k. Changes to the scripts that guess and canonicalize the system type, from
the latest `automake' distribution via Debian.
l. When using named pipes for process substitution, make sure the file
descriptors opened for reading are set to non-blocking mode.
m. Fixed a bug that caused termination of pipelines that are killed by a
signal to not be reported in some cases.
n. When not in literal-history mode, shell comment lines are not added to
the history list.
o. When running in POSIX.2 mode, bash no longer performs word splitting on
the expanded value of the word supplied as the filename argument to
redirection operators.
p. The prompt string decoding code now backslash-quotes only characters that
are special within double quotes when expanding the \w and \W escape
sequences.
q. Fixed a bug in the prompt decoding code that could cause a non-interactive
shell to seg fault if `\u' was used in PS4 and the shell was in xtrace
mode.
r. Fixed a bug that caused function definitions to be printed with any
redirections that should be attached to the entire function before the
closing brace.
s. Changed the tilde expansion code for Cygwin systems to avoid creating
pathnames beginning with `//' if $HOME == `/'.
t. Fixed a couple of autoconf tests to avoid creating files with fixed names
in /tmp.
u. The `trap' and `kill' builtins now know the names of the POSIX.1b real-
time signals on systems which support them.
2. Changes to Readline
a. Fixed a problem with the single-quote quoting function that could cause
buffer overflows.
b. Fixed a bug that caused incorrect `stat characters' to be printed if
the files being completed were in the root directory and visible-stats
was enabled.
3. New Features in Bash
a. There is a new `rbash.1' manual page, from the Debian release.
b. The `--enable-usg-echo-default' option to `configure' has been renamed to
`--enable-xpg-echo-default'. The old option is still there for backwards
compatibility.
------------------------------------------------------------------------------
This document details the changes between this version, bash-2.04-beta2,
and the previous version, bash-2.04-beta1.
1. Changes to Bash
a. Fixed a bug that could cause pipes to be closed inappropriately in
some obscure cases.
b. Fixed a bug that caused creation of the exported environment to clobber
the current command string if there were any exported shell functions.
c. Some changes were made to reduce bash's memory usage.
d. Fixed a problem with programmable completion and filenames to be
completed containing quote characters.
e. Changed the code the removes named pipes created for the <(...) and >(...)
expansions to defer removal until after any current shell function has
finished executing.
f. Fixed a bug in `select' which caused it to not handle the `continue'
builtin correctly.
g. Autoconf tests added for cygwin32 and mingw32.
2. New Features in Bash
a. The `--with-bash-malloc' configure option replaces `--with-gnu-malloc'
(which is still there for backwards compatibility).
------------------------------------------------------------------------------
This document details the changes between this version, bash-2.04-beta1,
and the previous version, bash-2.04-alpha1.
1. Changes to Bash
a. Fixed a bug in the programmable completion code that occurred when
trying to complete command lines containing a `;' or `@'.
b. The file descriptor from which the shell is reading a script is now
moved to a file descriptor above the user-addressible range.
c. Changes to `printf' so that it can handle integers beginning with 0
or 0x as octal and hex, respectively.
d. Fixes to the programmable completion code so it handles nonsense like
`compgen -C xyz' gracefully.
e. The shell no longer modifies the signal handler for SIGPROF, allowing
profiling again on certain systems.
f. The shell checks for a new window size, if the user has requested it,
after a process exits due to a signal.
g. Fixed a bug with variables with null values in a program's temporary
environment and the bash getenv() replacement.
h. `declare' and the other builtins that take variable assignments as
arguments now honor `set -a' and mark modified variables for export.
i. Some changes were made for --dump-po-strings mode when writing strings
with embedded newlines.
j. The code that caches export strings from the initial environment now
duplicates the string rather than just pointing into the environment.
k. The filename completion quoting code now uses single quotes by default
if the filename being completed contains newlines, since \<newline>
has a special meaning to the parser.
l. Bash now uses typedefs bits32_t and u_bits32_t instead of int32_t and
u_int32_t, respectively to avoid conflicts on certain Unix versions.
m. Configuration changes were made for: Rhapsody, Mac OS, FreeBSD-3.x.
n. Fixed a problem with hostname-to-ip-address translation in the
/dev/(tcp|udp)/hostname/port redirection code.
o. The texinfo manual has been reorganized slightly.
p. Filename generation (globbing) range comparisons in bracket expressions
no longer use strcoll(3) even if it is available, since it has unwanted
effects in certain locales.
q. Fixed a cosmetic problem in the source that caused the shell to not
compile if DPAREN_ARITHMETIC was not defined but ARITH_FOR_COMMAND was.
r. Fixed a bug in the here-document code tripped when the file descriptor
opened to the file containing the text of the here document was the
same as a redirector specified by the user.
s. Fixed a bug where the INVERT_RETURN flag was not being set for `pipeline'
in `time ! pipeline'.
t. Fixed a bug with the `wait' builtin which manifested itself when an
interrupt was received while the shell was waiting for asynchronous
processes in a shell script.
u. Fixed the DEBUG trap code so that it has the correct value of $?.
v. Fixed a bug in the parameter pattern substitution code that could cause
the shell to attempt to free unallocated memory if the pattern started
with `/' and an expansion error occurs.
w. Fixed a bug in the positional parameter substring code that could
cause the shell to loop freeing freed memory.
x. Fixed a bug in the positional parameter pattern substitution code so
that it correctly handles null replacement strings with a pattern
string prefixed with `%' or `#'.
y. The shell no longer attempts to import functions from the environment if
started with `-n'.
z. Fixed a bug that caused `return' in a command substitution executed in
a shell function to return from the function in a subshell and continue
execution.
aa. `hash -p /pathname/with/slashes name' is no longer allowed when the shell
is restricted.
bb. The wait* job control functions now behave better if called when there
are no unwaited-for children.
cc. Command substitution no longer unconditionally disables job control in
the subshell started to run the command.
dd. A bug was fixed that occasionally caused traps to mess up the parser
state.
ee. `bashbug' now honors user headers in the mail message it sends.
ff. A bug was fixed that caused the `:p' history modifier to not print the
history expansion if the `histverify' option was set.
2. Changes to Readline
a. Fixed a bug in the redisplay code for lines with more than 256 line
breaks.
b. A bug was fixed which caused invisible character markers to not be
stripped from the prompt string if the terminal was in no-echo mode.
c. Readline no longer tries to get the variables it needs for redisplay
from the termcap entry if the calling application has specified its
own redisplay function. Readline treats the terminal as `dumb' in
this case.
d. Fixes to the SIGWINCH code so that a multiple-line prompt with escape
sequences is redrawn correctly.
3. New Features in Bash
a. `bashbug' now accepts `--help' and `--version' options.
b. There is a new `xpg_echo' option to `shopt' that controls the behavior
of echo with respect to backslash-escaped characters at runtime.
------------------------------------------------------------------------------
This document details the changes between this version, bash-2.04-alpha1,
and the previous version, bash-2.04-devel.
1. Changes to Bash
a. Fixed a bug that could cause core dumps when performing substring
expansion.
b. Shared object configuration changes for: Solaris, OSF/1
c. The POSIX_GLOB_LIBRARY code that uses the POSIX.2 globbing facilities
for pathname expansion now understands GLOBIGNORE.
d. The code that implements `eval' was changed to save the value of the
current prompt, so an eval in a shell function called by the programmable
completion code will not change the prompt to $PS2.
e. Restored the undocumented NON_INTERACTIVE_LOGIN_SHELLS #define to
config-top.h. If this is defined, all login shells will read the
startup files, not just interactive and non-interactive started with
the `--login' option.
f. Fixed a bug that caused the expansion code to occasionally dump core if
IFS contained characters > 128.
g. Fixed a problem with the grammar so that a newline is not required
after the `))' in the new-style arithmetic for statement; a semicolon
may be used as expected.
h. Variable indirection may now reference the shell's special variables.
i. The $'...' and $"..." constructs are now added to the history correctly
if they contain newlines and command-oriented history is enabled.
j. It is now an error to try to assign a value to a function-local copy
of a readonly shell variable (declared with the `local' builtin).
2. Changes to Readline
a. The history file code now uses O_BINARY mode when reading and writing
the history file on cygwin32.
3. New Features in Bash
a. A new programmable completion facility, with two new builtin commands:
complete and compgen.
b. configure has a new option, `--enable-progcomp', to compile in the
programmable completion features (enabled by default).
c. `shopt' has a new option, `progcomp', to enable and disable programmable
completion at runtime.
d. Unsetting HOSTFILE now clears the list of hostnames used for completion.
4. New Features in Readline
a. A new variable, rl_gnu_readline_p, always 1. The intent is that an
application can verify whether or not it is linked with the `real'
readline library or some substitute.
------------------------------------------------------------------------------
This document details the changes between this version, bash-2.04-devel,
and the previous version, bash-2.03-release.
1. Changes to Bash
a. System-specific configuration and source changes for: Interix, Rhapsody
b. Fixed a bug in execute_cmd.c that resulted in a compile-time error if
JOB_CONTROL was not defined.
c. An obscure race condition in the trap code was fixed.
d. The string resulting from $'...' is now requoted to avoid any further
expansion.
e. The $'...' quoting syntax now allows backslash to escape a single quote,
for ksh-93 compatibility.
f. The $"..." quoting syntax now escapes backslashes and double quotes in
the translated string when displaying them with the --dump-po-strings
option.
g. `echo -e' no longer converts \' to '.
h. Fixes were made to the extended globbing code to handle embedded (...)
patterns better.
i. Some improvements were made to the code that unsets `nodelay' mode on
the file descriptor from which bash is reading input.
j. Some changes were made to the replacement termcap library for better
operation on MS-DOS.
k. Some changes were made to the tilde expansion code to handle backslash
as a pathname separator on MS-DOS.
l. The source has been reorganized a little bit -- there is now an `include'
subdirectory, and lib/posixheaders has been removed.
m. Improvements were made to the `read' builtin so that it makes many
fewer read(2) system calls.
n. The expansion of $- will include `c' and `s' when those options are
supplied at shell invocation.
o. Several improvments were made to the completion code: variable completion
now works better when there are unterminated expansions, command
completion understands quotes better, and completion now works in certain
unclosed $(... constructs.
p. The arithmetic expansion code was fixed to not need the value of a
variable being assigned a value (fixes the "ss=09; let ss=10" bug).
q. Some changes were made to make exported environment creation faster.
r. The html documentation will be installed into $(htmldir) if that variable
has a value when `make install' is run.
s. Fixed a bug that would cause the bashrc file to be sourced inappropriately
when bash is started by sshd.
t. The SSH_CLIENT environment variable is no longer auto-exported.
u. A bug that caused redirections with (...) subshells to be performed in
the wrong order was fixed.
v. A bug that occasionally caused inaapropriate expansion of assignment
statements in compound array assignments was fixed.
w. The code that parses the words in a compound array assignment was
simplified considerably and should work better now.
x. Fixes to the non-job-control code in nojobs.c to make it POSIX.2-compliant
when a user attempts to retrieve the status of a terminated background
process.
y. Fixes to the `printf' builtin so that it doesn't try to expand all
backslash escape sequences in the format string before parsing it for
% format specifiers.
2. Changes to Readline
a. The history library tries to truncate the history file only if it is a
regular file.
b. A bug that caused _rl_dispatch to address negative array indices on
systems with signed chars was fixed.
c. rl-yank-nth-arg now leaves the history position the same as when it was
called.
d. Changes to the completion code to handle MS-DOS drive-letter:pathname
filenames.
e. Completion is now case-insensitive by default on MS-DOS.
f. Fixes to the history file manipulation code for MS-DOS.
g. Readline attempts to bind the arrow keys to appropriate defaults on MS-DOS.
h. Some fixes were made to the redisplay code for better operation on MS-DOS.
i. The quoted-insert code will now insert tty special chars like ^C.
j. A bug was fixed that caused the display code to reference memory before
the start of the prompt string.
k. More support for __EMX__ (OS/2).
l. A bug was fixed in readline's signal handling that could cause infinite
recursion in signal handlers.
m. A bug was fixed that caused the point to be less than zero when rl_forward
was given a very large numeric argument.
n. The vi-mode code now gets characters via the application-settable value
of rl_getc_function rather than calling rl_getc directly.
3. New Features in Bash
a. The history builtin has a `-d offset' option to delete the history entry
at position `offset'.
b. The prompt expansion code has two new escape sequences: \j, the number of
active jobs; and \l, the basename of the shell's tty device name.
c. The `bind' builtin has a new `-x' option to bind key sequences to shell
commands.
d. There is a new shell option, no_empty_command_completion, which, when
enabled, disables command completion when TAB is typed on an empty line.
e. The `help' builtin has a `-s' option to just print a builtin's usage
synopsys.
f. There are several new arithmetic operators: id++, id-- (variable
post-increment/decrement), ++id, --id (variabl pre-increment/decrement),
expr1 , expr2 (comma operator).
g. There is a new ksh-93 style arithmetic for command:
for ((expr1 ; expr2; expr3 )); do list; done
h. The `read' builtin has a number of new options:
-t timeout only wait timeout seconds for input
-n nchars only read nchars from input instead of a full line
-d delim read until delim rather than newline
-s don't echo input chars as they are read
i. The redirection code now handles several filenames specially:
/dev/fd/N, /dev/stdin, /dev/stdout, and /dev/stderr, whether or
not they are present in the file system.
j. The redirection code now recognizes pathnames of the form
/dev/tcp/host/port and /dev/udp/host/port, and tries to open a socket
of the appropriate type to the specified port on the specified host.
k. The ksh-93 ${!prefix*} expansion, which expands to the names of all
shell variables whose names start with prefix, has been implemented.
l. There is a new dynamic variable, FUNCNAME, which expands to the name of
a currently-executing function. Assignments to FUNCNAME have no effect.
m. The GROUPS variable is no longer readonly; assignments to it are silently
discarded. This means it can be unset.
4. New Features in Readline
a. Parentheses matching is now always compiled into readline, and enabled
or disabled when the value of the `blink-matching-paren' variable is
changed.
b. MS-DOS systems now use ~/_inputrc as the last-ditch inputrc filename.
c. MS-DOS systems now use ~/_history as the default history file.
d. history-search-{forward,backward} now leave the point at the end of the
line when the string to search for is empty, like
{reverse,forward}-search-history.
e. history-search-{forward,backward} now leave the last history line found
in the readline buffer if the second or subsequent search fails.
f. New function for use by applications: rl_on_new_line_with_prompt, used
when an application displays the prompt itself before calling readline().
g. New variable for use by applications: rl_already_prompted. An application
that displays the prompt itself before calling readline() must set this to
a non-zero value.
------------------------------------------------------------------------------
This document details the changes between this version, bash-2.03-release,
and the previous version, bash-2.03-beta2.

9
COMPAT
View file

@ -1,5 +1,5 @@
This document details the incompatibilites between this version of bash,
bash-2.03, and the previous widely-available version, bash-1.14 (which
bash-2.04, and the previous widely-available version, bash-1.14 (which
is still the `standard' version for many Linux distributions). These
were discovered by users of bash-2.x, so this list is not comprehensive.
@ -124,3 +124,10 @@ were discovered by users of bash-2.x, so this list is not comprehensive.
when in POSIX mode. The bash-1.14 behavior may be obtained with
<>filename 1>&0
12. The `alias' builtin now checks for invalid options and takes a `-p'
option to display output in POSIX mode. If you have old aliases beginning
with `-' or `+', you will have to add the `--' to the alias command
that declares them:
alias -x='chmod a-x' --> alias -- -x='chmod a-x'

View file

@ -3,8 +3,8 @@ Bash POSIX Mode
Starting Bash with the `--posix' command-line option or executing `set
-o posix' while Bash is running will cause Bash to conform more closely
to the POSIX.2 standard by changing the behavior to match that
specified by POSIX.2 in areas where the Bash default differs.
to the POSIX 1003.2 standard by changing the behavior to match that
specified by POSIX in areas where the Bash default differs.
The following list is what's changed when `POSIX mode' is in effect:
@ -19,7 +19,7 @@ The following list is what's changed when `POSIX mode' is in effect:
4. Reserved words may not be aliased.
5. The POSIX.2 `PS1' and `PS2' expansions of `!' to the history
5. The POSIX 1003.2 `PS1' and `PS2' expansions of `!' to the history
number and `!!' to `!' are enabled, and parameter expansion is
performed on the values of `PS1' and `PS2' regardless of the
setting of the `promptvars' option.
@ -27,8 +27,8 @@ The following list is what's changed when `POSIX mode' is in effect:
6. Interactive comments are enabled by default. (Bash has them on by
default anyway.)
7. The POSIX.2 startup files are executed (`$ENV') rather than the
normal Bash files.
7. The POSIX 1003.2 startup files are executed (`$ENV') rather than
the normal Bash files.
8. Tilde expansion is only performed on assignments preceding a
command name, rather than on all assignment statements on the line.
@ -48,49 +48,52 @@ The following list is what's changed when `POSIX mode' is in effect:
13. Redirection operators do not perform filename expansion on the word
in the redirection unless the shell is interactive.
14. Function names must be valid shell `name's. That is, they may not
14. Redirection operators do not perform word splitting on the word in
the redirection.
15. Function names must be valid shell `name's. That is, they may not
contain characters other than letters, digits, and underscores, and
may not start with a digit. Declaring a function with an invalid
name causes a fatal syntax error in non-interactive shells.
15. POSIX.2 `special' builtins are found before shell functions during
command lookup.
16. POSIX 1003.2 `special' builtins are found before shell functions
during command lookup.
16. If a POSIX.2 special builtin returns an error status, a
17. If a POSIX 1003.2 special builtin returns an error status, a
non-interactive shell exits. The fatal errors are those listed in
the POSIX.2 standard, and include things like passing incorrect
options, redirection errors, variable assignment errors for
assignments preceding the command name, and so on.
17. If the `cd' builtin finds a directory to change to using
18. If the `cd' builtin finds a directory to change to using
`$CDPATH', the value it assigns to the `PWD' variable does not
contain any symbolic links, as if `cd -P' had been executed.
18. If `$CDPATH' is set, the `cd' builtin will not implicitly append
19. If `$CDPATH' is set, the `cd' builtin will not implicitly append
the current directory to it. This means that `cd' will fail if no
valid directory name can be constructed from any of the entries in
`$CDPATH', even if the a directory with the same name as the name
given as an argument to `cd' exists in the current directory.
19. A non-interactive shell exits with an error status if a variable
20. A non-interactive shell exits with an error status if a variable
assignment error occurs when no command name follows the assignment
statements. A variable assignment error occurs, for example, when
trying to assign a value to a readonly variable.
20. A non-interactive shell exits with an error status if the iteration
21. A non-interactive shell exits with an error status if the iteration
variable in a `for' statement or the selection variable in a
`select' statement is a readonly variable.
21. Process substitution is not available.
22. Process substitution is not available.
22. Assignment statements preceding POSIX.2 special builtins persist
in the shell environment after the builtin completes.
23. Assignment statements preceding POSIX 1003.2 special builtins
persist in the shell environment after the builtin completes.
23. The `export' and `readonly' builtin commands display their output
in the format required by POSIX.2.
24. The `export' and `readonly' builtin commands display their output
in the format required by POSIX 1003.2.
There is other POSIX.2 behavior that Bash does not implement.
There is other POSIX 1003.2 behavior that Bash does not implement.
Specifically:
1. Assignment statements affect the execution environment of all

File diff suppressed because it is too large Load diff

139
INSTALL
View file

@ -3,18 +3,44 @@ Basic Installation
These are installation instructions for Bash.
The simplest way to compile Bash is:
1. `cd' to the directory containing the source code and type
`./configure' to configure Bash for your system. If you're using
`csh' on an old version of System V, you might need to type `sh
./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes some time. While running, it prints
messages telling which features it is checking for.
2. Type `make' to compile Bash and build the `bashbug' bug reporting
script.
3. Optionally, type `make tests' to run the Bash test suite.
4. Type `make install' to install `bash' and `bashbug'. This will
also install the manual pages and Info file.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package
(the top directory, the `builtins' and `doc' directories, and the each
directory under `lib'). It also creates a `config.h' file containing
system-dependent definitions. Finally, it creates a shell script named
`config.status' that you can run in the future to recreate the current
configuration, a file `config.cache' that saves the results of its
tests to speed up reconfiguring, and a file `config.log' containing
compiler output (useful mainly for debugging `configure'). If at some
point `config.cache' contains results you don't want to keep, you may
remove or edit it.
(the top directory, the `builtins', `doc', and `support' directories,
each directory under `lib', and several others). It also creates a
`config.h' file containing system-dependent definitions. Finally, it
creates a shell script named `config.status' that you can run in the
future to recreate the current configuration, a file `config.cache'
that saves the results of its tests to speed up reconfiguring, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure'). If at some point `config.cache' contains
results you don't want to keep, you may remove or edit it.
To find out more about the options and arguments that the `configure'
script understands, type
bash-2.04$ ./configure --help
at the Bash prompt in your Bash source directory.
If you need to do unusual things to compile Bash, please try to figure
out how `configure' could check whether or not to do them, and mail
@ -34,25 +60,6 @@ contain the patch level of the Bash distribution, `0' for example. The
script `support/mkconffiles' has been provided to automate the creation
of these files.
The simplest way to compile Bash is:
1. `cd' to the directory containing the source code and type
`./configure' to configure Bash for your system. If you're using
`csh' on an old version of System V, you might need to type `sh
./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile Bash and build the `bashbug' bug reporting
script.
3. Optionally, type `make tests' to run the Bash test suite.
4. Type `make install' to install `bash' and `bashbug'. This will
also install the manual pages and Info file.
You can remove the program binaries and object files from the source
code directory by typing `make clean'. To also remove the files that
`configure' created (so you can compile Bash for a different kind of
@ -116,7 +123,7 @@ than `/usr/local' by giving `configure' the option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', `make install' will
use `PATH' as the prefix for installing programs and libraries.
use PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
Specifying the System Type
@ -171,14 +178,14 @@ Operation Controls
script, and exit.
`configure' also accepts some other, not widely used, boilerplate
options.
options. `configure --help' prints the complete list.
Optional Features
=================
The Bash `configure' has a number of `--enable-FEATURE' options, where
FEATURE indicates an optional part of Bash. There are also several
`--with-PACKAGE' options, where PACKAGE is something like `gnu-malloc'
`--with-PACKAGE' options, where PACKAGE is something like `bash-malloc'
or `purify'. To turn off the default use of a package, use
`--without-PACKAGE'. To configure Bash without a feature that is
enabled by default, use `--disable-FEATURE'.
@ -189,6 +196,15 @@ the Bash `configure' recognizes.
`--with-afs'
Define if you are using the Andrew File System from Transarc.
`--with-bash-malloc'
Use the Bash version of `malloc' in `lib/malloc/malloc.c'. This
is not the same `malloc' that appears in GNU libc, but an older
version derived from the 4.2 BSD `malloc'. This `malloc' is very
fast, but wastes some space on each allocation. This option is
enabled by default. The `NOTES' file contains a list of systems
for which this should be turned off, and `configure' disables this
option automatically for a number of systems.
`--with-curses'
Use the curses library instead of the termcap library. This should
be supplied if your system has an inadequate or incomplete termcap
@ -200,25 +216,19 @@ the Bash `configure' recognizes.
2, but a modified version of the `malloc' from glibc version 1.
This is somewhat slower than the default `malloc', but wastes less
space on a per-allocation basis, and will return memory to the
operating system under some circumstances.
operating system under certain circumstances.
`--with-gnu-malloc'
Use the GNU version of `malloc' in `lib/malloc/malloc.c'. This is
not the same `malloc' that appears in GNU libc, but an older
version derived from the 4.2 BSD `malloc'. This `malloc' is very
fast, but wastes some space on each allocation. This option is
enabled by default. The `NOTES' file contains a list of systems
for which this should be turned off, and `configure' disables this
option automatically for a number of systems.
A synonym for `--with-bash-malloc'.
`--with-installed-readline'
Define this to make bash link with a locally-installed version of
Readline rather than the version in lib/readline. This works only
with readline 4.0 and later versions.
Define this to make Bash link with a locally-installed version of
Readline rather than the version in `lib/readline'. This works
only with Readline 4.1 and later versions.
`--with-purify'
Define this to use the Purify memory allocation checker from Pure
Software.
Define this to use the Purify memory allocation checker from
Rational Software.
`--enable-minimal-config'
This produces a shell with minimal features, close to the
@ -240,13 +250,18 @@ options, but it is processed first, so individual options may be
enabled using `enable-FEATURE'.
All of the following options except for `disabled-builtins' and
`usg-echo-default' are enabled by default, unless the operating system
`xpg-echo-default' are enabled by default, unless the operating system
does not provide the necessary support.
`--enable-alias'
Allow alias expansion and include the `alias' and `unalias'
builtins (*note Aliases::.).
`--enable-arith-for-command'
Include support for the alternate form of the `for' command that
behaves like the C language `for' statement (*note Looping
Constructs::.).
`--enable-array-variables'
Include support for one-dimensional array shell variables (*note
Arrays::.).
@ -261,9 +276,9 @@ does not provide the necessary support.
`--enable-command-timing'
Include support for recognizing `time' as a reserved word and for
displaying timing statistics for the pipeline following `time'.
This allows pipelines as well as shell builtins and functions to
be timed.
displaying timing statistics for the pipeline following `time'
(*note Pipelines::.). This allows pipelines as well as shell
builtins and functions to be timed.
`--enable-cond-command'
Include support for the `[[' conditional command (*note
@ -289,16 +304,21 @@ does not provide the necessary support.
`--enable-help-builtin'
Include the `help' builtin, which displays help on shell builtins
and variables.
and variables (*note Bash Builtins::.).
`--enable-history'
Include command history and the `fc' and `history' builtin
commands.
commands (*note Bash History Facilities::.).
`--enable-job-control'
This enables the job control features (*note Job Control::.), if
the operating system supports them.
`--enable-net-redirections'
This enables the special handling of filenames of the form
`/dev/tcp/HOST/PORT' and `/dev/udp/HOST/PORT' when used in
redirections (*note Redirections::.).
`--enable-process-substitution'
This enables process substitution (*note Process Substitution::.)
if the operating system provides the necessary support.
@ -309,6 +329,11 @@ does not provide the necessary support.
strings. See *Note Printing a Prompt::, for a complete list of
prompt string escape sequences.
`--enable-progcomp'
Enable the programmable completion facilities (*note Programmable
Completion::.). If Readline is not enabled, this option has no
effect.
`--enable-readline'
Include support for command-line editing and history with the Bash
version of the Readline library (*note Command Line Editing::.).
@ -323,11 +348,17 @@ does not provide the necessary support.
menus (*note Conditional Constructs::.).
`--enable-usg-echo-default'
Make the `echo' builtin expand backslash-escaped characters by
default, without requiring the `-e' option. This makes the Bash
`echo' behave more like the System V version.
A synonym for `--enable-xpg-echo-default'.
The file `config.h.top' contains C Preprocessor `#define' statements
`--enable-xpg-echo-default'
Make the `echo' builtin expand backslash-escaped characters by
default, without requiring the `-e' option. This sets the default
value of the `xpg_echo' shell option to `on', which makes the Bash
`echo' behave more like the version specified in the Single Unix
Specification, version 2. *Note Bash Builtins::, for a
description of the escape sequences that `echo' recognizes.
The file `config-top.h' contains C Preprocessor `#define' statements
for options which are not settable from `configure'. Some of these are
not meant to be changed; beware of the consequences if you do. Read
the comments associated with each definition for more information about

105
MANIFEST
View file

@ -11,18 +11,21 @@ cross-build d
doc d
examples d
examples/bashdb d
examples/complete d
examples/functions d
examples/scripts d
examples/scripts.v2 d
examples/scripts.noah d
examples/startup-files d
examples/startup-files/apple d
examples/misc d
examples/loadables d
examples/loadables/perl d
include d
lib d
lib/glob d
lib/glob/doc d
lib/malloc d
lib/posixheaders d
lib/readline d
lib/readline/doc d
lib/readline/examples d
@ -90,6 +93,8 @@ bracecomp.c f
nojobs.c f
error.c f
xmalloc.c f
pcomplete.c f
pcomplib.c f
alias.h f
builtins.h f
bashhist.h f
@ -97,8 +102,6 @@ bashline.h f
variables.h f
array.h f
jobs.h f
maxpath.h f
filecntl.h f
findcmd.h f
hashlib.h f
quit.h f
@ -106,6 +109,7 @@ flags.h f
shell.h f
pathexp.h f
parser.h f
pcomplete.h f
sig.h f
test.h f
trap.h f
@ -120,7 +124,6 @@ subst.h f
dispose_cmd.h f
hashcmd.h f
bashansi.h f
bashtty.h f
bashjmp.h f
bashintl.h f
make_cmd.h f
@ -131,14 +134,6 @@ mailcheck.h f
pathnames.h f
y.tab.c f
y.tab.h f
posixdir.h f
posixjmp.h f
posixstat.h f
posixwait.h f
unionwait.h f
stdc.h f
ansi_stdlib.h f
memalloc.h f
parser-built f
builtins/ChangeLog f
builtins/Makefile.in f
@ -149,6 +144,7 @@ builtins/builtin.def f
builtins/cd.def f
builtins/colon.def f
builtins/command.def f
builtins/complete.def f
builtins/common.c f
builtins/declare.def f
builtins/echo.def f
@ -199,6 +195,19 @@ cross-build/win32sig.h f
cross-build/x86-beos.cache f
cross-build/beos-sig.h f
cross-build/opennt.cache f
include/ansi_stdlib.h f
include/filecntl.h f
include/maxpath.h f
include/memalloc.h f
include/posixdir.h f
include/posixjmp.h f
include/posixstat.h f
include/posixtime.h f
include/posixwait.h f
include/shtty.h f
include/stdc.h f
include/systimes.h f
include/unionwait.h f
lib/glob/ChangeLog f
lib/glob/Makefile.in f
lib/glob/fnmatch.c f
@ -220,13 +229,6 @@ lib/malloc/omalloc.c f
lib/malloc/stub.c f
lib/malloc/i386-alloca.s f
lib/malloc/x386-alloca.s f
lib/posixheaders/posixdir.h f
lib/posixheaders/posixjmp.h f
lib/posixheaders/posixstat.h f
lib/posixheaders/ansi_stdlib.h f
lib/posixheaders/stdc.h f
lib/posixheaders/memalloc.h f
lib/posixheaders/filecntl.h f
lib/readline/COPYING f
lib/readline/Makefile.in f
lib/readline/ChangeLog f
@ -265,6 +267,7 @@ lib/readline/tilde.c f
lib/readline/tilde.h f
lib/readline/rldefs.h f
lib/readline/rlconf.h f
lib/readline/rlshell.h f
lib/readline/rltty.h f
lib/readline/rlwinsize.h f
lib/readline/readline.h f
@ -278,15 +281,19 @@ lib/readline/posixjmp.h f
lib/readline/posixstat.h f
lib/readline/ansi_stdlib.h f
lib/readline/rlstdc.h f
lib/readline/rlprivate.h f
lib/readline/xmalloc.h f
lib/readline/doc/Makefile f
lib/readline/doc/manvers.texinfo f
lib/readline/doc/rlman.texinfo f
lib/readline/doc/rltech.texinfo f
lib/readline/doc/rluser.texinfo f
lib/readline/doc/rluserman.texinfo f
lib/readline/doc/hist.texinfo f
lib/readline/doc/hstech.texinfo f
lib/readline/doc/hsuser.texinfo f
lib/readline/examples/Makefile f
lib/readline/examples/excallback.c f
lib/readline/examples/fileman.c f
lib/readline/examples/manexamp.c f
lib/readline/examples/histexamp.c f
@ -295,19 +302,31 @@ lib/readline/examples/rl.c f
lib/readline/examples/Inputrc f
lib/sh/Makefile.in f
lib/sh/clktck.c f
lib/sh/clock.c f
lib/sh/getcwd.c f
lib/sh/getenv.c f
lib/sh/inet_aton.c f
lib/sh/itos.c f
lib/sh/makepath.c f
lib/sh/netopen.c f
lib/sh/oslib.c f
lib/sh/rename.c f
lib/sh/setlinebuf.c f
lib/sh/shquote.c f
lib/sh/shtty.c f
lib/sh/strcasecmp.c f
lib/sh/strerror.c f
lib/sh/strpbrk.c f
lib/sh/strtod.c f
lib/sh/strtol.c f
lib/sh/strtoul.c f
lib/sh/times.c f
lib/sh/timeval.c f
lib/sh/vprint.c f
lib/sh/zread.c f
lib/sh/zwrite.c f
lib/termcap/Makefile.in f
lib/termcap/ltcap.h f
lib/termcap/termcap.c f
lib/termcap/termcap.h f
lib/termcap/tparam.c f
@ -353,13 +372,14 @@ doc/FAQ f
doc/Makefile.in f
doc/bash.1 f
doc/bashbug.1 f
doc/builtins.1 f
doc/rbash.1 f
doc/README f
doc/INTRO f
doc/readline.3 f
doc/texinfo.tex f
doc/bashref.texi f
doc/bashref.info f
doc/builtins.1 f
doc/article.ms f
doc/htmlpost.sh f 755
support/Makefile.in f
@ -391,6 +411,7 @@ examples/bashdb/README f
examples/bashdb/bashdb f
examples/bashdb/bashdb.fns f
examples/bashdb/bashdb.pre f
examples/complete/complete-examples f
examples/loadables/README f
examples/loadables/template.c f
examples/loadables/Makefile.in f
@ -419,6 +440,11 @@ examples/loadables/sync.c f
examples/loadables/mkdir.c f
examples/loadables/ln.c f
examples/loadables/unlink.c f
examples/loadables/perl/Makefile.in f
examples/loadables/perl/README f
examples/loadables/perl/bperl.c f
examples/loadables/perl/iperl.c f
examples/functions/array-stuff f
examples/functions/autoload f
examples/functions/autoload.v2 f
examples/functions/autoload.v3 f
@ -440,6 +466,7 @@ examples/functions/isnum2 f
examples/functions/jdate.bash f
examples/functions/jj.bash f
examples/functions/keep f
examples/functions/ksh-compat-test f
examples/functions/kshenv f
examples/functions/login f
examples/functions/lowercase f
@ -460,12 +487,15 @@ examples/functions/whatis f
examples/functions/whence f
examples/functions/which f
examples/functions/xalias.bash f
examples/functions/xfind.bash f
examples/scripts/adventure.sh f
examples/scripts/bcsh.sh f
examples/scripts/center f
examples/scripts/fixfiles.bash f
examples/scripts/hanoi.bash f
examples/scripts/inpath f
examples/scripts/krand.bash f
examples/scripts/line-input.bash f
examples/scripts/nohup.bash f
examples/scripts/precedence f
examples/scripts/randomcard.bash f
@ -477,6 +507,9 @@ examples/scripts/spin.bash f
examples/scripts/timeout f
examples/scripts/vtree2 f
examples/scripts/vtree3 f
examples/scripts/vtree3a f
examples/scripts/websrv.sh f
examples/scripts/xterm_title f
examples/scripts/zprintf f
examples/startup-files/README f
examples/startup-files/Bashrc.bfox f
@ -484,11 +517,20 @@ examples/startup-files/Bash_aliases f
examples/startup-files/Bash_profile f
examples/startup-files/bash-profile f
examples/startup-files/bashrc f
examples/startup-files/apple/README f
examples/startup-files/apple/aliases f
examples/startup-files/apple/bash.defaults f
examples/startup-files/apple/environment f
examples/startup-files/apple/login f
examples/startup-files/apple/logout f
examples/startup-files/apple/rc f
examples/misc/suncmd.termcap f
examples/misc/aliasconv.sh f
examples/misc/aliasconv.bash f
examples/misc/cshtobash f
tests/README f
tests/arith-for.tests f
tests/arith-for.right f
tests/arith.tests f
tests/arith.right f
tests/array.tests f
@ -499,7 +541,8 @@ tests/braces-tests f
tests/braces.right f
tests/builtins.tests f
tests/builtins.right f
tests/builtins.sub1 f
tests/builtins1.sub f
tests/builtins2.sub f
tests/source1.sub f
tests/source2.sub f
tests/source3.sub f
@ -528,8 +571,11 @@ tests/exp-tests f
tests/exp.right f
tests/extglob.tests f
tests/extglob.right f
tests/extglob2.tests f
tests/extglob2.right f
tests/func.tests f
tests/func.right f
tests/func1.sub f
tests/getopts.tests f
tests/getopts.right f
tests/getopts1.sub f
@ -558,15 +604,19 @@ tests/ifs-3.right f
tests/input-line.sh f
tests/input-line.sub f
tests/input.right f
tests/invert.tests f
tests/invert.right f
tests/jobs.tests f
tests/jobs1.sub f
tests/jobs2.sub f
tests/jobs3.sub f
tests/jobs.right f
tests/more-exp.tests f
tests/more-exp.right f
tests/new-exp.tests f
tests/new-exp1.sub f
tests/new-exp2.sub f
tests/new-exp3.sub f
tests/new-exp.right f
tests/nquote.tests f
tests/nquote.right f
@ -582,6 +632,9 @@ tests/quote.tests f
tests/quote.right f
tests/read.tests f
tests/read.right f
tests/read1.sub f
tests/read2.sub f
tests/read3.sub f
tests/redir.tests f
tests/redir.right f
tests/redir1.sub f
@ -597,6 +650,7 @@ tests/rsh.tests f
tests/rsh.right f
tests/run-all f
tests/run-minimal f
tests/run-arith-for f
tests/run-arith f
tests/run-array f
tests/run-array2 f
@ -610,6 +664,7 @@ tests/run-errors f
tests/run-execscript f
tests/run-exp-tests f
tests/run-extglob f
tests/run-extglob2 f
tests/run-func f
tests/run-getopts f
tests/run-glob-test f
@ -618,6 +673,7 @@ tests/run-histexpand f
tests/run-history f
tests/run-ifs-tests f
tests/run-input-test f
tests/run-invert f
tests/run-jobs f
tests/run-more-exp f
tests/run-new-exp f
@ -645,7 +701,7 @@ tests/shopt.tests f
tests/shopt.right f
tests/strip.tests f
tests/strip.right f
tests/test-tests f
tests/test.tests f
tests/test.right f
tests/tilde-tests f
tests/tilde.right f
@ -658,8 +714,10 @@ tests/varenv.right f
tests/varenv.sh f
tests/version f
tests/version.mini f
tests/misc/perftest f
tests/misc/dev-tcp.tests f
tests/misc/perf-script f
tests/misc/perftest f
tests/misc/read-nchars.tests f
tests/misc/redir-t2.sh f
tests/misc/run-r2.sh f
tests/misc/sigint-1.sh f
@ -668,6 +726,7 @@ tests/misc/sigint-3.sh f
tests/misc/sigint-4.sh f
tests/misc/test-minus-e.1 f
tests/misc/test-minus-e.2 f
tests/misc/wait-bg.tests f
examples/scripts.v2/PERMISSION f
examples/scripts.v2/README f
examples/scripts.v2/arc2tarz f

View file

@ -1,5 +1,21 @@
# Makefile for bash-2.03, version 2.103
# Makefile for bash-2.04, version 2.115
#
# Copyright (C) 1996 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
# Make sure the first target in the makefile is the right one
all: .made
@ -20,6 +36,8 @@ man1dir = $(mandir)/$(manpfx)$(man1ext)
man3ext = 3
man3dir = $(mandir)/$(manpfx)$(man3ext)
htmldir = @htmldir@
topdir = @top_srcdir@
BUILD_DIR = @BUILD_DIR@
srcdir = @srcdir@
@ -40,9 +58,7 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALLMODE= -m 0755
COMPRESS = gzip
COMPRESS_EXT = .gz
INSTALLMODE2 = -m 0555
TESTSCRIPT = @TESTSCRIPT@
@ -58,7 +74,8 @@ PURIFY = @PURIFY@
$(CC) $(CCFLAGS) -c $<
# The name of this program and some version information.
Program = bash
EXEEXT = @EXEEXT@
Program = bash$(EXEEXT)
Version = @BASHVERS@
PatchLevel = @BASHPATCH@
RELSTATUS = release
@ -93,7 +110,7 @@ SYSTEM_FLAGS = -DPROGRAM='"$(Program)"' -DCONF_HOSTTYPE='"$(Machine)"' -DCONF_OS
CCFLAGS = $(PROFILE_FLAGS) $(SYSTEM_FLAGS) $(LOCAL_DEFS) \
$(DEFS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS)
INCLUDES = -I. @RL_INCLUDE@ -I$(srcdir) -I$(LIBSRC) -I$(includedir)
INCLUDES = -I. @RL_INCLUDE@ -I$(srcdir) -I$(BASHINCDIR) -I$(LIBSRC) -I$(includedir)
GCC_LINT_FLAGS = -ansi -Wall -Wshadow -Wpointer-arith -Wcast-qual \
-Wwrite-strings -Werror -Wstrict-prototypes \
@ -124,7 +141,12 @@ SHLIB_SOURCE = ${SH_LIBSRC}/clktck.c ${SH_LIBSRC}/getcwd.c \
${SH_LIBSRC}/strcasecmp.c ${SH_LIBSRC}/strerror.c \
${SH_LIBSRC}/strtod.c ${SH_LIBSRC}/strtol.c \
${SH_LIBSRC}/strtoul.c ${SH_LIBSRC}/vprint.c \
${SH_LIBSRC}/itos.c ${SH_LIBSRC}/rename.c
${SH_LIBSRC}/itos.c ${SH_LIBSRC}/rename.c \
${SH_LIBSRC}/zread.c ${SH_LIBSRC}/zwrite.c \
${SH_LIBSRC}/shtty.c ${SH_LIBSRC}/inet_aton.c \
${SH_LIBSRC}/netopen.c ${SH_LIBSRC}/strpbrk.c \
${SH_LIBSRC}/timeval.c ${SH_LIBSRC}/clock.c \
${SH_LIBSRC}/makepath.c
SHLIB_LIB = -lsh
SHLIB_LIBNAME = libsh.a
@ -149,7 +171,8 @@ READLINE_SOURCE = $(RL_LIBSRC)/rldefs.h $(RL_LIBSRC)/rlconf.h \
$(RL_LIBSRC)/chardefs.h $(RL_LIBSRC)/keymaps.h \
$(RL_LIBSRC)/history.h $(RL_LIBSRC)/histlib.h \
$(RL_LIBSRC)/posixstat.h $(RL_LIBSRC)/tilde.h \
$(RL_LIBSRC)/rlstdc.h \
$(RL_LIBSRC)/rlstdc.h ${RL_LIBSRC}/xmalloc.h \
$(RL_LIBSRC)/rlshell.h ${RL_LIBSRC}/rlprivate.h \
$(RL_LIBSRC)/funmap.c $(RL_LIBSRC)/emacs_keymap.c \
$(RL_LIBSRC)/search.c $(RL_LIBSRC)/vi_keymap.c \
$(RL_LIBSRC)/keymaps.c $(RL_LIBSRC)/parens.c \
@ -263,9 +286,14 @@ $(MALLOC_LIBRARY): ${MALLOC_SOURCE}
$(MAKE) $(MFLAGS) \
MALLOC_CFLAGS="$(MALLOC_CFLAGS)" ${MALLOC_TARGET} ) || exit 1
BASHPOSIX_LIB = $(LIBSRC)/posixheaders
BASHPOSIX_SUPPORT = $(BASHPOSIX_LIB)/posixstat.h $(BASHPOSIX_LIB)/ansi_stdlib.h \
$(BASHPOSIX_LIB)/memalloc.h $(BASHPOSIX_LIB)/stdc.h
BASHINCDIR = ${srcdir}/include
BASHINCFILES = $(BASHINCDIR)/posixstat.h $(BASHINCDIR)/ansi_stdlib.h \
$(BASHINCDIR)/filecntl.h $(BASHINCDIR)/posixdir.h \
$(BASHINCDIR)/memalloc.h $(BASHINCDIR)/stdc.h \
$(BASHINCDIR)/posixjmp.h $(BASHINCDIR)/posixwait.h \
$(BASHINCDIR)/posixtime.h $(BASHINCDIR)/systimes.h \
$(BASHINCDIR)/unionwait.h $(BASHINCDIR)/maxpath.h \
$(BASHINCDIR)/shtty.h
LIBRARIES = $(READLINE_LIB) $(HISTORY_LIB) $(TERMCAP_LIB) $(GLOB_LIB) \
$(TILDE_LIB) $(MALLOC_LIB) $(SHLIB_LIB) $(LOCAL_LIBS)
@ -287,16 +315,17 @@ CSOURCES = shell.c eval.c parse.y general.c make_cmd.c print_cmd.c y.tab.c \
test.c trap.c alias.c jobs.c nojobs.c $(ALLOC_FILES) braces.c \
input.c bashhist.c array.c sig.c pathexp.c \
unwind_prot.c siglist.c bashline.c bracecomp.c error.c \
list.c stringlib.c locale.c findcmd.c redir.c xmalloc.c
list.c stringlib.c locale.c findcmd.c redir.c \
pcomplete.c pcomplib.c xmalloc.c
HSOURCES = shell.h flags.h trap.h hashcmd.h hashlib.h jobs.h builtins.h \
general.h variables.h config.h $(ALLOC_HEADERS) alias.h maxpath.h \
quit.h posixdir.h posixstat.h filecntl.h unwind_prot.h ansi_stdlib.h \
general.h variables.h config.h $(ALLOC_HEADERS) alias.h \
quit.h unwind_prot.h \
command.h input.h error.h bashansi.h dispose_cmd.h make_cmd.h \
subst.h externs.h siglist.h bashhist.h bashline.h bashtypes.h \
array.h sig.h mailcheck.h bashtty.h bashintl.h bashjmp.h ${GRAM_H} \
posixwait.h execute_cmd.h memalloc.h parser.h pathexp.h pathnames.h \
posixjmp.h stdc.h unionwait.h $(BASHPOSIX_SUPPORT)
array.h sig.h mailcheck.h bashintl.h bashjmp.h ${GRAM_H} \
execute_cmd.h parser.h pathexp.h pathnames.h pcomplete.h \
$(BASHINCFILES)
SOURCES = $(CSOURCES) $(HSOURCES) $(BUILTIN_DEFS)
@ -312,7 +341,8 @@ OBJECTS = shell.o eval.o y.tab.o general.o make_cmd.o print_cmd.o $(GLOBO) \
expr.o flags.o $(JOBS_O) subst.o hashcmd.o hashlib.o mailcheck.o \
trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o \
alias.o array.o braces.o bracecomp.o bashhist.o bashline.o \
siglist.o list.o stringlib.o locale.o findcmd.o redir.o xmalloc.o
siglist.o list.o stringlib.o locale.o findcmd.o redir.o \
pcomplete.o pcomplib.o xmalloc.o
# Where the source code of the shell builtins resides.
BUILTIN_SRCDIR=$(srcdir)/builtins
@ -322,7 +352,8 @@ DEFDIR = $(dot)/builtins
BUILTIN_DEFS = $(DEFSRC)/alias.def $(DEFSRC)/bind.def $(DEFSRC)/break.def \
$(DEFSRC)/builtin.def $(DEFSRC)/cd.def $(DEFSRC)/colon.def \
$(DEFSRC)/command.def $(DEFSRC)/declare.def \
$(DEFSRC)/command.def ${DEFSRC}/complete.def \
$(DEFSRC)/declare.def \
$(DEFSRC)/echo.def $(DEFSRC)/enable.def $(DEFSRC)/eval.def \
$(DEFSRC)/exec.def $(DEFSRC)/exit.def $(DEFSRC)/fc.def \
$(DEFSRC)/fg_bg.def $(DEFSRC)/hash.def $(DEFSRC)/help.def \
@ -370,16 +401,17 @@ SIGNAMES_SUPPORT = $(SUPPORT_SRC)mksignames.c
SUPPORT_SRC = $(srcdir)/support/
SDIR = $(dot)/support/
TESTS_SUPPORT = recho zecho printenv
CREATED_SUPPORT = signames.h recho zecho printenv tests/recho tests/zecho \
tests/printenv mksignames lsignames.h
TESTS_SUPPORT = recho$(EXEEXT) zecho$(EXEEXT) printenv$(EXEEXT)
CREATED_SUPPORT = signames.h recho$(EXEEXT) zecho$(EXEEXT) printenv$(EXEEXT) \
tests/recho$(EXEEXT) tests/zecho$(EXEEXT) \
tests/printenv$(EXEEXT) mksignames$(EXEEXT) lsignames.h
CREATED_CONFIGURE = config.h config.cache config.status config.log \
stamp-h
CREATED_MAKEFILES = Makefile builtins/Makefile doc/Makefile \
lib/readline/Makefile lib/glob/Makefile \
lib/sh/Makefile lib/tilde/Makefile lib/malloc/Makefile \
lib/termcap/Makefile examples/loadables/Makefile \
support/Makefile
examples/loadables/perl/Makefile support/Makefile
# Keep GNU Make from exporting the entire environment for small machines.
.NOEXPORT:
@ -421,7 +453,7 @@ version.h: $(SOURCES) config.h Makefile
# old rules
GRAM_H = parser-built
y.tab.o: y.tab.c ${GRAM_H} command.h stdc.h input.h
y.tab.o: y.tab.c ${GRAM_H} command.h ${BASHINCDIR}/stdc.h input.h
${GRAM_H}: y.tab.h
@-if test -f y.tab.h ; then \
cmp -s $@ y.tab.h 2>/dev/null || cp -p y.tab.h $@; \
@ -433,7 +465,7 @@ y.tab.c y.tab.h: parse.y
# experimental new rules - work with GNU make but not BSD (or OSF) make
#y.tab.o: y.tab.c y.tab.h
#y.tab.c y.tab.h: parse.y command.h stdc.h input.h
#y.tab.c y.tab.h: parse.y command.h ${BASHINCDIR}/stdc.h input.h
# -if test -f y.tab.h; then mv -f y.tab.h old-y.tab.h; fi
# $(YACC) -d $(srcdir)/parse.y
# -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; fi
@ -468,12 +500,12 @@ $(SHLIB_LIBRARY): config.h ${SHLIB_SOURCE}
@(cd ${SH_LIBDIR} && \
$(MAKE) $(MFLAGS) ${SHLIB_LIBNAME}) || exit 1
mksignames: $(SUPPORT_SRC)mksignames.c
mksignames$(EXEEXT): $(SUPPORT_SRC)mksignames.c
$(CC_FOR_BUILD) $(CCFLAGS) $(CPPFLAGS) -o $@ $(SUPPORT_SRC)mksignames.c
# make a list of signals for the local system -- this is done when we're
# *not* cross-compiling
lsignames.h: mksignames
lsignames.h: mksignames$(EXEEXT)
$(RM) $@
./mksignames $@
@ -481,7 +513,7 @@ lsignames.h: mksignames
signames.h: $(SIGNAMES_H)
-if cmp -s $(SIGNAMES_H) $@ ; then :; else $(RM) $@ ; $(CP) $(SIGNAMES_H) $@ ; fi
$(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h memalloc.h
$(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h ${BASHINCDIR}/memalloc.h
@(cd $(DEFDIR) && $(MAKE) $(MFLAGS) libbuiltins.a ) || exit 1
# these require special rules to circumvent make builtin rules
@ -550,11 +582,11 @@ installdirs:
install: .made installdirs
$(INSTALL_PROGRAM) $(INSTALLMODE) $(Program) $(bindir)/$(Program)
$(INSTALL_PROGRAM) $(INSTALLMODE) bashbug $(bindir)/bashbug
$(INSTALL_PROGRAM) $(INSTALLMODE2) bashbug $(bindir)/bashbug
-( cd $(DOCDIR) ; $(MAKE) $(MFLAGS) \
man1dir=$(man1dir) man1ext=$(man1ext) \
man3dir=$(man3dir) man3ext=$(man3ext) \
infodir=$(infodir) $@ )
infodir=$(infodir) htmldir=$(htmldir) $@ )
install-strip:
$(MAKE) $(MFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
@ -624,13 +656,13 @@ maintainer-clean: basic-clean
$(RM) $(CREATED_CONFIGURE) $(CREATED_MAKEFILES)
$(RM) $(CREATED_SUPPORT) Makefile
recho: $(SUPPORT_SRC)recho.c
recho$(EXEEXT): $(SUPPORT_SRC)recho.c
@$(CC) $(CCFLAGS) -o $@ $(SUPPORT_SRC)recho.c
zecho: $(SUPPORT_SRC)zecho.c
zecho$(EXEEXT): $(SUPPORT_SRC)zecho.c
@$(CC) $(CCFLAGS) -o $@ $(SUPPORT_SRC)zecho.c
printenv: $(SUPPORT_SRC)printenv.c
printenv$(EXEEXT): $(SUPPORT_SRC)printenv.c
@$(CC) $(CCFLAGS) -o $@ $(SUPPORT_SRC)printenv.c
test tests check: force $(Program) $(TESTS_SUPPORT)
@ -645,13 +677,13 @@ symlinks:
dist: force
@echo Bash distributions are created using $(srcdir)/support/mkdist.
@echo Here is a sample of the necessary commands:
@echo $(Program) $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r ${Program} $(Version)
@echo tar cf $(Program)-$(Version).tar ${Program}-$(Version)
@echo gzip $(Program)-$(Version).tar
@echo $(Program) $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r ${Program} $(Version)-${RELSTATUS}
@echo tar cf $(Program)-$(Version)-${RELSTATUS}.tar ${Program}-$(Version)-${RELSTATUS}
@echo gzip $(Program)-$(Version)-${RELSTATUS}.tar
depend: depends
sdepend: force
depends: force
$(Program) $(SUPPORT_SRC)mkdep -c ${CC} -- ${CCFLAGS} ${CSOURCES}
############################ DEPENDENCIES ###############################
@ -674,213 +706,230 @@ builtins/exit.o: config-top.h
builtins/kill.o: config-top.h
# shell basics
copy_cmd.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
copy_cmd.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
copy_cmd.o: general.h bashtypes.h variables.h array.h hashlib.h
copy_cmd.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
copy_cmd.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
copy_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h
dispose_cmd.o: bashansi.h ansi_stdlib.h
dispose_cmd.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h
dispose_cmd.o: bashansi.h ${BASHINCDIR}/ansi_stdlib.h
dispose_cmd.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h
dispose_cmd.o: error.h general.h bashtypes.h variables.h array.h hashlib.h
dispose_cmd.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
dispose_cmd.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
dispose_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h
error.o: config.h bashtypes.h bashansi.h ansi_stdlib.h flags.h stdc.h error.h
error.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h flags.h ${BASHINCDIR}/stdc.h error.h
error.o: command.h general.h externs.h input.h bashhist.h
eval.o: config.h bashansi.h ansi_stdlib.h trap.h flags.h ${DEFSRC}/common.h
eval.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
eval.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h trap.h flags.h ${DEFSRC}/common.h
eval.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
eval.o: general.h bashtypes.h variables.h array.h hashlib.h
eval.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
eval.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
eval.o: make_cmd.h subst.h sig.h pathnames.h externs.h
eval.o: input.h execute_cmd.h
execute_cmd.o: config.h bashtypes.h filecntl.h posixstat.h bashansi.h ansi_stdlib.h
execute_cmd.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
execute_cmd.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
execute_cmd.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
execute_cmd.o: general.h bashtypes.h variables.h array.h hashlib.h
execute_cmd.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
execute_cmd.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
execute_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h
execute_cmd.o: memalloc.h ${GRAM_H} flags.h builtins.h jobs.h quit.h siglist.h
execute_cmd.o: ${BASHINCDIR}/memalloc.h ${GRAM_H} flags.h builtins.h jobs.h quit.h siglist.h
execute_cmd.o: execute_cmd.h findcmd.h redir.h trap.h test.h pathexp.h
execute_cmd.o: $(DEFSRC)/common.h ${DEFDIR}/builtext.h ${GLOB_LIBSRC}/fnmatch.h
expr.o: config.h bashansi.h ansi_stdlib.h
expr.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
execute_cmd.o: ${BASHINCDIR}/posixtime.h
expr.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
expr.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
expr.o: general.h bashtypes.h variables.h array.h hashlib.h
expr.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
expr.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
expr.o: make_cmd.h subst.h sig.h pathnames.h externs.h
findcmd.o: config.h bashtypes.h filecntl.h posixstat.h bashansi.h
findcmd.o: ansi_stdlib.h memalloc.h shell.h bashjmp.h posixjmp.h command.h
findcmd.o: stdc.h error.h general.h variables.h quit.h maxpath.h unwind_prot.h
findcmd.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h ${BASHINCDIR}/posixstat.h bashansi.h
findcmd.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/memalloc.h shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h
findcmd.o: ${BASHINCDIR}/stdc.h error.h general.h variables.h quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h
findcmd.o: dispose_cmd.h make_cmd.h subst.h sig.h pathnames.h externs.h
findcmd.o: flags.h hashlib.h pathexp.h hashcmd.h
flags.o: config.h flags.h
flags.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
flags.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
flags.o: general.h bashtypes.h variables.h array.h hashlib.h
flags.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
flags.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
flags.o: make_cmd.h subst.h sig.h pathnames.h externs.h
general.o: config.h bashtypes.h posixstat.h filecntl.h bashansi.h ansi_stdlib.h
general.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
general.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
general.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
general.o: general.h bashtypes.h variables.h array.h hashlib.h
general.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
general.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
general.o: make_cmd.h subst.h sig.h pathnames.h externs.h
general.o: maxpath.h
hashcmd.o: config.h posixstat.h bashtypes.h bashansi.h ansi_stdlib.h
hashcmd.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
general.o: ${BASHINCDIR}/maxpath.h ${BASHINCDIR}/posixtime.h
hashcmd.o: config.h ${BASHINCDIR}/posixstat.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
hashcmd.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
hashcmd.o: general.h bashtypes.h variables.h array.h hashcmd.h
hashcmd.o: execute_cmd.h findcmd.h stdc.h
hashlib.o: config.h bashansi.h ansi_stdlib.h
hashlib.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
hashcmd.o: execute_cmd.h findcmd.h ${BASHINCDIR}/stdc.h
hashlib.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
hashlib.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
hashlib.o: general.h bashtypes.h variables.h array.h hashlib.h
hashlib.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
hashlib.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
hashlib.o: make_cmd.h subst.h sig.h pathnames.h externs.h
input.o: config.h bashtypes.h filecntl.h posixstat.h bashansi.h ansi_stdlib.h
input.o: command.h stdc.h general.h input.h error.h externs.h
list.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
input.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
input.o: command.h ${BASHINCDIR}/stdc.h general.h input.h error.h externs.h
list.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
list.o: general.h bashtypes.h variables.h array.h hashlib.h
list.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
list.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
list.o: make_cmd.h subst.h sig.h pathnames.h externs.h
locale.o: config.h bashtypes.h bashintl.h bashansi.h ansi_stdlib.h
locale.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
locale.o: config.h bashtypes.h bashintl.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
locale.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
locale.o: general.h bashtypes.h variables.h array.h hashlib.h
locale.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
locale.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
locale.o: make_cmd.h subst.h sig.h pathnames.h externs.h
mailcheck.o: config.h bashtypes.h posixstat.h bashansi.h ansi_stdlib.h
mailcheck.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
mailcheck.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
mailcheck.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
mailcheck.o: general.h bashtypes.h variables.h array.h hashlib.h
mailcheck.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
mailcheck.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
mailcheck.o: make_cmd.h subst.h sig.h pathnames.h externs.h
mailcheck.o: execute_cmd.h mailcheck.h
make_cmd.o: config.h bashtypes.h filecntl.h bashansi.h
make_cmd.o: command.h stdc.h general.h error.h flags.h make_cmd.h
make_cmd.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h bashansi.h
make_cmd.o: command.h ${BASHINCDIR}/stdc.h general.h error.h flags.h make_cmd.h
make_cmd.o: variables.h array.h hashlib.h subst.h input.h externs.h
make_cmd.o: jobs.h quit.h siglist.h
y.tab.o: config.h bashtypes.h bashansi.h ansi_stdlib.h memalloc.h
y.tab.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
y.tab.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/memalloc.h
y.tab.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
y.tab.o: general.h bashtypes.h variables.h array.h hashlib.h
y.tab.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
y.tab.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
y.tab.o: make_cmd.h subst.h sig.h pathnames.h externs.h
y.tab.o: trap.h flags.h parser.h input.h mailcheck.h $(DEFSRC)/common.h
y.tab.o: $(DEFDIR)/builtext.h bashline.h bashhist.h jobs.h siglist.h alias.h
pathexp.o: config.h bashtypes.h bashansi.h ansi_stdlib.h
pathexp.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
pathexp.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
pathexp.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
pathexp.o: general.h bashtypes.h variables.h array.h hashlib.h
pathexp.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
pathexp.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
pathexp.o: make_cmd.h subst.h sig.h pathnames.h externs.h
pathexp.o: pathexp.h flags.h
pathexp.o: $(GLOB_LIBSRC)/glob.h $(GLOB_LIBSRC)/fnmatch.h
print_cmd.o: config.h bashansi.h ansi_stdlib.h
print_cmd.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
print_cmd.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
print_cmd.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
print_cmd.o: general.h bashtypes.h variables.h array.h hashlib.h
print_cmd.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
print_cmd.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
print_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h
print_cmd.o: ${GRAM_H} $(DEFSRC)/common.h
redir.o: config.h bashtypes.h posixstat.h bashansi.h ansi_stdlib.h filecntl.h
redir.o: memalloc.h shell.h bashjmp.h posixjmp.h command.h stdc.h error.h
redir.o: general.h variables.h array.h hashlib.h quit.h maxpath.h unwind_prot.h
redir.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/filecntl.h
redir.o: ${BASHINCDIR}/memalloc.h shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
redir.o: general.h variables.h array.h hashlib.h quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h
redir.o: dispose_cmd.h make_cmd.h subst.h sig.h pathnames.h externs.h
redir.o: flags.h execute_cmd.h redir.h input.h
shell.o: config.h bashtypes.h posixstat.h bashansi.h ansi_stdlib.h filecntl.h
shell.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
shell.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/filecntl.h
shell.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
shell.o: general.h bashtypes.h variables.h array.h hashlib.h
shell.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
shell.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
shell.o: make_cmd.h subst.h sig.h pathnames.h externs.h
shell.o: flags.h trap.h mailcheck.h builtins.h $(DEFSRC)/common.h
shell.o: jobs.h siglist.h input.h execute_cmd.h findcmd.h bashhist.h
shell.o: ${GLOB_LIBSRC}/fnmatch.h
sig.o: config.h bashtypes.h
sig.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
sig.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
sig.o: general.h bashtypes.h variables.h array.h hashlib.h
sig.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
sig.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
sig.o: make_cmd.h subst.h sig.h pathnames.h externs.h
sig.o: jobs.h siglist.h trap.h $(DEFSRC)/common.h bashline.h bashhist.h
siglist.o: config.h bashtypes.h siglist.h trap.h
stringlib.o: bashtypes.h
stringlib.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
stringlib.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
stringlib.o: general.h bashtypes.h variables.h array.h hashlib.h
stringlib.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
stringlib.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
stringlib.o: make_cmd.h subst.h sig.h pathnames.h externs.h
subst.o: config.h bashtypes.h bashansi.h ansi_stdlib.h posixstat.h
subst.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
subst.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/posixstat.h
subst.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
subst.o: general.h bashtypes.h variables.h array.h hashlib.h
subst.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
subst.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
subst.o: make_cmd.h subst.h sig.h pathnames.h externs.h
subst.o: flags.h jobs.h siglist.h execute_cmd.h filecntl.h trap.h pathexp.h
subst.o: flags.h jobs.h siglist.h execute_cmd.h ${BASHINCDIR}/filecntl.h trap.h pathexp.h
subst.o: mailcheck.h input.h $(DEFSRC)/getopt.h $(DEFSRC)/common.h
subst.o: bashline.h bashhist.h ${GLOB_LIBSRC}/fnmatch.h
test.o: bashtypes.h posixstat.h filecntl.h
test.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
test.o: bashtypes.h ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h
test.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
test.o: general.h bashtypes.h variables.h array.h hashlib.h
test.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
test.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
test.o: make_cmd.h subst.h sig.h pathnames.h externs.h test.h
test.o: ${DEFSRC}/common.h
trap.o: config.h bashtypes.h trap.h bashansi.h ansi_stdlib.h
trap.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
trap.o: config.h bashtypes.h trap.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
trap.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
trap.o: general.h bashtypes.h variables.h array.h hashlib.h
trap.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
trap.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
trap.o: make_cmd.h subst.h sig.h pathnames.h externs.h
trap.o: signames.h $(DEFSRC)/common.h
unwind_prot.o: config.h bashtypes.h bashansi.h ansi_stdlib.h command.h stdc.h
unwind_prot.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h command.h ${BASHINCDIR}/stdc.h
unwind_prot.o: general.h unwind_prot.h quit.h sig.h
variables.o: config.h bashtypes.h posixstat.h bashansi.h ansi_stdlib.h
variables.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
variables.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
variables.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
variables.o: general.h bashtypes.h variables.h array.h hashlib.h
variables.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
variables.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
variables.o: make_cmd.h subst.h sig.h pathnames.h externs.h
variables.o: flags.h execute_cmd.h mailcheck.h input.h $(DEFSRC)/common.h
variables.o: findcmd.h bashhist.h
variables.o: pcomplete.h
version.o: version.h .build
xmalloc.o: config.h bashtypes.h ansi_stdlib.h error.h
xmalloc.o: config.h bashtypes.h ${BASHINCDIR}/ansi_stdlib.h error.h
# job control
jobs.o: config.h bashtypes.h trap.h filecntl.h input.h bashtty.h
jobs.o: bashansi.h ansi_stdlib.h
jobs.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
jobs.o: config.h bashtypes.h trap.h ${BASHINCDIR}/filecntl.h input.h ${BASHINCDIR}/shtty.h
jobs.o: bashansi.h ${BASHINCDIR}/ansi_stdlib.h
jobs.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
jobs.o: general.h bashtypes.h variables.h array.h hashlib.h
jobs.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
jobs.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
jobs.o: make_cmd.h subst.h sig.h pathnames.h externs.h
jobs.o: jobs.h flags.h $(DEFSRC)/common.h $(DEFDIR)/builtext.h
nojobs.o: config.h bashtypes.h filecntl.h bashjmp.h posixjmp.h
nojobs.o: command.h stdc.h general.h jobs.h quit.h siglist.h externs.h
nojobs.o: sig.h error.h bashtty.h input.h
jobs.o: ${BASHINCDIR}/posixwait.h ${BASHINCDIR}/unionwait.h
nojobs.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h bashjmp.h ${BASHINCDIR}/posixjmp.h
nojobs.o: command.h ${BASHINCDIR}/stdc.h general.h jobs.h quit.h siglist.h externs.h
nojobs.o: sig.h error.h ${BASHINCDIR}/shtty.h input.h
# shell features that may be compiled in
array.o: config.h bashansi.h ansi_stdlib.h
array.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
array.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
array.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
array.o: general.h bashtypes.h variables.h array.h hashlib.h
array.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
array.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
array.o: make_cmd.h subst.h sig.h pathnames.h externs.h
array.o: $(DEFSRC)/common.h
braces.o: config.h bashansi.h ansi_stdlib.h
braces.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
braces.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
braces.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
braces.o: general.h bashtypes.h variables.h array.h hashlib.h
braces.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
braces.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
braces.o: make_cmd.h subst.h sig.h pathnames.h externs.h
alias.o: config.h bashansi.h ansi_stdlib.h command.h stdc.h
alias.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h command.h ${BASHINCDIR}/stdc.h
alias.o: general.h bashtypes.h externs.h alias.h
alias.o: pcomplete.h
pcomplib.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h bashtypes.h
pcomplib.o: ${BASHINCDIR}/stdc.h hashlib.h pcomplete.h shell.h
pcomplib.o: bashjmp.h command.h general.h error.h variables.h quit.h
pcomplib.o: unwind_prot.h dispose_cmd.h make_cmd.h subst.h sig.h pathnames.h
pcomplib.o: externs.h ${BASHINCDIR}/maxpath.h
pcomplete.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h bashtypes.h
pcomplete.o: ${BASHINCDIR}/stdc.h hashlib.h pcomplete.h shell.h
pcomplete.o: bashjmp.h command.h general.h error.h variables.h quit.h
pcomplete.o: unwind_prot.h dispose_cmd.h make_cmd.h subst.h sig.h pathnames.h
pcomplete.o: externs.h ${BASHINCDIR}/maxpath.h
# library support files
bashhist.o: config.h bashtypes.h bashansi.h ansi_stdlib.h posixstat.h
bashhist.o: filecntl.h
bashhist.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
bashhist.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/posixstat.h
bashhist.o: ${BASHINCDIR}/filecntl.h
bashhist.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
bashhist.o: general.h bashtypes.h variables.h array.h hashlib.h
bashhist.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
bashhist.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
bashhist.o: make_cmd.h subst.h sig.h pathnames.h externs.h
bashhist.o: flags.h input.h parser.h pathexp.h $(DEFSRC)/common.h bashline.h
bashhist.o: $(GLOB_LIBSRC)/fnmatch.h
bashline.o: config.h bashtypes.h posixstat.h bashansi.h ansi_stdlib.h
bashline.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
bashline.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
bashline.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
bashline.o: general.h bashtypes.h variables.h array.h hashlib.h
bashline.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
bashline.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
bashline.o: make_cmd.h subst.h sig.h pathnames.h externs.h
bashline.o: builtins.h bashhist.h bashline.h execute_cmd.h findcmd.h pathexp.h
bashline.o: $(DEFSRC)/common.h $(GLOB_LIBSRC)/glob.h alias.h
bracecomp.o: config.h bashansi.h ansi_stdlib.h
bracecomp.o: shell.h config.h bashjmp.h posixjmp.h command.h stdc.h error.h
bashline.o: pcomplete.h
bracecomp.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
bracecomp.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
bracecomp.o: general.h bashtypes.h variables.h array.h hashlib.h
bracecomp.o: quit.h maxpath.h unwind_prot.h dispose_cmd.h
bracecomp.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
bracecomp.o: make_cmd.h subst.h sig.h pathnames.h externs.h
bracecomp.o: shell.h bashjmp.h posixjmp.h sig.h command.h hashlib.h builtins.h general.h
bracecomp.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h command.h hashlib.h builtins.h general.h
bracecomp.o: quit.h alias.h config.h variables.h
bracecomp.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
bracecomp.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
# library dependencies
@ -910,183 +959,191 @@ variables.o: $(TILDE_LIBSRC)/tilde.h
# XXX - dependencies checked through here
# builtin c sources
builtins/bashgetopt.o: config.h bashansi.h ansi_stdlib.h
builtins/bashgetopt.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
builtins/bashgetopt.o: shell.h config.h bashjmp.h command.h general.h error.h
builtins/bashgetopt.o: variables.h quit.h maxpath.h unwind_prot.h dispose_cmd.h
builtins/bashgetopt.o: variables.h quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
builtins/bashgetopt.o: make_cmd.h subst.h sig.h pathnames.h externs.h
builtins/bashgetopt.o: $(DEFSRC)/common.h
builtins/common.o: bashtypes.h posixstat.h bashansi.h ansi_stdlib.h
builtins/common.o: shell.h config.h bashjmp.h posixjmp.h sig.h command.h
builtins/common.o: memalloc.h variables.h input.h siglist.h
builtins/common.o: quit.h unwind_prot.h maxpath.h jobs.h builtins.h
builtins/common.o: bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
builtins/common.o: shell.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h command.h
builtins/common.o: ${BASHINCDIR}/memalloc.h variables.h input.h siglist.h
builtins/common.o: quit.h unwind_prot.h ${BASHINCDIR}/maxpath.h jobs.h builtins.h
builtins/common.o: dispose_cmd.h make_cmd.h subst.h externs.h bashhist.h
builtins/common.o: execute_cmd.h stdc.h general.h error.h pathnames.h
builtins/common.o: execute_cmd.h ${BASHINCDIR}/stdc.h general.h error.h pathnames.h
builtins/common.o: ${DEFDIR}/builtext.h
builtins/evalfile.o: bashtypes.h posixstat.h filecntl.h bashansi.h ansi_stdlib.h
builtins/evalfile.o: bashtypes.h ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
builtins/evalfile.o: shell.h config.h bashjmp.h command.h general.h error.h
builtins/evalfile.o: variables.h quit.h maxpath.h unwind_prot.h dispose_cmd.h
builtins/evalfile.o: variables.h quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
builtins/evalfile.o: make_cmd.h subst.h sig.h pathnames.h externs.h
builtins/evalfile.o: jobs.h builtins.h flags.h input.h execute_cmd.h
builtins/evalfile.o: bashhist.h $(DEFSRC)/common.h
builtins/evalstring.o: config.h bashansi.h ansi_stdlib.h
builtins/evalstring.o: shell.h bashjmp.h posixjmp.h sig.h command.h siglist.h
builtins/evalstring.o: memalloc.h variables.h input.h
builtins/evalstring.o: quit.h unwind_prot.h maxpath.h jobs.h builtins.h
builtins/evalstring.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
builtins/evalstring.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h command.h siglist.h
builtins/evalstring.o: ${BASHINCDIR}/memalloc.h variables.h input.h
builtins/evalstring.o: quit.h unwind_prot.h ${BASHINCDIR}/maxpath.h jobs.h builtins.h
builtins/evalstring.o: dispose_cmd.h make_cmd.h subst.h externs.h
builtins/evalstring.o: jobs.h builtins.h flags.h input.h execute_cmd.h
builtins/evalstring.o: bashhist.h $(DEFSRC)/common.h
builtins/getopt.o: config.h memalloc.h
builtins/getopt.o: config.h ${BASHINCDIR}/memalloc.h
builtins/getopt.o: shell.h bashjmp.h command.h general.h error.h
builtins/getopt.o: variables.h quit.h maxpath.h unwind_prot.h dispose_cmd.h
builtins/getopt.o: variables.h quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
builtins/getopt.o: make_cmd.h subst.h sig.h pathnames.h externs.h
builtins/getopt.o: $(DEFSRC)/getopt.h
builtins/mkbuiltins.o: config.h bashtypes.h posixstat.h filecntl.h
builtins/mkbuiltins.o: bashansi.h ansi_stdlib.h
builtins/mkbuiltins.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h
builtins/mkbuiltins.o: bashansi.h ${BASHINCDIR}/ansi_stdlib.h
# builtin def files
builtins/alias.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/alias.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/alias.o: quit.h $(DEFSRC)/common.h
builtins/alias.o: shell.h bashjmp.h posixjmp.h sig.h command.h stdc.h unwind_prot.h
builtins/alias.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h command.h ${BASHINCDIR}/stdc.h unwind_prot.h
builtins/alias.o: dispose_cmd.h make_cmd.h subst.h externs.h variables.h
builtins/bind.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/bind.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/bind.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/bind.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/bind.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/bind.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/bind.o: $(DEFSRC)/bashgetopt.h
builtins/break.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/break.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/break.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/builtin.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/break.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/break.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/break.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/builtin.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/builtin.o: quit.h $(DEFSRC)/common.h
builtins/builtin.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/builtin.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/cd.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/cd.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/cd.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/builtin.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/builtin.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/cd.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/cd.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/cd.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/cd.o: $(DEFSRC)/common.h quit.h
builtins/command.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/command.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/command.o: quit.h $(DEFSRC)/bashgetopt.h
builtins/command.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/command.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/declare.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/declare.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/declare.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/echo.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/echo.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/echo.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/enable.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/enable.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/enable.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/eval.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/eval.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/eval.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/command.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/command.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/declare.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/declare.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/declare.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/echo.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/echo.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/echo.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/enable.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/enable.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/enable.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/enable.o: pcomplete.h
builtins/eval.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/eval.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/eval.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/exec.o: bashtypes.h
builtins/exec.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/exec.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/exec.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/exec.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/exec.o: dispose_cmd.h make_cmd.h subst.h externs.h execute_cmd.h
builtins/exec.o: findcmd.h flags.h quit.h $(DEFSRC)/common.h stdc.h
builtins/exec.o: findcmd.h flags.h quit.h $(DEFSRC)/common.h ${BASHINCDIR}/stdc.h
builtins/exit.o: bashtypes.h
builtins/exit.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/exit.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/exit.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/fc.o: bashtypes.h posixstat.h
builtins/fc.o: bashansi.h ansi_stdlib.h builtins.h command.h stdc.h
builtins/fc.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/fc.o: flags.h unwind_prot.h variables.h shell.h bashjmp.h posixjmp.h sig.h
builtins/fc.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h quit.h
builtins/exit.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/exit.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/exit.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/fc.o: bashtypes.h ${BASHINCDIR}/posixstat.h
builtins/fc.o: bashansi.h ${BASHINCDIR}/ansi_stdlib.h builtins.h command.h ${BASHINCDIR}/stdc.h
builtins/fc.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/fc.o: flags.h unwind_prot.h variables.h shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h
builtins/fc.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h quit.h
builtins/fc.o: $(DEFSRC)/bashgetopt.h bashhist.h
builtins/fg_bg.o: bashtypes.h
builtins/fg_bg.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/fg_bg.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/fg_bg.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/getopts.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/getopts.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/getopts.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/fg_bg.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/fg_bg.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/fg_bg.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/getopts.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/getopts.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/getopts.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/hash.o: bashtypes.h
builtins/hash.o: builtins.h command.h findcmd.h stdc.h $(DEFSRC)/common.h
builtins/hash.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/hash.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/help.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/help.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/help.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/hash.o: builtins.h command.h findcmd.h ${BASHINCDIR}/stdc.h $(DEFSRC)/common.h
builtins/hash.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/hash.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/help.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/help.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/help.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/help.o: $(GLOB_LIBSRC)/glob.h
builtins/history.o: bashtypes.h
builtins/history.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/history.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/history.o: filecntl.h shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h
builtins/history.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/history.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/history.o: ${BASHINCDIR}/filecntl.h shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h
builtins/history.o: bashhist.h variables.h
builtins/inlib.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/inlib.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/inlib.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/jobs.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/inlib.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/inlib.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h quit.h
builtins/inlib.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/jobs.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/jobs.o: quit.h $(DEFSRC)/bashgetopt.h
builtins/jobs.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/jobs.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/kill.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/kill.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/kill.o: shell.h bashjmp.h posixjmp.h sig.h trap.h unwind_prot.h variables.h
builtins/let.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/let.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/let.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/printf.o: config.h memalloc.h bashjmp.h command.h error.h
builtins/jobs.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/jobs.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/kill.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/kill.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/kill.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h trap.h unwind_prot.h variables.h
builtins/let.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/let.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/let.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/printf.o: config.h ${BASHINCDIR}/memalloc.h bashjmp.h command.h error.h
builtins/printf.o: general.h quit.h dispose_cmd.h make_cmd.h subst.h
builtins/printf.o: externs.h sig.h pathnames.h shell.h unwind_prot.h
builtins/printf.o: variables.h stdc.h $(DEFSRC)/bashgetopt.h
builtins/pushd.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/pushd.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/pushd.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/printf.o: variables.h ${BASHINCDIR}/stdc.h $(DEFSRC)/bashgetopt.h
builtins/pushd.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/pushd.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/pushd.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/pushd.o: $(DEFSRC)/common.h
builtins/read.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/read.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/read.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/return.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/return.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/return.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/set.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/set.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/set.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h flags.h
builtins/setattr.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/read.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/read.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/read.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/return.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/return.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/return.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/set.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/set.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/set.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h flags.h
builtins/setattr.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/setattr.o: quit.h $(DEFSRC)/common.h $(DEFSRC)/bashgetopt.h
builtins/setattr.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/setattr.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/shift.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/shift.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/shift.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/shift.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/shopt.o: command.h config.h memalloc.h error.h general.h
builtins/setattr.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/setattr.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/shift.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/shift.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/shift.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/shift.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/shopt.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h
builtins/shopt.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h
builtins/shopt.o: shell.h bashjmp.h posixjmp.h unwind_prot.h variables.h maxpath.h
builtins/shopt.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h unwind_prot.h variables.h ${BASHINCDIR}/maxpath.h
builtins/shopt.o: $(DEFSRC)/common.h $(DEFSRC)/bashgetopt.h
builtins/source.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/source.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/source.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/source.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/source.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/source.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/source.o: findcmd.h
builtins/suspend.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/suspend.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/suspend.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/test.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/test.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/test.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/suspend.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/suspend.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/suspend.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/test.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/test.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/test.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/test.o: test.h
builtins/times.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/times.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/times.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/trap.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/times.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/times.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/times.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/trap.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/trap.o: quit.h $(DEFSRC)/common.h
builtins/trap.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/trap.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/type.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/trap.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/trap.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/type.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/type.o: quit.h $(DEFSRC)/common.h findcmd.h
builtins/type.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/type.o: dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/ulimit.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/ulimit.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/ulimit.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/umask.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/umask.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/umask.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/wait.o: command.h config.h memalloc.h error.h general.h maxpath.h
builtins/wait.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h stdc.h
builtins/wait.o: shell.h bashjmp.h posixjmp.h sig.h unwind_prot.h variables.h
builtins/type.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/type.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/ulimit.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/ulimit.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/ulimit.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/umask.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/umask.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/umask.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/wait.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h ${BASHINCDIR}/maxpath.h
builtins/wait.o: quit.h dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/wait.o: shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h
builtins/complete.o: config.h shell.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h
builtins/complete.o: unwind_prot.h variables.h
builtins/complete.o: bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
builtins/complete.o: builtins.h
builtins/complete.o: pcomplete.h
builtins/complete.o: ${DEFSRC}/common.h ${DEFSRC}/bashgetopt.h
# builtin library dependencies
builtins/bind.o: $(RL_LIBSRC)/chardefs.h $(RL_LIBSRC)/readline.h
@ -1106,6 +1163,7 @@ builtins/builtin.o: $(DEFSRC)/builtin.def
builtins/cd.o: $(DEFSRC)/cd.def
builtins/colon.o: $(DEFSRC)/colon.def
builtins/command.o: $(DEFSRC)/command.def
builtins/complete.o: $(DEFSRC)/complete.def
builtins/declare.o: $(DEFSRC)/declare.def
builtins/echo.o: $(DEFSRC)/echo.def
builtins/enable.o: $(DEFSRC)/enable.def

108
NEWS
View file

@ -1,3 +1,111 @@
This is a terse description of the new features added to bash-2.04 since
the release of bash-2.03. As always, the manual page (doc/bash.1) is
the place to look for complete descriptions.
1. New Features in Bash
a. The history builtin has a `-d offset' option to delete the history entry
at position `offset'.
b. The prompt expansion code has two new escape sequences: \j, the number of
active jobs; and \l, the basename of the shell's tty device name.
c. The `bind' builtin has a new `-x' option to bind key sequences to shell
commands.
d. There is a new shell option, no_empty_command_completion, which, when
enabled, disables command completion when TAB is typed on an empty line.
e. The `help' builtin has a `-s' option to just print a builtin's usage
synopsis.
f. There are several new arithmetic operators: id++, id-- (variable
post-increment/decrement), ++id, --id (variabl pre-increment/decrement),
expr1 , expr2 (comma operator).
g. There is a new ksh-93 style arithmetic for command:
for ((expr1 ; expr2; expr3 )); do list; done
h. The `read' builtin has a number of new options:
-t timeout only wait timeout seconds for input
-n nchars only read nchars from input instead of a full line
-d delim read until delim rather than newline
-s don't echo input chars as they are read
i. The redirection code now handles several filenames specially:
/dev/fd/N, /dev/stdin, /dev/stdout, and /dev/stderr, whether or
not they are present in the file system.
j. The redirection code now recognizes pathnames of the form
/dev/tcp/host/port and /dev/udp/host/port, and tries to open a socket
of the appropriate type to the specified port on the specified host.
k. The ksh-93 ${!prefix*} expansion, which expands to the names of all
shell variables with prefix PREFIX, has been implemented.
l. There is a new dynamic variable, FUNCNAME, which expands to the name of
a currently-executing function. Assignments to FUNCNAME have no effect.
m. The GROUPS variable is no longer readonly; assignments to it are silently
discarded. This means it can be unset.
n. A new programmable completion facility, with two new builtin commands:
complete and compgen.
o. configure has a new option, `--enable-progcomp', to compile in the
programmable completion features (enabled by default).
p. `shopt' has a new option, `progcomp', to enable and disable programmable
completion at runtime.
q. Unsetting HOSTFILE now clears the list of hostnames used for completion.
r. configure has a new option, `--enable-bash-malloc', replacing the old
`--with-gnu-malloc' (which is still present for backwards compatibility).
s. There is a new manual page describing rbash, the restricted shell.
t. `bashbug' has new `--help' and `--version' options.
u. `shopt' has a new `xpg_echo' option, which controls the behavior of
`echo' with respect to backslash-escaped characters at runtime.
v. If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the
startup files, even if they are not interactive.
w. The LC_NUMERIC variable is now treated specially, and used to set the
LC_NUMERIC locale category for number formatting, e.g., when `printf'
displays floating-point numbers.
2. New features in Readline
a. Parentheses matching is now always compiled into readline, and enabled
or disabled when the value of the `blink-matching-paren' variable is
changed.
b. MS-DOS systems now use ~/_inputrc as the last-ditch inputrc filename.
c. MS-DOS systems now use ~/_history as the default history file.
d. history-search-{forward,backward} now leave the point at the end of the
line when the string to search for is empty, like
{reverse,forward}-search-history.
e. history-search-{forward,backward} now leave the last history line found
in the readline buffer if the second or subsequent search fails.
f. New function for use by applications: rl_on_new_line_with_prompt, used
when an application displays the prompt itself before calling readline().
g. New variable for use by applications: rl_already_prompted. An application
that displays the prompt itself before calling readline() must set this to
a non-zero value.
h. A new variable, rl_gnu_readline_p, always 1. The intent is that an
application can verify whether or not it is linked with the `real'
readline library or some substitute.
-------------------------------------------------------------------------------
This is a terse description of the new features added to bash-2.03 since
the release of bash-2.02. As always, the manual page (doc/bash.1) is
the place to look for complete descriptions.

12
NOTES
View file

@ -26,6 +26,10 @@ Platform-Specific Configuration and Operation Notes
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
If you are using GNU libc, especially on a linux system
(Configuring --without-gnu-malloc will still result in lib/malloc/libmalloc.a
@ -202,9 +206,13 @@ being built and linked against, but there is only a stub file in the archive.)
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.
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, or 7 is
complicated.
11. Building a statically-linked bash on Solaris 2.5.x or 2.6 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).

17
README
View file

@ -1,7 +1,7 @@
Introduction
============
This is GNU Bash, version 2.03. Bash is the GNU Project's Bourne
This is GNU Bash, version 2.04. Bash is the GNU Project's Bourne
Again SHell, a complete implementation of the POSIX.2 shell spec,
but also with interactive command line editing, job control on
architectures that support it, csh-like features such as history
@ -51,21 +51,20 @@ Reporting Bugs
Bug reports for bash should be sent to:
bug-bash@prep.ai.mit.edu
bug-bash@gnu.org
using the `bashbug' program that is built and installed at the same
time as bash.
The discussion list `bug-bash@prep.ai.mit.edu' often contains
information about new ports of Bash, or discussions of new features or
behavior changes that people would like. This mailing list is also
available as a usenet newsgroup: gnu.bash.bug.
The discussion list `bug-bash@gnu.org' often contains information
about new ports of Bash, or discussions of new features or behavior
changes that people would like. This mailing list is also available
as a usenet newsgroup: gnu.bash.bug.
When you send a bug report, please use the `bashbug' program that is
built at the same time as bash. If bash fails to build, try building
bashbug directly with `make bashbug'. If you cannot build `bashbug',
please send mail to bug-bash@prep.ai.mit.edu with the following
information:
please send mail to bug-bash@gnu.org with the following information:
* the version number and release status of Bash (e.g., 2.01-release)
* the machine and OS that it is running on (look at the file
@ -79,7 +78,7 @@ information:
The `bashbug' program includes much of this automatically.
If you would like to contact the Bash maintainers directly, send mail
to bash-maintainers@prep.ai.mit.edu.
to bash-maintainers@gnu.org.
While the Bash maintainers do not promise to fix all bugs, we would
like this shell to be the best that we can make it.

176
aclocal.m4 vendored
View file

@ -316,13 +316,19 @@ AC_CACHE_VAL(bash_cv_opendir_not_robust,
main()
{
DIR *dir;
int fd;
unlink("/tmp/not_a_directory");
fd = open("/tmp/not_a_directory", O_WRONLY|O_CREAT, 0666);
int fd, err;
err = mkdir("/tmp/bash-aclocal", 0700);
if (err < 0) {
perror("mkdir");
exit(1);
}
unlink("/tmp/bash-aclocal/not_a_directory");
fd = open("/tmp/bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666);
write(fd, "\n", 1);
close(fd);
dir = opendir("/tmp/not_a_directory");
unlink("/tmp/not_a_directory");
dir = opendir("/tmp/bash-aclocal/not_a_directory");
unlink("/tmp/bash-aclocal/not_a_directory");
rmdir("/tmp/bash-aclocal");
exit (dir == 0);
}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
[AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no)
@ -354,25 +360,59 @@ AC_DEFINE(VOID_SIGHANDLER)
fi
])
AC_DEFUN(BASH_TYPE_INT32_T,
dnl
dnl A signed 16-bit integer quantity
dnl
AC_DEFUN(BASH_TYPE_BITS16_T,
[
if test "$ac_cv_sizeof_int" = 4; then
AC_CHECK_TYPE(int32_t, int)
elif test "$ac_cv_sizeof_long" = 4; then
AC_CHECK_TYPE(int32_t, long)
if test "$ac_cv_sizeof_short" = 2; then
AC_CHECK_TYPE(bits16_t, short)
elif test "$ac_cv_sizeof_char" = 2; then
AC_CHECK_TYPE(bits16_t, char)
else
AC_CHECK_TYPE(int32_t, int)
AC_CHECK_TYPE(bits16_t, short)
fi
])
AC_DEFUN(BASH_TYPE_U_INT32_T,
dnl
dnl An unsigned 16-bit integer quantity
dnl
AC_DEFUN(BASH_TYPE_U_BITS16_T,
[
if test "$ac_cv_sizeof_short" = 2; then
AC_CHECK_TYPE(u_bits16_t, unsigned short)
elif test "$ac_cv_sizeof_char" = 2; then
AC_CHECK_TYPE(u_bits16_t, unsigned char)
else
AC_CHECK_TYPE(u_bits16_t, unsigned short)
fi
])
dnl
dnl A signed 32-bit integer quantity
dnl
AC_DEFUN(BASH_TYPE_BITS32_T,
[
if test "$ac_cv_sizeof_int" = 4; then
AC_CHECK_TYPE(u_int32_t, unsigned int)
AC_CHECK_TYPE(bits32_t, int)
elif test "$ac_cv_sizeof_long" = 4; then
AC_CHECK_TYPE(u_int32_t, unsigned long)
AC_CHECK_TYPE(bits32_t, long)
else
AC_CHECK_TYPE(u_int32_t, unsigned int)
AC_CHECK_TYPE(bits32_t, int)
fi
])
dnl
dnl An unsigned 32-bit integer quantity
dnl
AC_DEFUN(BASH_TYPE_U_BITS32_T,
[
if test "$ac_cv_sizeof_int" = 4; then
AC_CHECK_TYPE(u_bits32_t, unsigned int)
elif test "$ac_cv_sizeof_long" = 4; then
AC_CHECK_TYPE(u_bits32_t, unsigned long)
else
AC_CHECK_TYPE(u_bits32_t, unsigned int)
fi
])
@ -387,6 +427,9 @@ else
fi
])
dnl
dnl A signed 64-bit quantity
dnl
AC_DEFUN(BASH_TYPE_BITS64_T,
[
if test "$ac_sv_sizeof_char_p" = 8; then
@ -427,6 +470,20 @@ if test $bash_cv_func_lstat = yes; then
fi
])
AC_DEFUN(BASH_FUNC_INET_ATON,
[
AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton,
[AC_TRY_LINK([
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ],
bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)])
if test $bash_cv_func_inet_aton = yes; then
AC_DEFINE(HAVE_INET_ATON)
fi
])
AC_DEFUN(BASH_STRUCT_TERMIOS_LDISC,
[AC_MSG_CHECKING([for a c_line member of struct termios])
AC_CACHE_VAL(bash_cv_termios_ldisc,
@ -845,7 +902,7 @@ AC_CACHE_VAL(bash_cv_sys_named_pipes,
/* Add more tests in here as appropriate. */
main()
{
int fd;
int fd, err;
#if defined (HAVE_MKFIFO)
exit (0);
@ -858,12 +915,19 @@ exit (1);
#if defined (NeXT)
exit (1);
#endif
fd = mknod ("/tmp/sh-np-autoconf", 0666 | S_IFIFO, 0);
if (fd == -1)
err = mkdir("/tmp/bash-aclocal", 0700);
if (err < 0) {
perror ("mkdir");
exit(1);
}
fd = mknod ("/tmp/bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0);
if (fd == -1) {
rmdir ("/tmp/bash-aclocal");
exit (1);
}
close(fd);
unlink ("/tmp/sh-np-autoconf");
unlink ("/tmp/bash-aclocal/sh-np-autoconf");
rmdir ("/tmp/bash-aclocal");
exit(0);
}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
[AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing)
@ -1037,12 +1101,32 @@ elif test $bash_cv_dev_fd = "whacky"; then
fi
])
AC_DEFUN(BASH_CHECK_DEV_STDIN,
[AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)
AC_CACHE_VAL(bash_cv_dev_stdin,
[if test -d /dev/fd && test -r /dev/stdin; then
bash_cv_dev_stdin=present
elif test -d /proc/self/fd && test -r /dev/stdin; then
bash_cv_dev_stdin=present
else
bash_cv_dev_stdin=absent
fi
])
AC_MSG_RESULT($bash_cv_dev_stdin)
if test $bash_cv_dev_stdin = "present"; then
AC_DEFINE(HAVE_DEV_STDIN)
fi
])
dnl
dnl Check for the presence of getpeername (the only networking function
dnl bash currently requires) in libsocket. If libsocket is present,
dnl check for libnsl and add it to LIBS if it's there, since most
dnl systems with libsocket require linking with libnsl as well.
dnl This should only be called if getpeername was not found in libc.
dnl Check for the presence of getpeername in libsocket.
dnl If libsocket is present, check for libnsl and add it to LIBS if
dnl it's there, since most systems with libsocket require linking
dnl with libnsl as well. This should only be called if getpeername
dnl was not found in libc.
dnl
dnl NOTE: IF WE FIND GETPEERNAME, WE ASSUME THAT WE HAVE BIND/CONNECT
dnl AS WELL
dnl
AC_DEFUN(BASH_CHECK_SOCKLIB,
[
@ -1084,6 +1168,32 @@ if test $bash_cv_have_socklib = yes; then
fi
])
dnl
dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every
dnl system, we can't use AC_PREREQ
dnl
AC_DEFUN(BASH_FUNC_GETHOSTBYNAME,
[if test "X$bash_cv_have_gethostbyname" = "X"; then
_bash_needmsg=yes
else
AC_MSG_CHECKING(for gethostbyname in socket library)
_bash_needmsg=
fi
AC_CACHE_VAL(bash_cv_have_gethostbyname,
[AC_TRY_LINK([#include <netdb.h>],
[ struct hostent *hp;
hp = gethostbyname("localhost");
], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)]
)
if test "X$_bash_needmsg" = Xyes; then
AC_MSG_CHECKING(for gethostbyname in socket library)
fi
AC_MSG_RESULT($bash_cv_have_gethostbyname)
if test "$bash_cv_have_gethostbyname" = yes; then
AC_DEFINE(HAVE_GETHOSTBYNAME)
fi
])
AC_DEFUN(BASH_DEFAULT_MAIL_DIR,
[AC_MSG_CHECKING(for default mail directory)
AC_CACHE_VAL(bash_cv_mail_dir,
@ -1299,3 +1409,19 @@ switch (0) case 0: case (sizeof (off_t) <= 4):;
if test $bash_cv_off_t_64 = yes; then
AC_DEFINE(HAVE_OFF_T_64)
fi])
AC_DEFUN(BASH_STRUCT_TIMEVAL,
[AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
AC_CACHE_VAL(bash_cv_struct_timeval,
[
AC_EGREP_HEADER(struct timeval, sys/time.h,
bash_cv_struct_timeval=yes,
AC_EGREP_HEADER(struct timeval, time.h,
bash_cv_struct_timeval=yes,
bash_cv_struct_timeval=no))
])
AC_MSG_RESULT($bash_cv_struct_timeval)
if test $bash_cv_struct_timeval = yes; then
AC_DEFINE(HAVE_TIMEVAL)
fi
])

32
alias.c
View file

@ -7,7 +7,7 @@
Bash is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#include "config.h"
@ -37,6 +37,10 @@
#include "externs.h"
#include "alias.h"
#if defined (PROGRAMMABLE_COMPLETION)
# include "pcomplete.h"
#endif
static int qsort_alias_compare ();
/* Non-zero means expand all words on the line. Otherwise, expand
@ -121,6 +125,9 @@ add_alias (name, value)
elt = add_hash_item (savestring (name), aliases);
elt->data = (char *)temp;
#if defined (PROGRAMMABLE_COMPLETION)
set_itemlist_dirty (&it_aliases);
#endif
}
}
@ -155,6 +162,9 @@ remove_alias (name)
free_alias_data (elt->data);
free (elt->key); /* alias name */
free (elt); /* XXX */
#if defined (PROGRAMMABLE_COMPLETION)
set_itemlist_dirty (&it_aliases);
#endif
return (aliases->nentries);
}
return (-1);
@ -170,6 +180,9 @@ delete_all_aliases ()
flush_hash_table (aliases, free_alias_data);
dispose_hash_table (aliases);
aliases = (HASH_TABLE *)NULL;
#if defined (PROGRAMMABLE_COMPLETION)
set_itemlist_dirty (&it_aliases);
#endif
}
/* Return an array of aliases that satisfy the conditions tested by FUNCTION.
@ -433,21 +446,22 @@ char *
alias_expand (string)
char *string;
{
int line_len = 1 + strlen (string);
char *line = (char *)xmalloc (line_len);
register int i, j, start;
char *token = xmalloc (line_len);
int tl, real_start, expand_next, expand_this_token;
char *line, *token;
int line_len, tl, real_start, expand_next, expand_this_token;
alias_t *alias;
line_len = strlen (string) + 1;
line = xmalloc (line_len);
token = xmalloc (line_len);
line[0] = i = 0;
expand_next = 0;
command_word = 1; /* initialized to expand the first word on the line */
/* Each time through the loop we find the next word in line. If it
has an alias, substitute
the alias value. If the value ends in ` ', then try again
with the next word. Else, if there is no value, or if
has an alias, substitute the alias value. If the value ends in ` ',
then try again with the next word. Else, if there is no value, or if
the value does not end in space, we are done. */
for (;;)

View file

@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_ALIAS_H_)
#define _ALIAS_H_

39
array.c
View file

@ -8,6 +8,25 @@
* Chet Ramey
* chet@ins.cwru.edu
*/
/* Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#include "config.h"
#if defined (ARRAY_VARS)
@ -441,6 +460,26 @@ ARRAY *a;
return (REVERSE_LIST(list, WORD_LIST *));
}
char **
array_to_argv (a)
ARRAY *a;
{
char **ret, *t;
int i;
ARRAY_ELEMENT *ae;
if (a == 0 || array_empty(a))
return ((char **)NULL);
ret = alloc_array (array_num_elements (a) + 1);
i = 0;
for (ae = element_forw(a->head); ae != a->head; ae = element_forw(ae)) {
t = element_value (ae);
ret[i++] = t ? savestring (t) : (char *)NULL;
}
ret[i] = (char *)NULL;
return (ret);
}
ARRAY *
assign_word_list (array, list)
ARRAY *array;

21
array.h
View file

@ -1,5 +1,24 @@
/* array.h -- definitions for the interface exported by array.c that allows
the rest of the shell to manipulate array variables. */
/* Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#ifndef _ARRAY_H_
#define _ARRAY_H_
@ -41,6 +60,8 @@ extern WORD_LIST *array_to_word_list __P((ARRAY *));
extern ARRAY *word_list_to_array __P((WORD_LIST *));
extern ARRAY *assign_word_list __P((ARRAY *, WORD_LIST *));
extern char **array_to_argv __P((ARRAY *));
extern char *array_to_assignment_string __P((ARRAY *));
extern char *quoted_array_assignment_string __P((ARRAY *));
extern char *array_to_string __P((ARRAY *, char *, int));

View file

@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_BASHANSI_H_)
#define _BASHANSI_H_

View file

@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#include "config.h"
@ -408,7 +408,7 @@ pre_process_line (line, print_changes, addit)
if (expanded < 0)
internal_error ("%s", history_value);
#if defined (READLINE)
else if (hist_verify == 0)
else if (hist_verify == 0 || expanded == 2)
#else
else
#endif
@ -457,6 +457,34 @@ pre_process_line (line, print_changes, addit)
return (return_value);
}
/* Return 1 if the first non-whitespace character in LINE is a `#', indicating
* that the line is a shell comment. */
static int
shell_comment (line)
char *line;
{
char *p;
for (p = line; p && *p && whitespace (*p); p++)
;
return (p && *p == '#');
}
/* Remove shell comments from LINE. A `#' and anything after it is a comment.
This isn't really useful yet, since it doesn't handle quoting. */
static char *
filter_comments (line)
char *line;
{
char *p;
for (p = line; p && *p && *p != '#'; p++)
;
if (p && *p == '#')
*p = '\0';
return (line);
}
/* Add LINE to the history list depending on the value of HISTORY_CONTROL. */
void
maybe_add_history (line)
@ -476,7 +504,8 @@ maybe_add_history (line)
if (current_command_line_count > 1)
#endif
{
bash_add_history (line);
if (literal_history || dstack.delimiter_depth != 0 || shell_comment (line) == 0)
bash_add_history (line);
return;
}
@ -637,51 +666,15 @@ expand_histignore_pattern (pat)
char *pat;
{
HIST_ENTRY *phe;
char *ret, *p, *r, *t;
int len, rlen, ind, tlen;
char *ret;
phe = last_history_entry ();
if (phe == (HIST_ENTRY *)0)
return (savestring (pat));
len = strlen (phe->line);
rlen = len + strlen (pat) + 2;
ret = xmalloc (rlen);
ret = strcreplace (pat, '&', phe->line, 1);
for (p = pat, r = ret; p && *p; )
{
if (*p == '&')
{
ind = r - ret;
if (glob_pattern_p (phe->line) || strchr (phe->line, '\\'))
{
t = quote_globbing_chars (phe->line);
tlen = strlen (t);
RESIZE_MALLOCED_BUFFER (ret, ind, tlen, rlen, rlen);
r = ret + ind; /* in case reallocated */
strcpy (r, t);
r += tlen;
free (t);
}
else
{
tlen = strlen (phe->line);
RESIZE_MALLOCED_BUFFER (ret, ind, tlen, rlen, rlen);
r = ret + ind; /* in case reallocated */
strcpy (r, phe->line);
r += len;
}
p++;
continue;
}
if (*p == '\\' && p[1] == '&')
p++;
*r++ = *p++;
}
*r = '\0';
return ret;
}

View file

@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_BASHHIST_H_)
#define _BASHHIST_H_

View file

@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_BASHINTL_H_)
#define _BASHINTL_H_

View file

@ -1,5 +1,23 @@
/* bashjmp.h -- wrapper for setjmp.h with necessary bash definitions. */
/* Copyright (C) 1987,1991 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#ifndef _BASHJMP_H_
#define _BASHJMP_H_

View file

@ -6,7 +6,7 @@
Bash is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#include "config.h"
@ -49,6 +49,10 @@
# include "alias.h"
#endif
#if defined (PROGRAMMABLE_COMPLETION)
# include "pcomplete.h"
#endif
#if defined (BRACE_COMPLETION)
extern void bash_brace_completion ();
#endif /* BRACE_COMPLETION */
@ -57,6 +61,7 @@ extern void bash_brace_completion ();
static void shell_expand_line ();
static void display_shell_version (), operate_and_get_next ();
static void bash_ignore_filenames ();
static void bash_ignore_everything ();
static void cleanup_expansion_error (), set_up_new_line ();
#if defined (BANG_HISTORY)
@ -78,7 +83,6 @@ static void bash_push_line ();
static char **attempt_shell_completion ();
static char *variable_completion_function ();
static char *hostname_completion_function ();
static char *command_word_completion_function ();
static char *command_subst_completion_function ();
static void dynamic_complete_history ();
@ -86,7 +90,8 @@ static char *glob_complete_word ();
static void bash_glob_expand_word ();
static void bash_glob_list_expansions ();
static void snarf_hosts_from_file (), add_host_name ();
static void snarf_hosts_from_file ();
static void add_host_name ();
static char *bash_dequote_filename ();
static char *bash_quote_filename ();
@ -95,6 +100,11 @@ static char *bash_quote_filename ();
static int posix_edit_macros ();
#endif
#if defined (PROGRAMMABLE_COMPLETION)
static char **prog_complete_matches;
static int old_rl_completion_append_character;
#endif
/* Variables used here but defined in other files. */
extern int posixly_correct, no_symbolic_links;
extern int rl_explicit_arg;
@ -103,10 +113,6 @@ extern STRING_INT_ALIST word_token_alist[];
extern Function *rl_last_func;
extern int rl_filename_completion_desired;
/* Helper functions from subst.c */
extern int char_is_quoted ();
extern int unclosed_pair ();
/* SPECIFIC_COMPLETION_FUNCTIONS specifies that we have individual
completion functions which indicate what type of completion should be
done (at or before point) that can be bound to key sequences with
@ -139,6 +145,9 @@ int bash_readline_initialized = 0;
host list. */
int perform_hostname_completion = 1;
/* If non-zero, we don't do command completion on an empty line. */
int no_empty_command_completion;
static char *bash_completer_word_break_characters = " \t\n\"'@><=;|&(:";
static char *bash_nohostname_word_break_characters = " \t\n\"'><=;|&(:";
@ -386,8 +395,10 @@ display_shell_version (count, c)
/* **************************************************************** */
/* If the user requests hostname completion, then simply build a list
of hosts, and complete from that forever more. */
of hosts, and complete from that forever more, or at least until
HOSTFILE is unset. */
/* THIS SHOULD BE A STRINGLIST. */
/* The kept list of hostnames. */
static char **hostname_list = (char **)NULL;
@ -504,6 +515,27 @@ snarf_hosts_from_file (filename)
fclose (file);
}
/* Return the hostname list. */
char **
get_hostname_list ()
{
if (hostname_list_initialized == 0)
initialize_hostname_list ();
return (hostname_list);
}
void
clear_hostname_list ()
{
register int i;
if (hostname_list_initialized == 0)
return;
for (i = 0; i < hostname_list_length; i++)
free (hostname_list[i]);
hostname_list_length = 0;
}
/* Return a NULL terminated list of hostnames which begin with TEXT.
Initialize the hostname list the first time if neccessary.
The array is malloc ()'ed, but not the individual strings. */
@ -524,7 +556,7 @@ hostnames_matching (text)
what is desired. */
if (*text == '\0')
{
result = (char **)xmalloc ((1 + hostname_list_length) * sizeof (char *));
result = alloc_array (1 + hostname_list_length);
for (i = 0; i < hostname_list_length; i++)
result[i] = hostname_list[i];
result[i] = (char *)NULL;
@ -656,6 +688,87 @@ posix_edit_macros (count, key)
/* */
/* **************************************************************** */
#define COMMAND_SEPARATORS ";|&{(`"
static int
check_redir (ti)
int ti;
{
register int this_char, prev_char;
/* Handle the two character tokens `>&', `<&', and `>|'.
We are not in a command position after one of these. */
this_char = rl_line_buffer[ti];
prev_char = rl_line_buffer[ti - 1];
if ((this_char == '&' && (prev_char == '<' || prev_char == '>')) ||
(this_char == '|' && prev_char == '>'))
return (1);
else if ((this_char == '{' && prev_char == '$') || /* } */
(char_is_quoted (rl_line_buffer, ti)))
return (1);
return (0);
}
#if defined (PROGRAMMABLE_COMPLETION)
static int
find_cmd_start (start)
int start;
{
register int s, os;
os = 0;
while (((s = skip_to_delim (rl_line_buffer, os, COMMAND_SEPARATORS)) <= start) &&
rl_line_buffer[s])
os = s+1;
return os;
}
static int
find_cmd_end (end)
int end;
{
register int e;
e = skip_to_delim (rl_line_buffer, end, COMMAND_SEPARATORS);
return e;
}
static char *
find_cmd_name (start)
int start;
{
char *name;
register int s, e;
for (s = start; whitespace (rl_line_buffer[s]); s++)
;
/* skip until a shell break character */
e = skip_to_delim (rl_line_buffer, s, "()<>;&| \t\n");
name = substring (rl_line_buffer, s, e);
return (name);
}
static char *
prog_complete_return (text, matchnum)
char *text;
int matchnum;
{
static int ind;
if (matchnum == 0)
ind = 0;
if (prog_complete_matches == 0 || prog_complete_matches[ind] == 0)
return (char *)NULL;
return (prog_complete_matches[ind++]);
}
#endif /* PROGRAMMABLE_COMPLETION */
/* Do some completion on TEXT. The indices of TEXT in RL_LINE_BUFFER are
at START and END. Return an array of matches, or NULL if none. */
static char **
@ -663,10 +776,10 @@ attempt_shell_completion (text, start, end)
char *text;
int start, end;
{
int in_command_position, ti;
int in_command_position, ti, saveti, qc;
char **matches, *command_separator_chars;
command_separator_chars = ";|&{(`";
command_separator_chars = COMMAND_SEPARATORS;
matches = (char **)NULL;
rl_ignore_some_completions_function = (Function *)filename_completion_ignore;
@ -675,10 +788,23 @@ attempt_shell_completion (text, start, end)
appears after a character that separates commands. It cannot be a
command word if we aren't at the top-level prompt. */
ti = start - 1;
saveti = qc = -1;
while ((ti > -1) && (whitespace (rl_line_buffer[ti])))
ti--;
#if 1
/* If this is an open quote, maybe we're trying to complete a quoted
command name. */
if (rl_line_buffer[ti] == '"' || rl_line_buffer[ti] == '\'')
{
qc = rl_line_buffer[ti];
saveti = ti--;
while (ti > -1 && (whitespace (rl_line_buffer[ti])))
ti--;
}
#endif
in_command_position = 0;
if (ti < 0)
{
@ -689,21 +815,10 @@ attempt_shell_completion (text, start, end)
}
else if (member (rl_line_buffer[ti], command_separator_chars))
{
register int this_char, prev_char;
in_command_position++;
/* Handle the two character tokens `>&', `<&', and `>|'.
We are not in a command position after one of these. */
this_char = rl_line_buffer[ti];
prev_char = rl_line_buffer[ti - 1];
if ((this_char == '&' && (prev_char == '<' || prev_char == '>')) ||
(this_char == '|' && prev_char == '>'))
in_command_position = 0;
else if ((this_char == '{' && prev_char == '$') ||
(char_is_quoted (rl_line_buffer, ti)))
in_command_position = 0;
if (check_redir (ti) == 1)
in_command_position = 0;
}
else
{
@ -715,20 +830,59 @@ attempt_shell_completion (text, start, end)
/* Check that we haven't incorrectly flagged a closed command substitution
as indicating we're in a command position. */
if (in_command_position && ti >= 0 && rl_line_buffer[ti] == '`' &&
*text != '`' && unclosed_pair (rl_line_buffer, 0, "`") == 0)
*text != '`' && unclosed_pair (rl_line_buffer, end, "`") == 0)
in_command_position = 0;
/* Special handling for command substitution. If *TEXT is a backquote,
it can be the start or end of an old-style command substitution, or
unmatched. If it's unmatched, both calls to unclosed_pair will
succeed. */
if (*text == '`' && unclosed_pair (rl_line_buffer, start, "`") &&
unclosed_pair (rl_line_buffer, end, "`"))
if (*text == '`' &&
(in_command_position || (unclosed_pair (rl_line_buffer, start, "`") &&
unclosed_pair (rl_line_buffer, end, "`"))))
matches = completion_matches (text, command_subst_completion_function);
/* Variable name? */
#if defined (PROGRAMMABLE_COMPLETION)
/* Attempt programmable completion. */
if (!matches && in_command_position == 0 && prog_completion_enabled &&
(num_progcomps () > 0) && current_prompt_string == ps1_prompt)
{
int s, e, foundcs;
char *n;
/* XXX - don't free the members */
if (prog_complete_matches)
free (prog_complete_matches);
prog_complete_matches = (char **)NULL;
s = find_cmd_start (start);
e = find_cmd_end (end);
n = find_cmd_name (s);
prog_complete_matches = programmable_completions (n, text, s, e, &foundcs);
FREE (n);
/* XXX - if we found a COMPSPEC for the command, just return whatever
the programmable completion code returns, and disable the default
filename completion that readline will do. */
if (foundcs)
{
/* Turn what the programmable completion code returns into what
readline wants. I should have made compute_lcd_of_matches
external... */
matches = completion_matches (text, prog_complete_return);
rl_attempted_completion_over = 1; /* no default */
return (matches);
}
}
#endif
/* New posix-style command substitution or variable name? */
if (!matches && *text == '$')
matches = completion_matches (text, variable_completion_function);
{
if (qc != '\'' && text[1] == '(') /* ) */
matches = completion_matches (text, command_subst_completion_function);
else
matches = completion_matches (text, variable_completion_function);
}
/* If the word starts in `~', and there is no slash in the word, then
try completing this word as a username. */
@ -745,14 +899,22 @@ attempt_shell_completion (text, start, end)
and command names. */
if (!matches && in_command_position)
{
matches = completion_matches (text, command_word_completion_function);
/* If we are attempting command completion and nothing matches, we
do not want readline to perform filename completion for us. We
still want to be able to complete partial pathnames, so set the
completion ignore function to something which will remove filenames
and leave directories in the match list. */
if (!matches)
rl_ignore_some_completions_function = (Function *)bash_ignore_filenames;
if (start == 0 && end == 0 && text[0] == '\0' && no_empty_command_completion)
{
matches = (char **)NULL;
rl_ignore_some_completions_function = (Function *)bash_ignore_everything;
}
else
{
matches = completion_matches (text, command_word_completion_function);
/* If we are attempting command completion and nothing matches, we
do not want readline to perform filename completion for us. We
still want to be able to complete partial pathnames, so set the
completion ignore function to something which will remove
filenames and leave directories in the match list. */
if (matches == (char **)NULL)
rl_ignore_some_completions_function = (Function *)bash_ignore_filenames;
}
}
/* This could be a globbing pattern, so try to expand it using pathname
@ -776,7 +938,7 @@ attempt_shell_completion (text, start, end)
where a command word can be found. It grovels $PATH, looking for commands
that match. It also scans aliases, function names, and the shell_builtin
table. */
static char *
char *
command_word_completion_function (hint_text, state)
char *hint_text;
int state;
@ -1081,8 +1243,7 @@ variable_completion_function (text, state)
int state;
char *text;
{
register SHELL_VAR *var = (SHELL_VAR *)NULL;
static SHELL_VAR **varlist = (SHELL_VAR **)NULL;
static char **varlist = (char **)NULL;
static int varlist_index;
static char *varname = (char *)NULL;
static int namelen;
@ -1106,29 +1267,19 @@ variable_completion_function (text, state)
namelen = strlen (varname);
if (varlist)
free (varlist);
varlist = all_visible_variables ();
free_array (varlist);
varlist = all_variables_matching_prefix (varname);
varlist_index = 0;
}
while (varlist && varlist[varlist_index])
{
var = varlist[varlist_index];
/* Compare. You can't do better than Zayre. No text is also
a match. */
if (!*varname || (strncmp (varname, var->name, namelen) == 0))
break;
varlist_index++;
}
if (!varlist || !varlist[varlist_index])
{
return ((char *)NULL);
}
else
{
char *value = xmalloc (4 + strlen (var->name));
char *value = xmalloc (4 + strlen (varlist[varlist_index]));
if (first_char_loc)
{
@ -1137,7 +1288,7 @@ variable_completion_function (text, state)
value[1] = '{';
}
strcpy (&value[first_char_loc], var->name);
strcpy (value + first_char_loc, varlist[varlist_index]);
if (first_char_loc == 2)
strcat (value, "}");
@ -1479,9 +1630,9 @@ _ignore_completion_names (names, name_func)
filenames. The pointers are copied back to NAMES when done. */
for (nidx = 1; names[nidx]; nidx++)
;
newnames = (char **)xmalloc ((nidx + 1) * (sizeof (char *)));
newnames = alloc_array (nidx + 1);
#ifdef NO_FORCE_FIGNORE
oldnames = (char **)xmalloc ((nidx - 1) * (sizeof (char *)));
oldnames = alloc_array (nidx - 1);
oidx = 0;
#endif
@ -1605,6 +1756,20 @@ bash_ignore_filenames (names)
_ignore_completion_names (names, test_for_directory);
}
static int
return_zero (name)
char *name;
{
return 0;
}
static void
bash_ignore_everything (names)
char **names;
{
_ignore_completion_names (names, return_zero);
}
/* Handle symbolic link references and other directory name
expansions while hacking completion. */
static int
@ -1612,13 +1777,28 @@ bash_directory_completion_hook (dirname)
char **dirname;
{
char *local_dirname, *new_dirname, *t;
int return_value = 0;
int return_value, should_expand_dirname;
WORD_LIST *wl;
return_value = should_expand_dirname = 0;
local_dirname = *dirname;
new_dirname = savestring (local_dirname);
if (strchr (local_dirname, '$') || strchr (local_dirname, '`'))
#if 0
should_expand_dirname = strchr (local_dirname, '$') || strchr (local_dirname, '`');
#else
if (strchr (local_dirname, '$'))
should_expand_dirname = 1;
else
{
t = strchr (local_dirname, '`');
if (t && unclosed_pair (local_dirname, strlen (local_dirname), "`") == 0)
should_expand_dirname = 1;
}
#endif
if (should_expand_dirname)
{
new_dirname = savestring (local_dirname);
wl = expand_string (new_dirname, 0);
if (wl)
{
@ -1969,9 +2149,9 @@ bash_specific_completion (what_to_do, generator)
#endif /* SPECIFIC_COMPLETION_FUNCTIONS */
/* Filename quoting for completion. */
/* A function to strip quotes that are not protected by backquotes. It
allows single quotes to appear within double quotes, and vice versa.
It should be smarter. */
/* A function to strip unquoted quote characters (single quotes, double
quotes, and backslashes). It allows single quotes to appear
within double quotes, and vice versa. It should be smarter. */
static char *
bash_dequote_filename (text, quote_char)
char *text;
@ -2071,8 +2251,14 @@ bash_quote_filename (s, rtype, qcp)
cs = completion_quoting_style;
/* Might need to modify the default completion style based on *qcp,
since it's set to any user-provided opening quote. */
if (*qcp == '"')
since it's set to any user-provided opening quote. We also change
to single-quoting if there is no user-provided opening quote and
the word being completed contains newlines, since those are not
quoted correctly using backslashes (a backslash-newline pair is
special to the shell parser). */
if (*qcp == '\0' && cs == COMPLETE_BSQUOTE && strchr (mtext, '\n'))
cs = COMPLETE_SQUOTE;
else if (*qcp == '"')
cs = COMPLETE_DQUOTE;
else if (*qcp == '\'')
cs = COMPLETE_SQUOTE;
@ -2127,4 +2313,186 @@ bash_quote_filename (s, rtype, qcp)
return ret;
}
/* Support for binding readline key sequences to Unix commands. */
static Keymap cmd_xmap;
static int
bash_execute_unix_command (count, key)
int count; /* ignored */
int key;
{
Keymap ckmap; /* current keymap */
Keymap xkmap; /* unix command executing keymap */
register int i;
char *cmd;
/* First, we need to find the right command to execute. This is tricky,
because we might have already indirected into another keymap. */
ckmap = rl_get_keymap ();
if (ckmap != rl_executing_keymap)
{
/* bogus. we have to search. only handle one level of indirection. */
for (i = 0; i < KEYMAP_SIZE; i++)
{
if (ckmap[i].type == ISKMAP && (Keymap)ckmap[i].function == rl_executing_keymap)
break;
}
if (i < KEYMAP_SIZE)
xkmap = (Keymap)cmd_xmap[i].function;
else
{
crlf ();
internal_error ("bash_execute_unix_command: cannot find keymap for command");
rl_forced_update_display ();
return 1;
}
}
else
xkmap = cmd_xmap;
cmd = (char *)xkmap[key].function;
if (cmd == 0)
{
ding ();
return 1;
}
crlf (); /* move to a new line */
cmd = savestring (cmd);
parse_and_execute (cmd, "bash_execute_unix_command", 0);
/* and restore the readline buffer and display after command execution. */
rl_forced_update_display ();
return 0;
}
static void
init_unix_command_map ()
{
cmd_xmap = rl_make_bare_keymap ();
}
static int
isolate_sequence (string, ind, need_dquote, startp)
char *string;
int ind, need_dquote, *startp;
{
register int i;
int c, passc, delim;
for (i = ind; string[i] && whitespace (string[i]); i++)
;
/* NEED_DQUOTE means that the first non-white character *must* be `"'. */
if (need_dquote && string[i] != '"')
{
builtin_error ("%s: first non-whitespace character is not `\"'", string);
return -1;
}
/* We can have delimited strings even if NEED_DQUOTE == 0, like the command
string to bind the key sequence to. */
delim = (string[i] == '"' || string[i] == '\'') ? string[i] : 0;
if (startp)
*startp = delim ? ++i : i;
for (passc = 0; c = string[i]; i++)
{
if (passc)
{
passc = 0;
continue;
}
if (c == '\\')
{
passc++;
continue;
}
if (c == delim)
break;
}
if (delim && string[i] != delim)
{
builtin_error ("%s: no closing `%c'", string, delim);
return -1;
}
return i;
}
int
bind_keyseq_to_unix_command (line)
char *line;
{
Keymap kmap;
char *kseq, *value;
int i, kstart, len, ok;
if (cmd_xmap == 0)
init_unix_command_map ();
kmap = rl_get_keymap ();
/* We duplicate some of the work done by rl_parse_and_bind here, but
this code only has to handle `"keyseq": ["]command["]' and can
generate an error for anything else. */
i = isolate_sequence (line, 0, 1, &kstart);
if (i < 0)
return -1;
/* Create the key sequence string to pass to rl_generic_bind */
kseq = substring (line, kstart, i);
for ( ; line[i] && line[i] != ':'; i++)
;
if (line[i] != ':')
{
builtin_error ("%s: missing colon separator", line);
return -1;
}
i = isolate_sequence (line, i + 1, 0, &kstart);
if (i < 0)
return -1;
/* Create the value string containing the command to execute. */
value = substring (line, kstart, i);
/* Save the command to execute and the key sequence in the CMD_XMAP */
rl_generic_bind (ISMACR, kseq, value, cmd_xmap);
/* and bind the key sequence in the current keymap to a function that
understands how to execute from CMD_XMAP */
rl_set_key (kseq, (Function *)bash_execute_unix_command, kmap);
return 0;
}
/* Used by the programmable completion code. Complete TEXT as a filename,
but return only directories as matches. Dequotes the filename before
attempting to find matches. */
char **
bash_directory_completion_matches (text)
char *text;
{
char **m1;
char *dfn;
int qc;
qc = (text[0] == '"' || text[0] == '\'') ? text[0] : 0;
dfn = bash_dequote_filename (text, qc);
m1 = completion_matches (dfn, filename_completion_function);
free (dfn);
if (m1 == 0 || m1[0] == 0)
return m1;
/* We don't bother recomputing the lcd of the matches, because it will just
get thrown away by the programmable completion code and recomputed
later. */
(void)bash_ignore_filenames (m1);
return m1;
}
#endif /* READLINE */

View file

@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_BASHLINE_H_)
#define _BASHLINE_H_
@ -30,4 +30,14 @@ extern void initialize_readline __P((void));
extern void bashline_reinitialize __P((void));
extern int bash_re_edit __P((char *));
extern int bind_keyseq_to_unix_command __P((char *));
/* Used by programmable completion code. */
extern char *command_word_completion_function __P((char *, int));
extern char **get_hostname_list __P((void));
extern void clear_hostname_list __P((void));
extern char **bash_directory_completion_matches __P((char *));
#endif /* _BASHLINE_H_ */

View file

@ -1,34 +0,0 @@
/* bashtty.h -- what kind of tty driver do we have? */
/* Copyright (C) 1993 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (_BASHTTY_H_)
#define _BASHTTY_H_
#if defined (_POSIX_VERSION) && defined (HAVE_TERMIOS_H) && defined (HAVE_TCGETATTR) && !defined (TERMIOS_MISSING)
# define TERMIOS_TTY_DRIVER
#else
# if defined (HAVE_TERMIO_H)
# define TERMIO_TTY_DRIVER
# else
# define NEW_TTY_DRIVER
# endif
#endif
#endif /* _BASHTTY_H */

View file

@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_BASHTYPES_H_)
# define _BASHTYPES_H_

View file

@ -20,7 +20,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#include "config.h"
#if defined (BRACE_EXPANSION) && defined (READLINE)

View file

@ -6,7 +6,7 @@
Bash is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
/* Stuff in curly braces gets expanded before all other shell expansions. */
@ -117,9 +117,13 @@ brace_expand (text)
return (result);
}
#if defined (SHELL)
amble = substring (text, start, i);
#else
amble = (char *)xmalloc (1 + (i - start));
strncpy (amble, &text[start], (i - start));
amble[i - start] = '\0';
#endif
#if defined (SHELL)
/* If the amble does not contain an unquoted BRACE_ARG_SEPARATOR, then
@ -175,9 +179,13 @@ expand_amble (text)
for (start = 0, i = 0, c = 1; c; start = ++i)
{
c = brace_gobbler (text, &i, brace_arg_separator);
#if defined (SHELL)
tem = substring (text, start, i);
#else
tem = (char *)xmalloc (1 + (i - start));
strncpy (tem, &text[start], (i - start));
tem[i- start] = '\0';
#endif
partial = brace_expand (tem);

View file

@ -6,7 +6,7 @@
Bash is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#include "config.h"

View file

@ -1,4 +1,21 @@
# This Makefile for building libbuiltins.a is in -*- text -*- for Emacs.
#
# Copyright (C) 1996 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
#
SHELL = @MAKE_SHELL@
RANLIB = @RANLIB@
@ -9,6 +26,8 @@ ARFLAGS = @ARFLAGS@
RM = rm -f
CP = cp
EXEEXT = @EXEEXT@
srcdir = @srcdir@
VPATH = .:@srcdir@
topdir = @top_srcdir@
@ -25,12 +44,14 @@ LDFLAGS = @LDFLAGS@ $(LOCAL_LDFLAGS) $(CFLAGS)
LOCAL_LDFLAGS = @LOCAL_LDFLAGS@
LIBS = @LIBS@
INCLUDES = -I. -I.. @RL_INCLUDE@ -I$(topdir) -I$(topdir)/lib -I$(srcdir)
BASHINCDIR = ${topdir}/include
INCLUDES = -I. -I.. @RL_INCLUDE@ -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib -I$(srcdir)
CCFLAGS = ${PROFILE_FLAGS} $(DEFS) $(LOCAL_DEFS) $(SYSTEM_FLAGS) $(CPPFLAGS) \
${INCLUDES} $(LOCAL_CFLAGS) $(CFLAGS)
MKBUILTINS = mkbuiltins
MKBUILTINS = mkbuiltins$(EXEEXT)
DIRECTDEFINE = -D $(srcdir)
# xxx this is bad style
@ -68,7 +89,7 @@ DEFSRC = $(srcdir)/alias.def $(srcdir)/bind.def $(srcdir)/break.def \
$(srcdir)/times.def $(srcdir)/trap.def $(srcdir)/type.def \
$(srcdir)/ulimit.def $(srcdir)/umask.def $(srcdir)/wait.def \
$(srcdir)/reserved.def $(srcdir)/pushd.def $(srcdir)/shopt.def \
$(srcdir)/printf.def
$(srcdir)/printf.def $(srcdir)/complete.def
STATIC_SOURCE = common.c evalstring.c evalfile.c getopt.c bashgetopt.c \
getopt.h
@ -80,7 +101,7 @@ OFILES = builtins.o \
exit.o fc.o fg_bg.o hash.o help.o history.o jobs.o kill.o let.o \
pushd.o read.o return.o set.o setattr.o shift.o source.o \
suspend.o test.o times.o trap.o type.o ulimit.o umask.o \
wait.o getopts.o shopt.o printf.o getopt.o bashgetopt.o
wait.o getopts.o shopt.o printf.o getopt.o bashgetopt.o complete.o
CREATED_FILES = builtext.h builtins.c psize.aux pipesize.h
@ -112,7 +133,7 @@ mkbuiltins.o: mkbuiltins.c
$(RM) $@
$(CC_FOR_BUILD) -c $(CCFLAGS) $<
mkbuiltins: mkbuiltins.o
mkbuiltins$(EXEEXT): mkbuiltins.o
$(CC_FOR_BUILD) $(PROFILE_FLAGS) $(LDFLAGS) -o $(MKBUILTINS) mkbuiltins.o $(LIBS)
# rules for deficient makes, like SunOS
@ -188,274 +209,286 @@ umask.o: umask.def
wait.o: wait.def
getopts.o: getopts.def
reserved.o: reserved.def
complete.o: complete.def
# C files
bashgetopt.o: ../config.h $(topdir)/bashansi.h $(topdir)/ansi_stdlib.h
bashgetopt.o: ../config.h $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h
bashgetopt.o: $(topdir)/shell.h $(topdir)/bashjmp.h
bashgetopt.o: $(topdir)/command.h $(topdir)/general.h $(topdir)/error.h
bashgetopt.o: $(topdir)/variables.h $(topdir)/quit.h $(topdir)/maxpath.h
bashgetopt.o: $(topdir)/variables.h $(topdir)/quit.h $(BASHINCDIR)/maxpath.h
bashgetopt.o: $(topdir)/unwind_prot.h $(topdir)/dispose_cmd.h
bashgetopt.o: $(topdir)/make_cmd.h $(topdir)/subst.h $(topdir)/sig.h
bashgetopt.o: $(topdir)/pathnames.h $(topdir)/externs.h $(srcdir)/common.h
common.o: $(topdir)/bashtypes.h $(topdir)/posixstat.h $(topdir)/bashansi.h $(topdir)/ansi_stdlib.h
common.o: $(topdir)/shell.h ../config.h $(topdir)/bashjmp.h $(topdir)/posixjmp.h
common.o: $(topdir)/bashtypes.h $(BASHINCDIR)/posixstat.h $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h
common.o: $(topdir)/shell.h ../config.h $(topdir)/bashjmp.h $(BASHINCDIR)/posixjmp.h
common.o: $(topdir)/sig.h $(topdir)/command.h
common.o: $(topdir)/general.h $(topdir)/stdc.h $(topdir)/memalloc.h
common.o: $(topdir)/general.h $(BASHINCDIR)/stdc.h $(BASHINCDIR)/memalloc.h
common.o: $(topdir)/variables.h $(topdir)/input.h
common.o: $(topdir)/siglist.h $(topdir)/bashhist.h $(topdir)/quit.h
common.o: $(topdir)/unwind_prot.h $(topdir)/maxpath.h $(topdir)/jobs.h
common.o: $(topdir)/unwind_prot.h $(BASHINCDIR)/maxpath.h $(topdir)/jobs.h
common.o: $(topdir)/builtins.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
common.o: $(topdir)/subst.h $(topdir)/execute_cmd.h $(topdir)/error.h
common.o: $(topdir)/externs.h $(topdir)/pathnames.h ./builtext.h
evalfile.o: $(topdir)/bashtypes.h $(topdir)/posixstat.h $(topdir)/filecntl.h
evalfile.o: $(topdir)/bashansi.h $(topdir)/ansi_stdlib.h
evalfile.o: $(topdir)/bashtypes.h $(BASHINCDIR)/posixstat.h ${BASHINCDIR}/filecntl.h
evalfile.o: $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h
evalfile.o: $(topdir)/shell.h ../config.h $(topdir)/bashjmp.h
evalfile.o: $(topdir)/command.h $(topdir)/general.h $(topdir)/error.h
evalfile.o: $(topdir)/variables.h $(topdir)/quit.h $(topdir)/maxpath.h
evalfile.o: $(topdir)/variables.h $(topdir)/quit.h $(BASHINCDIR)/maxpath.h
evalfile.o: $(topdir)/unwind_prot.h $(topdir)/dispose_cmd.h
evalfile.o: $(topdir)/make_cmd.h $(topdir)/subst.h $(topdir)/sig.h
evalfile.o: $(topdir)/pathnames.h $(topdir)/externs.h
evalfile.o: $(topdir)/jobs.h $(topdir)/builtins.h $(topdir)/flags.h
evalfile.o: $(topdir)/input.h $(topdir)/execute_cmd.h
evalfile.o: $(topdir)/bashhist.h $(srcdir)/common.h
evalstring.o: ../config.h $(topdir)/bashansi.h $(topdir)/ansi_stdlib.h
evalstring.o: $(topdir)/shell.h $(topdir)/bashjmp.h $(topdir)/posixjmp.h
evalstring.o: ../config.h $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h
evalstring.o: $(topdir)/shell.h $(topdir)/bashjmp.h $(BASHINCDIR)/posixjmp.h
evalstring.o: $(topdir)/sig.h $(topdir)/command.h $(topdir)/siglist.h
evalstring.o: $(topdir)/memalloc.h $(topdir)/variables.h $(topdir)/input.h
evalstring.o: $(BASHINCDIR)/memalloc.h $(topdir)/variables.h $(topdir)/input.h
evalstring.o: $(topdir)/quit.h $(topdir)/unwind_prot.h
evalstring.o: $(topdir)/maxpath.h $(topdir)/jobs.h $(topdir)/builtins.h
evalstring.o: $(BASHINCDIR)/maxpath.h $(topdir)/jobs.h $(topdir)/builtins.h
evalstring.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
evalstring.o: $(topdir)/externs.h $(topdir)/jobs.h $(topdir)/builtins.h
evalstring.o: $(topdir)/flags.h $(topdir)/input.h $(topdir)/execute_cmd.h
evalstring.o: $(topdir)/bashhist.h $(srcdir)/common.h
getopt.o: ../config.h $(topdir)/memalloc.h
getopt.o: ../config.h $(BASHINCDIR)/memalloc.h
getopt.o: $(topdir)/shell.h $(topdir)/bashjmp.h $(topdir)/command.h
getopt.o: $(topdir)/general.h $(topdir)/error.h $(topdir)/variables.h
getopt.o: $(topdir)/quit.h $(topdir)/maxpath.h $(topdir)/unwind_prot.h
getopt.o: $(topdir)/quit.h $(BASHINCDIR)/maxpath.h $(topdir)/unwind_prot.h
getopt.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
getopt.o: $(topdir)/sig.h $(topdir)/pathnames.h $(topdir)/externs.h
getopt.o: $(srcdir)/getopt.h
mkbuiltins.o: ../config.h $(topdir)/bashtypes.h $(topdir)/posixstat.h
mkbuiltins.o: $(topdir)/filecntl.h
mkbuiltins.o: $(topdir)/bashansi.h $(topdir)/ansi_stdlib.h
mkbuiltins.o: ../config.h $(topdir)/bashtypes.h $(BASHINCDIR)/posixstat.h
mkbuiltins.o: ${BASHINCDIR}/filecntl.h
mkbuiltins.o: $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h
# def files
alias.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
alias.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/maxpath.h
alias.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
alias.o: $(topdir)/error.h $(topdir)/general.h $(BASHINCDIR)/maxpath.h
alias.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
alias.o: $(topdir)/subst.h $(topdir)/externs.h $(srcdir)/common.h
alias.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
bind.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h $(topdir)/error.h
bind.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
bind.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
bind.o: $(topdir)/subst.h $(topdir)/externs.h $(srcdir)/bashgetopt.h
bind.o: $(topdir)/general.h $(topdir)/maxpath.h $(topdir)/bashline.h
bind.o: $(topdir)/general.h $(BASHINCDIR)/maxpath.h $(topdir)/bashline.h
bind.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
break.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
break.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
break.o: $(topdir)/error.h $(topdir)/general.h
break.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
break.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
break.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
break.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
builtin.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
builtin.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
builtin.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/externs.h
builtin.o: $(topdir)/quit.h $(srcdir)/common.h $(topdir)/maxpath.h
builtin.o: $(topdir)/quit.h $(srcdir)/common.h $(BASHINCDIR)/maxpath.h
builtin.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
builtin.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
cd.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h $(topdir)/error.h
cd.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
cd.o: $(topdir)/general.h $(topdir)/quit.h $(topdir)/dispose_cmd.h
cd.o: $(topdir)/make_cmd.h $(topdir)/subst.h $(topdir)/externs.h
cd.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
cd.o: $(srcdir)/common.h $(topdir)/maxpath.h
command.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
cd.o: $(srcdir)/common.h $(BASHINCDIR)/maxpath.h
command.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
command.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/externs.h
command.o: $(topdir)/quit.h $(srcdir)/bashgetopt.h $(topdir)/maxpath.h
command.o: $(topdir)/quit.h $(srcdir)/bashgetopt.h $(BASHINCDIR)/maxpath.h
command.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
command.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
declare.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
declare.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
declare.o: $(topdir)/error.h $(topdir)/general.h
declare.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
declare.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
declare.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
declare.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
echo.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h $(topdir)/error.h
echo.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
echo.o: $(topdir)/general.h $(topdir)/subst.h $(topdir)/externs.h
echo.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
echo.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
echo.o: $(topdir)/maxpath.h
enable.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
echo.o: $(BASHINCDIR)/maxpath.h
enable.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
enable.o: $(topdir)/error.h $(topdir)/general.h
enable.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
enable.o: $(topdir)/subst.h $(topdir)/externs.h
enable.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
enable.o: $(topdir)/maxpath.h
eval.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
enable.o: $(BASHINCDIR)/maxpath.h
enable.o: $(topdir)/pcomplete.h
eval.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
eval.o: $(topdir)/error.h $(topdir)/general.h
eval.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
eval.o: $(topdir)/subst.h $(topdir)/externs.h
eval.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
eval.o: $(topdir)/maxpath.h
eval.o: $(BASHINCDIR)/maxpath.h
exec.o: $(topdir)/bashtypes.h
exec.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
exec.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
exec.o: $(topdir)/error.h $(topdir)/general.h
exec.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
exec.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/flags.h
exec.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
exec.o: $(srcdir)/common.h $(topdir)/execute_cmd.h $(topdir)/maxpath.h
exec.o: $(srcdir)/common.h $(topdir)/execute_cmd.h $(BASHINCDIR)/maxpath.h
exec.o: $(topdir)/findcmd.h
exit.o: $(topdir)/bashtypes.h
exit.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
exit.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
exit.o: $(topdir)/error.h $(topdir)/general.h
exit.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
exit.o: $(topdir)/subst.h $(topdir)/externs.h
exit.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
exit.o: $(topdir)/maxpath.h ./builtext.h
fc.o: $(topdir)/bashtypes.h $(topdir)/posixstat.h
exit.o: $(BASHINCDIR)/maxpath.h ./builtext.h
fc.o: $(topdir)/bashtypes.h $(BASHINCDIR)/posixstat.h
fc.o: $(topdir)/builtins.h $(topdir)/command.h $(srcdir)/bashgetopt.h
fc.o: $(topdir)/bashhist.h
fc.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h $(topdir)/error.h
fc.o: $(topdir)/general.h $(topdir)/maxpath.h
fc.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
fc.o: $(topdir)/general.h $(BASHINCDIR)/maxpath.h
fc.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
fc.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/shell.h
fc.o: $(topdir)/flags.h $(topdir)/unwind_prot.h $(topdir)/variables.h
fc.o: $(topdir)/bashansi.h $(topdir)/ansi_stdlib.h
fc.o: $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h
fg_bg.o: $(topdir)/bashtypes.h
fg_bg.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
fg_bg.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
fg_bg.o: $(topdir)/error.h $(topdir)/general.h
fg_bg.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
fg_bg.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
fg_bg.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
fg_bg.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
getopts.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
getopts.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
getopts.o: $(topdir)/error.h $(topdir)/general.h
getopts.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
getopts.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
getopts.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
getopts.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
hash.o: $(topdir)/builtins.h $(topdir)/command.h $(topdir)/quit.h
hash.o: $(topdir)/findcmd.h $(topdir)/hashlib.h
hash.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
hash.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
hash.o: $(topdir)/error.h $(topdir)/general.h
hash.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
hash.o: $(srcdir)/common.h $(topdir)/maxpath.h
help.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
hash.o: $(srcdir)/common.h $(BASHINCDIR)/maxpath.h
help.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
help.o: $(topdir)/error.h $(topdir)/general.h
help.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
help.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
help.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
help.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
history.o: $(topdir)/bashtypes.h
history.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
history.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
history.o: $(topdir)/error.h $(topdir)/general.h
history.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
history.o: $(topdir)/subst.h $(topdir)/externs.h
history.o: $(topdir)/filecntl.h $(topdir)/shell.h $(topdir)/unwind_prot.h
history.o: $(topdir)/variables.h $(topdir)/bashhist.h $(topdir)/maxpath.h
inlib.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
history.o: ${BASHINCDIR}/filecntl.h $(topdir)/shell.h $(topdir)/unwind_prot.h
history.o: $(topdir)/variables.h $(topdir)/bashhist.h $(BASHINCDIR)/maxpath.h
inlib.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
inlib.o: $(topdir)/error.h $(topdir)/general.h
inlib.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
inlib.o: $(topdir)/maxpath.h $(topdir)/subst.h $(topdir)/externs.h
inlib.o: $(BASHINCDIR)/maxpath.h $(topdir)/subst.h $(topdir)/externs.h
inlib.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
jobs.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h $(topdir)/error.h
jobs.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
jobs.o: $(topdir)/general.h $(topdir)/quit.h $(srcdir)/bashgetopt.h
jobs.o: $(topdir)/maxpath.h $(topdir)/externs.h
jobs.o: $(BASHINCDIR)/maxpath.h $(topdir)/externs.h
jobs.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
jobs.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
kill.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h $(topdir)/error.h
kill.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
kill.o: $(topdir)/general.h $(topdir)/subst.h $(topdir)/externs.h
kill.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
kill.o: $(topdir)/shell.h $(topdir)/trap.h $(topdir)/unwind_prot.h
kill.o: $(topdir)/variables.h $(topdir)/maxpath.h
let.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
kill.o: $(topdir)/variables.h $(BASHINCDIR)/maxpath.h
let.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
let.o: $(topdir)/error.h $(topdir)/general.h
let.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
let.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
let.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
let.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
printf.o: ../config.h $(topdir)/memalloc.h $(topdir)/bashjmp.h
printf.o: ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/bashjmp.h
printf.o: $(topdir)/command.h $(topdir)/error.h $(topdir)/general.h
printf.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
printf.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/sig.h
printf.o: $(topdir)/pathnames.h $(topdir)/shell.h $(topdir)/unwind_prot.h
printf.o: $(topdir)/variables.h $(topdir)/stdc.h $(srcdir)/bashgetopt.h
pushd.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
printf.o: $(topdir)/variables.h $(BASHINCDIR)/stdc.h $(srcdir)/bashgetopt.h
pushd.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
pushd.o: $(topdir)/error.h $(topdir)/general.h
pushd.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
pushd.o: $(topdir)/subst.h $(topdir)/externs.h
pushd.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
pushd.o: $(topdir)/maxpath.h $(srcdir)/common.h ./builtext.h
read.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
pushd.o: $(BASHINCDIR)/maxpath.h $(srcdir)/common.h ./builtext.h
read.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
read.o: $(topdir)/error.h $(topdir)/general.h
read.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
read.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
read.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
read.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
return.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
read.o: $(BASHINCDIR)/shtty.h
return.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
return.o: $(topdir)/error.h $(topdir)/general.h
return.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
return.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
return.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
return.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
set.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
set.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
set.o: $(topdir)/general.h $(topdir)/subst.h $(topdir)/externs.h
set.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
set.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
set.o: $(topdir)/maxpath.h $(topdir)/error.h
setattr.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
setattr.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/maxpath.h
set.o: $(BASHINCDIR)/maxpath.h $(topdir)/error.h
setattr.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
setattr.o: $(topdir)/error.h $(topdir)/general.h $(BASHINCDIR)/maxpath.h
setattr.o: $(topdir)/quit.h $(srcdir)/common.h $(srcdir)/bashgetopt.h
setattr.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
setattr.o: $(topdir)/externs.h
setattr.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
shift.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
shift.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
shift.o: $(topdir)/error.h $(topdir)/general.h
shift.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
shift.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
shift.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
shift.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
source.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
source.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
source.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/findcmd.h
source.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
source.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
source.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
source.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
suspend.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
suspend.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
suspend.o: $(topdir)/error.h $(topdir)/general.h
suspend.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
suspend.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
suspend.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
suspend.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
test.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
test.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
test.o: $(topdir)/error.h $(topdir)/general.h
test.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
test.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
test.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
test.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
test.o: $(topdir)/test.h
times.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
times.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
times.o: $(topdir)/error.h $(topdir)/general.h
times.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
times.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
times.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
times.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
trap.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
times.o: $(BASHINCDIR)/posixtime.h
trap.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
trap.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/externs.h
trap.o: $(topdir)/quit.h $(srcdir)/common.h $(topdir)/maxpath.h
trap.o: $(topdir)/quit.h $(srcdir)/common.h $(BASHINCDIR)/maxpath.h
trap.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
trap.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
trap.o: $(topdir)/findcmd.h
type.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
type.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
type.o: $(topdir)/error.h $(topdir)/general.h
type.o: $(topdir)/quit.h $(srcdir)/common.h $(topdir)/maxpath.h
type.o: $(topdir)/quit.h $(srcdir)/common.h $(BASHINCDIR)/maxpath.h
type.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
type.o: $(topdir)/externs.h $(topdir)/hashcmd.h
type.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
ulimit.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
ulimit.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
ulimit.o: $(topdir)/error.h $(topdir)/general.h
ulimit.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
ulimit.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
ulimit.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
ulimit.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
umask.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
umask.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
umask.o: $(topdir)/error.h $(topdir)/general.h
umask.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
umask.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
umask.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
umask.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
wait.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
wait.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
wait.o: $(topdir)/error.h $(topdir)/general.h
wait.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
wait.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
wait.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
wait.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
shopt.o: $(topdir)/command.h ../config.h $(topdir)/memalloc.h
shopt.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
shopt.o: $(topdir)/error.h $(topdir)/general.h
shopt.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
shopt.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/maxpath.h
shopt.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
shopt.o: $(topdir)/shell.h $(topdir)/unwind_prot.h $(topdir)/variables.h
shopt.o: $(srcdir)/common.h $(srcdir)/bashgetopt.h
complete.o: ../config.h
complete.o: ${topdir}/shell.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h ${topdir}/sig.h
complete.o: ${topdir}/unwind_prot.h ${topdir}/variables.h
complete.o: ${topdir}/bashtypes.h ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h
complete.o: ${topdir}/builtins.h
complete.o: ${topdir}/pcomplete.h
complete.o: ${srcdir}/common.h ${srcdir}/bashgetopt.h
#bind.o: $(RL_LIBSRC)chardefs.h $(RL_LIBSRC)readline.h $(RL_LIBSRC)keymaps.h

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$BUILTIN alias
$FUNCTION alias_builtin

View file

@ -6,7 +6,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -16,7 +16,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#include <config.h>

View file

@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
/* See getopt.h for the explanation of these variables. */

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES bind.c
@ -26,7 +26,7 @@ $PRODUCES bind.c
$BUILTIN bind
$DEPENDS_ON READLINE
$FUNCTION bind_builtin
$SHORT_DOC bind [-lpvsPVS] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [keyseq:readline-function]
$SHORT_DOC bind [-lpvsPVS] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function]
Bind a key sequence to a Readline function, or to a macro. The
syntax is equivalent to that found in ~/.inputrc, but must be
passed as a single argument: bind '"\C-x\C-r": re-read-init-file'.
@ -40,6 +40,8 @@ Arguments we accept:
-p List functions and bindings in a form that can be
reused as input.
-r keyseq Remove the binding for KEYSEQ.
-x keyseq:shell-command Cause SHELL-COMMAND to be executed when KEYSEQ
is entered.
-f filename Read key bindings from FILENAME.
-q function-name Query about which keys invoke the named function.
-u function-name Unbind all keys which are bound to the named function.
@ -93,6 +95,7 @@ extern int no_line_editing;
#define SFLAG 0x0200
#define SSFLAG 0x0400
#define UFLAG 0x0800
#define XFLAG 0x1000
int
bind_builtin (list)
@ -102,7 +105,7 @@ bind_builtin (list)
FILE *old_rl_outstream;
Keymap kmap, saved_keymap;
int flags, opt;
char *initfile, *map_name, *fun_name, *unbind_name, *remove_seq;
char *initfile, *map_name, *fun_name, *unbind_name, *remove_seq, *cmd_seq;
if (no_line_editing)
return (EXECUTION_FAILURE);
@ -122,7 +125,7 @@ bind_builtin (list)
rl_outstream = stdout;
reset_internal_getopt ();
while ((opt = internal_getopt (list, "lvpVPsSf:q:u:m:r:")) != EOF)
while ((opt = internal_getopt (list, "lvpVPsSf:q:u:m:r:x:")) != EOF)
{
switch (opt)
{
@ -167,6 +170,10 @@ bind_builtin (list)
case 'S':
flags |= SSFLAG;
break;
case 'x':
flags |= XFLAG;
cmd_seq = list_optarg;
break;
default:
builtin_usage ();
BIND_RETURN (EX_USAGE);
@ -242,6 +249,9 @@ bind_builtin (list)
}
}
if (flags & XFLAG)
return_code = bind_keyseq_to_unix_command (cmd_seq);
/* Process the rest of the arguments as binding specifications. */
while (list)
{

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES break.c

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES builtin.c

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES cd.c
#include <config.h>
@ -30,8 +30,8 @@ $PRODUCES cd.c
#endif
#include "../bashtypes.h"
#include "../posixdir.h"
#include "../posixstat.h"
#include "posixdir.h"
#include "posixstat.h"
#ifndef _MINIX
#include <sys/param.h>
#endif
@ -45,7 +45,7 @@ $PRODUCES cd.c
#include "../shell.h"
#include "../flags.h"
#include "../maxpath.h"
#include "maxpath.h"
#include "common.h"
#include "bashgetopt.h"
@ -83,45 +83,6 @@ instead of following symbolic links; the -L option forces symbolic links
to be followed.
$END
/* Take PATH, an element from $CDPATH, and DIR, a directory name, and paste
them together into PATH/DIR. Tilde expansion is performed on PATH if
DOTILDE is non-zero. If PATH is the empty string, it is converted to
`./', since a null element in $CDPATH means the current directory. */
static char *
mkpath (path, dir, dotilde)
char *path, *dir;
int dotilde;
{
int dirlen, pathlen;
char *ret, *xpath;
if (*path == '\0')
{
xpath = xmalloc (2);
xpath[0] = '.';
xpath[1] = '\0';
pathlen = 1;
}
else
{
xpath = (dotilde && *path == '~') ? bash_tilde_expand (path) : path;
pathlen = strlen (xpath);
}
dirlen = strlen (dir);
ret = xmalloc (2 + dirlen + pathlen);
strcpy (ret, xpath);
if (xpath[pathlen - 1] != '/')
{
ret[pathlen++] = '/';
ret[pathlen] = '\0';
}
strcpy (ret + pathlen, dir);
if (xpath != path)
free (xpath);
return (ret);
}
static int
bindpwd (no_symlinks)
int no_symlinks;
@ -245,7 +206,7 @@ cd_builtin (list)
{
/* OPT is 1 if the path element is non-empty */
opt = path[0] != '\0';
temp = mkpath (path, dirname, 1);
temp = sh_makepath (path, dirname, MP_DOTILDE);
free (path);
if (stat (temp, &sb) < 0 || S_ISDIR (sb.st_mode) == 0)

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES colon.c

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES command.c

View file

@ -4,7 +4,7 @@
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#include <config.h>
@ -27,7 +27,7 @@
#include <stdio.h>
#include "../bashtypes.h"
#include "../posixstat.h"
#include "posixstat.h"
#include <signal.h>
#include <errno.h>
@ -43,7 +43,7 @@
#include "../bashansi.h"
#include "../shell.h"
#include "../maxpath.h"
#include "maxpath.h"
#include "../flags.h"
#include "../jobs.h"
#include "../builtins.h"
@ -63,6 +63,12 @@
extern int errno;
#endif /* !errno */
#ifdef __STDC__
typedef int QSFUNC (const void *, const void *);
#else
typedef int QSFUNC ();
#endif
extern int no_symbolic_links, interactive, interactive_shell;
extern int indirection_level, startup_state, subshell_environment;
extern int line_number;
@ -462,7 +468,7 @@ get_job_spec (list)
if (digit (*word) && all_digits (word))
{
job = atoi (word);
return (job - 1);
return (job >= job_slots ? NO_JOB : job - 1);
}
substring = 0;
@ -701,13 +707,8 @@ shell_builtin_compare (sbp1, sbp2)
void
initialize_shell_builtins ()
{
#ifdef _MINIX
qsort (shell_builtins, num_shell_builtins, sizeof (struct builtin),
(int (*)(const void *, const void *))shell_builtin_compare);
#else
qsort (shell_builtins, num_shell_builtins, sizeof (struct builtin),
shell_builtin_compare);
#endif
(QSFUNC *)shell_builtin_compare);
}
/* **************************************************************** */
@ -767,6 +768,7 @@ double_quote (string)
case '$':
case '`':
case '\\':
case '\n': /* XXX */
*r++ = '\\';
default:
*r++ = c;
@ -780,6 +782,37 @@ double_quote (string)
return (result);
}
/* Remove backslashes that are quoting characters that are special between
double quotes. Return a new string. */
char *
un_double_quote (string)
char *string;
{
register int c, pass_next;
char *result, *r, *s;
r = result = xmalloc (strlen (string) + 1);
for (pass_next = 0, s = string; s && (c = *s); s++)
{
if (pass_next)
{
*r++ = c;
pass_next = 0;
continue;
}
if (c == '\\' && strchr (slashify_in_quotes, s[1]))
{
pass_next = 1;
continue;
}
*r++ = c;
}
*r = '\0';
return result;
}
/* Quote special characters in STRING using backslashes. Return a new
string. */
char *
@ -827,6 +860,41 @@ backslash_quote (string)
return (result);
}
#if defined (PROMPT_STRING_DECODE)
/* Quote characters that get special treatment when in double quotes in STRING
using backslashes. Return a new string. */
char *
backslash_quote_for_double_quotes (string)
char *string;
{
int c;
char *result, *r, *s;
result = xmalloc (2 * strlen (string) + 1);
for (r = result, s = string; s && (c = *s); s++)
{
switch (c)
{
case '"':
case '$':
case '`':
case '\\':
case '\n':
*r++ = '\\';
*r++ = c;
break;
default:
*r++ = c;
break;
}
}
*r = '\0';
return (result);
}
#endif /* PROMPT_STRING_DECODE */
int
contains_shell_metas (string)
char *string;

View file

@ -16,12 +16,12 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (__COMMON_H)
# define __COMMON_H
#include "../stdc.h"
#include "stdc.h"
#define ISOPTION(s, c) (s[0] == '-' && !s[2] && s[1] == c)
@ -72,7 +72,9 @@ extern void initialize_shell_builtins __P((void));
extern char *single_quote __P((char *));
extern char *double_quote __P((char *));
extern char *un_double_quote __P((char *));
extern char *backslash_quote __P((char *));
extern char *backslash_quote_for_double_quotes __P((char *));
extern int contains_shell_metas __P((char *));
/* Functions from set.def */
@ -81,9 +83,11 @@ extern void list_minus_o_opts __P((int, int));
extern int set_minus_o_option __P((int, char *));
extern int minus_o_option_value __P((char *));
extern void reset_shell_options __P((void));
extern char **get_minus_o_opts __P((void));
/* Functions from shopt.def */
extern void reset_shopt_options __P((void));
extern char **get_shopt_options __P((void));
/* Functions from type.def */
extern int describe_command __P((char *, int, int));

512
builtins/complete.def Normal file
View file

@ -0,0 +1,512 @@
This file is complete.def, from which is created complete.c.
It implements the builtins "complete" and "compgen" in Bash.
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES complete.c
$BUILTIN complete
$DEPENDS_ON PROGRAMMABLE_COMPLETION
$FUNCTION complete_builtin
$SHORT_DOC complete [-abcdefjkvu] [-pr] [-A action] [-G globpat] [-W wordlist] [-P prefix] [-S suffix] [-X filterpat] [-F function] [-C command] [name ...]
For each NAME, specify how arguments are to be completed.
If the -p option is supplied, or if no options are supplied, existing
completion specifications are printed in a way that allows them to be
reused as input. The -r option removes a completion specification for
each NAME, or, if no NAMEs are supplied, all completion specifications.
$END
#include <config.h>
#include <stdio.h>
#include "../bashtypes.h"
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#endif
#include "../bashansi.h"
#include "../shell.h"
#include "../builtins.h"
#include "../pcomplete.h"
#include "common.h"
#include "bashgetopt.h"
#define STRDUP(x) ((x) ? savestring (x) : (char *)NULL)
static int remove_cmd_completions ();
static void print_all_completions ();
static int print_cmd_completions ();
static char *Aarg, *Garg, *Warg, *Parg, *Sarg, *Xarg, *Farg, *Carg;
static struct _compacts {
char *actname;
int actflag;
int actopt;
} compacts[] = {
{ "alias", CA_ALIAS, 'a' },
{ "arrayvar", CA_ARRAYVAR, 0 },
{ "binding", CA_BINDING, 0 },
{ "builtin", CA_BUILTIN, 'b' },
{ "command", CA_COMMAND, 'c' },
{ "directory", CA_DIRECTORY, 'd' },
{ "disabled", CA_DISABLED, 0 },
{ "enabled", CA_ENABLED, 0 },
{ "export", CA_EXPORT, 'e' },
{ "file", CA_FILE, 'f' },
{ "function", CA_FUNCTION, 0 },
{ "helptopic", CA_BUILTIN, 0 }, /* for now */
{ "hostname", CA_HOSTNAME, 0 },
{ "job", CA_JOB, 'j' },
{ "keyword", CA_KEYWORD, 'k' },
{ "running", CA_RUNNING, 0 },
{ "setopt", CA_SETOPT, 0 },
{ "shopt", CA_SHOPT, 0 },
{ "signal", CA_SIGNAL, 0 },
{ "stopped", CA_STOPPED, 0 },
{ "user", CA_USER, 'u' },
{ "variable", CA_VARIABLE, 'v' },
{ (char *)NULL, 0, 0 },
};
static int
find_compact (name)
char *name;
{
register int i;
for (i = 0; compacts[i].actname; i++)
if (STREQ (name, compacts[i].actname))
return i;
return -1;
}
/* Build the actions from the options specified in LIST. ACTP is a pointer
to an unsigned long in which to place the bitmap of actions. PP, if
non-null, gets 1 if -p is supplied; RP, if non-null, gets 1 if -r is
supplied. If either is null, the corresponding option generates an
error. This also sets variables corresponding to options that take
arguments as a side effect; the caller should ensure that those variables
are set to NULL before calling build_actions. Return value:
EX_USAGE = bad option
EXECUTION_SUCCESS = some options supplied
EXECUTION_FAILURE = no options supplied
*/
static int
build_actions (list, pp, rp, actp)
WORD_LIST *list;
int *pp, *rp;
unsigned long *actp;
{
int opt, ind, pflag, rflag, opt_given;
unsigned long acts;
acts = (unsigned long)0L;
opt_given = 0;
reset_internal_getopt ();
while ((opt = internal_getopt (list, "abcdefjkpruvA:G:W:P:S:X:F:C:")) != -1)
{
opt_given = 1;
switch (opt)
{
case 'r':
if (rp)
{
*rp = 1;
break;
}
else
{
builtin_error ("illegal option: -r");
builtin_usage ();
return (EX_USAGE);
}
case 'p':
if (pp)
{
*pp = 1;
break;
}
else
{
builtin_error ("illegal option: -p");
builtin_usage ();
return (EX_USAGE);
}
case 'a':
acts |= CA_ALIAS;
break;
case 'b':
acts |= CA_BUILTIN;
break;
case 'c':
acts |= CA_COMMAND;
break;
case 'd':
acts |= CA_DIRECTORY;
break;
case 'e':
acts |= CA_EXPORT;
break;
case 'f':
acts |= CA_FILE;
break;
case 'j':
acts |= CA_JOB;
break;
case 'k':
acts |= CA_KEYWORD;
break;
case 'u':
acts |= CA_USER;
break;
case 'v':
acts |= CA_VARIABLE;
break;
case 'A':
ind = find_compact (list_optarg);
if (ind < 0)
{
builtin_error ("%s: invalid action name", list_optarg);
return (EX_USAGE);
}
acts |= compacts[ind].actflag;
break;
case 'C':
Carg = list_optarg;
break;
case 'F':
Farg = list_optarg;
break;
case 'G':
Garg = list_optarg;
break;
case 'P':
Parg = list_optarg;
break;
case 'S':
Sarg = list_optarg;
break;
case 'W':
Warg = list_optarg;
break;
case 'X':
Xarg = list_optarg;
break;
default:
builtin_usage ();
return (EX_USAGE);
}
}
*actp = acts;
return (opt_given ? EXECUTION_SUCCESS : EXECUTION_FAILURE);
}
/* Add, remove, and display completion specifiers. */
int
complete_builtin (list)
WORD_LIST *list;
{
int opt_given, pflag, rflag, rval;
unsigned long acts;
char *cmd;
COMPSPEC *cs;
if (list == 0)
{
print_all_completions ();
return (EXECUTION_SUCCESS);
}
opt_given = pflag = rflag = 0;
acts = (unsigned long)0L;
Aarg = Garg = Warg = Parg = Sarg = Xarg = Farg = Carg = (char *)NULL;
cs = (COMPSPEC *)NULL;
/* Build the actions from the arguments. Also sets the [A-Z]arg variables
as a side effect if they are supplied as options. */
rval = build_actions (list, &pflag, &rflag, &acts);
if (rval == EX_USAGE)
return (rval);
opt_given = rval != EXECUTION_FAILURE;
list = loptend;
/* -p overrides everything else */
if (pflag || (list == 0 && opt_given == 0))
{
if (list == 0)
{
print_all_completions ();
return (EXECUTION_SUCCESS);
}
return (print_cmd_completions (list));
}
/* next, -r overrides everything else. */
if (rflag)
{
if (list == 0)
{
clear_progcomps ();
return (EXECUTION_SUCCESS);
}
return (remove_cmd_completions (list));
}
if (list == 0 && opt_given)
{
builtin_usage ();
return (EX_USAGE);
}
/* If we get here, we need to build a compspec and add it for each
remaining argument. */
cs = alloc_compspec ();
cs->actions = acts;
cs->globpat = STRDUP (Garg);
cs->words = STRDUP (Warg);
cs->prefix = STRDUP (Parg);
cs->suffix = STRDUP (Sarg);
cs->funcname = STRDUP (Farg);
cs->command = STRDUP (Carg);
cs->filterpat = STRDUP (Xarg);
for (rval = EXECUTION_SUCCESS ; list; list = list->next)
{
/* Add CS as the compspec for the specified commands. */
cmd = list->word->word;
if (add_progcomp (cmd, cs) == 0)
rval = EXECUTION_FAILURE;
}
return (rval);
}
static int
remove_cmd_completions (list)
WORD_LIST *list;
{
WORD_LIST *l;
int ret;
for (ret = EXECUTION_SUCCESS, l = list; l; l = l->next)
{
if (remove_progcomp (l->word->word) == 0)
{
builtin_error ("%s: no completion specification", l->word->word);
ret = EXECUTION_FAILURE;
}
}
return ret;
}
#define SQPRINTARG(a, f) \
do { \
if (a) \
{ \
x = single_quote (a); \
printf ("%s %s ", f, x); \
free (x); \
} \
} while (0)
#define PRINTARG(a, f) \
do { \
if (a) \
printf ("%s %s ", f, a); \
} while (0)
#define PRINTOPT(a, f) \
do { \
if (acts & a) \
printf ("%s ", f); \
} while (0)
#define PRINTACT(a, f) \
do { \
if (acts & a) \
printf ("-A %s ", f); \
} while (0)
static void
print_one_completion (cmd, cs)
char *cmd;
COMPSPEC *cs;
{
unsigned long acts;
char *x;
printf ("complete ");
acts = cs->actions;
/* simple flags first */
PRINTOPT (CA_ALIAS, "-a");
PRINTOPT (CA_BUILTIN, "-b");
PRINTOPT (CA_COMMAND, "-c");
PRINTOPT (CA_DIRECTORY, "-d");
PRINTOPT (CA_EXPORT, "-e");
PRINTOPT (CA_FILE, "-f");
PRINTOPT (CA_KEYWORD, "-k");
PRINTOPT (CA_JOB, "-j");
PRINTOPT (CA_USER, "-u");
PRINTOPT (CA_VARIABLE, "-v");
/* now the rest of the actions */
PRINTACT (CA_ARRAYVAR, "arrayvar");
PRINTACT (CA_BINDING, "binding");
PRINTACT (CA_DISABLED, "disabled");
PRINTACT (CA_ENABLED, "enabled");
PRINTACT (CA_FUNCTION, "function");
PRINTACT (CA_HELPTOPIC, "helptopic");
PRINTACT (CA_HOSTNAME, "hostname");
PRINTACT (CA_RUNNING, "running");
PRINTACT (CA_SETOPT, "setopt");
PRINTACT (CA_SHOPT, "shopt");
PRINTACT (CA_SIGNAL, "signal");
PRINTACT (CA_STOPPED, "stopped");
/* now the rest of the arguments */
/* arguments that require quoting */
SQPRINTARG (cs->globpat, "-G");
SQPRINTARG (cs->words, "-W");
SQPRINTARG (cs->prefix, "-P");
SQPRINTARG (cs->suffix, "-S");
SQPRINTARG (cs->filterpat, "-X");
/* simple arguments that don't require quoting */
PRINTARG (cs->funcname, "-F");
PRINTARG (cs->command, "-C");
printf ("%s\n", cmd);
}
static void
print_all_completions ()
{
print_all_compspecs (print_one_completion);
}
static int
print_cmd_completions (list)
WORD_LIST *list;
{
WORD_LIST *l;
COMPSPEC *cs;
int ret;
for (ret = EXECUTION_SUCCESS, l = list; l; l = l->next)
{
cs = find_compspec (l->word->word);
if (cs)
print_one_completion (l->word->word, cs);
else
{
builtin_error ("%s: no completion specification", l->word->word);
ret = EXECUTION_FAILURE;
}
}
return (ret);
}
$BUILTIN compgen
$DEPENDS_ON PROGRAMMABLE_COMPLETION
$FUNCTION compgen_builtin
$SHORT_DOC compgen [-abcdefjkvu] [-A action] [-G globpat] [-W wordlist] [-P prefix] [-S suffix] [-X filterpat] [-F function] [-C command] [word]
Display the possible completions depending on the options. Intended
to be used from within a shell function generating possible completions.
If the optional WORD argument is supplied, matches against WORD are
generated.
$END
int
compgen_builtin (list)
WORD_LIST *list;
{
int rval;
unsigned long acts;
COMPSPEC *cs;
STRINGLIST *sl;
char *word;
if (list == 0)
return (EXECUTION_SUCCESS);
acts = (unsigned long)0L;
Aarg = Garg = Warg = Parg = Sarg = Xarg = Farg = Carg = (char *)NULL;
cs = (COMPSPEC *)NULL;
/* Build the actions from the arguments. Also sets the [A-Z]arg variables
as a side effect if they are supplied as options. */
rval = build_actions (list, (int *)NULL, (int *)NULL, &acts);
if (rval == EX_USAGE)
return (rval);
if (rval == EXECUTION_FAILURE)
return (EXECUTION_SUCCESS);
list = loptend;
word = (list && list->word) ? list->word->word : "";
if (Farg)
internal_warning ("compgen: -F option may not work as you expect");
if (Carg)
internal_warning ("compgen: -C option may not work as you expect");
/* If we get here, we need to build a compspec and evaluate it. */
cs = alloc_compspec ();
cs->actions = acts;
cs->refcount = 1;
cs->globpat = STRDUP (Garg);
cs->words = STRDUP (Warg);
cs->prefix = STRDUP (Parg);
cs->suffix = STRDUP (Sarg);
cs->funcname = STRDUP (Farg);
cs->command = STRDUP (Carg);
cs->filterpat = STRDUP (Xarg);
rval = EXECUTION_FAILURE;
sl = gen_compspec_completions (cs, "compgen", word, 0, 0);
if (sl)
{
if (sl->list)
{
rval = EXECUTION_SUCCESS;
print_stringlist (sl, (char *)NULL);
}
free_stringlist (sl);
}
free_compspec (cs);
return (rval);
}

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES declare.c
@ -255,10 +255,15 @@ declare_internal (list, local_var)
{
#if defined (ARRAY_VARS)
if ((flags_on & att_array) || making_array_special)
make_local_array_variable (name);
var = make_local_array_variable (name);
else
#endif
make_local_variable (name);
var = make_local_variable (name);
if (var == 0)
{
any_failed++;
NEXT_VARIABLE ();
}
}
/* If we are declaring a function, then complain about it in some way.
@ -297,8 +302,8 @@ declare_internal (list, local_var)
}
else /* declare -[fF] -[rx] name [name...] */
{
var->attributes |= flags_on;
var->attributes &= ~flags_off;
VSETATTR (var, flags_on);
VUNSETATTR (var, flags_off);
}
}
else
@ -364,22 +369,18 @@ declare_internal (list, local_var)
var = convert_var_to_array (var);
#endif /* ARRAY_VARS */
var->attributes |= flags_on;
var->attributes &= ~flags_off;
VSETATTR (var, flags_on);
VUNSETATTR (var, flags_off);
#if defined (ARRAY_VARS)
if (offset && assigning_array_special)
assign_array_var_from_string (var, value);
else
#endif
/* This essentially duplicates the internals of bind_variable() */
/* bind_variable_value duplicates the essential internals of
bind_variable() */
if (offset)
{
var->attributes &= ~att_invisible;
t = make_variable_value (var, value);
FREE (var->value);
var->value = t;
}
bind_variable_value (var, value);
/* If we found this variable in the temporary environment, as with
`var=value declare -x var', make sure it is treated identically

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES echo.c
#include <config.h>
@ -67,6 +67,17 @@ $END
# define VALID_ECHO_OPTIONS "n"
#endif /* !V9_ECHO */
/* System V machines already have a /bin/sh with a v9 behaviour. We
give Bash the identical behaviour for these machines so that the
existing system shells won't barf. Regrettably, the SUS v2 has
standardized the Sys V echo behavior. This variable is external
so that we can have a `shopt' variable to control it at runtime. */
#if defined (DEFAULT_ECHO_TO_XPG)
int xpg_echo = 1;
#else
int xpg_echo = 0;
#endif /* DEFAULT_ECHO_TO_XPG */
/* Print the words in LIST to standard output. If the first word is
`-n', then don't print a trailing newline. We also support the
echo syntax from Version 9 Unix systems. */
@ -77,15 +88,7 @@ echo_builtin (list)
int display_return, do_v9, i, len;
char *temp, *s;
#if defined (DEFAULT_ECHO_TO_USG)
/* System V machines already have a /bin/sh with a v9 behaviour. We
give Bash the identical behaviour for these machines so that the
existing system shells won't barf. */
do_v9 = 1;
#else
do_v9 = 0;
#endif /* DEFAULT_ECHO_TO_USG */
do_v9 = xpg_echo;
display_return = 1;
for (; list && (temp = list->word->word) && *temp == '-'; list = list->next)
@ -133,7 +136,7 @@ just_echo:
while (list)
{
i = len = 0;
temp = do_v9 ? ansicstr (list->word->word, STRLEN (list->word->word), &i, &len)
temp = do_v9 ? ansicstr (list->word->word, STRLEN (list->word->word), 1, &i, &len)
: list->word->word;
if (temp)
{
@ -163,5 +166,10 @@ just_echo:
if (display_return)
putchar ('\n');
fflush (stdout);
if (ferror (stdout))
{
clearerr (stdout);
return (EXECUTION_FAILURE);
}
return (EXECUTION_SUCCESS);
}

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES enable.c
@ -56,6 +56,10 @@ $END
#include "common.h"
#include "bashgetopt.h"
#if defined (PROGRAMMABLE_COMPLETION)
# include "../pcomplete.h"
#endif
#if defined (HAVE_DLOPEN) && defined (HAVE_DLSYM)
static int dyn_load_builtin ();
#endif
@ -163,6 +167,9 @@ enable_builtin (list)
filter |= SPECIAL;
result = dyn_load_builtin (list, filter, filename);
#if defined (PROGRAMMABLE_COMPLETION)
set_itemlist_dirty (&it_builtins);
#endif
}
#endif
#if defined (HAVE_DLCLOSE)
@ -175,6 +182,9 @@ enable_builtin (list)
result = EXECUTION_FAILURE;
list = list->next;
}
#if defined (PROGRAMMABLE_COMPLETION)
set_itemlist_dirty (&it_builtins);
#endif
}
#endif
else
@ -237,6 +247,11 @@ enable_shell_command (name, disable_p)
else
b->flags |= BUILTIN_ENABLED;
#if defined (PROGRAMMABLE_COMPLETION)
set_itemlist_dirty (&it_enabled);
set_itemlist_dirty (&it_disabled);
#endif
return (EXECUTION_SUCCESS);
}

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES eval.c

View file

@ -4,7 +4,7 @@
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#include <config.h>
@ -23,8 +23,8 @@
#endif
#include "../bashtypes.h"
#include "../posixstat.h"
#include "../filecntl.h"
#include "posixstat.h"
#include "filecntl.h"
#include <stdio.h>
#include <signal.h>

View file

@ -4,7 +4,7 @@
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#include <config.h>
@ -30,7 +30,7 @@
#include <errno.h>
#include "../filecntl.h"
#include "filecntl.h"
#include "../bashansi.h"
#include "../shell.h"
@ -54,6 +54,7 @@ extern int errno;
#define IS_BUILTIN(s) (builtin_address_internal(s, 0) != (struct builtin *)NULL)
extern void run_trap_cleanup ();
extern int zwrite ();
extern int interactive, interactive_shell;
extern int indirection_level, startup_state, subshell_environment;
@ -94,7 +95,7 @@ parse_and_execute (string, from_file, flags)
char *from_file;
int flags;
{
int code;
int code, x;
volatile int should_jump_to_top_level, last_result;
char *orig_string;
COMMAND *volatile command;
@ -119,6 +120,12 @@ parse_and_execute (string, from_file, flags)
# endif /* BANG_HISTORY */
#endif /* HISTORY */
if (interactive_shell)
{
x = get_current_prompt_level ();
add_unwind_protect (set_current_prompt_level, x);
}
add_unwind_protect (pop_stream, (char *)NULL);
if (orig_string)
add_unwind_protect (xfree, orig_string);
@ -282,36 +289,6 @@ parse_and_execute (string, from_file, flags)
return (last_result);
}
/* Write NB bytes from BUF to file descriptor FD, retrying the write if
it is interrupted. We retry three times if we get a zero-length
write. Any other signal causes this function to return prematurely. */
static int
zwrite (fd, buf, nb)
int fd;
unsigned char *buf;
int nb;
{
int n, i, nt;
for (n = nb, nt = 0;;)
{
i = write (fd, buf, n);
if (i > 0)
{
n -= i;
if (n <= 0)
return nb;
}
else if (i == 0)
{
if (++nt > 3)
return (nb - n);
}
else if (errno != EINTR)
return -1;
}
}
/* Handle a $( < file ) command substitution. This expands the filename,
returning errors as appropriate, then just cats the file to the standard
output. */
@ -349,10 +326,7 @@ cat_file (r)
rval = 0;
while (1)
{
/* Retry the reads on EINTR. Any other error causes a break from the
loop. */
while ((nr = read (fd, lbuf, sizeof(lbuf))) < 0 && errno == EINTR)
;
nr = zread (fd, lbuf, sizeof(lbuf));
if (nr == 0)
break;
else if (nr < 0)

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES exec.c
@ -37,7 +37,7 @@ $END
#include <config.h>
#include "../bashtypes.h"
#include "../posixstat.h"
#include "posixstat.h"
#include <signal.h>
#include <errno.h>

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES exit.c

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES fc.c
@ -53,7 +53,7 @@ $END
# include <sys/param.h>
#endif
#include "../bashtypes.h"
#include "../posixstat.h"
#include "posixstat.h"
#ifndef _MINIX
# include <sys/file.h>
#endif
@ -70,8 +70,8 @@ $END
#include "../shell.h"
#include "../builtins.h"
#include "../flags.h"
#include "../maxpath.h"
#include "../bashhist.h"
#include "maxpath.h"
#include <readline/history.h>
#include "bashgetopt.h"
#include "common.h"

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES fg_bg.c

View file

@ -15,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#include <config.h>
@ -27,7 +27,7 @@
#endif
#include <stdio.h>
#include "../memalloc.h"
#include "memalloc.h"
#include "../shell.h"
#include "getopt.h"

View file

@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
/* XXX THIS HAS BEEN MODIFIED FOR INCORPORATION INTO BASH XXX */

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES getopts.c
@ -194,7 +194,7 @@ dogetopts (argc, argv)
;
for (words = rest_of_args; words; words = words->next, i++)
;
v = (char **)xmalloc ((i + 1) * sizeof (char *));
v = alloc_array (i + 1);
for (i = 0; i < 10 && dollar_vars[i]; i++)
v[i] = dollar_vars[i];
for (words = rest_of_args; words; words = words->next, i++)

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES hash.c
@ -106,6 +106,14 @@ hash_builtin (list)
if (expunge_hash_table)
flush_hashed_filenames ();
#if defined (RESTRICTED_SHELL)
if (restricted && pathname && strchr (pathname, '/'))
{
builtin_error ("%s: restricted", pathname);
return (EXECUTION_FAILURE);
}
#endif
for (opt = EXECUTION_SUCCESS; list; list = list->next)
{
/* Add or rehash the specified commands. */

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,17 +17,19 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES help.c
$BUILTIN help
$FUNCTION help_builtin
$DEPENDS_ON HELP_BUILTIN
$SHORT_DOC help [pattern ...]
$SHORT_DOC help [-s] [pattern ...]
Display helpful information about builtin commands. If PATTERN is
specified, gives detailed help on all commands matching PATTERN,
otherwise a list of the builtins is printed.
otherwise a list of the builtins is printed. The -s option
restricts the output for each builtin command matching PATTERN to
a short usage synopsis.
$END
#include <config.h>
@ -64,14 +66,17 @@ help_builtin (list)
{
register int i, j;
char *pattern, *name;
int plen, match_found;
int plen, match_found, sflag;
/* Placeholder for future options. */
sflag = 0;
reset_internal_getopt ();
while ((i = internal_getopt (list, "")) != -1)
while ((i = internal_getopt (list, "s")) != -1)
{
switch (i)
{
case 's':
sflag = 1;
break;
default:
builtin_usage ();
return (EX_USAGE);
@ -108,8 +113,9 @@ help_builtin (list)
{
printf ("%s: %s\n", name, shell_builtins[i].short_doc);
for (j = 0; shell_builtins[i].long_doc[j]; j++)
printf (" %s\n", shell_builtins[i].long_doc[j]);
if (sflag == 0)
for (j = 0; shell_builtins[i].long_doc[j]; j++)
printf (" %s\n", shell_builtins[i].long_doc[j]);
match_found++;
}

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,18 +17,19 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES history.c
$BUILTIN history
$FUNCTION history_builtin
$DEPENDS_ON HISTORY
$SHORT_DOC history [-c] [n] or history -awrn [filename] or history -ps arg [arg...]
$SHORT_DOC history [-c] [-d offset] [n] or history -awrn [filename] or history -ps arg [arg...]
Display the history list with line numbers. Lines listed with
with a `*' have been modified. Argument of N says to list only
the last N lines. The -c option causes the history list to be
cleared by deleting all of the entries. The `-w' option writes out the
the last N lines. The `-c' option causes the history list to be
cleared by deleting all of the entries. The `-d' option deletes
the history entry at offset OFFSET. The `-w' option writes out the
current history to the history file; `-r' means to read the file and
append the contents to the history list instead. `-a' means
to append history lines from this session to the history file.
@ -49,8 +50,8 @@ $END
#ifndef _MINIX
# include <sys/file.h>
#endif
#include "../posixstat.h"
#include "../filecntl.h"
#include "posixstat.h"
#include "filecntl.h"
#include <errno.h>
#include <stdio.h>
#if defined (HAVE_UNISTD_H)
@ -72,6 +73,7 @@ extern int errno;
static void display_history ();
static void push_history ();
static int expand_and_print_history ();
static int delete_histent ();
#define AFLAG 0x01
#define RFLAG 0x02
@ -80,17 +82,19 @@ static int expand_and_print_history ();
#define SFLAG 0x10
#define PFLAG 0x20
#define CFLAG 0x40
#define DFLAG 0x80
int
history_builtin (list)
WORD_LIST *list;
{
int flags, opt, result;
char *filename;
char *filename, *delete_arg;
long delete_offset;
flags = 0;
reset_internal_getopt ();
while ((opt = internal_getopt (list, "acnpsrw")) != -1)
while ((opt = internal_getopt (list, "acd:npsrw")) != -1)
{
switch (opt)
{
@ -112,6 +116,10 @@ history_builtin (list)
case 's':
flags |= SFLAG;
break;
case 'd':
flags |= DFLAG;
delete_arg = list_optarg;
break;
case 'p':
#if defined (BANG_HISTORY)
flags |= PFLAG;
@ -153,6 +161,26 @@ history_builtin (list)
return (EXECUTION_SUCCESS);
}
#endif
else if (flags & DFLAG)
{
if (legal_number (delete_arg, &delete_offset) == 0)
{
builtin_error ("%s: not a valid history position", delete_arg);
return (EXECUTION_FAILURE);
}
opt = delete_offset;
if (opt < history_base || opt < 0 || opt > (history_base + history_length))
{
builtin_error ("%d: not a valid history position", opt);
return (EXECUTION_FAILURE);
}
result = delete_histent (opt - history_base);
/* Since remove_history changes history_length, this can happen if
we delete the last history entry. */
if (where_history () > history_length)
history_set_pos (history_length);
return (result ? EXECUTION_SUCCESS : EXECUTION_FAILURE);
}
else if ((flags & (AFLAG|RFLAG|NFLAG|WFLAG|CFLAG)) == 0)
{
display_history (list);
@ -224,11 +252,28 @@ display_history (list)
}
}
/* Delete and free the history list entry at offset I. */
static int
delete_histent (i)
int i;
{
HIST_ENTRY *discard;
discard = remove_history (i);
if (discard)
{
if (discard->line)
free (discard->line);
free ((char *) discard);
}
return 1;
}
static int
delete_last_history ()
{
register int i;
HIST_ENTRY **hlist, *histent, *discard;
HIST_ENTRY **hlist, *histent;
hlist = history_list ();
if (hlist == NULL)
@ -243,14 +288,7 @@ delete_last_history ()
if (histent == NULL)
return 0;
discard = remove_history (i);
if (discard)
{
if (discard->line)
free (discard->line);
free ((char *) discard);
}
return (1);
return (delete_histent (i));
}
/* Remove the last entry in the history list and add each argument in

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES inlib.c
#include <config.h>

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES jobs.c

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES kill.c

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$BUILTIN let
$FUNCTION let_builtin

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#include <config.h>
@ -33,8 +33,8 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <sys/file.h>
#endif
#include "../posixstat.h"
#include "../filecntl.h"
#include "posixstat.h"
#include "filecntl.h"
#include "../bashansi.h"
#include <stdio.h>
@ -1036,7 +1036,7 @@ char *structfile_header[] = {
"",
" Bash is free software; you can redistribute it and/or modify it",
" under the terms of the GNU General Public License as published by",
" the Free Software Foundation; either version 1, or (at your option)",
" the Free Software Foundation; either version 2, or (at your option)",
" any later version.",
"",
" Bash is distributed in the hope that it will be useful, but WITHOUT",
@ -1046,7 +1046,7 @@ char *structfile_header[] = {
"",
" You should have received a copy of the GNU General Public License",
" along with Bash; see the file COPYING. If not, write to the Free",
" Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */",
" Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */",
"",
"/* The list of shell builtins. Each element is name, function, flags,",
" long-doc, short-doc. The long-doc field contains a pointer to an array",

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -54,7 +54,7 @@ $END
#include "../bashansi.h"
#include "../shell.h"
#include "../stdc.h"
#include "stdc.h"
#include "bashgetopt.h"
#if !defined (errno)
@ -74,12 +74,13 @@ extern int errno;
} while (0)
#define PRETURN(value) \
do { free (format); fflush (stdout); return (value); } while (0)
do { /* free (format); */ fflush (stdout); return (value); } while (0)
#define SKIP1 "#-+ 0"
#define SKIP2 "*0123456789"
static void printstr __P((char *, char *, int, int, int));
static int tescape __P((char *, int, char *, int *));
static char *bexpand __P((char *, int, int *, int *));
static char *mklong __P((char *, int));
static int getchr __P((void));
@ -125,12 +126,12 @@ printf_builtin (list)
if (list->word->word == 0 || list->word->word[0] == '\0')
return (EXECUTION_SUCCESS);
format = ansicstr (list->word->word, strlen (list->word->word), (int *)NULL, &fmtlen);
format = list->word->word;
garglist = list->next;
/* If the format string is empty after preprocessing, return immediately. */
if ((format == 0 || *format == 0) && fmtlen == 0)
if (format == 0 || *format == 0)
return (EXECUTION_SUCCESS);
/* Basic algorithm is to scan the format string for conversion
@ -139,15 +140,25 @@ printf_builtin (list)
format strings are reused as necessary to use up the provided
arguments, arguments of zero/null string are provided to use
up the format string. */
#define FMTIND (fmt - format)
do
{
/* find next format specification */
for (fmt = format; FMTIND < fmtlen; fmt++)
for (fmt = format; *fmt; fmt++)
{
precision = fieldwidth = foundmod = 0;
if (*fmt == '\\')
{
fmt++;
/* A NULL third argument to tescape means to not do special
processing for \c. */
fmt += tescape (fmt, 1, &nextch, (int *)NULL);
putchar (nextch);
fmt--; /* for loop will increment it for us again */
continue;
}
if (*fmt != '%')
{
putchar (*fmt);
@ -301,10 +312,10 @@ printf_builtin (list)
break;
}
/* We output unrecognized format characters, but we print a
warning message and return a failure exit status. */
/* We don't output unrecognized format characters; we print an
error message and return a failure exit status. */
default:
builtin_error ("`%c': illegal format character", convch);
builtin_error ("`%c': invalid format character", convch);
PRETURN (EXECUTION_FAILURE);
}
@ -430,14 +441,114 @@ printstr (fmt, string, len, fieldwidth, precision)
#define HEXVALUE(c) \
((c) >= 'a' && (c) <= 'f' ? (c)-'a'+10 : (c) >= 'A' && (c) <= 'F' ? (c)-'A'+10 : (c)-'0')
/* Translate a single backslash-escape sequence starting at ESTART (the
character after the backslash) and return the number of characters
consumed by the sequence. CP is the place to return the translated
value. *SAWC is set to 1 if the escape sequence was \c, since that means
to short-circuit the rest of the processing. If SAWC is null, we don't
do the \c short-circuiting, and \c is treated as an unrecognized escape
sequence. */
static int
tescape (estart, trans_squote, cp, sawc)
char *estart;
int trans_squote;
char *cp;
int *sawc;
{
register char *p;
int temp, c, evalue;
p = estart;
switch (c = *p++)
{
#if defined (__STDC__)
case 'a': *cp = '\a'; break;
#else
case 'a': *cp = '\007'; break;
#endif
case 'b': *cp = '\b'; break;
case 'e': *cp = '\033'; break; /* ESC -- non-ANSI */
case 'f': *cp = '\f'; break;
case 'n': *cp = '\n'; break;
case 'r': *cp = '\r'; break;
case 't': *cp = '\t'; break;
case 'v': *cp = '\v'; break;
/* %b octal constants are `\0' followed by one, two, or three
octal digits... */
case '0':
for (temp = 3, evalue = 0; isoctal (*p) && temp--; p++)
evalue = (evalue * 8) + OCTVALUE (*p);
*cp = evalue;
break;
/* but, as an extension, the other echo-like octal escape
sequences are supported as well. */
case '1': case '2': case '3': case '4':
case '5': case '6': case '7':
for (temp = 2, evalue = c - '0'; isoctal (*p) && temp--; p++)
evalue = (evalue * 8) + OCTVALUE (*p);
*cp = evalue;
break;
/* And, as another extension, we allow \xNNN, where each N is a
hex digit. */
case 'x':
for (temp = 3, evalue = 0; isxdigit (*p) && temp--; p++)
evalue = (evalue * 16) + HEXVALUE (*p);
if (temp == 3)
{
builtin_error ("missing hex digit for \\x");
*cp = '\\';
return 0;
}
*cp = evalue;
break;
case '\\': /* \\ -> \ */
*cp = c;
break;
case '\'': /* TRANS_SQUOTE != 0 means \' -> ' */
if (trans_squote)
*cp = c;
else
{
*cp = '\\';
return 0;
}
break;
case 'c':
if (sawc)
{
*sawc = 1;
break;
}
/* other backslash escapes are passed through unaltered */
default:
*cp = '\\';
return 0;
}
return (p - estart);
}
static char *
bexpand (string, len, sawc, lenp)
char *string;
int len, *sawc, *lenp;
{
int c, temp;
char *ret, *r, *s;
int temp;
char *ret, *r, *s, c;
if (string == 0 || *string == '\0')
{
@ -457,74 +568,13 @@ bexpand (string, len, sawc, lenp)
*r++ = c;
continue;
}
switch (c = *s++)
temp = 0;
s += tescape (s, 0, &c, &temp);
if (temp)
{
#if defined (__STDC__)
case 'a': c = '\a'; break;
#else
case 'a': c = '\007'; break;
#endif
case 'b': c = '\b'; break;
case 'e': c = '\033'; break; /* ESC -- non-ANSI */
case 'f': c = '\f'; break;
case 'n': c = '\n'; break;
case 'r': c = '\r'; break;
case 't': c = '\t'; break;
case 'v': c = '\v'; break;
/* %b octal constants are `\0' followed by one, two, or three
octal digits... */
case '0':
for (temp = 3, c = 0; isoctal (*s) && temp--; s++)
c = (c * 8) + OCTVALUE (*s);
break;
/* but, as an extension, the other echo-like octal escape
sequences are supported as well. */
case '1': case '2': case '3': case '4':
case '5': case '6': case '7':
for (temp = 2, c -= '0'; isoctal (*s) && temp--; s++)
c = (c * 8) + OCTVALUE (*s);
break;
/* And, as another extension, we allow \xNNN, where each N is a
hex digit. */
case 'x':
for (temp = 3, c = 0; isxdigit (*s) && temp--; s++)
c = (c * 16) + HEXVALUE (*s);
if (temp == 3)
{
builtin_error ("missing hex digit for \\x");
*r++ = '\\';
c = 'x';
}
break;
case '\\':
#if 0
case '\'': /* XXX */
case '"': /* XXX */
#endif
break;
case 'c':
if (sawc)
*sawc = 1;
*r = '\0';
if (lenp)
*lenp = r - ret;
return ret;
/* other backslash escapes are passed through unaltered */
default: *r++ = '\\'; break;
break;
}
*r++ = c;
@ -600,6 +650,7 @@ getlong (lp)
long *lp;
{
long ret;
char *ep;
if (garglist == 0)
{
@ -614,11 +665,14 @@ getlong (lp)
}
errno = 0;
/* legal_number does not currently detect overflow, but it should.
Someday it will. */
if (legal_number (garglist->word->word, &ret) == 0)
/* If we use 0 as the third argument, we can handle octal and hex, which
legal_number does not. (This was
if (legal_number (garglist->word->word, &ret) == 0)
) */
ret = strtol (garglist->word->word, &ep, 0);
if (*ep != '\0')
{
builtin_error ("%s: illegal number", garglist->word->word);
builtin_error ("%s: invalid number", garglist->word->word);
return (1);
}
else if (errno == ERANGE)
@ -656,7 +710,7 @@ getulong (ulp)
if (*ep)
{
builtin_error ("%s: illegal number", garglist->word->word);
builtin_error ("%s: invalid number", garglist->word->word);
return (1);
}
else if (errno == ERANGE)

View file

@ -6,7 +6,7 @@
Bash is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
/* Write output in 128-byte chunks until we get a sigpipe or write gets an
EPIPE. Then report how many bytes we wrote. We assume that this is the

View file

@ -3,7 +3,7 @@
# psize.sh -- determine this system's pipe size, and write a define to
# pipesize.h so ulimit.c can use it.
TMPDIR=/tmp
: ${TMPDIR:=/tmp}
TMPNAME=pipsize.$$
TMPFILE=$TMPDIR/$TMPNAME

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES pushd.c
@ -113,7 +113,7 @@ $END
#include <tilde/tilde.h>
#include "../shell.h"
#include "../maxpath.h"
#include "maxpath.h"
#include "common.h"
#include "builtext.h"

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,44 +17,53 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES read.c
$BUILTIN read
$FUNCTION read_builtin
$SHORT_DOC read [-r] [-p prompt] [-a array] [-e] [name ...]
$SHORT_DOC read [-ers] [-t timeout] [-p prompt] [-a array] [-n nchars] [-d delim] [name ...]
One line is read from the standard input, and the first word is
assigned to the first NAME, the second word to the second NAME, and so
on, with leftover words assigned to the last NAME. Only the characters
found in $IFS are recognized as word delimiters. The return code is
zero, unless end-of-file is encountered. If no NAMEs are supplied, the
line read is stored in the REPLY variable. If the -r option is given,
this signifies `raw' input, and backslash escaping is disabled. If
the `-p' option is supplied, the string supplied as an argument is
output without a trailing newline before attempting to read. If -a is
supplied, the words read are assigned to sequential indices of ARRAY,
starting at zero. If -e is supplied and the shell is interactive,
readline is used to obtain the line.
found in $IFS are recognized as word delimiters. If no NAMEs are supplied,
the line read is stored in the REPLY variable. If the -r option is given,
this signifies `raw' input, and backslash escaping is disabled. The
-d option causes read to continue until the first character of DELIM is
read, rather than newline. If the `-p' option is supplied, the string
PROMPT is output without a trailing newline before attempting to read.
If -a is supplied, the words read are assigned to sequential indices of
ARRAY, starting at zero. If -e is supplied and the shell is interactive,
readline is used to obtain the line. If -n is supplied with a non-zero
NCHARS argument, read returns after NCHARS characters have been read.
The -s option causes input coming from a terminal to not be echoed.
The -t option causes read to time out and return failure if a complete line
of input is not read within TIMEOUT seconds. The return code is zero,
unless end-of-file is encountered or read times out.
$END
#include <config.h>
#include "bashtypes.h"
#include "posixstat.h"
#include <stdio.h>
#if defined (HAVE_UNISTD_H)
# ifdef _MINIX
# include <sys/types.h>
# endif
# include <unistd.h>
#endif
#include <signal.h>
#include <errno.h>
#include "../shell.h"
#include "common.h"
#include "bashgetopt.h"
#include <shtty.h>
#if defined (READLINE)
#include "../bashline.h"
#include <readline/readline.h>
@ -70,9 +79,29 @@ extern int interrupt_immediately;
#if defined (READLINE)
static char *edit_line ();
static void set_eol_delim ();
static void reset_eol_delim ();
#endif
static SHELL_VAR *bind_read_variable ();
static procenv_t alrmbuf;
static SigHandler *old_alrm;
static int delim;
static sighandler
sigalrm (s)
int s;
{
longjmp (alrmbuf, 1);
}
static void
reset_alarm ()
{
set_signal_handler (SIGALRM, old_alrm);
alarm (0);
}
/* Read the value of the shell variables whose names follow.
The reading is done from the current input stream, whatever
that may be. Successive words of the input line are assigned
@ -84,10 +113,14 @@ read_builtin (list)
WORD_LIST *list;
{
register char *varname;
int size, i, raw, pass_next, saw_escape, eof, opt, retval, edit;
int size, i, pass_next, saw_escape, eof, opt, retval, code;
int input_is_tty, input_is_pipe, unbuffered_read;
int raw, edit, tmout, nchars, silent;
long timeoutval, ncharsval;
char c;
char *input_string, *orig_input_string, *ifs_chars, *prompt, *arrayname;
char *e, *t, *t1;
struct stat tsb;
SHELL_VAR *var;
#if defined (ARRAY_VARS)
WORD_LIST *alist;
@ -99,6 +132,7 @@ read_builtin (list)
i = 0; /* Index into the string that we are reading. */
raw = edit = 0; /* Not reading raw input by default. */
silent = 0;
arrayname = prompt = (char *)NULL;
#if defined (READLINE)
@ -106,8 +140,12 @@ read_builtin (list)
rlind = 0;
#endif
tmout = -1; /* no timeout */
nchars = input_is_tty = input_is_pipe = unbuffered_read = 0;
delim = '\n'; /* read until newline */
reset_internal_getopt ();
while ((opt = internal_getopt (list, "erp:a:")) != -1)
while ((opt = internal_getopt (list, "erp:a:d:t:n:s")) != -1)
{
switch (opt)
{
@ -117,6 +155,9 @@ read_builtin (list)
case 'p':
prompt = list_optarg;
break;
case 's':
silent = 1;
break;
case 'e':
#if defined (READLINE)
edit = 1;
@ -127,6 +168,29 @@ read_builtin (list)
arrayname = list_optarg;
break;
#endif
case 't':
code = legal_number (list_optarg, &timeoutval);
if (code == 0 || timeoutval < 0)
{
builtin_error ("%s: invalid timeout specification", list_optarg);
return (EXECUTION_FAILURE);
}
else
tmout = timeoutval;
break;
case 'n':
code = legal_number (list_optarg, &ncharsval);
if (code == 0 || ncharsval < 0)
{
builtin_error ("%s: invalid number specification", list_optarg);
return (EXECUTION_FAILURE);
}
else
nchars = ncharsval;
break;
case 'd':
delim = *list_optarg;
break;
default:
builtin_usage ();
return (EX_USAGE);
@ -134,6 +198,10 @@ read_builtin (list)
}
list = loptend;
/* `read -t 0 var' returns failure immediately. */
if (tmout == 0)
return (EXECUTION_FAILURE);
/* IF IFS is unset, we use the default of " \t\n". */
var = find_variable ("IFS");
ifs_chars = var ? value_cell (var) : " \t\n";
@ -149,12 +217,20 @@ read_builtin (list)
#endif
interrupt_immediately++;
/* If the -p or -e flags were given, but input is not coming from the
input_is_tty = isatty (0);
if (input_is_tty == 0)
#ifndef __CYGWIN32__
input_is_pipe = (lseek (0, 0L, SEEK_CUR) < 0) && (errno == ESPIPE);
#else
input_is_pipe = 1;
#endif
/* If the -p, -e or -s flags were given, but input is not coming from the
terminal, turn them off. */
if ((prompt || edit) && (isatty (0) == 0))
if ((prompt || edit || silent) && input_is_tty == 0)
{
prompt = (char *)NULL;
edit = 0;
edit = silent = 0;
}
if (prompt && edit == 0)
@ -166,6 +242,67 @@ read_builtin (list)
pass_next = 0; /* Non-zero signifies last char was backslash. */
saw_escape = 0; /* Non-zero signifies that we saw an escape char */
if (tmout > 0)
{
/* Turn off the timeout if stdin is a regular file (e.g. from
input redirection). */
if ((fstat (0, &tsb) < 0) || S_ISREG (tsb.st_mode))
tmout = -1;
}
if (tmout > 0)
{
code = setjmp (alrmbuf);
if (code)
{
run_unwind_frame ("read_builtin");
return (EXECUTION_FAILURE);
}
old_alrm = set_signal_handler (SIGALRM, sigalrm);
add_unwind_protect (reset_alarm, (char *)NULL);
alarm (tmout);
}
/* If we've been asked to read only NCHARS chars, or we're using some
character other than newline to terminate the line, do the right
thing to readline or the tty. */
if (nchars > 0 || delim != '\n')
{
#if defined (READLINE)
if (edit)
{
if (nchars > 0)
{
unwind_protect_int (rl_num_chars_to_read);
rl_num_chars_to_read = nchars;
}
if (delim != '\n')
{
set_eol_delim (delim);
add_unwind_protect (reset_eol_delim, (char *)NULL);
}
}
else
#endif
if (input_is_tty)
{
ttsave ();
if (silent)
ttcbreak ();
else
ttonechar ();
add_unwind_protect ((Function *)ttrestore, (char *)NULL);
}
}
else if (silent) /* turn off echo but leave term in canonical mode */
{
ttsave ();
ttnoecho ();
add_unwind_protect ((Function *)ttrestore, (char *)NULL);
}
unbuffered_read = (nchars > 0) || (delim != '\n') || input_is_pipe;
for (eof = 0;;)
{
#if defined (READLINE)
@ -192,8 +329,11 @@ read_builtin (list)
{
#endif
while (((retval = read (0, &c, 1)) < 0) && errno == EINTR)
;
if (unbuffered_read)
retval = zread (0, &c, 1);
else
retval = zreadc (0, &c);
if (retval <= 0)
{
eof = 1;
@ -227,7 +367,7 @@ read_builtin (list)
continue;
}
if (c == '\n')
if (c == delim)
break;
if (c == CTLESC || c == CTLNUL)
@ -237,9 +377,36 @@ read_builtin (list)
}
input_string[i++] = c;
if (nchars > 0 && i >= nchars)
break;
}
input_string[i] = '\0';
if (tmout > 0)
reset_alarm ();
if (nchars > 0 || delim != '\n')
{
#if defined (READLINE)
if (edit)
{
if (nchars > 0)
rl_num_chars_to_read = 0;
if (delim != '\n')
reset_eol_delim ();
}
else
#endif
if (input_is_tty)
ttrestore ();
}
else if (silent)
ttrestore ();
if (unbuffered_read == 0)
zsyncfd (0);
interrupt_immediately--;
discard_unwind_frame ("read_builtin");
@ -294,7 +461,7 @@ read_builtin (list)
}
else
var = bind_variable ("REPLY", input_string);
var->attributes &= ~att_invisible;
VUNSETATTR (var, att_invisible);
#if 0
free (orig_input_string);
#else
@ -360,7 +527,7 @@ read_builtin (list)
}
stupidly_hack_special_variables (varname);
var->attributes &= ~att_invisible;
VUNSETATTR (var, att_invisible);
}
/* Now assign the rest of the line to the last variable argument. */
@ -390,7 +557,7 @@ read_builtin (list)
var = bind_read_variable (list->word->word, input_string);
stupidly_hack_special_variables (list->word->word);
if (var)
var->attributes &= ~att_invisible;
VUNSETATTR (var, att_invisible);
free (orig_input_string);
return (retval);
@ -434,8 +601,55 @@ edit_line (p)
return ret;
len = strlen (ret);
ret = xrealloc (ret, len + 2);
ret[len++] = '\n';
ret[len++] = delim;
ret[len] = '\0';
return ret;
}
static int old_delim_ctype;
static Function *old_delim_func;
static int old_newline_ctype;
static Function *old_newline_func;
static int delim_char;
static void
set_eol_delim (c)
int c;
{
Keymap cmap;
if (bash_readline_initialized == 0)
initialize_readline ();
cmap = rl_get_keymap ();
/* Change newline to self-insert */
old_newline_ctype = cmap[RETURN].type;
old_newline_func = cmap[RETURN].function;
cmap[RETURN].type = ISFUNC;
cmap[RETURN].function = rl_insert;
/* Bind the delimiter character to accept-line. */
old_delim_ctype = cmap[c].type;
old_delim_func = cmap[c].function;
cmap[c].type = ISFUNC;
cmap[c].function = rl_newline;
delim_char = c;
}
static void
reset_eol_delim (c)
int c;
{
Keymap cmap;
cmap = rl_get_keymap ();
cmap[RETURN].type = old_newline_ctype;
cmap[RETURN].function = old_newline_func;
cmap[delim_char].type = old_delim_ctype;
cmap[delim_char].function = old_delim_func;
}
#endif

View file

@ -8,7 +8,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -18,7 +18,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$BUILTIN for
$SHORT_DOC for NAME [in WORDS ... ;] do COMMANDS; done

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES return.c
@ -42,6 +42,7 @@ $END
#include "common.h"
extern int last_command_exit_value;
extern int subshell_environment;
extern int return_catch_flag, return_catch_value;
/* If we are executing a user-defined function then exit with the value

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES set.c
@ -266,6 +266,23 @@ list_minus_o_opts (mode, reusable)
}
}
char **
get_minus_o_opts ()
{
char **ret;
int n, i, ind;
n = (sizeof (o_options) / sizeof (o_options[0])) +
(sizeof (binary_o_options) / sizeof (binary_o_options[0]));
ret = alloc_array (n + 1);
for (i = ind = 0; o_options[i].name; i++)
ret[ind++] = o_options[i].name;
for (i = 0; binary_o_options[i].name; i++)
ret[ind++] = binary_o_options[i].name;
ret[ind] = (char *)NULL;
return ret;
}
static int
set_ignoreeof (on_or_off, option_name)
int on_or_off;
@ -457,7 +474,7 @@ set_shellopts ()
note whether or not the variable was exported. */
if (v)
{
v->attributes &= ~att_readonly;
VUNSETATTR (v, att_readonly);
exported = exported_p (v);
}
else
@ -468,9 +485,9 @@ set_shellopts ()
/* Turn the read-only attribute back on, and turn off the export attribute
if it was set implicitly by mark_modified_vars and SHELLOPTS was not
exported before we bound the new value. */
v->attributes |= att_readonly;
VSETATTR (v, att_readonly);
if (mark_modified_vars && exported == 0 && exported_p (v))
v->attributes &= ~att_exported;
VUNSETATTR (v, att_exported);
free (value);
}

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES setattr.c
@ -381,13 +381,13 @@ set_var_attribute (name, attribute, undo)
if (var == 0)
{
var = bind_variable (name, (char *)NULL);
var->attributes |= att_invisible;
VSETATTR (var, att_invisible);
}
}
if (var)
SETVARATTR (var, attribute, undo);
if (var && ((var->attributes & att_exported) || (attribute & att_exported)))
if (var && (exported_p (var) || (attribute & att_exported)))
array_needs_making++; /* XXX */
}

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES shift.c

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES shopt.c
@ -64,6 +64,7 @@ extern int cdspelling, expand_aliases;
extern int check_window_size;
extern int glob_ignore_case;
extern int hup_on_exit;
extern int xpg_echo;
#if defined (EXTENDED_GLOB)
extern int extended_glob;
@ -76,9 +77,14 @@ extern int force_append_history;
#if defined (READLINE)
extern int hist_verify, history_reediting, perform_hostname_completion;
extern int no_empty_command_completion;
extern void enable_hostname_completion ();
#endif
#if defined (PROGRAMMABLE_COMPLETION)
extern int prog_completion_enabled;
#endif
#if defined (RESTRICTED_SHELL)
extern int restricted_shell;
extern char *shell_name;
@ -126,14 +132,21 @@ static struct {
{ "lithist", &literal_history, (Function *)NULL },
#endif
{ "mailwarn", &mail_warning, (Function *)NULL },
#if defined (READLINE)
{ "no_empty_cmd_completion", &no_empty_command_completion, (Function *)NULL },
#endif
{ "nocaseglob", &glob_ignore_case, (Function *)NULL },
{ "nullglob", &allow_null_glob_expansion, (Function *)NULL },
#if defined (PROGRAMMABLE_COMPLETION)
{ "progcomp", &prog_completion_enabled, (Function *)NULL },
#endif
{ "promptvars", &promptvars, (Function *)NULL },
#if defined (RESTRICTED_SHELL)
{ "restricted_shell", &restricted_shell, set_restricted_shell },
#endif
{ "shift_verbose", &print_shift_error, (Function *)NULL },
{ "sourcepath", &source_uses_path, (Function *)NULL },
{ "xpg_echo", &xpg_echo, (Function *)NULL },
{ (char *)0, (int *)0, (Function *)NULL }
};
@ -429,3 +442,17 @@ set_restricted_shell (mode)
return (0);
}
#endif /* RESTRICTED_SHELL */
char **
get_shopt_options ()
{
char **ret;
int n, i;
n = sizeof (shopt_vars) / sizeof (shopt_vars[0]);
ret = alloc_array (n + 1);
for (i = 0; shopt_vars[i].name; i++)
ret[i] = savestring (shopt_vars[i].name);
ret[i] = (char *)NULL;
return ret;
}

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES source.c
@ -39,8 +39,8 @@ $END
#include <config.h>
#include "../bashtypes.h"
#include "../posixstat.h"
#include "../filecntl.h"
#include "posixstat.h"
#include "filecntl.h"
#ifndef _MINIX
# include <sys/file.h>
#endif

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES suspend.c

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES test.c

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES times.c
@ -41,16 +41,7 @@ $END
#include "../bashtypes.h"
#include "../shell.h"
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if defined (HAVE_SYS_TIME_H)
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#include <posixtime.h>
#if defined (HAVE_SYS_TIMES_H)
# include <sys/times.h>
@ -84,21 +75,19 @@ times_builtin (list)
#else
# if defined (HAVE_TIMES)
/* As of System V.3, HP-UX 6.5, and other ATT-like systems, this stuff is
returned in terms of clock ticks (HZ from sys/param.h). C'mon, guys.
This kind of stupid clock-dependent stuff is exactly the reason 4.2BSD
introduced the `timeval' struct. */
/* This uses the POSIX.1/XPG5 times(2) interface, which fills in a
`struct tms' with values of type clock_t. */
struct tms t;
times (&t);
print_time_in_hz (stdout, t.tms_utime);
print_clock_t (stdout, t.tms_utime);
putchar (' ');
print_time_in_hz (stdout, t.tms_stime);
print_clock_t (stdout, t.tms_stime);
putchar ('\n');
print_time_in_hz (stdout, t.tms_cutime);
print_clock_t (stdout, t.tms_cutime);
putchar (' ');
print_time_in_hz (stdout, t.tms_cstime);
print_clock_t (stdout, t.tms_cstime);
putchar ('\n');
# else /* !HAVE_TIMES */
printf ("0.00 0.00\n0.00 0.00\n");

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES trap.c

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES type.c
@ -44,7 +44,7 @@ $END
#include <config.h>
#include "../bashtypes.h"
#include "../posixstat.h"
#include "posixstat.h"
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
@ -66,6 +66,8 @@ $END
extern int find_reserved_word ();
extern char *this_command_name;
/* For each word in LIST, find out what the shell is going to do with
it as a simple command. i.e., which file would this shell use to
execve, or if it is a builtin command, or an alias. Possible flag
@ -210,8 +212,8 @@ describe_command (command, verbose, all)
char *command;
int verbose, all;
{
int found, i, found_file;
char *full_path;
int found, i, found_file, f;
char *full_path, *x, *cwd;
SHELL_VAR *func;
#if defined (ALIAS)
alias_t *alias;
@ -232,7 +234,7 @@ describe_command (command, verbose, all)
printf ("%s is aliased to `%s'\n", command, alias->value);
else if (verbose == 4)
{
char *x = single_quote (alias->value);
x = single_quote (alias->value);
printf ("alias %s=%s\n", command, x);
free (x);
}
@ -313,7 +315,7 @@ describe_command (command, verbose, all)
check to see if it is executable. */
if (absolute_program (command))
{
int f = file_status (command);
f = file_status (command);
if (f & FS_EXECABLE)
{
if (verbose == 1)
@ -361,6 +363,23 @@ describe_command (command, verbose, all)
if (!full_path)
break;
/* If we found the command as itself by looking through $PATH, it
probably doesn't exist. Check whether or not the command is an
executable file. If it's not, don't report a match. */
if (STREQ (full_path, command))
{
f = file_status (full_path);
if ((f & FS_EXECABLE) == 0)
{
free (full_path);
full_path = (char *)NULL;
if (all == 0)
break;
}
else if (verbose >= 2)
full_path = sh_makepath ((char *)NULL, full_path, MP_DOCWD);
}
found_file++;
found = 1;

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES ulimit.c
@ -547,7 +547,11 @@ filesize(valuep)
if ((result = ulimit (1, 0L)) < 0)
return -1;
else
# if 0
*valuep = (RLIMTYPE) result;
# else
*valuep = (RLIMTYPE) result * 512L;
# endif
return 0;
#else
errno = EINVAL;

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$PRODUCES umask.c
@ -36,7 +36,7 @@ $END
#include <config.h>
#include "../bashtypes.h"
#include "../filecntl.h"
#include "filecntl.h"
#ifndef _MINIX
# include <sys/file.h>
#endif
@ -48,7 +48,7 @@ $END
#include <stdio.h>
#include "../shell.h"
#include "../posixstat.h"
#include "posixstat.h"
#include "common.h"
#include "bashgetopt.h"
@ -295,6 +295,8 @@ symbolic_umask (list)
more intuitive and easier to deal with. It is complemented
again before being returned. */
bits = parse_symbolic_mode (list->word->word, ~um);
if (bits == -1)
return (-1);
um = ~bits & 0777;
return (um);

View file

@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any later
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@ -17,7 +17,7 @@ for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$BUILTIN wait
$FUNCTION wait_builtin
@ -59,6 +59,8 @@ $END
extern int interrupt_immediately;
procenv_t wait_intr_buf;
/* Wait for the pid in LIST to stop or die. If no arguments are given, then
wait for all of the active background processes of the shell and return
0. If a list of pids or job specs are given, return the exit status of
@ -70,7 +72,7 @@ int
wait_builtin (list)
WORD_LIST *list;
{
int status;
int status, code;
if (no_options (list))
return (EX_USAGE);
@ -81,6 +83,21 @@ wait_builtin (list)
unwind_protect_int (interrupt_immediately);
interrupt_immediately++;
/* POSIX.2 says: When the shell is waiting (by means of the wait utility)
for asynchronous commands to complete, the reception of a signal for
which a trap has been set shall cause the wait utility to return
immediately with an exit status greater than 128, after which the trap
associated with the signal shall be taken.
We handle SIGINT here; it's the only one that needs to be treated
specially (I think), since it's handled specially in {no,}jobs.c. */
code = setjmp (wait_intr_buf);
if (code)
{
status = 128 + SIGINT;
WAIT_RETURN (status);
}
/* We support jobs or pids.
wait <pid-or-job> [pid-or-job ...] */

View file

@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_COMMAND_H_)
#define _COMMAND_H_
@ -55,7 +55,7 @@ enum r_instruction {
/* Command Types: */
enum command_type { cm_for, cm_case, cm_while, cm_if, cm_simple, cm_select,
cm_connection, cm_function_def, cm_until, cm_group,
cm_arith, cm_cond };
cm_arith, cm_cond, cm_arith_for, cm_subshell };
/* Possible values for the `flags' field of a WORD_DESC. */
#define W_HASDOLLAR 0x01 /* Dollar sign present. */
@ -151,6 +151,10 @@ typedef struct command {
#if defined (COND_COMMAND)
struct cond_com *Cond;
#endif
#if defined (ARITH_FOR_COMMAND)
struct arith_for_com *ArithFor;
#endif
struct subshell_com *Subshell;
} value;
} COMMAND;
@ -188,6 +192,17 @@ typedef struct for_com {
members of MAP_LIST. */
} FOR_COM;
#if defined (ARITH_FOR_COMMAND)
typedef struct arith_for_com {
int flags;
int line; /* generally used for error messages */
WORD_LIST *init;
WORD_LIST *test;
WORD_LIST *step;
COMMAND *action;
} ARITH_FOR_COM;
#endif
#if defined (SELECT_COMMAND)
/* KSH SELECT command. */
typedef struct select_com {
@ -267,6 +282,11 @@ typedef struct group_com {
COMMAND *command;
} GROUP_COM;
typedef struct subshell_com {
int flags;
COMMAND *command;
} SUBSHELL_COM;
extern COMMAND *global_command;
/* Possible command errors */

View file

@ -44,8 +44,12 @@
# define HISTORY
#endif
#if defined (PROGRAMMABLE_COMPLETION) && !defined (READLINE)
# undef PROGRAMMABLE_COMPLETION
#endif
#if !defined (V9_ECHO)
# undef DEFAULT_ECHO_TO_USG
# undef DEFAULT_ECHO_TO_XPG
#endif
#if defined (JOB_CONTROL_MISSING)
@ -66,6 +70,11 @@
# undef HAVE_STRCOLL
#endif
#if defined (HAVE_SYS_SOCKET_H) && defined (HAVE_GETPEERNAME) && defined (HAVE_NETINET_IN_H)
# define HAVE_NETWORK
#endif
#if !defined (PROMPT_STRING_DECODE)
# undef PPROMPT
# define PPROMPT "$ "
#endif

View file

@ -53,3 +53,7 @@
/* System-wide .bash_logout for login shells. */
/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */
/* Define this to make non-interactive shells begun with argv[0][0] == '-'
run the startup files when not in posix mode. */
/* #define NON_INTERACTIVE_LOGIN_SHELLS */

View file

@ -6,7 +6,7 @@
Bash is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#ifndef _CONFIG_H_
#define _CONFIG_H_
@ -65,10 +65,11 @@
# define BRACE_COMPLETION
#endif /* BRACE_EXPANSION */
/* Define DEFAULT_ECHO_TO_USG if you want the echo builtin to interpret
the backslash-escape characters by default, like the System V echo.
/* Define DEFAULT_ECHO_TO_XPG if you want the echo builtin to interpret
the backslash-escape characters by default, like the XPG Single Unix
Specification V2 for echo.
This requires that V9_ECHO be defined. */
#undef DEFAULT_ECHO_TO_USG
#undef DEFAULT_ECHO_TO_XPG
/* Define HELP_BUILTIN if you want the `help' shell builtin and the long
documentation strings compiled into the shell. */
@ -118,6 +119,19 @@
command. */
#undef COND_COMMAND
/* Define ARITH_FOR_COMMAND if you want the ksh93-style
for (( init; test; step )) do list; done
arithmetic for command. */
#undef ARITH_FOR_COMMAND
/* Define NETWORK_REDIRECTIONS if you want /dev/(tcp|udp)/host/port to open
socket connections when used in redirections */
#undef NETWORK_REDIRECTIONS
/* Define PROGRAMMABLE_COMPLETION for the programmable completion features
and the complete builtin. */
#undef PROGRAMMABLE_COMPLETION
/* Define AFS if you are using Transarc's AFS. */
#undef AFS
@ -128,6 +142,9 @@
/* Beginning of autoconf additions. */
/* Define if using the bash version of malloc in lib/malloc/malloc.c */
#undef USING_BASH_MALLOC
/* Define if using alloca.c. */
#undef C_ALLOCA
@ -202,17 +219,29 @@
/* Define to `int' if <sys/types.h> doesn't define. */
#undef pid_t
/* Define to `short' if <sys/types.h> doesn't define. */
#undef bits16_t
/* Define to `unsigned short' if <sys/types.h> doesn't define. */
#undef u_bits16_t
/* Define to `int' if <sys/types.h> doesn't define. */
#undef int32_t
#undef bits32_t
/* Define to `unsigned int' if <sys/types.h> doesn't define. */
#undef u_int32_t
#undef u_bits32_t
/* Define to `double' if <sys/types.h> doesn't define. */
#undef bits64_t
/* Define to `int' if <sys/types.h> doesn't define. */
#undef ptrdiff_t
/* Define to `double' if <sys/types.h> doesn't define. */
#undef bits64_t
/* Define to `unsigned int' if <sys/types.h> doesn't define. */
#undef u_int
/* Define to `unsigned long' if <sys/types.h> doesn't define. */
#undef u_long
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
@ -261,6 +290,10 @@
#undef DUP2_BROKEN
#undef HAVE_GETHOSTBYNAME
#undef HAVE_INET_ATON
#undef HAVE_GETRLIMIT
#undef HAVE_GETRUSAGE
@ -287,6 +320,8 @@
#undef DEV_FD_PREFIX
#undef HAVE_DEV_STDIN
#undef HAVE_GETPW_DECLS
#undef HAVE_QUAD_T
@ -425,6 +460,10 @@
/* Define if you have the setlocale function. */
#undef HAVE_SETLOCALE
/* Define if you have the setvbuf function. */
#undef HAVE_SETVBUF
/* Define if you have the siginterrupt function. */
#undef HAVE_SIGINTERRUPT
/* Define if you have the strcasecmp function. */
@ -436,6 +475,9 @@
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
/* Define if you have the strpbrk function. */
#undef HAVE_STRPBRK
/* Define if you have the strtod function. */
#undef HAVE_STRTOD
@ -457,6 +499,8 @@
/* Define if you have the ulimit function. */
#undef HAVE_ULIMIT
#undef HAVE_TTYNAME
#undef HAVE_WAITPID
#undef HAVE_TCGETPGRP
@ -549,6 +593,15 @@
/* Define if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define if you have the <netdh.h> header file. */
#undef HAVE_NETDB_H
/* Define if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
#undef HAVE_LIBDL
#undef HAVE_LIBSUN

2127
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -1,18 +1,18 @@
dnl
dnl Configure script for bash-2.03
dnl Configure script for bash-2.04
dnl
dnl report bugs to chet@po.cwru.edu
dnl
dnl Process this file with autoconf to produce a configure script.
dnl checks for version info
AC_REVISION([for Bash 2.03, version 2.49, from autoconf version] AC_ACVERSION)dnl
dnl checks for version info
AC_REVISION([for Bash 2.04, version 2.77, from autoconf version] AC_ACVERSION)dnl
AC_INIT(shell.h)
AC_CONFIG_HEADER(config.h)
dnl make sure we are using a recent autoconf version
AC_PREREQ(2.10)
AC_PREREQ(2.12)
dnl where to find install.sh, config.sub, and config.guess
AC_CONFIG_AUX_DIR(./support)
@ -22,7 +22,7 @@ dnl parsing options
AC_CANONICAL_HOST
dnl configure defaults
opt_gnu_malloc=yes
opt_bash_malloc=yes
opt_glibc_malloc=no
opt_purify=no
opt_purecov=no
@ -30,35 +30,39 @@ opt_afs=no
opt_curses=no
opt_with_installed_readline=no
#htmldir=
dnl some systems should be configured without gnu malloc by default
dnl and some need a special compiler or loader
dnl look in the NOTES file for more
case "${host_cpu}-${host_os}" in
alpha*-*) opt_gnu_malloc=no ;; # alpha running osf/1 or linux
*[Cc]ray*-*) opt_gnu_malloc=no ;; # Crays
*-osf1*) opt_gnu_malloc=no ;; # other osf/1 machines
sparc-svr4*) opt_gnu_malloc=no ;; # sparc SVR4, SVR4.2
sparc-netbsd*) opt_gnu_malloc=no ;; # needs 8-byte alignment
mips-irix6*) opt_gnu_malloc=no ;; # needs 8-byte alignment
sparc-linux*) opt_gnu_malloc=no ;; # sparc running linux; requires ELF
#*-freebsd*) opt_gnu_malloc=no ;; # they claim it's better
*-aix*) opt_gnu_malloc=no ;; # AIX machines
*-nextstep*) opt_gnu_malloc=no ;; # NeXT machines running NeXTstep
*-rhapsody*) opt_gnu_malloc=no ;; # Apple Rhapsody
*-dgux*) opt_gnu_malloc=no ;; # DG/UX machines
*-qnx*) opt_gnu_malloc=no ;; # QNX 4.2
*-machten4) opt_gnu_malloc=no ;; # MachTen 4.x
*-bsdi2.1|*-bsdi3.?) opt_gnu_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins
*-beos*) opt_gnu_malloc=no ;; # they say it's suitable
*-cygwin32*) opt_gnu_malloc=no ;; # Cygnus's CYGWIN32 environment
alpha*-*) opt_bash_malloc=no ;; # alpha running osf/1 or linux
*[Cc]ray*-*) opt_bash_malloc=no ;; # Crays
*-osf1*) opt_bash_malloc=no ;; # other osf/1 machines
sparc-svr4*) opt_bash_malloc=no ;; # sparc SVR4, SVR4.2
sparc-netbsd*) opt_bash_malloc=no ;; # needs 8-byte alignment
mips-irix6*) opt_bash_malloc=no ;; # needs 8-byte alignment
m68k-sysv) opt_bash_malloc=no ;; # fixes file descriptor leak in closedir
sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
#*-freebsd*) opt_bash_malloc=no ;; # they claim it's better
*-aix*) opt_bash_malloc=no ;; # AIX machines
*-nextstep*) opt_bash_malloc=no ;; # NeXT machines running NeXTstep
*-rhapsody*) opt_bash_malloc=no ;; # Apple Rhapsody
*-dgux*) opt_bash_malloc=no ;; # DG/UX machines
*-qnx*) opt_bash_malloc=no ;; # QNX 4.2
*-machten4) opt_bash_malloc=no ;; # MachTen 4.x
*-bsdi2.1|*-bsdi3.?) opt_bash_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins
*-beos*) opt_bash_malloc=no ;; # they say it's suitable
*-cygwin32*) opt_bash_malloc=no ;; # Cygnus's CYGWIN32 environment
esac
dnl arguments to configure
dnl packages
AC_ARG_WITH(afs, --with-afs if you are running AFS, opt_afs=$withval)
AC_ARG_WITH(bash-malloc, --with-bash-malloc use the Bash version of malloc,opt_bash_malloc=$withval)
AC_ARG_WITH(curses, --with-curses use the curses library instead of the termcap library,opt_curses=$withval)
AC_ARG_WITH(glibc-malloc, --with-glibc-malloc use the GNU C library version of malloc,opt_glibc_malloc=$withval)
AC_ARG_WITH(gnu-malloc, --with-gnu-malloc use the GNU version of malloc,opt_gnu_malloc=$withval)
AC_ARG_WITH(gnu-malloc, --with-gnu-malloc synonym for --with-bash-malloc,opt_bash_malloc=$withval)
AC_ARG_WITH(installed-readline, --with-installed-readline use a version of the readline library that is already installed, opt_with_installed_readline=$withval)
AC_ARG_WITH(purecov, --with-purecov configure to postprocess with pure coverage, opt_purecov=$withval)
AC_ARG_WITH(purify, --with-purify configure to postprocess with purify, opt_purify=$withval)
@ -67,9 +71,10 @@ dnl test for glibc malloc first because it can override the default
if test "$opt_glibc_malloc" = yes; then
MALLOC_TARGET=gmalloc
MALLOC_SRC=gmalloc.c
elif test "$opt_gnu_malloc" = yes; then
elif test "$opt_bash_malloc" = yes; then
MALLOC_TARGET=malloc
MALLOC_SRC=malloc.c
AC_DEFINE(USING_BASH_MALLOC)
else
MALLOC_TARGET=stubmalloc
MALLOC_SRC=stub.c
@ -113,8 +118,11 @@ opt_extended_glob=yes
opt_brace_expansion=yes
opt_disabled_builtins=no
opt_command_timing=yes
opt_usg_echo=no
opt_xpg_echo=no
opt_cond_command=yes
opt_arith_for_command=yes
opt_net_redirs=yes
opt_progcomp=yes
dnl options that affect how bash is compiled and linked
opt_static_link=no
@ -131,10 +139,12 @@ if test $opt_minimal_config = yes; then
opt_restricted=no opt_process_subst=no opt_prompt_decoding=no
opt_select=no opt_help=no opt_array_variables=no opt_dparen_arith=no
opt_brace_expansion=no opt_disabled_builtins=no opt_command_timing=no
opt_extended_glob=no opt_cond_command=no
opt_extended_glob=no opt_cond_command=no opt_arith_for_command=no
opt_net_redirs=no opt_progcomp=no
fi
AC_ARG_ENABLE(alias, --enable-alias enable shell aliases, opt_alias=$enableval)
AC_ARG_ENABLE(arith-for-command, --enable-arith-for-command enable arithmetic for command, opt_arith_for_command=$enableval)
AC_ARG_ENABLE(array-variables, --enable-array-variables include shell array variables, opt_array_variables=$enableval)
AC_ARG_ENABLE(bang-history, --enable-bang-history turn on csh-style history substitution, opt_bang_history=$enableval)
AC_ARG_ENABLE(brace-expansion, --enable-brace-expansion include brace expansion, opt_brace_expansion=$enableval)
@ -147,12 +157,15 @@ AC_ARG_ENABLE(extended-glob, --enable-extended-glob include ksh-style extended p
AC_ARG_ENABLE(help-builtin, --enable-help-builtin include the help builtin, opt_help=$enableval)
AC_ARG_ENABLE(history, --enable-history turn on command history, opt_history=$enableval)
AC_ARG_ENABLE(job-control, --enable-job-control enable job control features, opt_job_control=$enableval)
AC_ARG_ENABLE(net-redirections, --enable-net-redirections enable /dev/tcp/host/port redirection, opt_net_redirs=$enableval)
AC_ARG_ENABLE(process-substitution, --enable-process-substitution enable process substitution, opt_process_subst=$enableval)
AC_ARG_ENABLE(progcomp, --enable-progcomp enable programmable completion and the complete builtin, opt_progcomp=$enableval)
AC_ARG_ENABLE(prompt-string-decoding, --enable-prompt-string-decoding turn on escape character decoding in prompts, opt_prompt_decoding=$enableval)
AC_ARG_ENABLE(readline, --enable-readline turn on command line editing, opt_readline=$enableval)
AC_ARG_ENABLE(restricted, --enable-restricted enable a restricted shell, opt_restricted=$enableval)
AC_ARG_ENABLE(select, --enable-select include select command, opt_select=$enableval)
AC_ARG_ENABLE(usg-echo-default, --enable-usg-echo-default make the echo builtin expand escape sequences by default, opt_usg_echo=$enableval)
AC_ARG_ENABLE(usg-echo-default, --enable-usg-echo-default a synonym for --enable-xpg-echo-default, opt_xpg_echo=$enableval)
AC_ARG_ENABLE(xpg-echo-default, --enable-xpg-echo-default make the echo builtin expand escape sequences by default, opt_xpg_echo=$enableval)
dnl options that alter how bash is compiled and linked
AC_ARG_ENABLE(profiling, --enable-profiling allow profiling with gprof, opt_profiling=$enableval)
@ -200,8 +213,8 @@ fi
if test $opt_command_timing = yes; then
AC_DEFINE(COMMAND_TIMING)
fi
if test $opt_usg_echo = yes ; then
AC_DEFINE(DEFAULT_ECHO_TO_USG)
if test $opt_xpg_echo = yes ; then
AC_DEFINE(DEFAULT_ECHO_TO_XPG)
fi
if test $opt_extended_glob = yes ; then
AC_DEFINE(EXTENDED_GLOB)
@ -209,6 +222,15 @@ fi
if test $opt_cond_command = yes ; then
AC_DEFINE(COND_COMMAND)
fi
if test $opt_arith_for_command = yes; then
AC_DEFINE(ARITH_FOR_COMMAND)
fi
if test $opt_net_redirs = yes; then
AC_DEFINE(NETWORK_REDIRECTIONS)
fi
if test $opt_progcomp = yes; then
AC_DEFINE(PROGRAMMABLE_COMPLETION)
fi
if test "$opt_minimal_config" = yes; then
TESTSCRIPT=run-minimal
@ -222,6 +244,8 @@ AC_SUBST(PURIFY)
AC_SUBST(MALLOC_TARGET)
AC_SUBST(MALLOC_SRC)
AC_SUBST(htmldir)
dnl Use GNU m4 macros to get the distribution and patchlevel information
dnl into configure without requiring the files to be distributed
[BASHVERS=]dnl
@ -236,9 +260,16 @@ dnl AC_PROG_CC sets $cross_compiling to `yes' if cross-compiling for a
dnl different environment
AC_PROG_CC
BASH_LARGE_FILE_SUPPORT
dnl test for Unix variants
AC_ISC_POSIX
AC_MINIX
dnl test for non-Unix variants
AC_CYGWIN
AC_MINGW32
AC_EXEEXT
dnl BEGIN changes for cross-building for cygwin32 and BeOS
SIGNAMES_H=lsignames.h
@ -322,15 +353,19 @@ then
dnl we duplicate some work that's done later here so we can look in
dnl the correct directory for the readline library
if test -z "$TERMCAP_LIB" ; then
BASH_CHECK_LIB_TERMCAP
fi
test "x$prefix" = xNONE && _rl_prefix=$ac_default_prefix || _rl_prefix=${prefix}
test "x$exec_prefix" = xNONE && _rl_exec_prefix=${_rl_prefix} || _rl_exec_prefix=${exec_prefix}
AC_MSG_CHECKING(version of installed readline library)
_rl_version=`exec_prefix=${_rl_exec_prefix} ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/rlvers.sh -C "${CC}" -L ${libdir}`
_rl_version=`exec_prefix=${_rl_exec_prefix} ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/rlvers.sh -C "${CC}" -L ${libdir} -T ${TERMCAP_LIB}`
AC_MSG_RESULT($_rl_version)
case "$_rl_version" in
3*|4*|5*|6*|7*|8*|9*) ;;
4.[[1-9]]*|5*|6*|7*|8*|9*) ;;
*) opt_with_installed_readline=no
AC_MSG_WARN(installed readline library is too old to be linked with bash)
AC_MSG_WARN(using private bash version)
@ -395,7 +430,7 @@ AC_PROG_YACC
AC_PROG_MAKE_SET
case "$host_os" in
opennt*|interix*) MAKE_SHELL="$OPENNT_ROOT/bin/sh" ;;
opennt*|interix*) MAKE_SHELL="$INTERIX_ROOT/bin/sh" ;;
*) MAKE_SHELL=/bin/sh ;;
esac
AC_SUBST(MAKE_SHELL)
@ -437,7 +472,8 @@ dnl checks for c library functions
AC_CHECK_FUNCS(bcopy bzero confstr getcwd strcasecmp setenv putenv \
setlinebuf setlocale strchr strerror strtod strtol \
strtoul tcgetattr uname sysconf ulimit times tzset \
siginterrupt memmove)
siginterrupt memmove ttyname gethostbyname inet_aton \
strpbrk setvbuf)
dnl checks for locale functions
AC_CHECK_HEADERS(libintl.h)
@ -467,18 +503,31 @@ AC_HEADER_TIME
AC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \
memory.h locale.h termcap.h termio.h termios.h dlfcn.h \
stddef.h)
stddef.h netdb.h)
AC_CHECK_HEADERS(sys/ptem.h sys/pte.h sys/stream.h sys/select.h sys/file.h \
sys/resource.h sys/param.h sys/socket.h \
sys/time.h sys/times.h sys/wait.h)
AC_CHECK_HEADERS(netinet/in.h arpa/inet.h)
dnl network functions -- check for inet_aton again
if test "$ac_cv_func_inet_aton" != 'yes'; then
BASH_FUNC_INET_ATON
fi
dnl libraries
dnl this is reportedly no longer necessary for irix[56].?
dnl AC_CHECK_LIB(sun, getpwent)
case "$host_os" in
irix4*) AC_CHECK_LIB(sun, getpwent) ;;
esac
dnl check for getpeername in the socket library only if it's not in libc
if test "$ac_cv_func_getpeername" = no; then
BASH_CHECK_SOCKLIB
fi
dnl check for gethostbyname in socket libraries if it's not in libc
if test "$ac_cv_func_gethostbyname" = no; then
BASH_FUNC_GETHOSTBYNAME
fi
dnl system types
AC_TYPE_GETGROUPS
@ -491,25 +540,26 @@ AC_CHECK_TYPE(time_t, long)
AC_TYPE_SIGNAL
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(char *, 4)
AC_CHECK_SIZEOF(double, 8)
BASH_TYPE_INT32_T
BASH_TYPE_U_INT32_T
BASH_TYPE_PTRDIFF_T
AC_CHECK_TYPE(u_int, unsigned int)
AC_CHECK_TYPE(u_long, unsigned long)
BASH_TYPE_BITS16_T
BASH_TYPE_U_BITS16_T
BASH_TYPE_BITS32_T
BASH_TYPE_U_BITS32_T
BASH_TYPE_BITS64_T
BASH_TYPE_PTRDIFF_T
dnl structures
AC_HEADER_STAT
AC_HEADER_EGREP(struct timeval, sys/time.h, bash_cv_struct_timeval=yes, )
if test -z "$bash_cv_struct_timeval"; then
AC_HEADER_EGREP(struct timeval, time.h, bash_cv_struct_timeval=yes, bash_cv_struct_timeval=no)
fi
if test $bash_cv_struct_timeval = yes; then
AC_DEFINE(HAVE_TIMEVAL)
fi
dnl C compiler characteristics
AC_C_BIGENDIAN
@ -554,6 +604,7 @@ BASH_STRUCT_TERMIO_LDISC
BASH_STRUCT_DIRENT_D_INO
BASH_STRUCT_DIRENT_D_FILENO
BASH_STRUCT_WINSIZE
BASH_STRUCT_TIMEVAL
dnl presence and behavior of C library functions
BASH_FUNC_STRSIGNAL
@ -596,6 +647,7 @@ AC_SUBST(TERMCAP_LIB)
AC_SUBST(TERMCAP_DEP)
BASH_CHECK_DEV_FD
BASH_CHECK_DEV_STDIN
BASH_DEFAULT_MAIL_DIR
if test "$bash_cv_job_control_missing" = missing; then
@ -629,7 +681,8 @@ sysv5*) AC_DEFINE(SVR5) ;;
hpux9*) LOCAL_CFLAGS="-DHPUX9 -DHPUX" ;;
hpux*) LOCAL_CFLAGS=-DHPUX ;;
dgux*) LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;;
isc*) LOCAL_CFLAGS=-Disc386;;
isc*) LOCAL_CFLAGS=-Disc386 ;;
rhapsody*) LOCAL_CFLAGS=-DRHAPSODY ;;
sco3.2v5*) LOCAL_CFLAGS="-b elf -DWAITPID_BROKEN -DNO_MEMSCRAMBLE -DPATH_MAX=1024" ;;
sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DNO_MEMSCRAMBLE -DPATH_MAX=1024" ;;
sco3.2*) LOCAL_CFLAGS=-DMUST_UNBLOCK_CHLD ;;
@ -650,6 +703,13 @@ aix4.2*) LOCAL_LDFLAGS="-bexpall -brtl" ;;
bsdi4*-*gcc*) LOCAL_LDFLAGS="-rdynamic" ;; # allow dynamic loading, like Linux
esac
dnl FreeBSD-3.x can have either a.out or ELF
case "${host_os}" in
freebsd3*) if test -x /usr/bin/objformat && test "`/usr/bin/objformat`" = "elf" ; then
LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
fi ;;
esac
case "$host_cpu" in
*cray*) LOCAL_CFLAGS="-DCRAY" ;; # shell var so config.h can use it
esac
@ -670,7 +730,7 @@ esac
if test "$ac_cv_func_dlopen" = "yes" && test -f ${srcdir}/support/shobj-conf
then
AC_MSG_CHECKING(shared object configuration for loadable builtins)
eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C ${CC} -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
AC_SUBST(SHOBJ_CC)
AC_SUBST(SHOBJ_CFLAGS)
AC_SUBST(SHOBJ_LD)
@ -692,6 +752,7 @@ case "$srcdir" in
test -d lib/$ld || mkdir lib/$ld
done
test -d examples/loadables || mkdir examples/loadables # loadable builtins
test -d examples/loadables/perl || mkdir examples/loadables/perl
;;
esac
@ -724,7 +785,7 @@ AC_SUBST(LOCAL_DEFS)
AC_OUTPUT([Makefile builtins/Makefile lib/readline/Makefile lib/glob/Makefile \
lib/malloc/Makefile lib/sh/Makefile lib/termcap/Makefile \
lib/tilde/Makefile doc/Makefile support/Makefile \
examples/loadables/Makefile],
examples/loadables/Makefile examples/loadables/perl/Makefile],
[
# Makefile uses this timestamp file to record whether config.h is up to date.
echo timestamp > stamp-h

View file

@ -8,7 +8,7 @@
Bash is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
@ -18,7 +18,7 @@
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#include "config.h"
@ -152,6 +152,24 @@ copy_for_command (com)
return (new_for);
}
#if defined (ARITH_FOR_COMMAND)
static ARITH_FOR_COM *
copy_arith_for_command (com)
ARITH_FOR_COM *com;
{
ARITH_FOR_COM *new_arith_for;
new_arith_for = (ARITH_FOR_COM *)xmalloc (sizeof (ARITH_FOR_COM));
new_arith_for->flags = com->flags;
new_arith_for->line = com->line;
new_arith_for->init = copy_word_list (com->init);
new_arith_for->test = copy_word_list (com->test);
new_arith_for->step = copy_word_list (com->step);
new_arith_for->action = copy_command (com->action);
return (new_arith_for);
}
#endif /* ARITH_FOR_COMMAND */
static GROUP_COM *
copy_group_command (com)
GROUP_COM *com;
@ -163,6 +181,18 @@ copy_group_command (com)
return (new_group);
}
static SUBSHELL_COM *
copy_subshell_command (com)
SUBSHELL_COM *com;
{
SUBSHELL_COM *new_subshell;
new_subshell = (SUBSHELL_COM *)xmalloc (sizeof (SUBSHELL_COM));
new_subshell->command = copy_command (com->command);
new_subshell->flags = com->flags;
return (new_subshell);
}
static CASE_COM *
copy_case_command (com)
CASE_COM *com;
@ -290,6 +320,12 @@ copy_command (command)
new_command->value.For = copy_for_command (command->value.For);
break;
#if defined (ARITH_FOR_COMMAND)
case cm_arith_for:
new_command->value.ArithFor = copy_arith_for_command (command->value.ArithFor);
break;
#endif
#if defined (SELECT_COMMAND)
case cm_select:
new_command->value.Select =
@ -301,6 +337,10 @@ copy_command (command)
new_command->value.Group = copy_group_command (command->value.Group);
break;
case cm_subshell:
new_command->value.Subshell = copy_subshell_command (command->value.Subshell);
break;
case cm_case:
new_command->value.Case = copy_case_command (command->value.Case);
break;

View file

@ -6,7 +6,7 @@
Bash is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bash is distributed in the hope that it will be useful, but WITHOUT
@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License
along with Bash; see the file COPYING. If not, write to the Free
Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#include "config.h"
@ -61,6 +61,21 @@ dispose_command (command)
break;
}
#if defined (ARITH_FOR_COMMAND)
case cm_arith_for:
{
register ARITH_FOR_COM *c;
c = command->value.ArithFor;
dispose_words (c->init);
dispose_words (c->test);
dispose_words (c->step);
dispose_command (c->action);
free (c);
break;
}
#endif /* ARITH_FOR_COMMAND */
case cm_group:
{
dispose_command (command->value.Group->command);
@ -68,6 +83,13 @@ dispose_command (command)
break;
}
case cm_subshell:
{
dispose_command (command->value.Subshell->command);
free (command->value.Subshell);
break;
}
case cm_case:
{
register CASE_COM *c;

View file

@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_DISPOSE_CMD_H_)
#define _DISPOSE_CMD_H_

620
doc/FAQ
View file

@ -1,4 +1,4 @@
This is the Bash FAQ, version 3.0, for Bash version 2.03.
This is the Bash FAQ, version 3.7, for Bash version 2.04.
This document contains a set of frequently-asked questions concerning
Bash, the GNU Bourne-Again Shell. Bash is a freely-available command
@ -15,6 +15,8 @@ This document is available for anonymous FTP with the URL
ftp://ftp.cwru.edu/pub/bash/FAQ
The Bash home page is http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html
----------
Contents:
@ -34,8 +36,8 @@ A10) What is the bash `posix mode'?
Section B: The latest version
B1) What's new in version 2.03?
B2) Are there any user-visible incompatibilities between bash-2.03 and
B1) What's new in version 2.04?
B2) Are there any user-visible incompatibilities between bash-2.04 and
bash-1.14.7?
Section C: Differences from other Unix shells
@ -56,26 +58,18 @@ D5) How can I pipe standard output and standard error from one command to
D6) Now that I've converted from ksh to bash, are there equivalents to
ksh features like autoloaded functions and the `whence' command?
Section E: How can I get bash to do certain things, and why does bash do
things the way it does?
Section E: Why does bash do certain things the way it does?
E1) Why is the bash builtin `test' slightly different from /bin/test?
E2) Why does bash sometimes say `Broken pipe'?
E3) How can I get bash to read and display eight-bit characters?
E4) How do I write a function `x' to replace builtin command `x', but
still invoke the command from within the function?
E5) When I have terminal escape sequences in my prompt, why does bash
E3) When I have terminal escape sequences in my prompt, why does bash
wrap lines at the wrong column?
E6) How can I find the value of a shell variable whose name is the value
of another shell variable?
E7) If I pipe the output of a command into `read variable', why doesn't
E4) If I pipe the output of a command into `read variable', why doesn't
the output show up in $variable when the read command finishes?
E8) I have a bunch of shell scripts that use backslash-escaped characters
E5) I have a bunch of shell scripts that use backslash-escaped characters
in arguments to `echo'. Bash doesn't interpret these characters. Why
not, and how can I make it understand them?
E9) Why doesn't a while or for loop get suspended when I type ^Z?
E10) How can I make the bash `time' reserved word print timing output that
looks like the output from my system's /usr/bin/time?
E6) Why doesn't a while or for loop get suspended when I type ^Z?
Section F: Things to watch out for on certain Unix versions
@ -87,15 +81,31 @@ F3) Why does bash dump core after I interrupt username completion or
F4) I'm running SVR4.2. Why is the line erased every time I type `@'?
F5) Why does bash report syntax errors when my C News scripts use a
redirection before a subshell command?
F6) Why can't I use vi-mode editing on Red Hat Linux 6.1?
Section G: Where do I go from here?
Section G: How can I get bash to do certain common things?
G1) How do I report bugs in bash, and where should I look for fixes and
G1) How can I get bash to read and display eight-bit characters?
G2) How do I write a function `x' to replace builtin command `x', but
still invoke the command from within the function?
G3) How can I find the value of a shell variable whose name is the value
of another shell variable?
G4) How can I make the bash `time' reserved word print timing output that
looks like the output from my system's /usr/bin/time?
G5) How do I get the current directory into my prompt?
G6) How can I rename "*.foo" to "*.bar"?
G7) How can I translate a filename from uppercase to lowercase?
G8) How can I write a filename expansion (globbing) pattern that will match
all files in the current directory except "." and ".."?
Section H: Where do I go from here?
H1) How do I report bugs in bash, and where should I look for fixes and
advice?
G2) What kind of bash documentation is there?
G3) What's coming in future versions?
G4) What's on the bash `wish list'?
G5) When will the next release appear?
H2) What kind of bash documentation is there?
H3) What's coming in future versions?
H4) What's on the bash `wish list'?
H5) When will the next release appear?
----------
Section A: The Basics
@ -120,22 +130,22 @@ of Case Western Reserve University.
A2) What's the latest version?
The latest version is 2.03, first made available on Friday, 19 Feburary 1999.
The latest version is 2.04, first made available on Friday, 17 March 2000.
A3) Where can I get it?
Bash is the GNU project's shell, and so is available from the
master GNU archive site, ftp.gnu.org, and its mirrors. The
latest version is also available for FTP from ftp.cwru.edu.
The following URLs tell how to get version 2.03:
The following URLs tell how to get version 2.04:
ftp://ftp.gnu.org/pub/gnu/bash-2.03.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-2.03.tar.gz
ftp://ftp.gnu.org/pub/gnu/bash/bash-2.04.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-2.04.tar.gz
Formatted versions of the documentation are available with the URLs:
ftp://ftp.gnu.org/pub/gnu/bash-doc-2.03.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-2.03.tar.gz
ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-2.04.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-2.04.tar.gz
A4) On what machines will bash run?
@ -150,25 +160,25 @@ More information appears in the file `INSTALL' in the distribution.
A5) Will bash run on operating systems other than Unix?
Configuration specifics for Unix-like systems such as QNX and
LynxOS are included in the distribution. Bash-2.03 should
LynxOS are included in the distribution. Bash-2.04 should
compile and run on Minix 2.0 (patches were contributed), but I
don't believe anyone has built bash-2.x on earlier Minix versions
yet.
Bash has been ported to versions of Windows implementing the Win32
programming interface. This includes Windows 95 and Windows NT.
The port was done by Cygnus Solutions as part of their GNU-Win32
The port was done by Cygnus Solutions as part of their CYGWIN
project. For more information about the project, look at the URL
http://www.cygnus.com/misc/gnu-win32
http:/sourceware.cygnus.com/cygwin
Cygnus originally ported bash-1.14.7, and that port was part of their
early GNU-Win32 releases. Cygnus has also done a port of bash-2.01 to the
GNU-Win32 environment, and it is available as part of their current
release. (They may have upgraded by now.)
early GNU-Win32 (the original name) releases. Cygnus has also done a
port of bash-2.02.1 to the CYGWIN environment, and it is available as
part of their current release. (They may have upgraded by now.)
Bash-2.03 should require no local Cygnus changes to build and run under
GNU-WIN32.
Bash-2.04 should require no local Cygnus changes to build and run under
CYGWIN.
The Cygnus port works only on Intel machines. There is a port of bash
(I don't know which version) to the alpha/NT environment available from
@ -185,7 +195,7 @@ but Interix users should fetch
ftp://ftp.interix.com/pub/tw/unsup/bash.diffs.tar.gz
and read the README.OpenNT file in that archive. It will detail the
arguments configure needs to build on Interix. A configure cache
arguments `configure' needs to build on Interix. A configure cache
file for Interix is in the bash distribution in cross-build/opennt.cache;
copy that to `config.cache' before starting configure.
@ -203,6 +213,15 @@ The corresponding source is
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147s.zip
Mark Elbrecht <snowball3@bigfoot.com> has sent me notice that bash-2.03
has become available for DJGPP V2. The files are available as:
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203b.zip binary
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203d.zip documentation
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203s.zip source
Mark has begun to work with bash-2.04.
Ports of bash-1.12 and bash-2.0 are available for OS/2 from
ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash_112.zip
@ -211,6 +230,10 @@ ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash-2.0(253).zip
I haven't looked at either, but the second appears to be a binary-only
distribution. Beware.
I have received word that Bash (I'm not sure which version, but I
believe that it's at least bash-2.02.1) is the standard shell on
BeOS.
A6) How can I build bash with gcc?
Bash configures to use gcc by default if it is available. Read the
@ -262,6 +285,33 @@ This will cause login shells to replace themselves with bash running as
a login shell. Once you have this working, you can copy your initialization
code from ~/.profile to ~/.bash_profile.
I have received word that the recipe supplied above is insufficient for
machines running CDE. CDE has a maze of twisty little startup files, all
slightly different.
If you cannot change your login shell in the password file to bash, you
will have to (apparently) live with CDE using the shell in the password
file to run its startup scripts. If you have changed your shell to bash,
there is code in the CDE startup files (on Solaris, at least) to do the
right thing.
`dtterm' claims to use $SHELL as the default program to start, so if you
can change $SHELL in the CDE startup files, you should be able to use bash
in your terminal windows.
Setting DTSOURCEPROFILE in ~/.dtprofile will cause the `Xsession' program
to read your login shell's startup files. You may be able to use bash for
the rest of the CDE programs by setting SHELL to bash in ~/.dtprofile as
well, but I have not tried this.
You can use the above `exec' recipe to start bash when not logging in with
CDE by testing the value of the DT variable:
if [ -n "$DT" ]; then
[ -f /usr/gnu/bin/bash ] && exec /usr/gnu/bin/bash --login
fi
A8) I just changed my login shell to bash, and now I can't FTP into my
machine. Why not?
@ -324,16 +374,59 @@ Reference Manual.
Section B: The latest version
B1) What's new in version 2.03?
B1) What's new in version 2.04?
Bash-2.03 has a very few new features, in keeping with the convention
Bash-2.04 contains the following new features (see the manual page for
complete descriptions and the CHANGES and NEWS files in the bash-2.04
distribution):
o Programmable word completion with the new `complete' and `compgen' builtins;
examples are provided in examples/complete/complete-examples
o `history' has a new `-d' option to delete a history entry
o `bind' has a new `-x' option to bind key sequences to shell commands
o The prompt expansion code has new `\j' and `\l' escape sequences
o The `no_empty_command_completion' shell option, if enabled, inhibits
command completion when TAB is typed on an empty line
o `help' has a new `-s' option to print a usage synopsis
o New arithmetic operators: var++, var--, ++var, --var, expr1,expr2 (comma)
o New ksh93-style arithmetic for command:
for ((expr1 ; expr2; expr3 )); do list; done
o `read' has new options: `-t', `-n', `-d', `-s'
o The redirection code handles several filenames specially: /dev/fd/N,
/dev/stdin, /dev/stdout, /dev/stderr
o The redirection code now recognizes /dev/tcp/HOST/PORT and
/dev/udp/HOST/PORT and tries to open a TCP or UDP socket, respectively,
to the specified port on the specified host
o The ${!prefix*} expansion has been implemented
o A new FUNCNAME variable, which expands to the name of a currently-executing
function
o The GROUPS variable is no longer readonly
o A new shopt `xpg_echo' variable, to control the behavior of echo with
respect to backslash-escape sequences at runtime
o The NON_INTERACTIVE_LOGIN_SHELLS #define has returned
The version of Readline released with Bash-2.04, Readline-4.1, has several
new features as well:
o Parentheses matching is always compiled into readline, and controllable
with the new `blink-matching-paren' variable
o The history-search-forward and history-search-backward functions now leave
point at the end of the line when the search string is empty, like
reverse-search-history, and forward-search-history
o A new function for applications: rl_on_new_line_with_prompt()
o New variables for applications: rl_already_prompted, and rl_gnu_readline_p
A short feature history dating from bash-2.0:
Bash-2.03 had very few new features, in keeping with the convention
that odd-numbered releases provide mainly bug fixes. A number of new
features were added to Readline, mostly at the request of the Cygnus
folks.
a new shopt option, `restricted_shell', so that startup files can test
A new shopt option, `restricted_shell', so that startup files can test
whether or not the shell was started in restricted mode
filename generation is now performed on the words between ( and ) in
Filename generation is now performed on the words between ( and ) in
compound array assignments (this is really a bug fix)
OLDPWD is now auto-exported, as POSIX.2 requires
ENV and BASH_ENV are read-only variables in a restricted shell
@ -342,7 +435,7 @@ Bash may now be linked against an already-installed Readline library,
All shells begun with the `--login' option will source the login shell
startup files, even if the shell is not interactive
There are lots of changes to the version of the Readline library released
There were lots of changes to the version of the Readline library released
along with Bash-2.03. For a complete list of the changes, read the file
CHANGES in the Bash-2.03 distribution.
@ -412,11 +505,11 @@ grammar tighter and smaller (66 reduce-reduce conflicts gone)
lots of code now smaller and faster
test suite greatly expanded
B2) Are there any user-visible incompatibilities between bash-2.03 and
B2) Are there any user-visible incompatibilities between bash-2.04 and
bash-1.14.7?
There are a few incompatibilities between version 1.14.7 and version 2.03.
They are detailed in the file COMPAT in the bash-2.03 distribution.
There are a few incompatibilities between version 1.14.7 and version 2.04.
They are detailed in the file COMPAT in the bash-2.04 distribution.
Section C: Differences from other Unix shells
@ -431,13 +524,15 @@ Things bash has that sh does not:
`!' reserved word to invert pipeline return value
`time' reserved word to time pipelines and shell builtins
the `function' reserved word
the select compound command and reserved word
the `select' compound command and reserved word
arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
new $'...' and $"..." quoting
the $(...) form of command substitution
the $(<filename) form of command substitution, equivalent to
$(cat filename)
the ${#param} parameter value length operator
the ${!param} indirect parameter expansion operator
the ${!param*} prefix expansion operator
the ${param:length[:offset]} parameter substring operator
the ${param/pat[/string]} parameter pattern substitution operator
expansions to perform substring removal (${p%[%]w}, ${p#[#]w})
@ -448,16 +543,18 @@ Things bash has that sh does not:
ENV, PS3, PS4, DIRSTACK, PIPESTATUS, HISTSIZE, HISTFILE,
HISTFILESIZE, HISTCONTROL, HISTIGNORE, GLOBIGNORE, GROUPS,
PROMPT_COMMAND, FCEDIT, FIGNORE, IGNOREEOF, INPUTRC,
SHELLOPTS, OPTERR, HOSTFILE, TMOUT, histchars, auto_resume
SHELLOPTS, OPTERR, HOSTFILE, TMOUT, FUNCNAME, histchars,
auto_resume
DEBUG trap
variable arrays with new compound assignment syntax
redirections: <>, &>, >|
prompt string special char translation and variable expansion
auto-export of modified values of variables in initial environment
auto-export of variables in initial environment
command search finds functions before builtins
bash return builtin will exit a file sourced with `.'
builtins: cd -/-L/-P, exec -l/-c/-a, echo -e/-E, hash -p.
export -n/-f/-p/name=value, pwd -L/-P, read -e/-p/-a,
export -n/-f/-p/name=value, pwd -L/-P,
read -e/-p/-a/-t/-n/-d/-s,
readonly -a/-f/name=value, trap -l, set +o,
set -b/-m/-o option/-h/-p/-B/-C/-H/-P,
unset -f/-v, ulimit -m/-p/-u,
@ -473,12 +570,13 @@ Things bash has that sh does not:
process substitution
aliases and alias/unalias builtins
local variables in functions and `local' builtin
readline and command-line editing
readline and command-line editing with programmable completion
command history and history/fc builtins
csh-like history expansion
other new bash builtins: bind, command, builtin, declare/typeset,
dirs, enable, fc, help, history, logout,
popd, pushd, disown, shopt, printf
other new bash builtins: bind, command, compgen, complete, builtin,
declare/typeset, dirs, enable, fc, help,
history, logout, popd, pushd, disown, shopt,
printf
exported functions
filename generation when using output redirection (command >a*)
POSIX.2-style globbing character classes
@ -489,6 +587,8 @@ Things bash has that sh does not:
variable assignments preceding commands affect only that command,
even for builtins and functions
posix mode
redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr,
/dev/tcp/host/port, /dev/udp/host/port
Things sh has that bash does not:
uses variable SHACCT to do shell accounting
@ -521,11 +621,13 @@ C2) How does bash differ from the Korn shell, version ksh88?
Things bash has or uses that ksh88 does not:
long invocation options
`!' reserved word
arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
posix mode and posix conformance
command hashing
tilde expansion for assignment statements that look like $PATH
process substitution with named pipes if /dev/fd is not available
the ${!param} indirect parameter expansion operator
the ${!param*} prefix expansion operator
the ${param:length[:offset]} parameter substring operator
the ${param/pat[/string]} parameter pattern substitution operator
variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, SHLVL,
@ -533,18 +635,19 @@ Things bash has or uses that ksh88 does not:
HISTFILESIZE, HISTIGNORE, HISTCONTROL, PROMPT_COMMAND,
IGNOREEOF, FIGNORE, INPUTRC, HOSTFILE, DIRSTACK,
PIPESTATUS, HOSTNAME, OPTERR, SHELLOPTS, GLOBIGNORE,
GROUPS, histchars, auto_resume
GROUPS, FUNCNAME, histchars, auto_resume
prompt expansion with backslash escapes and command substitution
redirection: &> (stdout and stderr)
more extensive and extensible editing and completion
more extensive and extensible editing and programmable completion
builtins: bind, builtin, command, declare, dirs, echo -e/-E, enable,
exec -l/-c/-a, fc -s, export -n/-f/-p, hash, help, history,
jobs -x/-r/-s, kill -s/-n/-l, local, logout, popd, pushd,
read -e/-p/-a, readonly -a/-n/-f/-p, set -o braceexpand/
-o histexpand/-o interactive-comments/-o notify/-o physical/
-o posix/-o hashall/-o onecmd/-h/-B/-C/-b/-H/-P, set +o,
suspend, trap -l, type, typeset -a/-F/-p, ulimit -u,
umask -S, alias -p, shopt, disown, printf
read -e/-p/-a/-t/-n/-d/-s, readonly -a/-n/-f/-p,
set -o braceexpand/-o histexpand/-o interactive-comments/
-o notify/-o physical/-o posix/-o hashall/-o onecmd/
-h/-B/-C/-b/-H/-P, set +o, suspend, trap -l, type,
typeset -a/-F/-p, ulimit -u, umask -S, alias -p, shopt,
disown, printf, complete, compgen
`!' csh-style history expansion
POSIX.2-style globbing character classes
POSIX.2-style globbing equivalence classes
@ -552,10 +655,11 @@ Things bash has or uses that ksh88 does not:
egrep-like extended pattern matching operators
case-insensitive pattern matching and globbing
`**' arithmetic operator to do exponentiation
redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr
Things ksh88 has or uses that bash does not:
tracked aliases
variables: ERRNO, FPATH, COLUMNS, LINES, EDITOR, VISUAL
variables: ERRNO, FPATH, EDITOR, VISUAL
co-processes (|&, >&p, <&p)
weirdly-scoped functions
typeset +f to list all function names without definitions
@ -574,30 +678,29 @@ Implementation differences:
C3) Which new features in ksh-93 are not in bash, and which are?
New things in ksh-93 not in bash-2.03:
New things in ksh-93 not in bash-2.04:
associative arrays
floating point arithmetic
++, --, comma arithmetic operators
math library functions
${!name[sub]} name of subscript for associative array
${!prefix*} and {!prefix@} variable name prefix expansions
`.' is allowed in variable names to create a hierarchical namespace
more extensive compound assignment syntax
discipline functions
`sleep' and `getconf' builtins (bash has loadable versions)
typeset -n and `nameref' variables
KEYBD trap
variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, HISTEDIT,
.sh.version, .sh.name, .sh.subscript, .sh.value
variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, .sh.version,
.sh.name, .sh.subscript, .sh.value, HISTEDIT
backreferences in pattern matching
print -f (bash has a loadable version of print and the printf builtin)
print -f (bash uses printf)
`fc' has been renamed to `hist'
read -t/-d
`.' can execute shell functions
New things in ksh-93 present in bash-2.03:
?: arithmetic operator
expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]}
New things in ksh-93 present in bash-2.04:
for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command
?:, ++, --, `expr1 , expr2' arithmetic operators
expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]},
${!param*}
compound array assignment
the `!' reserved word
loadable builtins -- but ksh uses `builtin' while bash uses `enable'
@ -607,6 +710,7 @@ New things in ksh-93 present in bash-2.03:
set -o notify/-C
changes to kill builtin
read -A (bash uses read -a)
read -t/-d
trap -p
exec -c/-a
`.' restores the positional parameters when it completes
@ -638,7 +742,7 @@ the following function definition to your .bashrc:
which()
{
builtin type -p "$@"
builtin type "$@"
}
If you're moving from tcsh and would like to bring `where' along
@ -771,8 +875,8 @@ descriptor 2.
D6) Now that I've converted from ksh to bash, are there equivalents to
ksh features like autoloaded functions and the `whence' command?
There are features in ksh-88 that do not have direct bash equivalents.
Most, however, can be emulated with very little trouble.
There are features in ksh-88 and ksh-93 that do not have direct bash
equivalents. Most, however, can be emulated with very little trouble.
ksh-88 feature Bash equivalent
-------------- ---------------
@ -784,6 +888,14 @@ cd, print, whence function substitutes in examples/functions/kshenv
autoloaded functions examples/functions/autoload is the same as typeset -fu
read var?prompt read -p prompt var
ksh-93 feature Bash equivalent
-------------- ---------------
sleep, getconf Bash has loadable versions in examples/loadables
${.sh.version} $BASH_VERSION
print -f printf
hist alias fc=hist
$HISTEDIT $FCEDIT
Section E: How can I get bash to do certain things, and why does bash do
things the way it does?
@ -835,62 +947,7 @@ You can build a version of bash that will not report SIGPIPE errors
by uncommenting the definition of DONT_REPORT_SIGPIPE in the file
config-top.h.
E3) How can I get bash to read and display eight-bit characters?
This is a process requiring several steps.
First, you must ensure that the `physical' data path is a full eight
bits. For xterms, for example, the `vt100' resources `eightBitInput'
and `eightBitOutput' should be set to `true'.
Once you have set up an eight-bit path, you must tell the kernel and
tty driver to leave the eighth bit of characters alone when processing
keyboard input. Use `stty' to do this:
stty cs8 -istrip -parenb
For old BSD-style systems, you can use
stty pass8
You may also need
stty even odd
Finally, you need to tell readline that you will be inputting and
displaying eight-bit characters. You use readline variables to do
this. These variables can be set in your .inputrc or using the bash
`bind' builtin. Here's an example using `bind':
bash$ bind 'set convert-meta off'
bash$ bind 'set meta-flag on'
bash$ bind 'set output-meta on'
The `set' commands between the single quotes may also be placed
in ~/.inputrc.
E4) How do I write a function `x' to replace builtin command `x', but
still invoke the command from within the function?
This is why the `command' and `builtin' builtins exist. The
`command' builtin executes the command supplied as its first
argument, skipping over any function defined with that name. The
`builtin' builtin executes the builtin command given as its first
argument directly.
For example, to write a function to replace `cd' that writes the
hostname and current directory to an xterm title bar, use
something like the following:
cd()
{
builtin cd "$@" && xtitle "$HOST: $PWD"
}
This could also be written using `command' instead of `builtin';
the version above is marginally more efficient.
E5) When I have terminal escape sequences in my prompt, why does bash
E3) When I have terminal escape sequences in my prompt, why does bash
wrap lines at the wrong column?
Readline, the line editing library that bash uses, does not know
@ -906,38 +963,7 @@ characters in the prompt strings take up no screen space.
Use the \[ escape to begin a sequence of non-printing characters,
and the \] escape to signal the end of such a sequence.
E6) How can I find the value of a shell variable whose name is the value
of another shell variable?
Versions of Bash newer than Bash-2.0 support this directly. You can use
${!var}
For example, the following sequence of commands will echo `z':
var1=var2
var2=z
echo ${!var1}
For sh compatibility, use the `eval' builtin. The important
thing to remember is that `eval' expands the arguments you give
it again, so you need to quote the parts of the arguments that
you want `eval' to act on.
For example, this expression prints the value of the last positional
parameter:
eval echo \"\$\{$#\}\"
The expansion of the quoted portions of this expression will be
deferred until `eval' runs, while the `$#' will be expanded
before `eval' is executed. In versions of bash later than bash-2.0,
echo ${!#}
does the same thing.
E7) If I pipe the output of a command into `read variable', why doesn't
E4) If I pipe the output of a command into `read variable', why doesn't
the output show up in $variable when the read command finishes?
This has to do with the parent-child relationship between Unix
@ -993,13 +1019,13 @@ this.
This is the general approach -- in most cases you will not need to
set $IFS to a different value.
E8) I have a bunch of shell scripts that use backslash-escaped characters
E5) I have a bunch of shell scripts that use backslash-escaped characters
in arguments to `echo'. Bash doesn't interpret these characters. Why
not, and how can I make it understand them?
This is the behavior of echo on most Unix System V machines.
The bash builtin `echo' is modelled after the 9th Edition
The bash builtin `echo' is modeled after the 9th Edition
Research Unix version of `echo'. It does not interpret
backslash-escaped characters in its argument strings by default;
it requires the use of the -e option to enable the
@ -1013,7 +1039,11 @@ configure with the --enable-usg-echo-default option to turn this
on. Be aware that this will cause some of the tests run when you
type `make tests' to fail.
E9) Why doesn't a while or for loop get suspended when I type ^Z?
There is a shell option, `xpg_echo', settable with `shopt' that will
change the behavior of echo at runtime. Enabling this option turns
on expansion of backslash-escape sequences.
E6) Why doesn't a while or for loop get suspended when I type ^Z?
This is a consequence of how job control works on Unix. The only
thing that can be suspended is the process group. This is a single
@ -1028,38 +1058,6 @@ If you want to be able to stop the entire loop, you need to put it
within parentheses, which will force the loop into a subshell that
may be stopped (and subsequently restarted) as a single unit.
E10) How can I make the bash `time' reserved word print timing output that
looks like the output from my system's /usr/bin/time?
The bash command timing code looks for a variable `TIMEFORMAT' and
uses its value as a format string to decide how to display the
timing statistics.
The value of TIMEFORMAT is a string with `%' escapes expanded in a
fashion similar in spirit to printf(3). The manual page explains
the meanings of the escape sequences in the format string.
If TIMEFORMAT is not set, bash acts as if the following assignment had
been performed:
TIMEFORMAT=$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'
The POSIX.2 default time format (used by `time -p command') is
TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S'
The BSD /usr/bin/time format can be emulated with:
TIMEFORMAT=$'\t%1R real\t%1U user\t%1S sys'
The System V /usr/bin/time format can be emulated with:
TIMEFORMAT=$'\nreal\t%1R\nuser\t%1U\nsys\t%1S'
The ksh format can be emulated with:
TIMEFORMAT=$'\nreal\t%2lR\nuser\t%2lU\nsys\t%2lS'
Section F: Things to watch out for on certain Unix versions
F1) Why can't I use command line editing in my `cmdtool'?
@ -1156,16 +1154,211 @@ is, in fact, a syntax error. Redirections may only precede `simple
commands'. A subshell construct such as the above is one of the shell's
`compound commands'. A redirection may only follow a compound command.
The file CWRU/sh-redir-hack in the bash-2.03 distribution is an
This affects the mechanical transformation of commands that use `cat'
to pipe a file into a command (a favorite Useless-Use-Of-Cat topic on
comp.unix.shell). While most commands of the form
cat file | command
can be converted to `< file command', shell control structures such as
loops and subshells require `command < file'.
The file CWRU/sh-redir-hack in the bash-2.04 distribution is an
(unofficial) patch to parse.y that will modify the grammar to
support this construct. It will not apply with `patch'; you must
modify parse.y by hand. Note that if you apply this, you must
recompile with -DREDIRECTION_HACK. This introduces a large
number of reduce/reduce conflicts into the shell grammar.
Section G: Where do I go from here?
F6) Why can't I use vi-mode editing on Red Hat Linux 6.1?
G1) How do I report bugs in bash, and where should I look for fixes and
The short answer is that Red Hat screwed up.
The long answer is that they shipped an /etc/inputrc that only works
for emacs mode editing, and then screwed all the vi users by setting
INPUTRC to /etc/inputrc in /etc/profile.
The short fix is to do one of the following: remove or rename
/etc/inputrc, set INPUTRC=~/.inputrc in ~/.bashrc (or .bash_profile,
but make sure you export it if you do), remove the assignment to
INPUTRC from /etc/profile, add
set keymap emacs
to the beginning of /etc/inputrc, or bracket the key bindings in
/etc/inputrc with these lines
$if mode=emacs
[...]
$endif
Section G: How can I get bash to do certain common things?
G1) How can I get bash to read and display eight-bit characters?
This is a process requiring several steps.
First, you must ensure that the `physical' data path is a full eight
bits. For xterms, for example, the `vt100' resources `eightBitInput'
and `eightBitOutput' should be set to `true'.
Once you have set up an eight-bit path, you must tell the kernel and
tty driver to leave the eighth bit of characters alone when processing
keyboard input. Use `stty' to do this:
stty cs8 -istrip -parenb
For old BSD-style systems, you can use
stty pass8
You may also need
stty even odd
Finally, you need to tell readline that you will be inputting and
displaying eight-bit characters. You use readline variables to do
this. These variables can be set in your .inputrc or using the bash
`bind' builtin. Here's an example using `bind':
bash$ bind 'set convert-meta off'
bash$ bind 'set meta-flag on'
bash$ bind 'set output-meta on'
The `set' commands between the single quotes may also be placed
in ~/.inputrc.
G2) How do I write a function `x' to replace builtin command `x', but
still invoke the command from within the function?
This is why the `command' and `builtin' builtins exist. The
`command' builtin executes the command supplied as its first
argument, skipping over any function defined with that name. The
`builtin' builtin executes the builtin command given as its first
argument directly.
For example, to write a function to replace `cd' that writes the
hostname and current directory to an xterm title bar, use
something like the following:
cd()
{
builtin cd "$@" && xtitle "$HOST: $PWD"
}
This could also be written using `command' instead of `builtin';
the version above is marginally more efficient.
G3) How can I find the value of a shell variable whose name is the value
of another shell variable?
Versions of Bash newer than Bash-2.0 support this directly. You can use
${!var}
For example, the following sequence of commands will echo `z':
var1=var2
var2=z
echo ${!var1}
For sh compatibility, use the `eval' builtin. The important
thing to remember is that `eval' expands the arguments you give
it again, so you need to quote the parts of the arguments that
you want `eval' to act on.
For example, this expression prints the value of the last positional
parameter:
eval echo \"\$\{$#\}\"
The expansion of the quoted portions of this expression will be
deferred until `eval' runs, while the `$#' will be expanded
before `eval' is executed. In versions of bash later than bash-2.0,
echo ${!#}
does the same thing.
G4) How can I make the bash `time' reserved word print timing output that
looks like the output from my system's /usr/bin/time?
The bash command timing code looks for a variable `TIMEFORMAT' and
uses its value as a format string to decide how to display the
timing statistics.
The value of TIMEFORMAT is a string with `%' escapes expanded in a
fashion similar in spirit to printf(3). The manual page explains
the meanings of the escape sequences in the format string.
If TIMEFORMAT is not set, bash acts as if the following assignment had
been performed:
TIMEFORMAT=$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'
The POSIX.2 default time format (used by `time -p command') is
TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S'
The BSD /usr/bin/time format can be emulated with:
TIMEFORMAT=$'\t%1R real\t%1U user\t%1S sys'
The System V /usr/bin/time format can be emulated with:
TIMEFORMAT=$'\nreal\t%1R\nuser\t%1U\nsys\t%1S'
The ksh format can be emulated with:
TIMEFORMAT=$'\nreal\t%2lR\nuser\t%2lU\nsys\t%2lS'
G5) How do I get the current directory into my prompt?
Bash provides a number of backslash-escape sequences which are expanded
when the prompt string (PS1 or PS2) is displayed. The full list is in
the manual page.
The \w expansion gives the full pathname of the current directory, with
a tilde (`~') substituted for the current value of $HOME. The \W
expansion gives the basename of the current directory. To put the full
pathname of the current directory into the path without any tilde
subsitution, use $PWD. Here are some examples:
PS1='\w$ ' # current directory with tilde
PS1='\W$ ' # basename of current directory
PS1='$PWD$ ' # full pathname of current directory
The single quotes are important in the final example to prevent $PWD from
being expanded when the assignment to PS1 is performed.
G6) How can I rename "*.foo" to "*.bar"?
Use the pattern removal functionality described in D3. The following `for'
loop will do the trick:
for f in *.foo; do
mv $f ${f%foo}bar
done
G7) How can I translate a filename from uppercase to lowercase?
The script examples/functions/lowercase, originally written by John DuBois,
will do the trick. The converse is left as an exercise.
G8) How can I write a filename expansion (globbing) pattern that will match
all files in the current directory except "." and ".."?
You must have set the `extglob' shell option using `shopt -s extglob' to use
this:
echo .!(.|) *
A solution that works without extended globbing is given in the Unix Shell
FAQ, posted periodically to comp.unix.shell.
Section H: Where do I go from here?
H1) How do I report bugs in bash, and where should I look for fixes and
advice?
Use the `bashbug' script to report bugs. It is built and
@ -1183,7 +1376,7 @@ and problems also take place there.
To reach the bash maintainers directly, send mail to
bash-maintainers@gnu.org.
G2) What kind of bash documentation is there?
H2) What kind of bash documentation is there?
First, look in the doc directory in the bash distribution. It should
contain at least the following files:
@ -1213,36 +1406,33 @@ A second edition of this book is available, published in January, 1998.
The ISBN number is 1-56592-347-2. Look for it in the same fine bookstores
or on the web.
G3) What's coming in future versions?
H3) What's coming in future versions?
These are features I plan to include in a future version of bash.
a bash debugger (a minimally-tested version is included with bash-2.02)
Programmable completion a la zsh/tcsh
a bash debugger (a minimally-tested version is included with bash-2.04)
associative arrays
G4) What's on the bash `wish list' for future versions?
H4) What's on the bash `wish list' for future versions?
These are features that may or may not appear in a future version of bash.
associative arrays (not really all that hard)
breaking some of the shell functionality into embeddable libraries
a module system like zsh's, using dynamic loading like builtins
better internationalization using GNU `gettext'
an option to use external files for the long `help' text
timeouts for the `read' builtin
the ksh-93 ${!prefix*} and ${!prefix@} operators
arithmetic ++ and -- prefix and postfix operators
date-stamped command history
a way to bind readline editing key sequences to shell commands
a mechanism to open network connections and assign them to file descriptors
using redirection (like ksh /dev/{tcp,udp})
a bash programmer's guide with a chapter on creating loadable builtins
a better loadable interface to perl with access to the shell builtins and
variables (contributions gratefully accepted)
G5) When will the next release appear?
H5) When will the next release appear?
The next version will appear sometime in 1999. Never make
The next version will appear sometime in 2000 or 2001. Never make
predictions.
This document is Copyright 1995-1999 by Chester Ramey.
This document is Copyright 1995-2000 by Chester Ramey.
Permission is hereby granted, without written agreement and
without license or royalty fees, to use, copy, and distribute

View file

@ -1,4 +1,21 @@
# This Makefile is for the Bash/documentation directory -*- text -*-.
#
# Copyright (C) 1996 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
#
SHELL = @MAKE_SHELL@
RM = rm -f
@ -7,8 +24,14 @@ topdir = @top_srcdir@
srcdir = @srcdir@
VPATH = .:@srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
infodir = @infodir@
# set this to a directory name to have the HTML files installed
htmldir = @htmldir@
mandir = @mandir@
manpfx = man
@ -34,7 +57,9 @@ TEXI2HTML = ${topdir}/support/texi2html
MAN2HTML = ${BUILD_DIR}/support/man2html
HTMLPOST = ${srcdir}/htmlpost.sh
QUIETPS = #set this to -q to shut up dvips
DVIPS = dvips -D 300 $(QUIETPS) -o $@ # tricky
PAPERSIZE = letter # change to a4 for A4-size paper
PSDPI = 300 # could be 600 if you like
DVIPS = dvips -D ${PSDPI} $(QUIETPS) -t ${PAPERSIZE} -o $@ # tricky
TEXINPUTDIR = $(RL_LIBDIR)/doc
MKDIRS = ${topdir}/support/mkdirs
@ -85,10 +110,10 @@ RLUSER = $(RL_LIBDIR)/doc/rluser.texinfo
all: ps info dvi text html
nodvi: ps info text html
PSFILES = bash.ps bashbug.ps readline.ps article.ps builtins.ps
PSFILES = bash.ps bashbug.ps readline.ps article.ps builtins.ps rbash.ps
DVIFILES = bashref.dvi bashref.ps
INFOFILES = bashref.info
MAN0FILES = bash.0 bashbug.0 builtins.0 readline.0
MAN0FILES = bash.0 bashbug.0 builtins.0 rbash.0 readline.0
HTMLFILES = bashref.html bash.html
ps: ${PSFILES}
@ -110,6 +135,16 @@ bashref.info: $(srcdir)/bashref.texi $(HSUSER) $(RLUSER)
bashref.html: bashref.texi $(HSUSER) $(RLUSER)
$(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/bashref.texi
new-bashref.dvi: $(srcdir)/new-bashref.texi $(HSUSER) $(RLUSER)
TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/new-bashref.texi
new-bashref.ps: new-bashref.dvi
$(RM) $@
$(DVIPS) new-bashref.dvi
new-bashref.info: $(srcdir)/new-bashref.texi $(HSUSER) $(RLUSER)
$(MAKEINFO) --no-split -I$(TEXINPUTDIR) $(srcdir)/new-bashref.texi
bash.dvi: bash.texinfo $(HSUSER) $(RLUSER)
TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) bash.texinfo
@ -122,9 +157,11 @@ bash.ps: bash.1
bash.html: bash.1 $(MAN2HTML)
bashbug.ps: bashbug.1
builtins.ps: builtins.1 bash.1
rbash.ps: rbash.1 bash.1
bash.0: bash.1
bashbug.0: bashbug.1
builtins.0: builtins.1 bash.1
rbash.0: rbash.1 bash.1
readline.0: readline.3
readline.ps: readline.3
article.ps: article.ms
@ -139,17 +176,26 @@ faq: ${CREATED_FAQ}
faq.version: FAQ.version FAQ
sh mkfaqvers FAQ.version > $@
faq.news: FAQ FAQ.headers.news faq.version
$(RM) $@
cat FAQ.headers.news faq.version FAQ > $@
faq.headers.mail: FAQ.headers.mail FAQ
sh mkfaqvers FAQ.headers.mail > $@
faq.news2: FAQ FAQ.headers.news2 faq.version
$(RM) $@
cat FAQ.headers.news2 faq.version FAQ > $@
faq.headers.news: FAQ.headers.news FAQ
sh mkfaqvers FAQ.headers.news > $@
faq.mail: FAQ FAQ.headers.mail faq.version
faq.headers.news2: FAQ.headers.news2 FAQ
sh mkfaqvers FAQ.headers.news2 > $@
faq.news: FAQ faq.headers.news faq.version
$(RM) $@
cat FAQ.headers.mail faq.version FAQ > $@
cat faq.headers.news faq.version FAQ > $@
faq.news2: FAQ faq.headers.news2 faq.version
$(RM) $@
cat faq.headers.news2 faq.version FAQ > $@
faq.mail: FAQ faq.headers.mail faq.version
$(RM) $@
cat faq.headers.mail faq.version FAQ > $@
clean:
$(RM) *.aux *.bak *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps \
@ -169,6 +215,9 @@ installdirs:
# uncomment the next line to create the directory for the readline man page
# -test -d $(man3dir) || $(SHELL) ${MKDIRS} $(man3dir)
-test -d $(infodir) || $(SHELL) ${MKDIRS} $(infodir)
-if [ -n "$(htmldir)" ]; then \
test -d $(htmldir) || $(SHELL) ${MKDIRS} $(htmldir) ; \
fi
install: info installdirs
-$(INSTALL_DATA) $(srcdir)/bash.1 $(man1dir)/bash.${man1ext}
@ -182,11 +231,20 @@ install: info installdirs
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
install-info --dir-file=$(infodir)/dir $(infodir)/bash.info; \
else true; fi
# if htmldir is set, install the html files into that directory
-if [ -n "${htmldir}" ]; then \
$(INSTALL_DATA) $(srcdir)/bash.html $(htmldir) ; \
$(INSTALL_DATA) $(srcdir)/bashref.html $(htmldir) ; \
fi
uninstall:
-$(RM) $(man1dir)/bash.${man1ext} $(man1dir)/bashbug.${man1ext}
-$(RM) $(man3dir)/readline.${man3ext}
$(RM) $(infodir)/bash.info
-if [ -n "$(htmldir)" ]; then \
$(RM) $(htmldir)/bash.html ; \
$(RM) $(htmldir)/bashref.html ; \
fi
# for use by chet
inst: bashref.texi

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
.\" This is a hack to force bash builtins into the whatis database
.\" and to get the list of builtins to come up with the man command.
.TH BASH_BUILTINS 1 "1996 March 20" GNU
.TH BASH_BUILTINS 1 "1996 Mar 20" GNU
.SH NAME
bash, :, ., alias, bg, bind, break, builtin, case, cd, command,
continue, declare, dirs, disown, echo, enable, eval, exec, exit,

View file

@ -6,14 +6,14 @@
# directory of the user running navigator
#
sed -e 's|<B>gnu.bash.bug</B>|<A HREF="news:gnu.bash.bug">gnu.bash.bug</A>|' \
-e 's|<I>/bin/bash</I>|<A HREF="file:/bin/bash"><I>/bin/bash</I></A>|' \
-e 's|<I>/etc/profile</I>|<A HREF="file:/etc/profile"><I>/etc/profile</I></A>|' \
-e 's|<I>~/.bash_profile</I>|<A HREF="file:~/.bash_profile"><I>~/.bash_profile</I></A>|' \
-e 's|<I>~/.bash_login</I>|<A HREF="file:~/.bash_login"><I>~/.bash_login</I></A>|' \
-e 's|<I>~/.profile</I>|<A HREF="file:~/.profile"><I>~/.profile</I></A>|' \
-e 's|<I>~/.bashrc</I>|<A HREF="file:~/.bashrc"><I>~/.bashrc</I></A>|' \
-e 's|<I>~/.bash_logout</I>|<A HREF="file:~/.bash_logout"><I>~/.bash_logout</I></A>|' \
-e 's|<I>~/.bash_history</I>|<A HREF="file:~/.bash_history"><I>~/.bash_history</I></A>|' \
-e 's|<I>~/.inputrc</I>|<A HREF="file:~/.inputrc"><I>~/.inputrc</I></A>|' \
-e 's|<I>/etc/inputrc</I>|<A HREF="file:/etc/inputrc"><I>/etc/inputrc</I></A>|'
sed -e 's|<B>gnu.bash.bug</B>|<A HREF="news:gnu.bash.bug">gnu.bash.bug</A>|g' \
-e 's|<I>/bin/bash</I>|<A HREF="file:/bin/bash"><I>/bin/bash</I></A>|g' \
-e 's|<I>/etc/profile</I>|<A HREF="file:/etc/profile"><I>/etc/profile</I></A>|g' \
-e 's|<I>~/.bash_profile</I>|<A HREF="file:~/.bash_profile"><I>~/.bash_profile</I></A>|g' \
-e 's|<I>~/.bash_login</I>|<A HREF="file:~/.bash_login"><I>~/.bash_login</I></A>|g' \
-e 's|<I>~/.profile</I>|<A HREF="file:~/.profile"><I>~/.profile</I></A>|g' \
-e 's|<I>~/.bashrc</I>|<A HREF="file:~/.bashrc"><I>~/.bashrc</I></A>|g' \
-e 's|<I>~/.bash_logout</I>|<A HREF="file:~/.bash_logout"><I>~/.bash_logout</I></A>|g' \
-e 's|<I>~/.bash_history</I>|<A HREF="file:~/.bash_history"><I>~/.bash_history</I></A>|g' \
-e 's|<I>~/.inputrc</I>|<A HREF="file:~/.inputrc"><I>~/.inputrc</I></A>|g' \
-e 's|<I>/etc/inputrc</I>|<A HREF="file:/etc/inputrc"><I>/etc/inputrc</I></A>|g'

8
doc/rbash.1 Normal file
View file

@ -0,0 +1,8 @@
.TH RBASH 1 "1999 Nov 29" GNU
.SH NAME
rbash \- restricted bash, see \fBbash\fR(1)
.SH RESTRICTED SHELL
.nr zY 1
.so bash.1
.SH SEE ALSO
bash(1)

View file

@ -6,9 +6,9 @@
.\" Case Western Reserve University
.\" chet@ins.CWRU.Edu
.\"
.\" Last Change: Thu Dec 31 10:16:30 EST 1998
.\" Last Change: Tue Jun 1 13:28:03 EDT 1999
.\"
.TH READLINE 3 "1998 Dec 31" GNU
.TH READLINE 3 "1999 Jun 1" GNU
.\"
.\" File Name macro. This used to be `.PN', for Path Name,
.\" but Sun doesn't seem to like that very much.
@ -148,6 +148,7 @@ processing key bindings:
.IR SPACE ,
and
.IR TAB .
.PP
In addition to command names, readline allows keys to be bound
to a string that is inserted when the key is pressed (a \fImacro\fP).
.PP
@ -564,7 +565,7 @@ Move forward to the end of the next word. Words are composed of
alphanumeric characters (letters and digits).
.TP
.B backward\-word (M\-b)
Move back to the start of this, or the previous, word. Words are
Move back to the start of the current or previous word. Words are
composed of alphanumeric characters (letters and digits).
.TP
.B clear\-screen (C\-l)
@ -1172,9 +1173,9 @@ VI Command Mode functions
Individual \fBreadline\fP initialization file
.PD
.SH AUTHORS
Brian Fox, Free Software Foundation (primary author)
Brian Fox, Free Software Foundation
.br
bfox@ai.MIT.Edu
bfox@gnu.org
.PP
Chet Ramey, Case Western Reserve University
.br

14
error.c
View file

@ -15,7 +15,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#include "config.h"
@ -64,7 +64,7 @@ extern int give_terminal_to ();
/* The current maintainer of the shell. You change this in the
Makefile. */
#if !defined (MAINTAINER)
#define MAINTAINER "bash-maintainers@prep.ai.mit.edu"
#define MAINTAINER "bash-maintainers@gnu.org"
#endif
char *the_current_maintainer = MAINTAINER;
@ -121,7 +121,10 @@ programming_error (reason, arg1, arg2, arg3, arg4, arg5)
}
#endif
#if 0
fprintf (stderr, "Report this to %s\n", the_current_maintainer);
#endif
fprintf (stderr, "Stopping myself...");
fflush (stderr);
@ -245,7 +248,10 @@ programming_error (format, va_alist)
}
#endif
#if 0
fprintf (stderr, "Report this to %s\n", the_current_maintainer);
#endif
fprintf (stderr, "Stopping myself...");
fflush (stderr);
@ -455,7 +461,6 @@ itrace (format, va_alist)
fflush(stderr);
}
#if 0
/* A trace function for silent debugging -- doesn't require a control
terminal. */
void
@ -471,7 +476,7 @@ trace (format, va_alist)
static FILE *tracefp = (FILE *)NULL;
if (tracefp == NULL)
tracefp = fopen("/usr/tmp/bash-trace.log", "a+");
tracefp = fopen("/tmp/bash-trace.log", "a+");
if (tracefp == NULL)
tracefp = stderr;
@ -493,7 +498,6 @@ trace (format, va_alist)
fflush(tracefp);
}
#endif /* 0 */
#endif /* USE_VARARGS */

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