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

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

This commit is contained in:
Jari Aalto 2004-07-27 13:29:18 +00:00
parent 7117c2d221
commit b80f6443b6
400 changed files with 69247 additions and 13346 deletions

625
ABOUT-NLS Normal file
View file

@ -0,0 +1,625 @@
Notes on the Free Translation Project
*************************************
Free software is going international! The Free Translation Project
is a way to get maintainers of free software, translators, and users all
together, so that will gradually become able to speak many languages.
A few packages already provide translations for their messages.
If you found this `ABOUT-NLS' file inside a distribution, you may
assume that the distributed package does use GNU `gettext' internally,
itself available at your nearest GNU archive site. But you do _not_
need to install GNU `gettext' prior to configuring, installing or using
this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
work at translations should contact the appropriate team.
When reporting bugs in the `intl/' directory or bugs which may be
related to internationalization, you should tell about the version of
`gettext' which is used. The information can be found in the
`intl/VERSION' file, in internationalized packages.
Quick configuration advice
==========================
If you want to exploit the full power of internationalization, you
should configure it using
./configure --with-included-gettext
to force usage of internationalizing routines provided within this
package, despite the existence of internationalizing capabilities in the
operating system where this package is being installed. So far, only
the `gettext' implementation in the GNU C library version 2 provides as
many features (such as locale alias, message inheritance, automatic
charset conversion or plural form handling) as the implementation here.
It is also not possible to offer this additional functionality on top
of a `catgets' implementation. Future versions of GNU `gettext' will
very likely convey even more functionality. So it might be a good idea
to change to GNU `gettext' as soon as possible.
So you need _not_ provide this option if you are using GNU libc 2 or
you have installed a recent copy of the GNU gettext package with the
included `libintl'.
INSTALL Matters
===============
Some packages are "localizable" when properly installed; the
programs they contain can be made to speak your own native language.
Most such packages use GNU `gettext'. Other packages have their own
ways to internationalization, predating GNU `gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system already
provides the GNU `gettext' functions. If not, the GNU `gettext' own
library will be used. This library is wholly contained within this
package, usually in the `intl/' subdirectory, so prior installation of
the GNU `gettext' package is _not_ required. Installers may use
special options at configuration time for changing the default
behaviour. The commands:
./configure --with-included-gettext
./configure --disable-nls
will respectively bypass any pre-existing `gettext' to use the
internationalizing routines provided within this package, or else,
_totally_ disable translation of messages.
When you already have GNU `gettext' installed on your system and run
configure without an option for your new package, `configure' will
probably detect the previously built and installed `libintl.a' file and
will decide to use this. This might be not what is desirable. You
should use the more recent version of the GNU `gettext' library. I.e.
if the file `intl/VERSION' shows that the library which comes with this
package is more recent, you should use
./configure --with-included-gettext
to prevent auto-detection.
The configuration process will not test for the `catgets' function
and therefore it will not be used. The reason is that even an
emulation of `gettext' on top of `catgets' could not provide all the
extensions of the GNU `gettext' library.
Internationalized packages have usually many `po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
translations have been forbidden at `configure' time by using the
`--disable-nls' switch, all available translations are installed
together with the package. However, the environment variable `LINGUAS'
may be set, prior to configuration, to limit the installed set.
`LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
Using This Package
==================
As a user, if your language has been installed for this package, you
only have to set the `LANG' environment variable to the appropriate
`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
and `CC' is an ISO 3166 two-letter country code. For example, let's
suppose that you speak German and live in Germany. At the shell
prompt, merely execute `setenv LANG de_DE' (in `csh'),
`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
This can be done from your `.login' or `.profile' file, once and for
all.
You might think that the country code specification is redundant.
But in fact, some languages have dialects in different countries. For
example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
country code serves to distinguish the dialects.
The locale naming convention of `LL_CC', with `LL' denoting the
language and `CC' denoting the country, is the one use on systems based
on GNU libc. On other systems, some variations of this scheme are
used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
locales supported by your system for your country by running the command
`locale -a | grep '^LL''.
Not all programs have translations for all languages. By default, an
English message is shown in place of a nonexistent translation. If you
understand other languages, you can set up a priority list of languages.
This is done through a different environment variable, called
`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
for the purpose of message handling, but you still need to have `LANG'
set to the primary language; this is required by other parts of the
system libraries. For example, some Swedish users who would rather
read translations in German than English for when Swedish is not
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
In the `LANGUAGE' environment variable, but not in the `LANG'
environment variable, `LL_CC' combinations can be abbreviated as `LL'
to denote the language's main dialect. For example, `de' is equivalent
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
(Portuguese as spoken in Portugal) in this context.
Translating Teams
=================
For the Free Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
Each translation team has its own mailing list. The up-to-date list of
teams can be found at the Free Translation Project's homepage,
`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
area.
If you'd like to volunteer to _work_ at translating messages, you
should become a member of the translating team for your own language.
The subscribing address is _not_ the same as the list itself, it has
`-request' appended. For example, speakers of Swedish can send a
message to `sv-request@li.org', having this message body:
subscribe
Keep in mind that team members are expected to participate
_actively_ in translations, or at solving translational difficulties,
rather than merely lurking around. If your team does not exist yet and
you want to start one, or if you are unsure about what to do or how to
get started, please write to `translation@iro.umontreal.ca' to reach the
coordinator for all translator teams.
The English team is special. It works at improving and uniformizing
the terminology in use. Proven linguistic skill are praised more than
programming skill, here.
Available Packages
==================
Languages are not equally supported in all packages. The following
matrix shows the current state of internationalization, as of May 2003.
The matrix shows, in regard of each package, for which languages PO
files have been submitted to translation coordination, with a
translation percentage of at least 50%.
Ready PO files am az be bg ca cs da de el en en_GB eo es
+-------------------------------------------+
a2ps | [] [] [] [] |
aegis | () |
anubis | |
ap-utils | |
bash | [] [] [] |
batchelor | |
bfd | [] [] |
binutils | [] [] |
bison | [] [] [] |
bluez-pin | [] [] |
clisp | |
clisp | [] [] [] |
coreutils | [] [] [] [] |
cpio | [] [] [] |
darkstat | () [] |
diffutils | [] [] [] [] [] [] [] |
e2fsprogs | [] [] |
enscript | [] [] [] [] |
error | [] [] [] [] [] |
fetchmail | [] () [] [] [] [] |
fileutils | [] [] [] |
findutils | [] [] [] [] [] [] |
flex | [] [] [] [] |
gas | [] |
gawk | [] [] [] [] |
gcal | [] |
gcc | [] [] |
gettext | [] [] [] [] [] |
gettext-runtime | [] [] [] [] [] |
gettext-tools | [] [] |
gimp-print | [] [] [] [] [] |
gliv | |
glunarclock | [] [] [] |
gnucash | () [] |
gnucash-glossary | [] () [] |
gnupg | [] () [] [] [] [] |
gpe-calendar | [] |
gpe-conf | [] |
gpe-contacts | [] |
gpe-edit | |
gpe-login | [] |
gpe-ownerinfo | [] |
gpe-sketchbook | [] |
gpe-timesheet | |
gpe-today | [] |
gpe-todo | [] |
gphoto2 | [] [] [] [] |
gprof | [] [] |
gpsdrive | () () () |
grep | [] [] [] [] [] |
gretl | [] |
hello | [] [] [] [] [] [] |
id-utils | [] [] |
indent | [] [] [] [] |
jpilot | [] [] [] [] |
jwhois | [] |
kbd | [] [] [] [] [] |
ld | [] [] |
libc | [] [] [] [] [] [] |
libgpewidget | [] |
libiconv | [] [] [] [] [] |
lifelines | [] () |
lilypond | [] |
lingoteach | |
lingoteach_lessons | () () |
lynx | [] [] [] [] |
m4 | [] [] [] [] |
mailutils | [] [] |
make | [] [] [] |
man-db | [] () [] [] () |
mysecretdiary | [] [] [] |
nano | [] () [] [] [] |
nano_1_0 | [] () [] [] [] |
opcodes | [] [] |
parted | [] [] [] [] [] |
ptx | [] [] [] [] [] |
python | |
radius | |
recode | [] [] [] [] [] [] |
screem | |
sed | [] [] [] [] [] |
sh-utils | [] [] [] |
sharutils | [] [] [] [] [] [] |
sketch | [] () [] |
soundtracker | [] [] [] |
sp | [] |
tar | [] [] [] [] |
texinfo | [] [] [] [] |
textutils | [] [] [] [] |
tin | () () |
util-linux | [] [] [] [] [] |
vorbis-tools | [] [] [] |
wastesedge | () |
wdiff | [] [] [] [] |
wget | [] [] [] [] [] [] [] |
xchat | [] [] [] |
xpad | |
+-------------------------------------------+
am az be bg ca cs da de el en en_GB eo es
0 1 4 2 31 17 54 60 14 1 4 12 56
et fa fi fr ga gl he hr hu id it ja ko
+----------------------------------------+
a2ps | [] [] [] () () |
aegis | |
anubis | [] |
ap-utils | [] |
bash | [] [] |
batchelor | [] |
bfd | [] [] |
binutils | [] [] |
bison | [] [] [] [] |
bluez-pin | [] [] [] [] |
clisp | |
clisp | [] |
coreutils | [] [] [] [] |
cpio | [] [] [] [] |
darkstat | () [] [] [] |
diffutils | [] [] [] [] [] [] [] |
e2fsprogs | |
enscript | [] [] |
error | [] [] [] [] |
fetchmail | [] |
fileutils | [] [] [] [] [] |
findutils | [] [] [] [] [] [] [] [] [] [] [] |
flex | [] [] |
gas | [] |
gawk | [] [] |
gcal | [] |
gcc | [] |
gettext | [] [] [] |
gettext-runtime | [] [] [] [] |
gettext-tools | [] |
gimp-print | [] [] |
gliv | () |
glunarclock | [] [] [] [] |
gnucash | [] |
gnucash-glossary | [] |
gnupg | [] [] [] [] [] [] [] |
gpe-calendar | [] |
gpe-conf | |
gpe-contacts | [] |
gpe-edit | [] [] |
gpe-login | [] |
gpe-ownerinfo | [] [] [] |
gpe-sketchbook | [] |
gpe-timesheet | [] [] [] |
gpe-today | [] [] |
gpe-todo | [] [] |
gphoto2 | [] [] [] |
gprof | [] [] |
gpsdrive | () [] () () |
grep | [] [] [] [] [] [] [] [] [] [] [] |
gretl | [] |
hello | [] [] [] [] [] [] [] [] [] [] [] [] [] |
id-utils | [] [] [] |
indent | [] [] [] [] [] [] [] [] |
jpilot | [] () |
jwhois | [] [] [] [] |
kbd | [] |
ld | [] |
libc | [] [] [] [] [] [] |
libgpewidget | [] [] [] |
libiconv | [] [] [] [] [] [] [] [] |
lifelines | () |
lilypond | [] |
lingoteach | [] [] |
lingoteach_lessons | |
lynx | [] [] [] [] |
m4 | [] [] [] [] |
mailutils | |
make | [] [] [] [] [] [] |
man-db | [] () () |
mysecretdiary | [] [] |
nano | [] [] [] [] |
nano_1_0 | [] [] [] [] |
opcodes | [] [] |
parted | [] [] [] |
ptx | [] [] [] [] [] [] [] |
python | |
radius | |
recode | [] [] [] [] [] [] |
screem | |
sed | [] [] [] [] [] [] [] [] |
sh-utils | [] [] [] [] [] [] |
sharutils | [] [] [] [] [] |
sketch | [] |
soundtracker | [] [] [] |
sp | [] () |
tar | [] [] [] [] [] [] [] [] [] |
texinfo | [] [] [] [] |
textutils | [] [] [] [] [] |
tin | [] () |
util-linux | [] [] [] [] () [] |
vorbis-tools | [] |
wastesedge | () |
wdiff | [] [] [] [] [] |
wget | [] [] [] [] [] [] [] [] |
xchat | [] [] [] |
xpad | |
+----------------------------------------+
et fa fi fr ga gl he hr hu id it ja ko
20 1 15 73 14 24 8 10 30 31 19 31 9
lg lt lv ms nb nl nn no pl pt pt_BR ro
+----------------------------------------+
a2ps | [] [] () () () [] [] |
aegis | () |
anubis | [] [] |
ap-utils | () |
bash | [] |
batchelor | |
bfd | |
binutils | |
bison | [] [] [] [] |
bluez-pin | [] |
clisp | |
clisp | [] |
coreutils | [] |
cpio | [] [] [] |
darkstat | [] [] [] [] |
diffutils | [] [] [] |
e2fsprogs | |
enscript | [] [] |
error | [] [] |
fetchmail | () () |
fileutils | [] |
findutils | [] [] [] [] |
flex | [] |
gas | |
gawk | [] |
gcal | |
gcc | |
gettext | [] |
gettext-runtime | [] |
gettext-tools | |
gimp-print | [] |
gliv | [] |
glunarclock | [] |
gnucash | |
gnucash-glossary | [] [] |
gnupg | |
gpe-calendar | [] [] |
gpe-conf | [] [] |
gpe-contacts | [] |
gpe-edit | [] [] |
gpe-login | [] [] |
gpe-ownerinfo | [] [] |
gpe-sketchbook | [] [] |
gpe-timesheet | [] [] |
gpe-today | [] [] |
gpe-todo | [] [] |
gphoto2 | |
gprof | [] |
gpsdrive | () () () |
grep | [] [] [] [] |
gretl | |
hello | [] [] [] [] [] [] [] [] [] |
id-utils | [] [] [] |
indent | [] [] [] |
jpilot | () () |
jwhois | [] [] [] |
kbd | |
ld | |
libc | [] [] [] [] |
libgpewidget | [] [] |
libiconv | [] [] |
lifelines | |
lilypond | [] |
lingoteach | |
lingoteach_lessons | |
lynx | [] [] |
m4 | [] [] [] [] |
mailutils | |
make | [] [] |
man-db | [] |
mysecretdiary | [] |
nano | [] [] [] [] |
nano_1_0 | [] [] [] [] |
opcodes | [] [] [] |
parted | [] [] [] |
ptx | [] [] [] [] [] [] [] |
python | |
radius | |
recode | [] [] [] |
screem | |
sed | [] [] |
sh-utils | [] |
sharutils | [] |
sketch | [] |
soundtracker | |
sp | |
tar | [] [] [] [] [] [] |
texinfo | [] |
textutils | [] |
tin | |
util-linux | [] [] |
vorbis-tools | [] [] |
wastesedge | |
wdiff | [] [] [] [] |
wget | [] [] [] |
xchat | [] [] |
xpad | [] |
+----------------------------------------+
lg lt lv ms nb nl nn no pl pt pt_BR ro
0 0 2 11 7 26 3 4 18 15 34 34
ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW
+-------------------------------------------+
a2ps | [] [] [] [] [] | 16
aegis | () | 0
anubis | [] [] | 5
ap-utils | () | 1
bash | [] | 7
batchelor | | 1
bfd | [] [] [] | 7
binutils | [] [] [] | 7
bison | [] [] | 13
bluez-pin | | 7
clisp | | 0
clisp | | 5
coreutils | [] [] [] [] [] | 14
cpio | [] [] [] | 13
darkstat | [] () () | 9
diffutils | [] [] [] [] | 21
e2fsprogs | [] | 3
enscript | [] [] [] | 11
error | [] [] [] | 14
fetchmail | [] | 7
fileutils | [] [] [] [] [] [] | 15
findutils | [] [] [] [] [] [] | 27
flex | [] [] [] | 10
gas | [] | 3
gawk | [] [] | 9
gcal | [] [] | 4
gcc | [] | 4
gettext | [] [] [] [] [] [] | 15
gettext-runtime | [] [] [] [] [] [] | 16
gettext-tools | [] [] | 5
gimp-print | [] [] | 10
gliv | | 1
glunarclock | [] [] [] | 11
gnucash | [] [] | 4
gnucash-glossary | [] [] [] | 8
gnupg | [] [] [] [] | 16
gpe-calendar | [] | 5
gpe-conf | | 3
gpe-contacts | [] | 4
gpe-edit | [] | 5
gpe-login | [] | 5
gpe-ownerinfo | [] | 7
gpe-sketchbook | [] | 5
gpe-timesheet | [] | 6
gpe-today | [] | 6
gpe-todo | [] | 6
gphoto2 | [] [] | 9
gprof | [] [] | 7
gpsdrive | [] [] | 3
grep | [] [] [] [] | 24
gretl | | 2
hello | [] [] [] [] [] | 33
id-utils | [] [] [] | 11
indent | [] [] [] [] | 19
jpilot | [] [] [] [] [] | 10
jwhois | () () [] [] | 10
kbd | [] [] | 8
ld | [] [] | 5
libc | [] [] [] [] | 20
libgpewidget | | 6
libiconv | [] [] [] [] [] [] | 21
lifelines | [] | 2
lilypond | [] | 4
lingoteach | | 2
lingoteach_lessons | () | 0
lynx | [] [] [] [] | 14
m4 | [] [] [] | 15
mailutils | | 2
make | [] [] [] [] | 15
man-db | [] | 6
mysecretdiary | [] [] | 8
nano | [] [] [] | 15
nano_1_0 | [] [] [] | 15
opcodes | [] [] | 9
parted | [] [] | 13
ptx | [] [] [] | 22
python | | 0
radius | | 0
recode | [] [] [] [] | 19
screem | [] | 1
sed | [] [] [] [] [] | 20
sh-utils | [] [] [] | 13
sharutils | [] [] [] [] | 16
sketch | [] | 5
soundtracker | [] | 7
sp | [] | 3
tar | [] [] [] [] [] | 24
texinfo | [] [] [] [] | 13
textutils | [] [] [] [] [] | 15
tin | | 1
util-linux | [] [] | 14
vorbis-tools | [] | 7
wastesedge | | 0
wdiff | [] [] [] [] | 17
wget | [] [] [] [] [] [] [] | 25
xchat | [] [] [] | 11
xpad | | 1
+-------------------------------------------+
50 teams ru sk sl sr sv ta tr uk vi wa zh_CN zh_TW
97 domains 32 19 16 0 56 0 48 10 1 1 12 23 913
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
used for implementing regional variants of languages, or language
dialects.
For a PO file in the matrix above to be effective, the package to
which it applies should also have been internationalized and
distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
distribution.
If May 2003 seems to be old, you may fetch a more recent copy of
this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
matrix with full percentage details can be found at
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
Using `gettext' in new packages
===============================
If you are writing a freely available program and want to
internationalize it you are welcome to use GNU `gettext' in your
package. Of course you have to respect the GNU Library General Public
License which covers the use of the GNU `gettext' library. This means
in particular that even non-free programs can use `libintl' as a shared
library, whereas only free software can use `libintl' as a static
library or use modified versions of `libintl'.
Once the sources are changed appropriately and the setup can handle
the use of `gettext' the only thing missing are the translations. The
Free Translation Project is also available for packages which are not
developed inside the GNU project. Therefore the information given above
applies also for every other Free Software Project. Contact
`translation@iro.umontreal.ca' to make the `.pot' files available to
the translation teams.

View file

@ -1,6 +1,8 @@
#
# Master author manifest for bash
#
# The files in lib/intl were taken from the GNU gettext distribution.
#
# Any files appearing in the bash distribution not listed in this file
# were created by Chet Ramey.
#
@ -100,6 +102,7 @@ builtins/alias.def Brian Fox, Chet Ramey
builtins/bind.def Brian Fox, Chet Ramey
builtins/break.def Brian Fox, Chet Ramey
builtins/builtin.def Brian Fox, Chet Ramey
builtins/caller.def Rocky Bernstein, Chet Ramey
builtins/cd.def Brian Fox, Chet Ramey
builtins/colon.def Brian Fox, Chet Ramey
builtins/command.def Brian Fox, Chet Ramey

711
CHANGES
View file

@ -1,3 +1,712 @@
This document details the changes between this version, bash-3.0-release,
and the previous version, bash-3.0-rc1.
1. Changes to Bash
a. Fixed a boundary overrun that could cause segmentation faults when the
completion code hands an incomplete construct to the word expansion
functions.
b. Changed posix mode behavior so that an error in a variable assignment
preceding a special builtin causes a non-interactive shell to exit.
c. Change the directory expansion portion of the completion code to not
expand embedded command substitutions if the directory name appears in
the file system.
d. Fixed a problem that caused `bash -r' to turn on restrictions before
reading the startup files.
e. Fixed a problem with the default operation of the `umask' builtin.
2. Changes to Readline
a. Fixed a problem with readline saving the contents of the current line
before beginning a non-interactive search.
b. Fixed a problem with EOF detection when using rl_event_hook.
c. Fixed a problem with the vi mode `p' and `P' commands ignoring numeric
arguments.
------------------------------------------------------------------------------
This document details the changes between this version, bash-3.0-rc1,
and the previous version, bash-3.0-beta1.
1. Changes to Bash
a. Fixed a bug that caused incorrect behavior when referecing element 0 of
an array using $array, element 0 was unset, and `set -u' was enabled.
b. System-specific changes for: SCO Unix 3.2, Tandem.
c. Fixed a bug that caused inappropriate word splitting when a variable was
expanded within a double-quoted string that also included $@.
d. Fixed a bug that caused `pwd' to not display anything in physical mode
when the file system had changed underneath the shell.
e. Fixed a bug in the pre- and post- increment and decrement parsing in the
expression evaluator that caused errors when the operands and corresponding
operators were separated by whitespace.
f. Fixed a bug that caused `history -p' to add an entry to the history list,
counter to the documentation. (Keeps the history expansions invoked by
emacs-mode command line editing from doing that as well.)
g. Fixed a bug that could cause a core dump if `cd' is asked to print out a
pathname longer than PATH_MAX characters.
h. Fixed a bug that caused jobs to be put into the wrong process group under
some circumstances after enabling job control with `set -m'.
i. `unalias' now returns failure if no alias name arguments are supplied.
j. Documented the characters not allowed to appear in an alias name.
k. $* is no longer expanded as if in double quotes when it appears in the
body of a here document, as the SUS seems to require.
l. The `bashbug' script now uses a directory in $TMPDIR for exclusive
access rather than trying to guess how the underlying OS provides for
secure temporary file creation.
m. Fixed a few problems with `cd' and `pwd' when asked to operate on pathnames
longer than PATH_MAX characters.
n. Fixed a memory leak caused when creating multiple local array variables
with identical names.
o. Fixed a problem with calls to getcwd() so that bash now operates better
when the full pathname to the current directory is longer than PATH_MAX
bytes.
p. The `trap' builtin now reports an error if a single non-signal argument
is specified.
q. Fixed a bug that caused `umask' to not work correctly when presented
with a mask of all 0s.
r. When `getopts' reaches the end of options, OPTARG is unset, as POSIX
appears to specify.
s. Interactive mode now depends on whether or not stdin and stderr are
connected to a tty; formerly it was stdin and stdout. POSIX requires
this.
t. Fixed vi-mode completion to work more as POSIX specifies (e.g., doing the
right kind of filename generation).
2. Changes to Readline
a. Fixed a problem that could cause readline to refer to freed memory when
moving between history lines while doing searches.
b. Improvements to the code that expands and displays prompt strings
containing multibyte characters.
c. Fixed a problem with vi-mode not correctly remembering the numeric argument
to the last `c'hange command for later use with `.'.
d. Fixed a bug in vi-mode that caused multi-digit count arguments to work
incorrectly.
e. Fixed a problem in vi-mode that caused the last text modification command
to not be remembered across different command lines.
f. Fixed problems with changing characters and changing case at the end of
the line.
3. New Features in Bash
a. The `jobs', `kill', and `wait' builtins now accept job control notation
even if job control is not enabled.
b. The historical behavior of `trap' that allows a missing `action' argument
to cause each specified signal's handling to be reset to its default is
now only supported when `trap' is given a single non-option argument.
4. New Features in Readline
a. When listing completions, directories have a `/' appended if the
`mark-directories' option has been enabled.
------------------------------------------------------------------------------
This document details the changes between this version, bash-3.0-beta1,
and the previous version, bash-3.0-alpha.
1. Changes to Bash
a. Fixes to build correctly when arrays are not compiled into the shell.
b. Fixed command substitution to run any exit trap defined in the command
substitution before returning; the exit trap is not inherited from the
calling shell.
c. Fixes to process group synchronization code so that every child process
attempts to set the terminal's process group; fixes some synchronization
problems on Linux kernels that schedule the child to always run before
the parent.
d. Fixed processing of octal and hex constants in printf builtin for POSIX.2
compliance.
e. Fixed a couple of core dumps in the pattern removal code.
f. Fixes to the array subrange extraction code to deal better with sparse
arrays.
g. Parser errors and other errors that result in the shell exiting now cause
the exit trap to be run.
h. Change the command substitution completion functions to not append any
closing quote, because it would be inserted a closing "`" or ")".
i. Fix history initialization so assignments to $histchars made in startup
files are honored.
j. If an exit trap does not contain a call to `exit', the shell now uses
the exit status of the last command executed before the trap as the exit
status of the shell.
k. The parser now prompts with $PS2 if it reads a newline while parsing a
compound array assignment statement.
l. When performing a compound array assignment, the parser doesn't treat
words of the form [index]=value as assignments if they're the result of
expansions.
m. Fixed a bug that caused `return' executed in a trap command to make the
shell think it was still running the trap.
n. Fixed the value of errno set by the pathname canonicalization functions.
o. Changed the grammar so that `time' alone on a line times a null command
rather than being a syntax error.
p. The pattern substitution coded no longer performs quote removal on the
pattern before trying to match it, as the pattern removal functions do.
q. Fixed a bug that could cause core dumps when checking whether a quoted
command name was being completed.
r. Fixes to the pattern removal and pattern replacement expansions to deal
with multibyte characters better (and faster).
s. Fix to the substring expansion (${param:off[:len]}) to deal with (possibly
multibyte) characters instead of raw bytes.
t. Fixed a bug that caused some key bindings set in an inputrc to be ignored
at shell startup.
u. Fixed a bug that caused unsetting a local variable within a function to
not work correctly.
v. Fixed a bug that caused invalid variables to be created when using
`read -a'.
w. Fixed a bug that caused "$@" to expand incorrectly when used as the right
hand side of a parameter expansion such as ${word:="$@"} if the first
character of $IFS was not a space.
x. Fixed a slight cosmetic problem when printing commands containing a
`>&word' redirection.
y. Fixed a problem that could cause here documents to not be created correctly
if the system temporary directory did not allow writing.
2. Changes to Readline
a. Change to history expansion functions to treat `^' as equivalent to word
one, as the documention states.
b. Some changes to the display code to improve display and redisplay of
multibyte characters.
c. Changes to speed up the multibyte character redisplay code.
d. Fixed a bug in the vi-mode `E' command that caused it to skip over the
last character of a word if invoked while point was on the word's
next-to-last character.
e. Fixed a bug that could cause incorrect filename quoting when
case-insensitive completion was enabled and the word being completed
contained backslashes quoting word break characters.
f. Fixed a bug in redisplay triggered when the prompt string contains
invisible characters.
g. Fixed some display (and other) bugs encountered in multibyte locales
when a non-ascii character was the last character on a line.
h. Fixed some display bugs caused by multibyte characters in prompt strings.
i. Fixed a problem with history expansion caused by non-whitespace characters
used as history word delimiters.
3. New Features in Bash
a. printf builtin understands two new escape sequences: \" and \?.
b. `echo -e' understands two new escape sequences: \" and \?.
c. The GNU `gettext' package and libintl have been integrated; the shell's
messages can be translated into different languages.
d. The `\W' prompt expansion now abbreviates $HOME as `~', like `\w'.
e. The error message printed when bash cannot open a shell script supplied
as argument 1 now includes the name of the shell, to better identify
the error as coming from bash.
4. New Features in Readline
a. New application variable, rl_completion_quote_character, set to any
quote character readline finds before it calls the application completion
function.
b. New application variable, rl_completion_suppress_quote, settable by an
application completion function. If set to non-zero, readline does not
attempt to append a closing quote to a completed word.
c. New application variable, rl_completion_found_quote, set to a non-zero
value if readline determines that the word to be completed is quoted.
Set before readline calls any application completion function.
d. New function hook, rl_completion_word_break_hook, called when readline
needs to break a line into words when completion is attempted. Allows
the word break characters to vary based on position in the line.
e. New bindable command: unix-filename-rubout. Does the same thing as
unix-word-rubout, but adds `/' to the set of word delimiters.
------------------------------------------------------------------------------
This document details the changes between this version, bash-3.0-alpha,
and the previous version, bash-2.05b-release.
1. Changes to Bash
a. Fixes so that the shell will compile without some of the default options
defined.
b. Fixed an error message that did not pass enough arguments to printf.
c. Fixed a bug that caused input redirection to a builtin inside a script
being read from standard input to result in the rest of the already-
read and buffered script to be discarded.
d. Fixed a bug that caused subshell initialization to close the file
descriptor from which the shell was reading a script under certain
circumstances.
e. Fixed a bug that caused the shell to not advance a string pointer over
a null wide character when doing string operations.
f. Fixed the internal logout code so that shells that time out waiting for
input (using $TMOUT) run ~/.bash_logout.
g. Portability and configuration changes for: cygwin, HP/UX, GNU/FreeBSD.
h. The parser no longer adds implicit double quotes to ((...)) arithmetic
commands.
i. The ((...)) arithmetic command evaluation code was fixed to not dump core
when the expanded string is null.
j. The ((...)) arithmetic command evaluation code was fixed to not perform
variable assignments while expanding the expression.
k. Fixed a bug that caused word splitting to be performed incorrectly when
IFS is set, but null.
l. Fixed a bug in brace expansion that caused a quoted `$' preceding an
open brace to inhibit brace expansion.
m. Fixed a bug that caused a leading `-' in the shell's name to cause it to
not be recognized as a restricted shell.
n. Fixed a bug in the arithmetic evaluation code that could cause longjmps
to an invalid location and result in a core dump.
o. Fixed a bug in the calculation of how many history lines are new in a
single shell session when reading new history lines from a file with
`history -n'.
p. Fixed a bug in pathname canonicalization that caused the shell to dump
core when presented with a pathname longer than PATH_MAX.
q. Fixed the parser so that it doesn't try to compare a char variable to
EOF, which fails when chars are unsigned.
r. Fixed a bug in the simple command execution code that caused occasional
core dumps.
s. The shell does a better job of saving any partial parsing state during
operations which cause a command to be executed while a line is being
entered and parsed.
t. The completion code now splits words more like the expansion code when
$IFS is used to split.
u. The locale code does a better job of recomputing the various locale
variable values when LC_ALL is unset.
v. The programmable completion code does a better job of dequoting expanded
word lists before comparing them against the word to be matched.
w. The shell no longer seg faults if the expanded value of $PS4 is null
and `set -x' is enabled.
x. Fixed a bug that caused core dumps when a here string expanded to NULL.
y. The mail checking code now makes sure the mailbox is bigger before
reporting the existence of new mail.
z. The parser does not try to expand $'...' and $"..." when the appear
within double quotes unless the `extquote' option has been enabled with
`shopt'. For backwards compatibility, it is enabled by default.
aa. Fixed a bug that caused `for x; do ...' and `select x; do ... to use
$@ instead of "$@" for the implicit list of arguments.
bb. Fixed a bug that caused a subshell of a restricted shell (e.g., one
spawned to execute a pipeline) to not exit immediately if attempting
to use a command containing a slash.
cc. Fixed a problem with empty replacements for a pattern that doesn't match
when performing ${param/word/} expansion.
dd. Word expansions performed while expanding redirections no longer search
a command's temporary environment to expand variable values.
ee. Improvements to the alias expansion code when expanding subsequent words
because an aliase's value ends with a space.
ff. `cd -' now prints the current working directory after a successful chdir
even when the shell is not interactive, as the standard requires.
gg. The shell does a better job of ensuring a child process dies of SIGINT
before resending SIGINT to itself.
hh. The arithmetic expansion variable assignment code now does the right
thing when assigning to `special' variables like OPTIND.
ii. When history expansion verification is enabled, the bash readline helper
functions that do history expansion on the current line don't print
the results.
jj. Fixed bugs with multiple consecutive alias expansion when one of the
expansions ends with a space.
kk. Fixed a problem in the programmable completion code that could cause core
dumps when trying to initialize a set of possible completions from a
list of variables.
ll. The \[ and \] escape characters are now ignored when decoding the prompt
string if the shell is started with editing disabled.
mm. Fixed a bug that could leave extra characters in a string when doing
quoted null character removal.
nn. Command substitution and other subshell operations no longer reset the
line number (aids the bash debugger).
oo. Better line number management when executing simple commands, conditional
commands, for commands, and select commands.
pp. The globbing code now uses malloc, with its better failure properties,
rather than alloca().
qq. Fixed a bug that caused expansions like #{a[2]:=value} to create the
appropriate array element instead of a variable named `a[2]'.
rr. Fixed a bug in the handling of a `?(...)' pattern immediately following
a `*' when extglob is enabled.
ss. Fixed a bug that caused a `return' invoked in an exit trap when exit is
invoked in a function to misbehave.
tt. Fixed a bug that caused CTLESC and CTLNUL characters to not be escaped
by the internal shell string quoting functions.
uu. Fixed a bug that caused quoted null characters in an expanded word list
to be inappropriately assigned to an array variable when using `read -a'.
vv. Fixed a bug that caused redirections accompanying a null command to persist
in the current shell.
ww. Fixed a bug that caused the prompt to be printed when the shell was
expanding a multiline alias.
xx. Fixed a bug that resulted in core dumps when the completion for a command
changed the compspec.
yy. Fixed a bug that caused evaluation of programmable completions to print
notifications of completed jobs.
zz. Bash now disables line editing when $EMACS == `t' and $TERM == `dumb'
(which is what emacs shell windows do).
aaa. In posix mode, `kill -l' causes signal names to be displayed without
a leading `SIG'.
bbb. Clear error flag on standard output so it doesn't persist across multiple
builtin commands.
ccc. In posix mode, `alias' displays alias values without the leading `alias',
so the output cannot be used as subsequent input.
ddd. In posix mode, the `trap' builtin doesn't check whether or not its
first argument is a signal specification and revert the signal handling
to its original disposition if it is.
eee. Fixed several bugs in the handling of "$*" and "${array[*]}" by the
pattern substitution and removal expansions.
fff. Fixed several problems with the handling of ${array[@]}, ${array[*]},
$@, and $* by the indirect variable expansion code.
ggg. Fixed a bug that did not allow `time' to be aliased.
hhh. Improved the mail checking code so it won't check (and possibly cause an
NFS file system mount) until MAILPATH or MAIL is given a value -- there
is no default if DEFAULT_MAIL_DIRECTORY is not defined at compile time.
(It is computed by configure, but can be #undef'd in config-bot.h.)
iii. If the `chkwinsize' option is enabled, the shell checks for window size
changes if a child process exits due to a signal.
jjj. Removed the attempts to avoid adding a slash at the end of a completed
executable name if there was a directory with the same name in the
current directory.
kkk. Fixed PATH lookup code so it treats the permission bits separately for
owner, group, and other, rather than checking them all.
lll. Fixed the locale code to reset the parser's idea of the character class
<blank>, which controls how it splits tokens, when the locale changes.
mmm. The shell now binds its special readline functions and key bindings only
if the user's inputrc file has not already bound them.
nnn. The shell now reports on processes that dump core due to signals when
invoked as `-c command'.
2. Changes to Readline
a. Fixes to avoid core dumps because of null pointer references in the
multibyte character code.
b. Fix to avoid infinite recursion caused by certain key combinations.
c. Fixed a bug that caused the vi-mode `last command' to be set incorrectly.
d. Readline no longer tries to read ahead more than one line of input, even
when more is available.
e. Fixed the code that adjusts the point to not mishandle null wide
characters.
f. Fixed a bug in the history expansion `g' modifier that caused it to skip
every other match.
g. Fixed a bug that caused the prompt to overwrite previous output when the
output doesn't contain a newline and the locale supports multibyte
characters. This same change fixes the problem of readline redisplay
slowing down dramatically as the line gets longer in multibyte locales.
h. History traversal with arrow keys in vi insertion mode causes the cursor
to be placed at the end of the new line, like in emacs mode.
i. The locale initialization code does a better job of using the right
precedence and defaulting when checking the appropriate environment
variables.
j. Fixed the history word tokenizer to handle <( and >( better when used as
part of bash.
k. The overwrite mode code received several bug fixes to improve undo.
l. Many speedups to the multibyte character redisplay code.
m. The callback character reading interface should not hang waiting to read
keyboard input.
n. Fixed a bug with redoing vi-mode `s' command.
o. The code that initializes the terminal tracks changes made to the terminal
special characters with stty(1) (or equivalent), so that these changes
are reflected in the readline bindings. New application-callable function
to make it work: rl_tty_unset_default_bindings().
p. Fixed a bug that could cause garbage to be inserted in the buffer when
changing character case in vi mode when using a multibyte locale.
q. Fixed a bug in the redisplay code that caused problems on systems
supporting multibyte characters when moving between history lines when the
new line has more glyphs but fewer bytes.
r. Undo and redo now work better after exiting vi insertion mode.
s. Make sure system calls are restarted after a SIGWINCH is received using
SA_RESTART.
t. Improvements to the code that displays possible completions when using
multibyte characters.
u. Fixed a problem when parsing nested if statements in inputrc files.
v. The completer now takes multibyte characters into account when looking for
quoted substrings on which to perform completion.
w. The history search functions now perform better bounds checking on the
history list.
3. New Features in Bash
a. ANSI string expansion now implements the \x{hexdigits} escape.
b. There is a new loadable `strftime' builtin.
c. New variable, COMP_WORDBREAKS, which controls the readline completer's
idea of word break characters.
d. The `type' builtin no longer reports on aliases unless alias expansion
will actually be performed.
e. HISTCONTROL is now a colon-separated list of values, which permits
more extensibility and backwards compatibility.
f. HISTCONTROL may now include the `erasedups' option, which causes all lines
matching a line being added to be removed from the history list.
g. `configure' has a new `--enable-multibyte' argument that permits multibyte
character support to be disabled even on systems that support it.
h. New variables to support the bash debugger: BASH_ARGC, BASH_ARGV,
BASH_SOURCE, BASH_LINENO, BASH_SUBSHELL, BASH_EXECUTION_STRING,
BASH_COMMAND
i. FUNCNAME has been changed to support the debugger: it's now an array
variable.
j. for, case, select, arithmetic commands now keep line number information
for the debugger.
k. There is a new `RETURN' trap executed when a function or sourced script
returns (not inherited child processes; inherited by command substitution
if function tracing is enabled and the debugger is active).
l. New invocation option: --debugger. Enables debugging and turns on new
`extdebug' shell option.
m. New `functrace' and `errtrace' options to `set -o' cause DEBUG and ERR
traps, respectively, to be inherited by shell functions. Equivalent to
`set -T' and `set -E' respectively. The `functrace' option also controls
whether or not the DEBUG trap is inherited by sourced scripts.
n. The DEBUG trap is run before binding the variable and running the action
list in a `for' command, binding the selection variable and running the
query in a `select' command, and before attempting a match in a `case'
command.
o. New `--enable-debugger' option to `configure' to compile in the debugger
support code.
p. `declare -F' now prints out extra line number and source file information
if the `extdebug' option is set.
q. If `extdebug' is enabled, a non-zero return value from a DEBUG trap causes
the next command to be skipped, and a return value of 2 while in a
function or sourced script forces a `return'.
r. New `caller' builtin to provide a call stack for the bash debugger.
s. The DEBUG trap is run just before the first command in a function body is
executed, for the debugger.
t. `for', `select', and `case' command heads are printed when `set -x' is
enabled.
u. There is a new {x..y} brace expansion, which is shorthand for {x.x+1,
x+2,...,y}. x and y can be integers or single characters; the sequence
may ascend or descend; the increment is always 1.
v. New ksh93-like ${!array[@]} expansion, expands to all the keys (indices)
of array.
w. New `force_fignore' shopt option; if enabled, suffixes specified by
FIGNORE cause words to be ignored when performing word completion even
if they're the only possibilities.
x. New `gnu_errfmt' shopt option; if enabled, error messages follow the `gnu
style' (filename:lineno:message) format.
y. New `-o bashdefault' option to complete and compgen; if set, causes the
whole set of bash completions to be performed if the compspec doesn't
result in a match.
z. New `-o plusdirs' option to complete and compgen; if set, causes directory
name completion to be performed and the results added to the rest of the
possible completions.
aa. `kill' is available as a builtin even when the shell is built without
job control.
bb. New HISTTIMEFORMAT variable; value is a format string to pass to
strftime(3). If set and not null, the `history' builtin prints out
timestamp information according to the specified format when displaying
history entries. If set, bash tells the history library to write out
timestamp information when the history file is written.
cc. The [[ ... ]] command has a new binary `=~' operator that performs
extended regular expression (egrep-like) matching.
dd. `configure' has a new `--enable-cond-regexp' option (enabled by default)
to enable the =~ operator and regexp matching in [[ ... ]].
ee. Subexpressions matched by the =~ operator are placed in the new
BASH_REMATCH array variable.
ff. New `failglob' option that causes an expansion error when pathname
expansion fails to produce a match.
gg. New `set -o pipefail' option that causes a pipeline to return a failure
status if any of the processes in the pipeline fail, not just the last
one.
4. New Features in Readline
a. History expansion has a new `a' modifier equivalent to the `g' modifier
for compatibility with the BSD csh.
b. History expansion has a new `G' modifier equivalent to the BSD csh `g'
modifier, which performs a substitution once per word.
c. All non-incremental search operations may now undo the operation of
replacing the current line with the history line.
d. The text inserted by an `a' command in vi mode can be reinserted with
`.'.
e. New bindable variable, `show-all-if-unmodified'. If set, the readline
completer will list possible completions immediately if there is more
than one completion and partial completion cannot be performed.
f. There is a new application-callable `free_history_entry()' function.
g. History list entries now contain timestamp information; the history file
functions know how to read and write timestamp information associated
with each entry.
h. Four new key binding functions have been added:
rl_bind_key_if_unbound()
rl_bind_key_if_unbound_in_map()
rl_bind_keyseq_if_unbound()
rl_bind_keyseq_if_unbound_in_map()
------------------------------------------------------------------------------
This document details the changes between this version, bash-2.05b-release,
and the previous version, bash-2.05b-beta2.
@ -157,7 +866,7 @@ e. The `fc' builtin has been fixed, as POSIX requires, to use the closest
f. The history file loading code was changed to allow lines to be saved in
the history list from the shell startup files.
g. `history -s args' now works bettern in compound commands.
g. `history -s args' now works better in compound commands.
h. The tilde expansion code was fixed to better recognize when it's being
invoked in an assignment context, which enables expansion after `='

16
COMPAT
View file

@ -1,11 +1,12 @@
This document details the incompatibilites between this version of bash,
bash-2.05b, 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.
Some of these incompatibilities occur between the current version and
versions 2.0 and above.
bash-3.0, and a previous widely-available version, bash-1.14 (which
is still the `standard' version for a few Linux distributions). These
were discovered by users of bash-2.x and 3.x, so this list is not
comprehensive. Some of these incompatibilities occur between the current
version and versions 2.0 and above. (The differences between bash-1.14
and bash-2.0 were significant.)
1. Bash now uses a new quoting syntax, $"...", to do locale-specific
1. Bash uses a new quoting syntax, $"...", to do locale-specific
string translation. Users who have relied on the (undocumented)
behavior of bash-1.14 will have to change their scripts. For
instance, if you are doing something like this to get the value of
@ -208,3 +209,6 @@ versions 2.0 and above.
17. Bash no longer removes the export attribute from the SSH_CLIENT or
SSH2_CLIENT variables, and no longer attempts to discover whether or
not it has been invoked by sshd in order to run the startup files.
18. Bash no longer requires that the body of a function be a group command;
any compound command is accepted.

File diff suppressed because it is too large Load diff

11
INSTALL
View file

@ -283,7 +283,12 @@ does not provide the necessary support.
builtins and functions to be timed.
`--enable-cond-command'
Include support for the `[[' conditional command (*note
Include support for the `[[' conditional command. (*note
Conditional Constructs::).
`--enable-cond-regexp'
Include support for matching POSIX regular expressions using the
`=~' binary operator in the `[[' conditional command. (*note
Conditional Constructs::).
`--enable-directory-stack'
@ -316,6 +321,10 @@ does not provide the necessary support.
This enables the job control features (*note Job Control::), if
the operating system supports them.
`--enable-multibyte'
This enables support for multibyte characters if the operating
system provides the necessary support.
`--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

123
MANIFEST
View file

@ -26,6 +26,7 @@ include d
lib d
lib/glob d
lib/glob/doc d
lib/intl d
lib/malloc d
lib/readline d
lib/readline/doc d
@ -35,9 +36,11 @@ lib/termcap d
lib/termcap/grot d
lib/tilde d
lib/tilde/doc d
po d
support d
tests d
tests/misc d
ABOUT-NLS f
CHANGES f
COMPAT f
COPYING f
@ -140,16 +143,17 @@ execute_cmd.h f
redir.h f
bashtypes.h f
mailcheck.h f
pathnames.h f
xmalloc.h f
y.tab.c f
y.tab.h f
parser-built f
pathnames.h.in f
builtins/Makefile.in f
builtins/alias.def f
builtins/bind.def f
builtins/break.def f
builtins/builtin.def f
builtins/caller.def f
builtins/cd.def f
builtins/colon.def f
builtins/command.def f
@ -207,6 +211,7 @@ cross-build/opennt.cache f
include/ansi_stdlib.h f
include/chartypes.h f
include/filecntl.h f
include/gettext.h f
include/maxpath.h f
include/memalloc.h f
include/ocache.h f
@ -234,6 +239,47 @@ lib/glob/collsyms.h f
lib/glob/doc/Makefile f
lib/glob/doc/glob.texi f
lib/glob/ndir.h f
lib/intl/ChangeLog f
lib/intl/Makefile.in f
lib/intl/VERSION f
lib/intl/bindtextdom.c f
lib/intl/config.charset f
lib/intl/dcgettext.c f
lib/intl/dcigettext.c f
lib/intl/dcngettext.c f
lib/intl/dgettext.c f
lib/intl/dngettext.c f
lib/intl/eval-plural.h f
lib/intl/explodename.c f
lib/intl/finddomain.c f
lib/intl/gettext.c f
lib/intl/gettextP.h f
lib/intl/gmo.h f
lib/intl/hash-string.h f
lib/intl/intl-compat.c f
lib/intl/l10nflist.c f
lib/intl/libgnuintl.h.in f
lib/intl/loadinfo.h f
lib/intl/loadmsgcat.c f
lib/intl/localcharset.c f
lib/intl/localcharset.h f
lib/intl/locale.alias f
lib/intl/localealias.c f
lib/intl/localename.c f
lib/intl/log.c f
lib/intl/ngettext.c f
lib/intl/os2compat.c f
lib/intl/os2compat.h f
lib/intl/osdep.c f
lib/intl/plural-exp.c f
lib/intl/plural-exp.h f
lib/intl/plural.c f
lib/intl/plural.y f
lib/intl/ref-add.sin f
lib/intl/ref-del.sin f
lib/intl/relocatable.c f
lib/intl/relocatable.h f
lib/intl/textdomain.c f
lib/malloc/Makefile.in f
lib/malloc/getpagesize.h f
lib/malloc/imalloc.h f
@ -313,14 +359,15 @@ 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/doc/version.texi f
lib/readline/doc/rlman.texi f
lib/readline/doc/rltech.texi f
lib/readline/doc/rluser.texi f
lib/readline/doc/rluserman.texi f
lib/readline/doc/history.texi f
lib/readline/doc/hstech.texi f
lib/readline/doc/hsuser.texi f
lib/readline/doc/fdl.texi f
lib/readline/examples/Makefile f
lib/readline/examples/excallback.c f
lib/readline/examples/fileman.c f
@ -351,6 +398,7 @@ lib/sh/pathcanon.c f
lib/sh/pathphys.c f
lib/sh/rename.c f
lib/sh/setlinebuf.c f
lib/sh/shmatch.c f
lib/sh/shquote.c f
lib/sh/shtty.c f
lib/sh/snprintf.c f
@ -362,6 +410,7 @@ lib/sh/strindex.c f
lib/sh/stringlist.c f
lib/sh/stringvec.c f
lib/sh/strpbrk.c f
lib/sh/strstr.c f
lib/sh/strtod.c f
lib/sh/strtoimax.c f
lib/sh/strtol.c f
@ -406,6 +455,24 @@ lib/tilde/doc/Makefile f
lib/tilde/tilde.c f
lib/tilde/tilde.h f
lib/tilde/shell.c f
po/LINGUAS f
po/Makefile.in.in f
po/Makevars f
po/POTFILES.in f
po/Rules-builtins f
po/Rules-quot f
po/bash.pot f
po/boldquot.sed f
po/builtins.pot f
po/en@quot.header f
po/en@boldquot.header f
po/en@quot.po f
po/en@boldquot.po f
po/en@quot.gmo f
po/en@boldquot.gmo f
po/insert-header.sin f
po/quot.sed f
po/remove-potcdate.sin f
CWRU/misc/open-files.c f
CWRU/misc/sigs.c f
CWRU/misc/sigstat.c f
@ -427,12 +494,17 @@ doc/README f
doc/INTRO f
doc/texinfo.tex f
doc/bashref.texi f
doc/version.texi f
doc/bashref.info f
doc/article.ms f
doc/htmlpost.sh f 755
doc/infopost.sh f 755
doc/fdl.texi f
doc/fdl.txt f
support/Makefile.in f
support/bashversion.c f
support/config.guess f
support/config.rpath f 755
support/config.sub f
support/printenv.sh f 755
support/printenv.c f
@ -441,6 +513,7 @@ support/missing f 755
support/mkclone f 755
support/mkconffiles f 755
support/mkdirs f 755
support/mkinstalldirs f 755
support/mkversion.sh f 755
support/mksignames.c f
support/bashbug.sh f
@ -450,7 +523,7 @@ support/zecho.c f
support/SYMLINKS f
support/fixlinks f 755
support/install.sh f 755
support/texi2dvi f
support/texi2dvi f 755
support/texi2html f 755
support/xenix-link.sh f 755
support/shobj-conf f 755
@ -468,6 +541,7 @@ examples/complete/complete.ianmac f
examples/complete/complete2.ianmac f
examples/complete/complete.freebsd f
examples/complete/complete.gnu-longopt f
examples/complete/bashcc-1.0.1.tar.gz f
examples/loadables/README f
examples/loadables/template.c f
examples/loadables/Makefile.in f
@ -476,6 +550,7 @@ examples/loadables/hello.c f
examples/loadables/print.c f
examples/loadables/realpath.c f
examples/loadables/sleep.c f
examples/loadables/strftime.c f
examples/loadables/truefalse.c f
examples/loadables/getconf.h f
examples/loadables/getconf.c f
@ -601,15 +676,19 @@ examples/misc/aliasconv.sh f
examples/misc/aliasconv.bash f
examples/misc/cshtobash f
tests/README f
tests/alias.tests f
tests/alias.right f
tests/arith-for.tests f
tests/arith-for.right f
tests/arith.tests f
tests/arith.right f
tests/arith1.sub f
tests/arith2.sub f
tests/array.tests f
tests/array.right f
tests/array-at-star f
tests/array2.right f
tests/braces-tests f
tests/braces.tests f
tests/braces.right f
tests/builtins.tests f
tests/builtins.right f
@ -624,7 +703,15 @@ tests/cond.tests f
tests/cond.right f
tests/cprint.tests f
tests/cprint.right f
tests/dbg-support.right f
tests/dbg-support.sub f
tests/dbg-support.tests f
tests/dbg-support2.right f
tests/dbg-support2.tests f
tests/dollar-at-star f
tests/dollar-at1.sub f
tests/dollar-at2.sub f
tests/dollar-star1.sub f
tests/dollar.right f
tests/dstack.tests f
tests/dstack.right f
@ -640,6 +727,7 @@ tests/exec3.sub f
tests/exec4.sub f
tests/exec5.sub f
tests/exec6.sub f
tests/exec7.sub f
tests/exp-tests f
tests/exp.right f
tests/extglob.tests f
@ -683,6 +771,7 @@ tests/jobs.tests f
tests/jobs1.sub f
tests/jobs2.sub f
tests/jobs3.sub f
tests/jobs4.sub f
tests/jobs.right f
tests/more-exp.tests f
tests/more-exp.right f
@ -690,6 +779,7 @@ tests/new-exp.tests f
tests/new-exp1.sub f
tests/new-exp2.sub f
tests/new-exp3.sub f
tests/new-exp4.sub f
tests/new-exp.right f
tests/nquote.tests f
tests/nquote.right f
@ -699,6 +789,8 @@ tests/nquote2.tests f
tests/nquote2.right f
tests/nquote3.tests f
tests/nquote3.right f
tests/nquote4.tests f
tests/nquote4.right f
tests/posix2.tests f
tests/posix2.right f
tests/posixpat.tests f
@ -715,6 +807,7 @@ tests/read1.sub f
tests/read2.sub f
tests/read3.sub f
tests/read4.sub f
tests/read5.sub f
tests/redir.tests f
tests/redir.right f
tests/redir1.sub f
@ -725,12 +818,14 @@ tests/redir3.in2 f
tests/redir4.sub f
tests/redir4.in1 f
tests/redir5.sub f
tests/redir6.sub f
tests/rhs-exp.tests f
tests/rhs-exp.right f
tests/rsh.tests f
tests/rsh.right f
tests/run-all f
tests/run-minimal f
tests/run-alias f
tests/run-arith-for f
tests/run-arith f
tests/run-array f
@ -739,6 +834,8 @@ tests/run-braces f
tests/run-builtins f
tests/run-cond f
tests/run-cprint f
tests/run-dbg-support f
tests/run-dbg-support2 f
tests/run-dirstack f
tests/run-dollars f
tests/run-errors f
@ -763,6 +860,7 @@ tests/run-nquote f
tests/run-nquote1 f
tests/run-nquote2 f
tests/run-nquote3 f
tests/run-nquote4 f
tests/run-posix2 f
tests/run-posixpat f
tests/run-precedence f
@ -773,6 +871,7 @@ tests/run-redir f
tests/run-rhs-exp f
tests/run-rsh f
tests/run-set-e f
tests/run-set-x f
tests/run-shopt f
tests/run-strip f
tests/run-test f
@ -782,6 +881,8 @@ tests/run-type f
tests/run-varenv f
tests/set-e-test f
tests/set-e.right f
tests/set-x.tests f
tests/set-x.right f
tests/shopt.tests f
tests/shopt.right f
tests/strip.tests f

View file

@ -1,6 +1,6 @@
# Makefile for bash-2.05b, version 2.142
# Makefile for bash-3.0, version 2.152
#
# Copyright (C) 1996-2002 Free Software Foundation, Inc.
# Copyright (C) 1996-2004 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
@ -19,6 +19,14 @@
# Make sure the first target in the makefile is the right one
all: .made
PACKAGE = @PACKAGE_NAME@
VERSION = @PACKAGE_VERSION@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_VERSION = @PACKAGE_VERSION@
# Include some boilerplate Gnu makefile definitions.
prefix = @prefix@
@ -28,6 +36,7 @@ libdir = @libdir@
infodir = @infodir@
includedir = @includedir@
datadir = @datadir@
localedir = $(datadir)/locale
mandir = @mandir@
manpfx = man
@ -44,6 +53,7 @@ DESTDIR =
topdir = @top_srcdir@
BUILD_DIR = @BUILD_DIR@
top_builddir = @BUILD_DIR@
srcdir = @srcdir@
VPATH = .:@srcdir@
@ -113,12 +123,14 @@ LOCAL_CFLAGS = @LOCAL_CFLAGS@ ${DEBUG}
DEFS = @DEFS@
LOCAL_DEFS = @LOCAL_DEFS@
LOCALE_DEFS = -DLOCALEDIR='"$(localedir)"' -DPACKAGE='"$(PACKAGE)"'
LOCAL_LIBS = @LOCAL_LIBS@
LIBS = $(BUILTINS_LIB) $(LIBRARIES) @LIBS@
STATIC_LD = @STATIC_LD@
LOCAL_LDFLAGS = @LOCAL_LDFLAGS@
SYSTEM_FLAGS = -DPROGRAM='"$(Program)"' -DCONF_HOSTTYPE='"$(Machine)"' -DCONF_OSTYPE='"$(OS)"' -DCONF_MACHTYPE='"$(MACHTYPE)"' -DCONF_VENDOR='"$(VENDOR)"'
SYSTEM_FLAGS = -DPROGRAM='"$(Program)"' -DCONF_HOSTTYPE='"$(Machine)"' -DCONF_OSTYPE='"$(OS)"' -DCONF_MACHTYPE='"$(MACHTYPE)"' -DCONF_VENDOR='"$(VENDOR)"' $(LOCALE_DEFS)
BASE_CCFLAGS = $(PROFILE_FLAGS) $(SYSTEM_FLAGS) $(LOCAL_DEFS) \
$(DEFS) $(LOCAL_CFLAGS) $(INCLUDES)
@ -130,7 +142,7 @@ CCFLAGS_FOR_BUILD = $(BASE_CCFLAGS) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
LDFLAGS = @LDFLAGS@ $(STATIC_LD) $(LOCAL_LDFLAGS) $(PROFILE_FLAGS) $(CFLAGS)
LDFLAGS_FOR_BUILD = $(LDFLAGS)
INCLUDES = -I. @RL_INCLUDE@ -I$(srcdir) -I$(BASHINCDIR) -I$(LIBSRC)
INCLUDES = -I. @RL_INCLUDE@ -I$(srcdir) -I$(BASHINCDIR) -I$(LIBSRC) $(INTL_INC)
GCC_LINT_FLAGS = -Wall -Wshadow -Wpointer-arith -Wcast-qual \
-Wcast-align -Wstrict-prototypes -Wconversion \
@ -147,8 +159,13 @@ dot = .
LIBSUBDIR = lib
LIBSRC = $(srcdir)/$(LIBSUBDIR)
LIBBUILD = ${BUILD_DIR}/${LIBSUBDIR}
SUBDIR_INCLUDES = -I. @RL_INCLUDE@ -I$(topdir) -I$(topdir)/$(LIBSUBDIR)
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
# the bash library
# the library is a mix of functions that the C library does not provide on
# some platforms and general shell utility functions
@ -179,7 +196,7 @@ SHLIB_SOURCE = ${SH_LIBSRC}/clktck.c ${SH_LIBSRC}/getcwd.c \
${SH_LIBSRC}/fmtumax.c ${SH_LIBSRC}/netconn.c \
${SH_LIBSRC}/mktime.c ${SH_LIBSRC}/strftime.c \
${SH_LIBSRC}/memset.c ${SH_LIBSRC}/xstrchr.c \
${SH_LIBSRC}/zcatfd.c
${SH_LIBSRC}/zcatfd.c ${SH_LIBSRC}/shmatch.c
SHLIB_LIB = -lsh
SHLIB_LIBNAME = libsh.a
@ -221,7 +238,7 @@ READLINE_SOURCE = $(RL_LIBSRC)/rldefs.h $(RL_LIBSRC)/rlconf.h \
$(RL_LIBSRC)/terminal.c $(RL_LIBSRC)/nls.c \
$(RL_LIBSRC)/input.c $(RL_LIBSRC)/xmalloc.c \
$(RL_LIBSRC)/shell.c $(RL_LIBSRC)/savestring.c \
$(RL_LIBSRC)/misc.c $(RL_LIBSRC)/compat.c \
$(RL_LIBSRC)/misc.c $(RL_LIBSRC)/mbutil.c $(RL_LIBSRC)/compat.c \
$(RL_LIBSRC)/histexpand.c $(RL_LIBSRC)/history.c \
$(RL_LIBSRC)/histsearch.c $(RL_LIBSRC)/histfile.c
@ -236,7 +253,7 @@ READLINE_OBJ = $(RL_LIBDIR)/readline.o $(RL_LIBDIR)/funmap.o \
$(RL_LIBDIR)/macro.o $(RL_LIBDIR)/input.o \
$(RL_LIBDIR)/terminal.o $(RL_LIBDIR)/callback.o \
$(RL_LIBDIR)/shell.o $(RL_LIBDIR)/savestring.o \
$(RL_LIBDIR)/compat.o \
$(RL_LIBDIR)/mbutil.o $(RL_LIBDIR)/compat.o \
$(RL_LIBDIR)/history.o $(RL_LIBDIR)/histexpand.o \
$(RL_LIBDIR)/histsearch.o $(RL_LIBDIR)/histfile.o
@ -300,6 +317,25 @@ TILDE_DEP = $(TILDE_LIBRARY)
TILDE_SOURCE = $(TILDE_LIBSRC)/tilde.c $(TILDE_LIBSRC)/tilde.h
TILDE_OBJ = $(TILDE_LIBDIR)/tilde.o
# libintl
INTL_LIBSRC = $(LIBSRC)/intl
INTL_LIBDIR = $(dot)/$(LIBSUBDIR)/intl
INTL_ABSSRC = ${topdir}/$(INTL_LIB)
INTL_BUILDDIR = ${LIBBUILD}/intl
INTL_LIB = @LIBINTL@
INTL_LIBRARY = $(INTL_LIBDIR)/libintl.a
INTL_DEP = @INTL_DEP@
INTL_INC = @INTL_INC@
LIBINTL_H = @LIBINTL_H@
# tests
LIBINTL = @LIBINTL@
LTLIBINTL = @LTLIBINTL@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
# Our malloc.
MALLOC_TARGET = @MALLOC_TARGET@
@ -341,9 +377,9 @@ BASHINCFILES = $(BASHINCDIR)/posixstat.h $(BASHINCDIR)/ansi_stdlib.h \
$(BASHINCDIR)/ocache.h
LIBRARIES = $(SHLIB_LIB) $(READLINE_LIB) $(HISTORY_LIB) $(TERMCAP_LIB) $(GLOB_LIB) \
$(TILDE_LIB) $(MALLOC_LIB) $(LOCAL_LIBS)
$(TILDE_LIB) $(MALLOC_LIB) $(INTL_LIB) $(LOCAL_LIBS)
LIBDEP = $(SHLIB_DEP) $(READLINE_DEP) $(HISTORY_DEP) $(TERMCAP_DEP) $(GLOB_DEP) \
LIBDEP = $(SHLIB_DEP) $(INTL_DEP) $(READLINE_DEP) $(HISTORY_DEP) $(TERMCAP_DEP) $(GLOB_DEP) \
$(TILDE_DEP) $(MALLOC_DEP)
LIBRARY_LDFLAGS = $(READLINE_LDFLAGS) $(HISTORY_LDFLAGS) $(GLOB_LDFLAGS) \
@ -395,11 +431,12 @@ BUILTIN_SRCDIR=$(srcdir)/builtins
DEFSRC=$(BUILTIN_SRCDIR)
BUILTIN_ABSSRC=${topdir}/builtins
DEFDIR = $(dot)/builtins
DEBUGGER_DIR = $(dot)/debugger
BUILTIN_DEFS = $(DEFSRC)/alias.def $(DEFSRC)/bind.def $(DEFSRC)/break.def \
$(DEFSRC)/builtin.def $(DEFSRC)/cd.def $(DEFSRC)/colon.def \
$(DEFSRC)/command.def ${DEFSRC}/complete.def \
$(DEFSRC)/declare.def \
$(DEFSRC)/caller.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 \
@ -418,7 +455,7 @@ BUILTIN_C_OBJ = $(DEFDIR)/common.o $(DEFDIR)/evalstring.o \
$(DEFDIR)/evalfile.o $(DEFDIR)/bashgetopt.o
BUILTIN_OBJS = $(DEFDIR)/alias.o $(DEFDIR)/bind.o $(DEFDIR)/break.o \
$(DEFDIR)/builtin.o $(DEFDIR)/cd.o $(DEFDIR)/colon.o \
$(DEFDIR)/command.o $(DEFDIR)/declare.o \
$(DEFDIR)/command.o $(DEFDIR)/caller.o $(DEFDIR)/declare.o \
$(DEFDIR)/echo.o $(DEFDIR)/enable.o $(DEFDIR)/eval.o \
$(DEFDIR)/exec.o $(DEFDIR)/exit.o $(DEFDIR)/fc.o \
$(DEFDIR)/fg_bg.o $(DEFDIR)/hash.o $(DEFDIR)/help.o \
@ -442,6 +479,10 @@ BUILTINS_DEP = $(BUILTINS_LIBRARY)
DOCSRC = $(srcdir)/doc
DOCDIR = $(dot)/doc
# Translations and other i18n support files
PO_SRC = $(srcdir)/po/
PO_DIR = $(dot)/po/
SIGNAMES_SUPPORT = $(SUPPORT_SRC)mksignames.c
SUPPORT_SRC = $(srcdir)/support/
@ -454,12 +495,13 @@ CREATED_SUPPORT = signames.h recho$(EXEEXT) zecho$(EXEEXT) printenv$(EXEEXT) \
mksyntax${EXEEXT} syntax.c $(VERSPROG) $(VERSOBJ) \
buildversion.o
CREATED_CONFIGURE = config.h config.cache config.status config.log \
stamp-h
stamp-h po/POTFILES
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 \
examples/loadables/perl/Makefile support/Makefile
examples/loadables/perl/Makefile support/Makefile \
lib/intl/Makefile po/Makefile po/Makefile.in
# Keep GNU Make from exporting the entire environment for small machines.
.NOEXPORT:
@ -506,7 +548,7 @@ bashversion$(EXEEXT): patchlevel.h conftypes.h version.h buildversion.o $(SUPPOR
$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)bashversion.c buildversion.o
buildversion.o: version.h conftypes.h patchlevel.h $(srcdir)/version.c
$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -c -o $@ $(srcdir)/version.c
$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -DBUILDTOOL -c -o $@ $(srcdir)/version.c
# old rules
GRAM_H = parser-built
@ -558,6 +600,13 @@ $(SHLIB_LIBRARY): config.h ${SHLIB_SOURCE}
@(cd ${SH_LIBDIR} && \
$(MAKE) $(MFLAGS) DEBUG=${DEBUG} ${SHLIB_LIBNAME}) || exit 1
${INTL_LIBRARY}: config.h ${INTL_LIBDIR}/Makefile
@echo making $@ in ${INTL_LIBDIR}
@(cd ${INTL_LIBDIR} && \
$(MAKE) $(MFLAGS) all) || exit 1
${LIBINTL_H}: ${INTL_LIBRARY}
mksignames$(EXEEXT): $(SUPPORT_SRC)mksignames.c
$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)mksignames.c
@ -578,7 +627,7 @@ syntax.c: mksyntax${EXEEXT} $(srcdir)/syntax.h
$(RM) $@
./mksyntax -o $@
$(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h ${BASHINCDIR}/memalloc.h
$(BUILTINS_LIBRARY): $(BUILTIN_DEFS) $(BUILTIN_C_SRC) config.h ${BASHINCDIR}/memalloc.h version.h
@(cd $(DEFDIR) && $(MAKE) $(MFLAGS) DEBUG=${DEBUG} libbuiltins.a ) || exit 1
# these require special rules to circumvent make builtin rules
@ -597,6 +646,9 @@ ${DEFDIR}/builtext.h: $(BUILTIN_DEFS)
Makefile makefile: config.status $(srcdir)/Makefile.in
CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
pathnames.h: config.status $(srcdir)/Makefile.in
CONFIG_HEADERS= $(SHELL) ./config.status
Makefiles makefiles: config.status $(srcdir)/Makefile.in
@for mf in $(CREATED_MAKEFILES); do \
CONFIG_FILES=$$mf CONFIG_HEADERS= $(SHELL) ./config.status ; \
@ -641,9 +693,10 @@ TAGS: $(SOURCES) $(BUILTIN_C_SRC) $(LIBRARY_SOURCE)
# Targets that actually do things not part of the build
installdirs:
@${SHELL} $(SUPPORT_SRC)mkdirs $(DESTDIR)$(bindir)
@${SHELL} $(SUPPORT_SRC)mkdirs $(DESTDIR)$(man1dir)
@${SHELL} $(SUPPORT_SRC)mkdirs $(DESTDIR)$(infodir)
@${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(bindir)
@${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(man1dir)
@${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(infodir)
-( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ )
install: .made installdirs
$(INSTALL_PROGRAM) $(INSTALLMODE) $(Program) $(DESTDIR)$(bindir)/$(Program)
@ -653,6 +706,7 @@ install: .made installdirs
man3dir=$(man3dir) man3ext=$(man3ext) \
infodir=$(infodir) htmldir=$(htmldir) DESTDIR=$(DESTDIR) $@ )
-( cd $(DEFDIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ )
-( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ )
install-strip:
$(MAKE) $(MFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
@ -665,49 +719,44 @@ uninstall: .made
man1dir=$(man1dir) man1ext=$(man1ext) \
man3dir=$(man3dir) man3ext=$(man3ext) \
infodir=$(infodir) htmldir=$(htmldir) DESTDIR=$(DESTDIR) $@ )
-( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ )
.PHONY: basic-clean clean realclean maintainer-clean distclean mostlyclean maybe-clean
LIB_SUBDIRS = ${RL_LIBDIR} ${HIST_LIBDIR} ${TERM_LIBDIR} ${GLOB_LIBDIR} \
${INTL_LIBDIR} ${TILDE_LIBDIR} ${ALLOC_LIBDIR} ${SH_LIBDIR}
basic-clean:
$(RM) $(OBJECTS) $(Program) bashbug
$(RM) .build .made version.h
$(RM) .build .made version.h pathnames.h
clean: basic-clean
( cd $(DOCDIR) && $(MAKE) $(MFLAGS) $@ )
( cd builtins && $(MAKE) $(MFLAGS) $@ )
-( cd $(SDIR) && $(MAKE) $(MFLAGS) $@ )
-(cd $(RL_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(HIST_LIBDIR) && test -f Makefile && $(MAKE) $(MFLAGS) $@)
-(cd $(TERM_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(GLOB_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(TILDE_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(ALLOC_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(SH_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-for libdir in ${LIB_SUBDIRS}; do \
(cd $$libdir && test -f Makefile && $(MAKE) $(MFLAGS) $@) ;\
done
-( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ )
$(RM) $(CREATED_SUPPORT)
mostlyclean: basic-clean
( cd $(DOCDIR) && $(MAKE) $(MFLAGS) $@ )
( cd builtins && $(MAKE) $(MFLAGS) $@ )
-( cd $(SDIR) && $(MAKE) $(MFLAGS) $@ )
-(cd $(RL_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(HIST_LIBDIR) && test -f Makefile && $(MAKE) $(MFLAGS) $@)
-(cd $(TERM_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(GLOB_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(TILDE_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(ALLOC_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(SH_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-for libdir in ${LIB_SUBDIRS}; do \
(cd $$libdir && test -f Makefile && $(MAKE) $(MFLAGS) $@) ;\
done
-( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ )
distclean: basic-clean maybe-clean
( cd $(DOCDIR) && $(MAKE) $(MFLAGS) $@ )
( cd builtins && $(MAKE) $(MFLAGS) $@ )
-( cd $(SDIR) && $(MAKE) $(MFLAGS) $@ )
-(cd $(RL_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(HIST_LIBDIR) && test -f Makefile && $(MAKE) $(MFLAGS) $@)
-(cd $(TERM_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(GLOB_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(TILDE_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(ALLOC_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(SH_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-for libdir in ${LIB_SUBDIRS}; do \
(cd $$libdir && test -f Makefile && $(MAKE) $(MFLAGS) $@) ;\
done
-( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ )
$(RM) $(CREATED_CONFIGURE) tags TAGS
$(RM) $(CREATED_SUPPORT) Makefile $(CREATED_MAKEFILES)
@ -718,13 +767,10 @@ maintainer-clean: basic-clean
( cd $(DOCDIR) && $(MAKE) $(MFLAGS) $@ )
( cd builtins && $(MAKE) $(MFLAGS) $@ )
( cd $(SDIR) && $(MAKE) $(MFLAGS) $@ )
-(cd $(RL_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(HIST_LIBDIR) && test -f Makefile && $(MAKE) $(MFLAGS) $@)
-(cd $(TERM_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(GLOB_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(TILDE_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(ALLOC_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-(cd $(SH_LIBDIR) && $(MAKE) $(MFLAGS) $@)
-for libdir in ${LIB_SUBDIRS}; do \
(cd $$libdir && test -f Makefile && $(MAKE) $(MFLAGS) $@) ;\
done
-( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ )
$(RM) $(CREATED_CONFIGURE) $(CREATED_MAKEFILES)
$(RM) $(CREATED_SUPPORT) Makefile
@ -754,9 +800,9 @@ 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)-${RELSTATUS}
@echo tar cf $(Program)-$(Version)-${RELSTATUS}.tar ${Program}-$(Version)-${RELSTATUS}
@echo gzip $(Program)-$(Version)-${RELSTATUS}.tar
@echo $(Program) $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r ${PACKAGE} $(PACKAGE_VERSION)
@echo tar cf $(PACKAGE)-${PACKAGE_VERSION}.tar ${PACKAGE}-$(PACKAGE_VERSION)
@echo gzip $(PACKAGE)-$(PACKAGE_VERSION).tar
depend: depends
@ -799,22 +845,27 @@ dispose_cmd.o: make_cmd.h subst.h sig.h pathnames.h externs.h
dispose_cmd.o: ${BASHINCDIR}/ocache.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 xmalloc.h externs.h input.h bashhist.h
error.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
error.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h
error.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
error.o: make_cmd.h subst.h sig.h pathnames.h externs.h
error.o: input.h execute_cmd.h
eval.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h trap.h flags.h ${DEFSRC}/common.h
eval.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
eval.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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
eval.o: input.h execute_cmd.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 syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
execute_cmd.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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: make_cmd.h subst.h sig.h pathnames.h externs.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}/strmatch.h
execute_cmd.o: ${BASHINCDIR}/posixtime.h ${BASHINCDIR}/chartypes.h
expr.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
expr.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
expr.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
expr.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h
expr.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
@ -826,7 +877,7 @@ findcmd.o: ${BASHINCDIR}/stdc.h error.h general.h xmalloc.h variables.h arrayfun
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
findcmd.o: ${BASHINCDIR}/chartypes.h
flags.o: config.h flags.h
flags.o: config.h flags.h
flags.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
flags.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h
flags.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
@ -835,7 +886,7 @@ general.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl
general.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
general.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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: make_cmd.h subst.h sig.h pathnames.h externs.h
general.o: ${BASHINCDIR}/maxpath.h ${BASHINCDIR}/posixtime.h
general.o: ${BASHINCDIR}/chartypes.h
hashcmd.o: config.h ${BASHINCDIR}/posixstat.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
@ -846,18 +897,18 @@ hashlib.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
hashlib.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
hashlib.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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
hashlib.o: make_cmd.h subst.h sig.h pathnames.h externs.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 xmalloc.h input.h error.h externs.h
list.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
list.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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 ${BASHINCDIR}/ansi_stdlib.h
list.o: make_cmd.h subst.h sig.h pathnames.h externs.h
locale.o: config.h bashtypes.h bashintl.h ${LIBINTL_H} bashansi.h ${BASHINCDIR}/ansi_stdlib.h
locale.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
locale.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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
locale.o: make_cmd.h subst.h sig.h pathnames.h externs.h
locale.o: ${BASHINCDIR}/chartypes.h
mailcheck.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
mailcheck.o: ${BASHINCDIR}/posixtime.h
@ -865,7 +916,7 @@ mailcheck.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h comman
mailcheck.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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
mailcheck.o: execute_cmd.h mailcheck.h
make_cmd.o: config.h bashtypes.h ${BASHINCDIR}/filecntl.h bashansi.h
make_cmd.o: command.h ${BASHINCDIR}/stdc.h general.h xmalloc.h error.h flags.h make_cmd.h
make_cmd.o: variables.h arrayfunc.h conftypes.h array.h hashlib.h subst.h input.h externs.h
@ -890,18 +941,18 @@ print_cmd.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
print_cmd.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
print_cmd.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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: 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 ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/filecntl.h
redir.o: ${BASHINCDIR}/memalloc.h shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
redir.o: general.h xmalloc.h variables.h arrayfunc.h conftypes.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: 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 ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/filecntl.h
shell.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
shell.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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 version.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}/strmatch.h ${BASHINCDIR}/posixtime.h
@ -909,20 +960,20 @@ sig.o: config.h bashtypes.h
sig.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
sig.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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: 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 ${BASHINCDIR}/chartypes.h
stringlib.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
stringlib.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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
stringlib.o: make_cmd.h subst.h sig.h pathnames.h externs.h
stringlib.o: ${GLOB_LIBSRC}/glob.h ${GLOB_LIBSRC}/strmatch.h
subst.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/posixstat.h
subst.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
subst.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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: make_cmd.h subst.h sig.h pathnames.h externs.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}/strmatch.h
@ -933,25 +984,26 @@ test.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h $
test.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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
test.o: ${DEFSRC}/common.h
trap.o: config.h bashtypes.h trap.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
trap.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
trap.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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: make_cmd.h subst.h sig.h pathnames.h externs.h
trap.o: signames.h $(DEFSRC)/common.h
trap.o: ${DEFDIR}/builtext.h
unwind_prot.o: config.h bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h command.h ${BASHINCDIR}/stdc.h
unwind_prot.o: general.h xmalloc.h unwind_prot.h quit.h sig.h
variables.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
variables.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
variables.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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: 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 hashcmd.h pathexp.h
variables.o: pcomplete.h version.h ${BASHINCDIR}/chartypes.h
variables.o: pcomplete.h ${BASHINCDIR}/chartypes.h
variables.o: ${BASHINCDIR}/posixtime.h
version.o: version.h conftypes.h patchlevel.h
version.o: conftypes.h patchlevel.h version.h
xmalloc.o: config.h bashtypes.h ${BASHINCDIR}/ansi_stdlib.h error.h
# job control
@ -961,7 +1013,7 @@ jobs.o: bashansi.h ${BASHINCDIR}/ansi_stdlib.h
jobs.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
jobs.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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: make_cmd.h subst.h sig.h pathnames.h externs.h
jobs.o: jobs.h flags.h $(DEFSRC)/common.h $(DEFDIR)/builtext.h
jobs.o: ${BASHINCDIR}/posixwait.h ${BASHINCDIR}/unionwait.h
jobs.o: ${BASHINCDIR}/posixtime.h
@ -975,24 +1027,24 @@ array.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
array.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
array.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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: make_cmd.h subst.h sig.h pathnames.h externs.h
array.o: $(DEFSRC)/common.h
arrayfunc.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
arrayfunc.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
arrayfunc.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.h
arrayfunc.o: quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
arrayfunc.o: make_cmd.h subst.h sig.h pathnames.h externs.h
arrayfunc.o: make_cmd.h subst.h sig.h pathnames.h externs.h
arrayfunc.o: $(DEFSRC)/common.h
arrayfunc.o: ${BASHINCDIR}/shmbutil.h
braces.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
braces.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
braces.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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
braces.o: make_cmd.h subst.h sig.h pathnames.h externs.h
braces.o: ${BASHINCDIR}/shmbutil.h
alias.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h command.h ${BASHINCDIR}/stdc.h
alias.o: general.h xmalloc.h bashtypes.h externs.h alias.h
alias.o: pcomplete.h
alias.o: pcomplete.h
alias.o: ${BASHINCDIR}/chartypes.h
pcomplib.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h bashtypes.h
@ -1005,7 +1057,7 @@ pcomplete.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h bashtypes.h
pcomplete.o: ${BASHINCDIR}/stdc.h hashlib.h pcomplete.h shell.h syntax.h
pcomplete.o: bashjmp.h command.h general.h xmalloc.h error.h variables.h arrayfunc.h conftypes.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 execute_cmd.h
pcomplete.o: externs.h ${BASHINCDIR}/maxpath.h execute_cmd.h
# library support files
@ -1014,14 +1066,14 @@ bashhist.o: ${BASHINCDIR}/filecntl.h
bashhist.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
bashhist.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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: 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)/strmatch.h
bashline.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
bashline.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
bashline.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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: 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
bashline.o: pcomplete.h ${BASHINCDIR}/chartypes.h input.h
@ -1029,7 +1081,7 @@ bracecomp.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
bracecomp.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h command.h ${BASHINCDIR}/stdc.h error.h
bracecomp.o: general.h xmalloc.h bashtypes.h variables.h arrayfunc.h conftypes.h array.h hashlib.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: make_cmd.h subst.h sig.h pathnames.h externs.h
bracecomp.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h command.h hashlib.h builtins.h general.h xmalloc.h
bracecomp.o: quit.h alias.h config.h variables.h arrayfunc.h conftypes.h
bracecomp.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
@ -1059,27 +1111,57 @@ shell.o: $(TILDE_LIBSRC)/tilde.h
subst.o: $(TILDE_LIBSRC)/tilde.h
variables.o: $(TILDE_LIBSRC)/tilde.h
# libintl dependencies
arrayfunc.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
bashhist.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
bashline.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
braces.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
error.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
eval.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
execute_cmd.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
expr.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
general.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
input.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
jobs.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
mailcheck.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
make_cmd.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
nojobs.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
parse.y: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
pcomplete.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
pcomplib.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
print_cmd.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
redir.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
shell.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
sig.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
siglist.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
subst.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
test.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
trap.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
variables.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
version.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
xmalloc.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
# XXX - dependencies checked through here
# builtin c sources
builtins/bashgetopt.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
builtins/bashgetopt.o: shell.h syntax.h config.h bashjmp.h command.h general.h xmalloc.h error.h
builtins/bashgetopt.o: variables.h arrayfunc.h conftypes.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: make_cmd.h subst.h sig.h pathnames.h externs.h
builtins/bashgetopt.o: $(DEFSRC)/common.h
builtins/bashgetopt.o: ${BASHINCDIR}/chartypes.h
builtins/common.o: bashtypes.h ${BASHINCDIR}/posixstat.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
builtins/common.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h command.h
builtins/common.o: ${BASHINCDIR}/memalloc.h variables.h arrayfunc.h conftypes.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: dispose_cmd.h make_cmd.h subst.h externs.h bashhist.h
builtins/common.o: execute_cmd.h ${BASHINCDIR}/stdc.h general.h xmalloc.h error.h pathnames.h
builtins/common.o: ${DEFDIR}/builtext.h
builtins/common.o: ${BASHINCDIR}/chartypes.h
builtins/evalfile.o: bashtypes.h ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
builtins/evalfile.o: shell.h syntax.h config.h bashjmp.h command.h general.h xmalloc.h error.h
builtins/evalfile.o: variables.h arrayfunc.h conftypes.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: 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 ${BASHINCDIR}/ansi_stdlib.h
@ -1092,7 +1174,7 @@ builtins/evalstring.o: bashhist.h $(DEFSRC)/common.h
builtins/getopt.o: config.h ${BASHINCDIR}/memalloc.h
builtins/getopt.o: shell.h syntax.h bashjmp.h command.h general.h xmalloc.h error.h
builtins/getopt.o: variables.h arrayfunc.h conftypes.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: make_cmd.h subst.h sig.h pathnames.h externs.h
builtins/getopt.o: $(DEFSRC)/getopt.h
builtins/mkbuiltins.o: config.h bashtypes.h ${BASHINCDIR}/posixstat.h ${BASHINCDIR}/filecntl.h
builtins/mkbuiltins.o: bashansi.h ${BASHINCDIR}/ansi_stdlib.h
@ -1113,6 +1195,12 @@ builtins/builtin.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.
builtins/builtin.o: quit.h $(DEFSRC)/common.h $(DEFSRC)/bashgetopt.h
builtins/builtin.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h
builtins/builtin.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/caller.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h
builtins/caller.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h
builtins/caller.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
builtins/caller.o: $(DEFSRC)/common.h quit.h
builtins/caller.o: ${BASHINCDIR}/chartypes.h bashtypes.h
builtins/caller.o: ${DEFDIR}/builtext.h
builtins/cd.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h
builtins/cd.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h
builtins/cd.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
@ -1131,16 +1219,16 @@ 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 xmalloc.h ${BASHINCDIR}/maxpath.h
builtins/enable.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.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/enable.o: pcomplete.h
builtins/eval.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h
builtins/eval.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.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: bashtypes.h
builtins/exec.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h
builtins/exec.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h
builtins/exec.o: dispose_cmd.h make_cmd.h subst.h externs.h execute_cmd.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 ${BASHINCDIR}/stdc.h
builtins/exit.o: bashtypes.h
builtins/exit.o: bashtypes.h
builtins/exit.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h
builtins/exit.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h
builtins/exit.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
@ -1151,22 +1239,22 @@ builtins/fc.o: flags.h unwind_prot.h variables.h arrayfunc.h conftypes.h shell.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/fc.o: ${BASHINCDIR}/chartypes.h
builtins/fg_bg.o: bashtypes.h $(DEFSRC)/bashgetopt.h
builtins/fg_bg.o: bashtypes.h $(DEFSRC)/bashgetopt.h
builtins/fg_bg.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h
builtins/fg_bg.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.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 xmalloc.h ${BASHINCDIR}/maxpath.h
builtins/getopts.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.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: bashtypes.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 xmalloc.h ${BASHINCDIR}/maxpath.h
builtins/hash.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h
builtins/help.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.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 syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h
builtins/help.o: $(GLOB_LIBSRC)/glob.h version.h
builtins/history.o: bashtypes.h
builtins/help.o: $(GLOB_LIBSRC)/glob.h
builtins/history.o: bashtypes.h
builtins/history.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.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 syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h
@ -1217,14 +1305,14 @@ builtins/shopt.o: $(DEFSRC)/common.h $(DEFSRC)/bashgetopt.h
builtins/source.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.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 syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h
builtins/source.o: findcmd.h $(DEFSRC)/bashgetopt.h
builtins/source.o: findcmd.h $(DEFSRC)/bashgetopt.h flags.h trap.h
builtins/suspend.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.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 syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h
builtins/test.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.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 syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h
builtins/test.o: test.h
builtins/test.o: test.h
builtins/times.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.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 syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h
@ -1251,10 +1339,47 @@ builtins/wait.o: ${BASHINCDIR}/chartypes.h
builtins/complete.o: config.h shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h
builtins/complete.o: unwind_prot.h variables.h arrayfunc.h conftypes.h
builtins/complete.o: bashtypes.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
builtins/complete.o: builtins.h
builtins/complete.o: builtins.h
builtins/complete.o: pcomplete.h
builtins/complete.o: ${DEFSRC}/common.h ${DEFSRC}/bashgetopt.h
# libintl dependencies
builtins/bind.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/break.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/caller.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/cd.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/common.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/complete.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/declare.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/enable.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/evalfile.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/exec.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/exit.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/fc.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/fg_bg.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/getopt.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/hash.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/help.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/history.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/inlib.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/jobs.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/kill.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/let.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/mkbuiltins.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/printf.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/pushd.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/read.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/return.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/set.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/setattr.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/shift.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/shopt.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/source.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/suspend.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/type.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/ulimit.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
builtins/umask.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
# builtin library dependencies
builtins/bind.o: $(RL_LIBSRC)/chardefs.h $(RL_LIBSRC)/readline.h
builtins/bind.o: $(RL_LIBSRC)/keymaps.h $(RL_LIBSRC)/rlstdc.h
@ -1270,6 +1395,7 @@ builtins/alias.o: $(DEFSRC)/alias.def
builtins/bind.o: $(DEFSRC)/bind.def
builtins/break.o: $(DEFSRC)/break.def
builtins/builtin.o: $(DEFSRC)/builtin.def
builtins/caller.o: $(DEFSRC)/caller.def
builtins/cd.o: $(DEFSRC)/cd.def
builtins/colon.o: $(DEFSRC)/colon.def
builtins/command.o: $(DEFSRC)/command.def

194
NEWS
View file

@ -1,3 +1,197 @@
This is a terse description of the new features added to bash-3.0 since
the release of bash-2.05b. As always, the manual page (doc/bash.1) is
the place to look for complete descriptions.
1. New Features in Bash
a. ANSI string expansion now implements the \x{hexdigits} escape.
b. There is a new loadable `strftime' builtin.
c. New variable, COMP_WORDBREAKS, which controls the readline completer's
idea of word break characters.
d. The `type' builtin no longer reports on aliases unless alias expansion
will actually be performed.
e. HISTCONTROL is now a colon-separated list of values, which permits
more extensibility and backwards compatibility.
f. HISTCONTROL may now include the `erasedups' option, which causes all lines
matching a line being added to be removed from the history list.
g. `configure' has a new `--enable-multibyte' argument that permits multibyte
character support to be disabled even on systems that support it.
h. New variables to support the bash debugger: BASH_ARGC, BASH_ARGV,
BASH_SOURCE, BASH_LINENO, BASH_SUBSHELL, BASH_EXECUTION_STRING,
BASH_COMMAND
i. FUNCNAME has been changed to support the debugger: it's now an array
variable.
j. for, case, select, arithmetic commands now keep line number information
for the debugger.
k. There is a new `RETURN' trap executed when a function or sourced script
returns (not inherited child processes; inherited by command substitution
if function tracing is enabled and the debugger is active).
l. New invocation option: --debugger. Enables debugging and turns on new
`extdebug' shell option.
m. New `functrace' and `errtrace' options to `set -o' cause DEBUG and ERR
traps, respectively, to be inherited by shell functions. Equivalent to
`set -T' and `set -E' respectively. The `functrace' option also controls
whether or not the DEBUG trap is inherited by sourced scripts.
n. The DEBUG trap is run before binding the variable and running the action
list in a `for' command, binding the selection variable and running the
query in a `select' command, and before attempting a match in a `case'
command.
o. New `--enable-debugger' option to `configure' to compile in the debugger
support code.
p. `declare -F' now prints out extra line number and source file information
if the `extdebug' option is set.
q. If `extdebug' is enabled, a non-zero return value from a DEBUG trap causes
the next command to be skipped, and a return value of 2 while in a
function or sourced script forces a `return'.
r. New `caller' builtin to provide a call stack for the bash debugger.
s. The DEBUG trap is run just before the first command in a function body is
executed, for the debugger.
t. `for', `select', and `case' command heads are printed when `set -x' is
enabled.
u. There is a new {x..y} brace expansion, which is shorthand for {x.x+1,
x+2,...,y}. x and y can be integers or single characters; the sequence
may ascend or descend; the increment is always 1.
v. New ksh93-like ${!array[@]} expansion, expands to all the keys (indices)
of array.
w. New `force_fignore' shopt option; if enabled, suffixes specified by
FIGNORE cause words to be ignored when performing word completion even
if they're the only possibilities.
x. New `gnu_errfmt' shopt option; if enabled, error messages follow the `gnu
style' (filename:lineno:message) format.
y. New `-o bashdefault' option to complete and compgen; if set, causes the
whole set of bash completions to be performed if the compspec doesn't
result in a match.
z. New `-o plusdirs' option to complete and compgen; if set, causes directory
name completion to be performed and the results added to the rest of the
possible completions.
aa. `kill' is available as a builtin even when the shell is built without
job control.
bb. New HISTTIMEFORMAT variable; value is a format string to pass to
strftime(3). If set and not null, the `history' builtin prints out
timestamp information according to the specified format when displaying
history entries. If set, bash tells the history library to write out
timestamp information when the history file is written.
cc. The [[ ... ]] command has a new binary `=~' operator that performs
extended regular expression (egrep-like) matching.
dd. `configure' has a new `--enable-cond-regexp' option (enabled by default)
to enable the =~ operator and regexp matching in [[ ... ]].
ee. Subexpressions matched by the =~ operator are placed in the new
BASH_REMATCH array variable.
ff. New `failglob' option that causes an expansion error when pathname
expansion fails to produce a match.
gg. New `set -o pipefail' option that causes a pipeline to return a failure
status if any of the processes in the pipeline fail, not just the last
one.
hh. printf builtin understands two new escape sequences: \" and \?.
ii. `echo -e' understands two new escape sequences: \" and \?.
jj. The GNU `gettext' package and libintl have been integrated; the shell's
messages can be translated into different languages.
kk. The `\W' prompt expansion now abbreviates $HOME as `~', like `\w'.
ll. The error message printed when bash cannot open a shell script supplied
as argument 1 now includes the name of the shell, to better identify
the error as coming from bash.
mm. The parameter pattern removal and substitution expansions are now much
faster and more efficient when using multibyte characters.
nn. The `jobs', `kill', and `wait' builtins now accept job control notation
even if job control is not enabled.
oo. The historical behavior of `trap' that allows a missing `action' argument
to cause each specified signal's handling to be reset to its default is
now only supported when `trap' is given a single non-option argument.
2. New Features in Readline
a. History expansion has a new `a' modifier equivalent to the `g' modifier
for compatibility with the BSD csh.
b. History expansion has a new `G' modifier equivalent to the BSD csh `g'
modifier, which performs a substitution once per word.
c. All non-incremental search operations may now undo the operation of
replacing the current line with the history line.
d. The text inserted by an `a' command in vi mode can be reinserted with
`.'.
e. New bindable variable, `show-all-if-unmodified'. If set, the readline
completer will list possible completions immediately if there is more
than one completion and partial completion cannot be performed.
f. There is a new application-callable `free_history_entry()' function.
g. History list entries now contain timestamp information; the history file
functions know how to read and write timestamp information associated
with each entry.
h. Four new key binding functions have been added:
rl_bind_key_if_unbound()
rl_bind_key_if_unbound_in_map()
rl_bind_keyseq_if_unbound()
rl_bind_keyseq_if_unbound_in_map()
i. New application variable, rl_completion_quote_character, set to any
quote character readline finds before it calls the application completion
function.
j. New application variable, rl_completion_suppress_quote, settable by an
application completion function. If set to non-zero, readline does not
attempt to append a closing quote to a completed word.
k. New application variable, rl_completion_found_quote, set to a non-zero
value if readline determines that the word to be completed is quoted.
Set before readline calls any application completion function.
l. New function hook, rl_completion_word_break_hook, called when readline
needs to break a line into words when completion is attempted. Allows
the word break characters to vary based on position in the line.
m. New bindable command: unix-filename-rubout. Does the same thing as
unix-word-rubout, but adds `/' to the set of word delimiters.
n. When listing completions, directories have a `/' appended if the
`mark-directories' option has been enabled.
-------------------------------------------------------------------------------
This is a terse description of the new features added to bash-2.05b since
the release of bash-2.05a. As always, the manual page (doc/bash.1) is
the place to look for complete descriptions.

3
NOTES
View file

@ -324,3 +324,6 @@ Platform-Specific Configuration and Operation Notes
15. Configure with `CC=xlc' if you don't have gcc on AIX 4.2 and later
versions. `xlc' running in `cc' mode has trouble compiling error.c.
16. Configure --disable-multibyte on NetBSD versions (1.4 through at least
1.6.1) that include wctype.h but do not define wctype_t.

38
POSIX
View file

@ -29,20 +29,20 @@ The following list is what's changed when `POSIX mode' is in effect:
performed on the values of `PS1' and `PS2' regardless of the
setting of the `promptvars' option.
6. Interactive comments are enabled by default. (Bash has them on by
default anyway.)
7. The POSIX 1003.2 startup files are executed (`$ENV') rather than
6. 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
7. Tilde expansion is only performed on assignments preceding a
command name, rather than on all assignment statements on the line.
9. The default history file is `~/.sh_history' (this is the default
8. The default history file is `~/.sh_history' (this is the default
value of `$HISTFILE').
10. The output of `kill -l' prints all the signal names on a single
line, separated by spaces.
9. The output of `kill -l' prints all the signal names on a single
line, separated by spaces, without the `SIG' prefix.
10. The `kill' builtin does not accept signal names with a `SIG'
prefix.
11. Non-interactive shells exit if FILENAME in `.' FILENAME is not
found.
@ -103,23 +103,33 @@ The following list is what's changed when `POSIX mode' is in effect:
26. The `trap' builtin displays signal names without the leading `SIG'.
27. The `.' and `source' builtins do not search the current directory
27. The `trap' builtin doesn't check the first argument for a possible
signal specification and revert the signal handling to the original
disposition if it is. If users want to reset the handler for a
given signal to the original disposition, they should use `-' as
the first argument.
28. The `.' and `source' builtins do not search the current directory
for the filename argument if it is not found by searching `PATH'.
28. Subshells spawned to execute command substitutions inherit the
29. Subshells spawned to execute command substitutions inherit the
value of the `-e' option from the parent shell. When not in POSIX
mode, Bash clears the `-e' option in such subshells.
29. Alias expansion is always enabled, even in non-interactive shells.
30. Alias expansion is always enabled, even in non-interactive shells.
30. When the `set' builtin is invoked without options, it does not
31. When the `alias' builtin displays alias definitions, it does not
display them with a leading `alias ' unless the `-p' option is
supplied.
32. When the `set' builtin is invoked without options, it does not
display shell function names and definitions.
31. When the `set' builtin is invoked without options, it displays
33. When the `set' builtin is invoked without options, it displays
variable values without quotes, unless they contain shell
metacharacters, even if the result contains nonprinting characters.
32. When the `cd' builtin is invoked in LOGICAL mode, and the pathname
34. When the `cd' builtin is invoked in LOGICAL mode, and the pathname
constructed from `$PWD' and the directory name supplied as an
argument does not refer to an existing directory, `cd' will fail
instead of falling back to PHYSICAL mode.

6
README
View file

@ -1,7 +1,7 @@
Introduction
============
This is GNU Bash, version 2.05b. Bash is the GNU Project's Bourne
This is GNU Bash, version 3.0. 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
@ -11,11 +11,11 @@ type of shell, see the file `doc/bashref.texi'. There is also a
large Unix-style man page. The man page is the definitive description
of the shell's features.
See the file CWRU/POSIX.NOTES for a discussion of how Bash differs
See the file POSIX for a discussion of how the Bash defaults differ
from the POSIX.2 spec and a description of the Bash `posix mode'.
There are some user-visible incompatibilities between this version
of Bash and the previous widely-distributed version, bash-1.14.
of Bash and a previous widely-distributed version, bash-1.14.
For details, see the file COMPAT. The NEWS file tersely lists
features that are new in this release.

3
Y2K
View file

@ -1,5 +1,4 @@
Since Bash does not manipulate date strings, it is Y2K-safe.
The only thing that Bash does with date strings is manipulate the string
returned by ctime(3) in the prompt customization code. In all cases,
it discards the year.
returned by ctime(3) or strftime(3) in the prompt customization code.

2257
aclocal.m4 vendored

File diff suppressed because it is too large Load diff

97
array.c
View file

@ -9,7 +9,7 @@
* chet@ins.cwru.edu
*/
/* Copyright (C) 1997-2002 Free Software Foundation, Inc.
/* Copyright (C) 1997-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -154,16 +154,17 @@ ARRAY_ELEMENT *s, *e;
* element as the argument.
*/
void
array_walk(a, func)
array_walk(a, func, udata)
ARRAY *a;
sh_ae_map_func_t *func;
void *udata;
{
register ARRAY_ELEMENT *ae;
if (a == 0 || array_empty(a))
return;
for (ae = element_forw(a->head); ae != a->head; ae = element_forw(ae))
if ((*func)(ae) < 0)
if ((*func)(ae, udata) < 0)
return;
}
@ -265,6 +266,21 @@ char *s;
return (a->num_elements);
}
ARRAY_ELEMENT *
array_unshift_element(a)
ARRAY *a;
{
return (array_shift (a, 1, 0));
}
int
array_shift_element(a, v)
ARRAY *a;
char *v;
{
return (array_rshift (a, 1, v));
}
ARRAY *
array_quote(array)
ARRAY *array;
@ -282,27 +298,50 @@ ARRAY *array;
return array;
}
/*
* Return a string whose elements are the members of array A beginning at
* index START and spanning NELEM members. Null elements are counted.
* Since arrays are sparse, unset array elements are not counted.
*/
char *
array_subrange (a, start, end, quoted)
array_subrange (a, start, nelem, starsub, quoted)
ARRAY *a;
arrayind_t start, end;
int quoted;
arrayind_t start, nelem;
int starsub, quoted;
{
ARRAY_ELEMENT *h, *p;
arrayind_t i;
char *ifs, sep[2];
p = array_head (a);
if (p == 0 || array_empty (a) || start > array_num_elements (a))
if (p == 0 || array_empty (a) || start > array_max_index(a))
return ((char *)NULL);
for (i = 0, p = element_forw(p); p != a->head && i < start; i++, p = element_forw(p))
/*
* Find element with index START. If START corresponds to an unset
* element (arrays can be sparse), use the first element whose index
* is >= START. If START is < 0, we count START indices back from
* the end of A (not elements, even with sparse arrays -- START is an
* index).
*/
for (p = element_forw(p); p != array_head(a) && start > element_index(p); p = element_forw(p))
;
if (p == a->head)
return ((char *)NULL);
for (h = p; p != a->head && i < end; i++, p = element_forw(p))
/* Starting at P, take NELEM elements, inclusive. */
for (i = 0, h = p; p != a->head && i < nelem; i++, p = element_forw(p))
;
return (array_to_string_internal (h, p, " ", quoted));
if (starsub && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT))) {
ifs = getifs();
sep[0] = ifs ? *ifs : '\0';
} else
sep[0] = ' ';
sep[1] = '\0';
return (array_to_string_internal (h, p, sep, quoted));
}
char *
@ -313,7 +352,7 @@ int mflags;
{
ARRAY *a2;
ARRAY_ELEMENT *e;
char *t;
char *t, *ifs, sifs[2];
if (array_head (a) == 0 || array_empty (a))
return ((char *)NULL);
@ -327,7 +366,13 @@ int mflags;
if (mflags & MATCH_QUOTED)
array_quote (a2);
t = array_to_string (a2, " ", 0);
if (mflags & MATCH_STARSUB) {
ifs = getifs();
sifs[0] = ifs ? *ifs : '\0';
sifs[1] = '\0';
t = array_to_string (a2, sifs, 0);
} else
t = array_to_string (a2, " ", 0);
array_dispose (a2);
return t;
@ -365,8 +410,10 @@ void
array_dispose_element(ae)
ARRAY_ELEMENT *ae;
{
FREE(ae->value);
free(ae);
if (ae) {
FREE(ae->value);
free(ae);
}
}
/*
@ -460,6 +507,7 @@ arrayind_t i;
/* Convenience routines for the shell to translate to and from the form used
by the rest of the code. */
WORD_LIST *
array_to_word_list(a)
ARRAY *a;
@ -487,6 +535,25 @@ WORD_LIST *list;
return (array_assign_list (a, list));
}
WORD_LIST *
array_keys_to_word_list(a)
ARRAY *a;
{
WORD_LIST *list;
ARRAY_ELEMENT *ae;
char *t;
if (a == 0 || array_empty(a))
return((WORD_LIST *)NULL);
list = (WORD_LIST *)NULL;
for (ae = element_forw(a->head); ae != a->head; ae = element_forw(ae)) {
t = itos(element_index(ae));
list = make_word_list (make_bare_word(t), list);
free(t);
}
return (REVERSE_LIST(list, WORD_LIST *));
}
ARRAY *
array_assign_list (array, list)
ARRAY *array;
@ -767,7 +834,7 @@ print_array(a)
ARRAY *a;
{
printf("\n");
array_walk(a, print_element);
array_walk(a, print_element, (void *)NULL);
}
main()

22
array.h
View file

@ -40,7 +40,7 @@ typedef struct array_element {
struct array_element *next, *prev;
} ARRAY_ELEMENT;
typedef int sh_ae_map_func_t __P((ARRAY_ELEMENT *));
typedef int sh_ae_map_func_t __P((ARRAY_ELEMENT *, void *));
/* Basic operations on entire arrays */
extern ARRAY *array_create __P((void));
@ -48,13 +48,15 @@ extern void array_flush __P((ARRAY *));
extern void array_dispose __P((ARRAY *));
extern ARRAY *array_copy __P((ARRAY *));
extern ARRAY *array_slice __P((ARRAY *, ARRAY_ELEMENT *, ARRAY_ELEMENT *));
extern void array_walk __P((ARRAY *, sh_ae_map_func_t *));
extern void array_walk __P((ARRAY *, sh_ae_map_func_t *, void *));
extern ARRAY_ELEMENT *array_shift __P((ARRAY *, int, int));
extern int array_rshift __P((ARRAY *, int, char *));
extern ARRAY_ELEMENT *array_unshift_element __P((ARRAY *));
extern int array_shift_element __P((ARRAY *, char *));
extern ARRAY *array_quote __P((ARRAY *));
extern char *array_subrange __P((ARRAY *, arrayind_t, arrayind_t, int));
extern char *array_subrange __P((ARRAY *, arrayind_t, arrayind_t, int, int));
extern char *array_patsub __P((ARRAY *, char *, char *, int));
/* Basic operations on array elements. */
@ -69,6 +71,8 @@ extern char *array_reference __P((ARRAY *, arrayind_t));
/* Converting to and from arrays */
extern WORD_LIST *array_to_word_list __P((ARRAY *));
extern ARRAY *array_from_word_list __P((WORD_LIST *));
extern WORD_LIST *array_keys_to_word_list __P((ARRAY *));
extern ARRAY *array_assign_list __P((ARRAY *, WORD_LIST *));
extern char **array_to_argv __P((ARRAY *));
@ -90,6 +94,18 @@ extern ARRAY *array_from_string __P((char *, char *));
#define element_forw(ae) ((ae)->next)
#define element_back(ae) ((ae)->prev)
/* Convenience */
#define array_push(a,v) \
do { array_rshift ((a), 1, (v)); } while (0)
#define array_pop(a) \
do { array_dispose_element (array_shift ((a), 1, 0)); } while (0)
#define GET_ARRAY_FROM_VAR(n, v, a) \
do { \
(v) = find_variable (n); \
(a) = ((v) && array_p ((v))) ? array_cell (v) : (ARRAY *)0; \
} while (0)
#define ALL_ELEMENT_SUB(c) ((c) == '@' || (c) == '*')
#endif /* _ARRAY_H_ */

View file

@ -1,6 +1,6 @@
/* arrayfunc.c -- High-level array functions used by other parts of the shell. */
/* Copyright (C) 2001-2002 Free Software Foundation, Inc.
/* Copyright (C) 2001-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -27,6 +27,8 @@
#endif
#include <stdio.h>
#include "bashintl.h"
#include "shell.h"
#include "shmbutil.h"
@ -39,6 +41,9 @@ extern int last_command_exit_value;
static void quote_array_assignment_chars __P((WORD_LIST *));
static char *array_value_internal __P((char *, int, int, int *));
/* Standard error message to use when encountering an invalid array subscript */
char *bash_badsub_errmsg = N_("bad array subscript");
/* **************************************************************** */
/* */
/* Functions to manipulate array variables and perform assignments */
@ -56,7 +61,8 @@ convert_var_to_array (var)
oldval = value_cell (var);
array = array_create ();
array_insert (array, 0, oldval);
if (oldval)
array_insert (array, 0, oldval);
FREE (value_cell (var));
var_setarray (var, array);
@ -245,7 +251,7 @@ assign_array_var_from_string (var, value)
shell expansions including pathname generation and word splitting. */
/* First we split the string on whitespace, using the shell parser
(ksh93 seems to do this). */
list = parse_string_to_word_list (val, "array assign");
list = parse_string_to_word_list (val, 1, "array assign");
/* If we're using [subscript]=value, we need to quote each [ and ] to
prevent unwanted filename expansion. */
@ -273,7 +279,7 @@ assign_array_var_from_string (var, value)
w = list->word->word;
/* We have a word of the form [ind]=value */
if (w[0] == '[')
if ((list->word->flags & W_ASSIGNMENT) && w[0] == '[')
{
len = skipsubscript (w, 0);
@ -297,7 +303,7 @@ assign_array_var_from_string (var, value)
if (ALL_ELEMENT_SUB (w[1]) && len == 2)
{
report_error ("%s: cannot assign to non-numeric index", w);
report_error (_("%s: cannot assign to non-numeric index"), w);
continue;
}
@ -395,13 +401,13 @@ skipsubscript (s, i)
state_bak = state;
mblength = mbrlen (s + i, slength, &state);
if (mblength == (size_t)-2 || mblength == (size_t)-1)
if (MB_INVALIDCH (mblength))
{
state = state_bak;
i++;
slength--;
}
else if (mblength == 0)
else if (MB_NULLWCH (mblength))
return i;
else
{
@ -441,7 +447,7 @@ unbind_array_element (var, sub)
len = skipsubscript (sub, 0);
if (sub[len] != ']' || len == 0)
{
builtin_error ("%s[%s: bad array subscript", var->name, sub);
builtin_error ("%s[%s: %s", var->name, sub, _(bash_badsub_errmsg));
return -1;
}
sub[len] = '\0';
@ -454,7 +460,7 @@ unbind_array_element (var, sub)
ind = array_expand_index (sub, len+1);
if (ind < 0)
{
builtin_error ("[%s]: bad array subscript", sub);
builtin_error ("[%s]: %s", sub, _(bash_badsub_errmsg));
return -1;
}
ae = array_remove (array_cell (var), ind);
@ -557,12 +563,22 @@ array_variable_name (s, subp, lenp)
t = xstrchr (s, '[');
if (t == 0)
return ((char *)NULL);
{
if (subp)
*subp = t;
if (lenp)
*lenp = 0;
return ((char *)NULL);
}
ind = t - s;
ni = skipsubscript (s, ind);
if (ni <= ind + 1 || s[ni] != ']')
{
err_badarraysub (s);
if (subp)
*subp = t;
if (lenp)
*lenp = 0;
return ((char *)NULL);
}
@ -623,6 +639,9 @@ array_value_internal (s, quoted, allow_all, rtype)
return (char *)NULL;
#endif
if (len == 0)
return ((char *)NULL); /* error message already printed */
/* [ */
if (ALL_ELEMENT_SUB (t[0]) && t[1] == ']')
{
@ -704,4 +723,41 @@ get_array_value (s, allow_all, rtype)
return (array_value_internal (s, 0, allow_all, rtype));
}
char *
array_keys (s, quoted)
char *s;
int quoted;
{
int len;
char *retval, *t, *temp;
WORD_LIST *l;
SHELL_VAR *var;
var = array_variable_part (s, &t, &len);
/* [ */
if (var == 0 || ALL_ELEMENT_SUB (t[0]) == 0 || t[1] != ']')
return (char *)NULL;
if (array_p (var) == 0)
l = add_string_to_list ("0", (WORD_LIST *)NULL);
else
{
l = array_keys_to_word_list (array_cell (var));
if (l == (WORD_LIST *)NULL)
return ((char *) NULL);
}
if (t[0] == '*' && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)))
{
temp = string_list_dollar_star (l);
retval = quote_string (temp);
free (temp);
}
else /* ${!name[@]} or unquoted ${!name[*]} */
retval = string_list_dollar_at (l, quoted);
dispose_words (l);
return retval;
}
#endif /* ARRAY_VARS */

View file

@ -45,6 +45,8 @@ extern int valid_array_reference __P((char *));
extern char *array_value __P((char *, int, int *));
extern char *get_array_value __P((char *, int, int *));
extern char *array_keys __P((char *, int));
extern char *array_variable_name __P((char *, char **, int *));
extern SHELL_VAR *array_variable_part __P((char *, char **, int *));

View file

@ -1,6 +1,6 @@
/* bashhist.c -- bash interface to the GNU history library. */
/* Copyright (C) 1993 Free Software Foundation, Inc.
/* Copyright (C) 1993-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -36,6 +36,8 @@
#include "posixstat.h"
#include "filecntl.h"
#include "bashintl.h"
#include "shell.h"
#include "flags.h"
#include "input.h"
@ -50,6 +52,7 @@
#if defined (READLINE)
# include "bashline.h"
extern int rl_done, rl_dispatching; /* should really include readline.h */
#endif
#if !defined (errno)
@ -58,6 +61,7 @@ extern int errno;
static int histignore_item_func __P((struct ign *));
static int check_history_control __P((char *));
static void hc_erasedups __P((char *));
static void really_add_history __P((char *));
static struct ignorevar histignore =
@ -77,7 +81,10 @@ static struct ignorevar histignore =
becomes zero when we read lines from a file, for example. */
int remember_on_history = 1;
/* The number of lines that Bash has added to this history session. */
/* The number of lines that Bash has added to this history session. The
difference between the number of the top element in the history list
(offset from history_base) and the number of lines in the history file.
Appending this session's history to the history file resets this to 0. */
int history_lines_this_session;
/* The number of lines that Bash has read from the history file. */
@ -134,10 +141,14 @@ int literal_history;
exit, even if the history has been stifled. */
int force_append_history;
/* A nit for picking at history saving.
Value of 0 means save all lines parsed by the shell on the history.
Value of 1 means save all lines that do not start with a space.
Value of 2 means save all lines that do not match the last line saved. */
/* A nit for picking at history saving. Flags have the following values:
Value == 0 means save all lines parsed by the shell on the history.
Value & HC_IGNSPACE means save all lines that do not start with a space.
Value & HC_IGNDUPS means save all lines that do not match the last
line saved.
Value & HC_ERASEDUPS means to remove all other matching lines from the
history list before saving the latest line. */
int history_control;
/* Set to 1 if the last command was added to the history list successfully
@ -206,6 +217,7 @@ bash_initialize_history ()
history_quotes_inhibit_expansion = 1;
history_search_delimiter_chars = ";&()|<>";
history_inhibit_expansion_function = bash_history_inhibit_expansion;
sv_histchars ("histchars");
}
void
@ -307,7 +319,7 @@ maybe_append_history (filename)
fd = open (filename, O_WRONLY|O_CREAT, 0600);
if (fd < 0)
{
builtin_error ("%s: cannot create: %s", filename, strerror (errno));
builtin_error (_("%s: cannot create: %s"), filename, strerror (errno));
return (EXECUTION_FAILURE);
}
close (fd);
@ -433,12 +445,19 @@ pre_process_line (line, print_changes, addit)
/* If there was an error, return NULL. */
if (expanded < 0 || expanded == 2) /* 2 == print only */
{
# if defined (READLINE)
if (expanded == 2 && rl_dispatching == 0 && *history_value)
# else
if (expanded == 2 && *history_value)
# endif /* !READLINE */
maybe_add_history (history_value);
free (history_value);
# if defined (READLINE)
/* New hack. We can allow the user to edit the
failed history expansion. */
if (history_reediting && expanded < 0)
if (history_reediting && expanded < 0 && rl_done)
re_edit (line);
# endif /* READLINE */
return ((char *)NULL);
@ -511,27 +530,49 @@ check_history_control (line)
HIST_ENTRY *temp;
int r;
switch (history_control)
if (history_control == 0)
return 1;
/* ignorespace or ignoreboth */
if ((history_control & HC_IGNSPACE) && *line == ' ')
return 0;
/* ignoredups or ignoreboth */
if (history_control & HC_IGNDUPS)
{
case 0: /* nothing */
return 1;
case 1: /* ignorespace */
return (*line != ' ');
case 3: /* ignoreboth */
if (*line == ' ')
return 0;
/* FALLTHROUGH if case == 3 (`ignoreboth') */
case 2: /* ignoredups */
using_history ();
temp = previous_history ();
r = (temp == 0 || STREQ (temp->line, line) == 0);
using_history ();
return r;
if (r == 0)
return r;
}
return 0;
return 1;
}
/* Remove all entries matching LINE from the history list. Triggered when
HISTCONTROL includes `erasedups'. */
static void
hc_erasedups (line)
char *line;
{
HIST_ENTRY *temp;
int r;
using_history ();
while (temp = previous_history ())
{
if (STREQ (temp->line, line))
{
r = where_history ();
remove_history (r);
}
}
using_history ();
}
/* Add LINE to the history list, handling possibly multi-line compound
@ -577,6 +618,11 @@ check_add_history (line, force)
{
if (check_history_control (line) && history_should_ignore (line) == 0)
{
/* We're committed to saving the line. If the user has requested it,
remove other matching lines from the history. */
if (history_control & HC_ERASEDUPS)
hc_erasedups (line);
if (force)
{
really_add_history (line);
@ -635,10 +681,8 @@ bash_add_history (line)
free (new_line);
if (old)
{
FREE (old->line);
free (old);
}
free_history_entry (old);
add_it = 0;
}
}

View file

@ -23,6 +23,13 @@
#include "stdc.h"
/* Flag values for history_control */
#define HC_IGNSPACE 0x01
#define HC_IGNDUPS 0x02
#define HC_ERASEDUPS 0x04
#define HC_IGNBOTH (HC_IGNSPACE|HC_IGNDUPS)
extern int remember_on_history;
extern int history_lines_this_session;
extern int history_lines_in_file;

View file

@ -1,6 +1,6 @@
/* bashintl.h -- Internationalization stuff
Copyright (C) 1996 Free Software Foundation, Inc.
Copyright (C) 1996-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -21,15 +21,22 @@
#if !defined (_BASHINTL_H_)
#define _BASHINTL_H_
/* Include this *after* config.h */
#if defined (HAVE_LIBINTL_H)
# include <libintl.h>
#if defined (BUILDTOOL)
# undef ENABLE_NLS
# define ENABLE_NLS 0
#endif
/* Include this *after* config.h */
#include "gettext.h"
#if defined (HAVE_LOCALE_H)
# include <locale.h>
#endif
#define _(msgid) gettext(msgid)
#define N_(msgid) msgid
#define D_(d, msgid) dgettext(d, msgid)
#if defined (HAVE_SETLOCALE) && !defined (LC_ALL)
# undef HAVE_SETLOCALE
#endif
@ -38,12 +45,4 @@
# define setlocale(cat, loc)
#endif
#if !defined (HAVE_TEXTDOMAIN)
# define textdomain(dom)
#endif
#if !defined (HAVE_BINDTEXTDOMAIN)
# define bindtextdomain(dom, dir)
#endif
#endif /* !_BASHINTL_H_ */

View file

@ -33,9 +33,10 @@ extern procenv_t return_catch; /* used by `return' builtin */
xbcopy ((char *)old, (char *)save, sizeof (procenv_t));
/* Values for the second argument to longjmp/siglongjmp. */
#define NOT_JUMPED 0 /* Not returning from a longjmp. */
#define FORCE_EOF 1 /* We want to stop parsing. */
#define DISCARD 2 /* Discard current command. */
#define EXITPROG 3 /* Unconditionally exit the program now. */
#define NOT_JUMPED 0 /* Not returning from a longjmp. */
#define FORCE_EOF 1 /* We want to stop parsing. */
#define DISCARD 2 /* Discard current command. */
#define EXITPROG 3 /* Unconditionally exit the program now. */
#define ERREXIT 4 /* Exit due to error condition */
#endif /* _BASHJMP_H_ */

View file

@ -1,6 +1,6 @@
/* bashline.c -- Bash's interface to the readline library. */
/* Copyright (C) 1987-2002 Free Software Foundation, Inc.
/* Copyright (C) 1987-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -40,6 +40,8 @@
#include <stdio.h>
#include "chartypes.h"
#include "bashansi.h"
#include "bashintl.h"
#include "shell.h"
#include "input.h"
#include "builtins.h"
@ -150,10 +152,15 @@ static char **prog_complete_matches;
#endif
/* Variables used here but defined in other files. */
extern int current_command_line_count;
#if defined (BANG_HISTORY)
extern int hist_verify;
#endif
extern int current_command_line_count, last_command_exit_value;
extern int posixly_correct, no_symbolic_links;
extern char *current_prompt_string, *ps1_prompt;
extern STRING_INT_ALIST word_token_alist[];
extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin;
/* SPECIFIC_COMPLETION_FUNCTIONS specifies that we have individual
completion functions which indicate what type of completion should be
@ -186,11 +193,13 @@ static int bash_glob_completion_internal __P((int));
static int bash_glob_complete_word __P((int, int));
static int bash_glob_expand_word __P((int, int));
static int bash_glob_list_expansions __P((int, int));
#endif /* SPECIFIC_COMPLETION_FUNCTIONS */
static int edit_and_execute_command __P((int, int, int, char *));
#if defined (VI_MODE)
static int vi_edit_and_execute_command __P((int, int));
static int bash_vi_complete __P((int, int));
#endif
static int emacs_edit_and_execute_command __P((int, int));
@ -205,8 +214,14 @@ int perform_hostname_completion = 1;
/* If non-zero, we don't do command completion on an empty line. */
int no_empty_command_completion;
/* Set FORCE_FIGNORE if you want to honor FIGNORE even if it ignores the
only possible matches. Set to 0 if you want to match filenames if they
are the only possible matches, even if FIGNORE says to. */
int force_fignore = 1;
static char *bash_completer_word_break_characters = " \t\n\"'@><=;|&(:";
static char *bash_nohostname_word_break_characters = " \t\n\"'><=;|&(:";
/* )) */
static rl_hook_func_t *old_rl_startup_hook = (rl_hook_func_t *)NULL;
@ -233,11 +248,14 @@ posix_readline_initialize (on_or_off)
#endif
}
/* When this function returns, rl_completer_word_break_characters points to
dynamically allocated memory. */
int
enable_hostname_completion (on_or_off)
int on_or_off;
{
int old_value;
char *at, *nv, *nval;
old_value = perform_hostname_completion;
@ -245,13 +263,60 @@ enable_hostname_completion (on_or_off)
{
perform_hostname_completion = 1;
rl_special_prefixes = "$@";
rl_completer_word_break_characters = bash_completer_word_break_characters;
}
else
{
perform_hostname_completion = 0;
rl_special_prefixes = "$";
rl_completer_word_break_characters = bash_nohostname_word_break_characters;
}
/* Now we need to figure out how to appropriately modify and assign
rl_completer_word_break_characters depending on whether we want
hostname completion on or off. */
/* If this is the first time this has been called
(bash_readline_initialized == 0), use the sames values as before, but
allocate new memory for rl_completer_word_break_characters. */
if (bash_readline_initialized == 0 &&
(rl_completer_word_break_characters == 0 ||
rl_completer_word_break_characters == rl_basic_word_break_characters))
{
if (on_or_off)
rl_completer_word_break_characters = savestring (bash_completer_word_break_characters);
else
rl_completer_word_break_characters = savestring (bash_nohostname_word_break_characters);
}
else
{
/* See if we have anything to do. */
at = strchr (rl_completer_word_break_characters, '@');
if ((at == 0 && on_or_off == 0) || (at != 0 && on_or_off != 0))
return;
/* We have something to do. Do it. */
nval = (char *)xmalloc (strlen (rl_completer_word_break_characters) + 1 + on_or_off);
if (on_or_off == 0)
{
/* Turn it off -- just remove `@' from word break chars. We want
to remove all occurrences of `@' from the char list, so we loop
rather than just copy the rest of the list over AT. */
for (nv = nval, at = rl_completer_word_break_characters; *at; )
if (*at != '@')
*nv++ = *at++;
else
at++;
*nv = '\0';
}
else
{
nval[0] = '@';
strcpy (nval + 1, rl_completer_word_break_characters);
}
free (rl_completer_word_break_characters);
rl_completer_word_break_characters = nval;
}
return (old_value);
@ -261,6 +326,9 @@ enable_hostname_completion (on_or_off)
void
initialize_readline ()
{
rl_command_func_t *func;
char kseq[2];
if (bash_readline_initialized)
return;
@ -320,52 +388,65 @@ initialize_readline ()
rl_initialize ();
/* Bind up our special shell functions. */
rl_bind_key_in_map (CTRL('E'), shell_expand_line, emacs_meta_keymap);
rl_bind_key_if_unbound_in_map (CTRL('E'), shell_expand_line, emacs_meta_keymap);
/* Bind up our special shell functions. */
#ifdef BANG_HISTORY
rl_bind_key_in_map ('^', history_expand_line, emacs_meta_keymap);
rl_bind_key_if_unbound_in_map ('^', history_expand_line, emacs_meta_keymap);
#endif
rl_bind_key_in_map (CTRL ('O'), operate_and_get_next, emacs_standard_keymap);
rl_bind_key_in_map (CTRL ('V'), display_shell_version, emacs_ctlx_keymap);
rl_bind_key_if_unbound_in_map (CTRL ('O'), operate_and_get_next, emacs_standard_keymap);
rl_bind_key_if_unbound_in_map (CTRL ('V'), display_shell_version, emacs_ctlx_keymap);
/* In Bash, the user can switch editing modes with "set -o [vi emacs]",
so it is not necessary to allow C-M-j for context switching. Turn
off this occasionally confusing behaviour. */
rl_unbind_key_in_map (CTRL('J'), emacs_meta_keymap);
rl_unbind_key_in_map (CTRL('M'), emacs_meta_keymap);
kseq[0] = CTRL('J');
kseq[1] = '\0';
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
if (func == rl_vi_editing_mode)
rl_unbind_key_in_map (CTRL('J'), emacs_meta_keymap);
kseq[0] = CTRL('M');
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
if (func == rl_vi_editing_mode)
rl_unbind_key_in_map (CTRL('M'), emacs_meta_keymap);
#if defined (VI_MODE)
rl_unbind_key_in_map (CTRL('E'), vi_movement_keymap);
#endif
#if defined (BRACE_COMPLETION)
rl_bind_key_in_map ('{', bash_brace_completion, emacs_meta_keymap);
rl_bind_key_if_unbound_in_map ('{', bash_brace_completion, emacs_meta_keymap); /*}*/
#endif /* BRACE_COMPLETION */
#if defined (SPECIFIC_COMPLETION_FUNCTIONS)
rl_bind_key_in_map ('/', bash_complete_filename, emacs_meta_keymap);
rl_bind_key_in_map ('/', bash_possible_filename_completions, emacs_ctlx_keymap);
rl_bind_key_if_unbound_in_map ('/', bash_complete_filename, emacs_meta_keymap);
rl_bind_key_if_unbound_in_map ('/', bash_possible_filename_completions, emacs_ctlx_keymap);
rl_bind_key_in_map ('~', bash_complete_username, emacs_meta_keymap);
rl_bind_key_in_map ('~', bash_possible_username_completions, emacs_ctlx_keymap);
/* Have to jump through hoops here because there is a default binding for
M-~ (rl_tilde_expand) */
kseq[0] = '~';
kseq[1] = '\0';
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
if (func == 0 || func == rl_tilde_expand)
rl_bind_keyseq_in_map (kseq, bash_complete_username, emacs_meta_keymap);
rl_bind_key_in_map ('@', bash_complete_hostname, emacs_meta_keymap);
rl_bind_key_in_map ('@', bash_possible_hostname_completions, emacs_ctlx_keymap);
rl_bind_key_if_unbound_in_map ('~', bash_possible_username_completions, emacs_ctlx_keymap);
rl_bind_key_in_map ('$', bash_complete_variable, emacs_meta_keymap);
rl_bind_key_in_map ('$', bash_possible_variable_completions, emacs_ctlx_keymap);
rl_bind_key_if_unbound_in_map ('@', bash_complete_hostname, emacs_meta_keymap);
rl_bind_key_if_unbound_in_map ('@', bash_possible_hostname_completions, emacs_ctlx_keymap);
rl_bind_key_in_map ('!', bash_complete_command, emacs_meta_keymap);
rl_bind_key_in_map ('!', bash_possible_command_completions, emacs_ctlx_keymap);
rl_bind_key_if_unbound_in_map ('$', bash_complete_variable, emacs_meta_keymap);
rl_bind_key_if_unbound_in_map ('$', bash_possible_variable_completions, emacs_ctlx_keymap);
rl_bind_key_in_map ('g', bash_glob_complete_word, emacs_meta_keymap);
rl_bind_key_in_map ('*', bash_glob_expand_word, emacs_ctlx_keymap);
rl_bind_key_in_map ('g', bash_glob_list_expansions, emacs_ctlx_keymap);
rl_bind_key_if_unbound_in_map ('!', bash_complete_command, emacs_meta_keymap);
rl_bind_key_if_unbound_in_map ('!', bash_possible_command_completions, emacs_ctlx_keymap);
rl_bind_key_if_unbound_in_map ('g', bash_glob_complete_word, emacs_meta_keymap);
rl_bind_key_if_unbound_in_map ('*', bash_glob_expand_word, emacs_ctlx_keymap);
rl_bind_key_if_unbound_in_map ('g', bash_glob_list_expansions, emacs_ctlx_keymap);
#endif /* SPECIFIC_COMPLETION_FUNCTIONS */
rl_bind_key_in_map (TAB, dynamic_complete_history, emacs_meta_keymap);
rl_bind_key_if_unbound_in_map (TAB, dynamic_complete_history, emacs_meta_keymap);
/* Tell the completer that we want a crack first. */
rl_attempted_completion_function = attempt_shell_completion;
@ -378,12 +459,16 @@ initialize_readline ()
rl_ignore_some_completions_function = filename_completion_ignore;
/* Bind C-xC-e to invoke emacs and run result as commands. */
rl_bind_key_in_map (CTRL ('E'), emacs_edit_and_execute_command, emacs_ctlx_keymap);
rl_bind_key_if_unbound_in_map (CTRL ('E'), emacs_edit_and_execute_command, emacs_ctlx_keymap);
#if defined (VI_MODE)
rl_bind_key_in_map ('v', vi_edit_and_execute_command, vi_movement_keymap);
rl_bind_key_if_unbound_in_map ('v', vi_edit_and_execute_command, vi_movement_keymap);
# if defined (ALIAS)
rl_bind_key_in_map ('@', posix_edit_macros, vi_movement_keymap);
rl_bind_key_if_unbound_in_map ('@', posix_edit_macros, vi_movement_keymap);
# endif
rl_bind_key_in_map ('\\', bash_vi_complete, vi_movement_keymap);
rl_bind_key_in_map ('*', bash_vi_complete, vi_movement_keymap);
rl_bind_key_in_map ('=', bash_vi_complete, vi_movement_keymap);
#endif
rl_completer_quote_characters = "'\"";
@ -708,8 +793,8 @@ operate_and_get_next (count, c)
command being entered (if no explicit argument is given), otherwise on
a command from the history file. */
#define VI_EDIT_COMMAND "fc -e ${VISUAL:-${EDITOR:-vi}}"
#define EMACS_EDIT_COMMAND "fc -e ${VISUAL:-${EDITOR:-emacs}}"
#define VI_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-vi}}\""
#define EMACS_EDIT_COMMAND "fc -e \"${VISUAL:-${EDITOR:-emacs}}\""
static int
edit_and_execute_command (count, c, editing_mode, edit_command)
@ -810,6 +895,7 @@ posix_edit_macros (count, key)
/* **************************************************************** */
#define COMMAND_SEPARATORS ";|&{(`"
/* )} */
static int
check_redir (ti)
@ -922,7 +1008,7 @@ attempt_shell_completion (text, start, end)
#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] == '\'')
if (ti >= 0 && (rl_line_buffer[ti] == '"' || rl_line_buffer[ti] == '\''))
{
qc = rl_line_buffer[ti];
saveti = ti--;
@ -1008,11 +1094,27 @@ attempt_shell_completion (text, start, end)
matches = rl_completion_matches (text, prog_complete_return);
if ((foundcs & COPT_DEFAULT) == 0)
rl_attempted_completion_over = 1; /* no default */
return (matches);
if (matches || ((foundcs & COPT_BASHDEFAULT) == 0))
return (matches);
}
}
#endif
if (matches == 0)
matches = bash_default_completion (text, start, end, qc, in_command_position);
return matches;
}
char **
bash_default_completion (text, start, end, qc, in_command_position)
const char *text;
int start, end, qc, in_command_position;
{
char **matches;
matches = (char **)NULL;
/* New posix-style command substitution or variable name? */
if (!matches && *text == '$')
{
@ -1044,7 +1146,10 @@ attempt_shell_completion (text, start, end)
}
else
{
#define CMD_IS_DIR(x) (absolute_pathname(x) == 0 && absolute_program(x) == 0 && *(x) != '~' && test_for_directory (x))
matches = rl_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
@ -1052,7 +1157,8 @@ attempt_shell_completion (text, start, end)
filenames and leave directories in the match list. */
if (matches == (char **)NULL)
rl_ignore_some_completions_function = bash_ignore_filenames;
else if (matches[1] == 0 && *matches[0] != '/')
#if 0
else if (matches[1] == 0 && CMD_IS_DIR(matches[0]))
/* Turn off rl_filename_completion_desired so readline doesn't
append a slash if there is a directory with the same name
in the current directory, or other filename-specific things.
@ -1061,7 +1167,7 @@ attempt_shell_completion (text, start, end)
looking in the current directory anyway, so there's no
conflict. */
rl_filename_completion_desired = 0;
else if (matches[0] && matches[1] && STREQ (matches[0], matches[1]) && *matches[0] != '/')
else if (matches[0] && matches[1] && STREQ (matches[0], matches[1]) && CMD_IS_DIR (matches[0]))
/* There are multiple instances of the same match (duplicate
completions haven't yet been removed). In this case, all of
the matches will be the same, and the duplicate removal code
@ -1071,6 +1177,7 @@ attempt_shell_completion (text, start, end)
completion. If there are multiple completions this won't
make a difference and the problem won't occur. */
rl_filename_completion_desired = 0;
#endif
}
}
@ -1365,6 +1472,9 @@ command_subst_completion_function (text, state)
text++;
else if (*text == '$' && text[1] == '(') /* ) */
text += 2;
/* If the text was quoted, suppress any quote character that the
readline completion code would insert. */
rl_completion_suppress_quote = 1;
start_len = text - orig_start;
filename_text = savestring (text);
if (matches)
@ -1631,8 +1741,13 @@ history_expand_line_internal (line)
char *line;
{
char *new_line;
int old_verify;
old_verify = hist_verify;
hist_verify = 0;
new_line = pre_process_line (line, 0, 0);
hist_verify = old_verify;
return (new_line == line) ? savestring (line) : new_line;
}
#endif
@ -1643,11 +1758,20 @@ static void
cleanup_expansion_error ()
{
char *to_free;
#if defined (BANG_HISTORY)
int old_verify;
old_verify = hist_verify;
hist_verify = 0;
#endif
fprintf (rl_outstream, "\r\n");
to_free = pre_process_line (rl_line_buffer, 1, 0);
#if defined (BANG_HISTORY)
hist_verify = old_verify;
#endif
if (to_free != rl_line_buffer)
free (to_free);
FREE (to_free);
putc ('\r', rl_outstream);
rl_forced_update_display ();
}
@ -1773,9 +1897,7 @@ history_and_alias_expand_line (count, ignore)
{
char *new_line;
new_line = pre_process_line (rl_line_buffer, 0, 0);
if (new_line == rl_line_buffer)
new_line = savestring (new_line);
new_line = history_expand_line_internal (rl_line_buffer);
#if defined (ALIAS)
if (new_line)
@ -1811,9 +1933,7 @@ shell_expand_line (count, ignore)
char *new_line;
WORD_LIST *expanded_string;
new_line = pre_process_line (rl_line_buffer, 0, 0);
if (new_line == rl_line_buffer)
new_line = savestring (new_line);
new_line = history_expand_line_internal (rl_line_buffer);
#if defined (ALIAS)
if (new_line)
@ -1873,10 +1993,6 @@ shell_expand_line (count, ignore)
}
}
/* Define NO_FORCE_FIGNORE if you want to match filenames that would
otherwise be ignored if they are the only possible matches. */
/* #define NO_FORCE_FIGNORE */
/* If FIGNORE is set, then don't match files with the given suffixes when
completing filenames. If only one of the possibilities has an acceptable
suffix, delete the others, else just return and let the completer
@ -1901,10 +2017,8 @@ _ignore_completion_names (names, name_func)
{
char **newnames;
int idx, nidx;
#ifdef NO_FORCE_FIGNORE
char **oldnames;
int oidx;
#endif
/* If there is only one completion, see if it is acceptable. If it is
not, free it up. In any case, short-circuit and return. This is a
@ -1912,13 +2026,13 @@ _ignore_completion_names (names, name_func)
if there is only one completion; it is the completion itself. */
if (names[1] == (char *)0)
{
#ifndef NO_FORCE_FIGNORE
if ((*name_func) (names[0]) == 0)
{
free (names[0]);
names[0] = (char *)NULL;
}
#endif
if (force_fignore)
if ((*name_func) (names[0]) == 0)
{
free (names[0]);
names[0] = (char *)NULL;
}
return;
}
@ -1927,22 +2041,22 @@ _ignore_completion_names (names, name_func)
for (nidx = 1; names[nidx]; nidx++)
;
newnames = strvec_create (nidx + 1);
#ifdef NO_FORCE_FIGNORE
oldnames = strvec_create (nidx - 1);
oidx = 0;
#endif
if (force_fignore == 0)
{
oldnames = strvec_create (nidx - 1);
oidx = 0;
}
newnames[0] = names[0];
for (idx = nidx = 1; names[idx]; idx++)
{
if ((*name_func) (names[idx]))
newnames[nidx++] = names[idx];
else
#ifndef NO_FORCE_FIGNORE
free (names[idx]);
#else
else if (force_fignore == 0)
oldnames[oidx++] = names[idx];
#endif
else
free (names[idx]);
}
newnames[nidx] = (char *)NULL;
@ -1950,21 +2064,24 @@ _ignore_completion_names (names, name_func)
/* If none are acceptable then let the completer handle it. */
if (nidx == 1)
{
#ifndef NO_FORCE_FIGNORE
free (names[0]);
names[0] = (char *)NULL;
#else
free (oldnames);
#endif
if (force_fignore)
{
free (names[0]);
names[0] = (char *)NULL;
}
else
free (oldnames);
free (newnames);
return;
}
#ifdef NO_FORCE_FIGNORE
while (oidx)
free (oldnames[--oidx]);
free (oldnames);
#endif
if (force_fignore == 0)
{
while (oidx)
free (oldnames[--oidx]);
free (oldnames);
}
/* If only one is acceptable, copy it to names[0] and return. */
if (nidx == 2)
@ -2079,6 +2196,7 @@ bash_directory_completion_hook (dirname)
char *local_dirname, *new_dirname, *t;
int return_value, should_expand_dirname;
WORD_LIST *wl;
struct stat sb;
return_value = should_expand_dirname = 0;
local_dirname = *dirname;
@ -2096,6 +2214,13 @@ bash_directory_completion_hook (dirname)
}
#endif
#if defined (HAVE_LSTAT)
if (should_expand_dirname && lstat (local_dirname, &sb) == 0)
#else
if (should_expand_dirname && stat (local_dirname, &sb) == 0)
#endif
should_expand_dirname = 0;
if (should_expand_dirname)
{
new_dirname = savestring (local_dirname);
@ -2292,7 +2417,7 @@ bash_complete_filename_internal (what_to_do)
rl_compentry_func_t *orig_func;
rl_completion_func_t *orig_attempt_func;
rl_icppfunc_t *orig_dir_func;
const char *orig_rl_completer_word_break_characters;
/*const*/ char *orig_rl_completer_word_break_characters;
int r;
orig_func = rl_completion_entry_function;
@ -2449,7 +2574,8 @@ bash_glob_complete_word (count, key)
int r;
rl_quote_func_t *orig_quoting_function;
rl_explicit_arg = 1; /* force `*' append */
if (rl_editing_mode == EMACS_EDITING_MODE)
rl_explicit_arg = 1; /* force `*' append */
orig_quoting_function = rl_filename_quoting_function;
rl_filename_quoting_function = bash_glob_quote_filename;
@ -2497,6 +2623,63 @@ bash_specific_completion (what_to_do, generator)
#endif /* SPECIFIC_COMPLETION_FUNCTIONS */
#if defined (VI_MODE)
/* Completion, from vi mode's point of view. This is a modified version of
rl_vi_complete which uses the bash globbing code to implement what POSIX
specifies, which is to append a `*' and attempt filename generation (which
has the side effect of expanding any globbing characters in the word). */
static int
bash_vi_complete (count, key)
int count, key;
{
#if defined (SPECIFIC_COMPLETION_FUNCTIONS)
int p, r;
char *t;
if ((rl_point < rl_end) && (!whitespace (rl_line_buffer[rl_point])))
{
if (!whitespace (rl_line_buffer[rl_point + 1]))
rl_vi_end_word (1, 'E');
rl_point++;
}
/* Find boundaries of current word, according to vi definition of a
`bigword'. */
t = 0;
if (rl_point > 0)
{
p = rl_point;
rl_vi_bWord (1, 'B');
r = rl_point;
rl_point = p;
p = r;
t = substring (rl_line_buffer, p, rl_point);
}
if (t && glob_pattern_p (t) == 0)
rl_explicit_arg = 1; /* XXX - force glob_complete_word to append `*' */
FREE (t);
if (key == '*') /* Expansion and replacement. */
r = bash_glob_expand_word (count, key);
else if (key == '=') /* List possible completions. */
r = bash_glob_list_expansions (count, key);
else if (key == '\\') /* Standard completion */
r = bash_glob_complete_word (count, key);
else
r = rl_complete (0, key);
if (key == '*' || key == '\\')
rl_vi_start_inserting (key, 1, 1);
return (r);
#else
return rl_vi_complete (count, key);
#endif /* !SPECIFIC_COMPLETION_FUNCTIONS */
}
#endif /* VI_MODE */
/* Filename quoting for completion. */
/* A function to strip unquoted quote characters (single quotes, double
quotes, and backslashes). It allows single quotes to appear
@ -2676,8 +2859,7 @@ bash_execute_unix_command (count, key)
Keymap xkmap; /* unix command executing keymap */
register int i;
char *cmd;
int old_line_count;
int *ts;
sh_parser_state_t ps;
/* First, we need to find the right command to execute. This is tricky,
because we might have already indirected into another keymap. */
@ -2695,7 +2877,7 @@ bash_execute_unix_command (count, key)
else
{
rl_crlf ();
internal_error ("bash_execute_unix_command: cannot find keymap for command");
internal_error (_("bash_execute_unix_command: cannot find keymap for command"));
rl_forced_update_display ();
return 1;
}
@ -2713,14 +2895,12 @@ bash_execute_unix_command (count, key)
rl_crlf (); /* move to a new line */
old_line_count = current_command_line_count;
ts = save_token_state ();
save_parser_state (&ps);
cmd = savestring (cmd);
parse_and_execute (cmd, "bash_execute_unix_command", SEVAL_NOHIST);
current_command_line_count = old_line_count;
restore_token_state (ts);
restore_parser_state (&ps);
/* and restore the readline buffer and display after command execution. */
rl_forced_update_display ();
@ -2746,7 +2926,7 @@ isolate_sequence (string, ind, need_dquote, startp)
/* 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);
builtin_error (_("%s: first non-whitespace character is not `\"'"), string);
return -1;
}
@ -2775,7 +2955,7 @@ isolate_sequence (string, ind, need_dquote, startp)
if (delim && string[i] != delim)
{
builtin_error ("%s: no closing `%c'", string, delim);
builtin_error (_("no closing `%c' in %s"), delim, string);
return -1;
}
@ -2809,7 +2989,7 @@ bind_keyseq_to_unix_command (line)
;
if (line[i] != ':')
{
builtin_error ("%s: missing colon separator", line);
builtin_error (_("%s: missing colon separator"), line);
return -1;
}
@ -2825,7 +3005,7 @@ bind_keyseq_to_unix_command (line)
/* and bind the key sequence in the current keymap to a function that
understands how to execute from CMD_XMAP */
rl_set_key (kseq, bash_execute_unix_command, kmap);
rl_bind_keyseq_in_map (kseq, bash_execute_unix_command, kmap);
return 0;
}
@ -2841,7 +3021,11 @@ bash_directory_completion_matches (text)
char *dfn;
int qc;
#if 0
qc = (text[0] == '"' || text[0] == '\'') ? text[0] : 0;
#else
qc = rl_dispatching ? rl_completion_quote_character : 0;
#endif
dfn = bash_dequote_filename ((char *)text, qc);
m1 = rl_completion_matches (dfn, rl_filename_completion_function);
free (dfn);
@ -2854,4 +3038,16 @@ bash_directory_completion_matches (text)
(void)bash_ignore_filenames (m1);
return m1;
}
char *
bash_dequote_text (text)
const char *text;
{
char *dtxt;
int qc;
qc = (text[0] == '"' || text[0] == '\'') ? text[0] : 0;
dtxt = bash_dequote_filename ((char *)text, qc);
return (dtxt);
}
#endif /* READLINE */

View file

@ -33,6 +33,8 @@ extern int bash_re_edit __P((char *));
extern int bind_keyseq_to_unix_command __P((char *));
extern char **bash_default_completion __P((const char *, int, int, int, int));
/* Used by programmable completion code. */
extern char *command_word_completion_function __P((const char *, int));
extern char *bash_groupname_completion_function __P((const char *, int));
@ -42,5 +44,6 @@ extern char **get_hostname_list __P((void));
extern void clear_hostname_list __P((void));
extern char **bash_directory_completion_matches __P((const char *));
extern char *bash_dequote_text __P((const char *));
#endif /* _BASHLINE_H_ */

169
braces.c
View file

@ -1,6 +1,6 @@
/* braces.c -- code for doing word expansion in curly braces. */
/* Copyright (C) 1987-2002 Free Software Foundation, Inc.
/* Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -39,9 +39,12 @@
#include "general.h"
#include "shmbutil.h"
#include "chartypes.h"
#define brace_whitespace(c) (!(c) || (c) == ' ' || (c) == '\t' || (c) == '\n')
#define BRACE_SEQ_SPECIFIER ".."
/* Basic idea:
Segregate the text into 3 sections: preamble (stuff before an open brace),
@ -56,11 +59,15 @@ int brace_arg_separator = ',';
#if defined (__P)
static int brace_gobbler __P((char *, size_t, int *, int));
static char **expand_amble __P((char *, size_t));
static char **expand_amble __P((char *, size_t, int));
static char **expand_seqterm __P((char *, size_t));
static char **mkseq __P((int, int, int));
static char **array_concat __P((char **, char **));
#else
static int brace_gobbler ();
static char **expand_amble ();
static char **expand_seqterm ();
static char **mkseq();
static char **array_concat ();
#endif
@ -117,9 +124,9 @@ brace_expand (text)
}
if (text[j] == brace_arg_separator)
{
{ /* { */
strvec_dispose (result);
report_error ("missing `}'");
report_error ("no closing `%c' in %s", '}', text);
throw_to_top_level ();
}
ADVANCE_CHAR (text, tlen, j);
@ -161,22 +168,29 @@ brace_expand (text)
ADVANCE_CHAR (amble, alen, j);
}
if (!amble[j])
if (amble[j] == 0)
{
free (amble);
free (preamble);
result[0] = savestring (text);
return (result);
tack = expand_seqterm (amble, alen);
if (tack)
goto add_tack;
else
{
free (amble);
free (preamble);
result[0] = savestring (text);
return (result);
}
}
#endif /* SHELL */
postamble = &text[i + 1];
tack = expand_amble (amble, alen);
tack = expand_amble (amble, alen, 0);
add_tack:
result = array_concat (result, tack);
free (amble);
strvec_dispose (tack);
postamble = text + i + 1;
tack = brace_expand (postamble);
result = array_concat (result, tack);
strvec_dispose (tack);
@ -189,9 +203,10 @@ brace_expand (text)
expand each slot which needs it, until there are no more slots which
need it. */
static char **
expand_amble (text, tlen)
expand_amble (text, tlen, flags)
char *text;
size_t tlen;
int flags;
{
char **result, **partial;
char *tem;
@ -220,9 +235,10 @@ expand_amble (text, tlen)
result = partial;
else
{
register int lr = strvec_len (result);
register int lp = strvec_len (partial);
register int j;
register int lr, lp, j;
lr = strvec_len (result);
lp = strvec_len (partial);
result = strvec_resize (result, lp + lr + 1);
@ -239,6 +255,108 @@ expand_amble (text, tlen)
return (result);
}
#define ST_BAD 0
#define ST_INT 1
#define ST_CHAR 2
static char **
mkseq (start, end, type)
int start, end, type;
{
int n, incr, i;
char **result, *t;
n = abs (end - start) + 1;
result = strvec_create (n + 1);
incr = (start < end) ? 1 : -1;
/* Make sure we go through the loop at least once, so {3..3} prints `3' */
i = 0;
n = start;
do
{
if (type == ST_INT)
result[i++] = itos (n);
else
{
t = (char *)xmalloc (2);
t[0] = n;
t[1] = '\0';
result[i++] = t;
}
if (n == end)
break;
n += incr;
}
while (1);
result[i] = (char *)0;
return (result);
}
static char **
expand_seqterm (text, tlen)
char *text;
size_t tlen;
{
char *t, *lhs, *rhs;
int i, lhs_t, rhs_t, lhs_v, rhs_v;
intmax_t tl, tr;
char **result;
t = strstr (text, BRACE_SEQ_SPECIFIER);
if (t == 0)
return ((char **)NULL);
i = t - text; /* index of start of BRACE_SEQ_SPECIFIER */
lhs = substring (text, 0, i);
rhs = substring (text, i + sizeof(BRACE_SEQ_SPECIFIER) - 1, tlen);
if (lhs[0] == 0 || rhs[0] == 0)
{
free (lhs);
free (rhs);
return ((char **)NULL);
}
/* Now figure out whether LHS and RHS are integers or letters. Both
sides have to match. */
lhs_t = (legal_number (lhs, &tl)) ? ST_INT :
((ISALPHA (lhs[0]) && lhs[1] == 0) ? ST_CHAR : ST_BAD);
rhs_t = (legal_number (rhs, &tr)) ? ST_INT :
((ISALPHA (rhs[0]) && rhs[1] == 0) ? ST_CHAR : ST_BAD);
if (lhs_t != rhs_t || lhs_t == ST_BAD || rhs_t == ST_BAD)
{
free (lhs);
free (rhs);
return ((char **)NULL);
}
/* OK, we have something. It's either a sequence of integers, ascending
or descending, or a sequence or letters, ditto. Generate the sequence,
put it into a string vector, and return it. */
if (lhs_t == ST_CHAR)
{
lhs_v = lhs[0];
rhs_v = rhs[0];
}
else
{
lhs_v = tl; /* integer truncation */
rhs_v = tr;
}
result = mkseq (lhs_v, rhs_v, lhs_t);
free (lhs);
free (rhs);
return (result);
}
/* Start at INDEX, and skip characters in TEXT. Set INDEX to the
index of the character matching SATISFY. This understands about
quoting. Return the character that caused us to stop searching;
@ -278,6 +396,16 @@ brace_gobbler (text, tlen, indx, satisfy)
continue;
}
#if defined (SHELL)
/* If compiling for the shell, treat ${...} like \{...} */
if (c == '$' && text[i+1] == '{' && quoted != '\'') /* } */
{
pass_next = 1;
i++;
continue;
}
#endif
if (quoted)
{
if (c == quoted)
@ -318,11 +446,7 @@ brace_gobbler (text, tlen, indx, satisfy)
i++;
continue;
}
#if defined (SHELL)
/* If this is being compiled as part of bash, ignore the `{'
in a `${}' construct */
if ((c != '{') || i == 0 || (text[i - 1] != '$'))
#endif /* SHELL */
break;
}
@ -368,8 +492,7 @@ array_concat (arr1, arr2)
for (j = 0; j < len2; j++)
{
result[len] =
(char *)xmalloc (1 + strlen_1 + strlen (arr2[j]));
result[len] = (char *)xmalloc (1 + strlen_1 + strlen (arr2[j]));
strcpy (result[len], arr1[i]);
strcpy (result[len] + strlen_1, arr2[j]);
len++;

View file

@ -1,6 +1,6 @@
# This Makefile for building libbuiltins.a is in -*- text -*- for Emacs.
#
# Copyright (C) 1996 Free Software Foundation, Inc.
# Copyright (C) 1996-2003 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
@ -16,6 +16,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_VERSION = @PACKAGE_VERSION@
#
SHELL = @MAKE_SHELL@
RANLIB = @RANLIB@
@ -35,6 +41,7 @@ VPATH = .:@srcdir@
topdir = @top_srcdir@
includedir = @includedir@
datadir = @datadir@
localedir = $(datadir)/locale
# Support an alternate destination root directory for package building
DESTDIR =
@ -43,6 +50,8 @@ INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
BUILD_DIR = @BUILD_DIR@
LIBBUILD = ${BUILD_DIR}/lib
PROFILE_FLAGS = @PROFILE_FLAGS@
CFLAGS = @CFLAGS@
CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
@ -63,10 +72,15 @@ BASHINCDIR = ${topdir}/include
RL_INCLUDEDIR = @RL_INCLUDEDIR@
INTL_LIBSRC = ${topdir}/lib/intl
INTL_BUILDDIR = ${LIBBUILD}/intl
INTL_INC = @INTL_INC@
LIBINTL_H = @LIBINTL_H@
HELPDIR = @HELPDIR@
MKDIRS = ${topdir}/support/mkdirs
INCLUDES = -I. -I.. @RL_INCLUDE@ -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib -I$(srcdir)
INCLUDES = -I. -I.. @RL_INCLUDE@ -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib -I$(srcdir) ${INTL_INC}
BASE_CCFLAGS = ${PROFILE_FLAGS} $(DEFS) $(LOCAL_DEFS) $(SYSTEM_FLAGS) \
${INCLUDES} $(LOCAL_CFLAGS)
@ -106,7 +120,8 @@ RL_LIBSRC = $(topdir)/lib/readline
$(CC) -c $(CCFLAGS) $<
DEFSRC = $(srcdir)/alias.def $(srcdir)/bind.def $(srcdir)/break.def \
$(srcdir)/builtin.def $(srcdir)/cd.def $(srcdir)/colon.def \
$(srcdir)/builtin.def $(srcdir)/caller.def \
$(srcdir)/cd.def $(srcdir)/colon.def \
$(srcdir)/command.def $(srcdir)/declare.def $(srcdir)/echo.def \
$(srcdir)/enable.def $(srcdir)/eval.def $(srcdir)/getopts.def \
$(srcdir)/exec.def $(srcdir)/exit.def $(srcdir)/fc.def \
@ -124,7 +139,7 @@ STATIC_SOURCE = common.c evalstring.c evalfile.c getopt.c bashgetopt.c \
getopt.h
OFILES = builtins.o \
alias.o bind.o break.o builtin.o cd.o colon.o command.o \
alias.o bind.o break.o builtin.o caller.o cd.o colon.o command.o \
common.o declare.o echo.o enable.o eval.o evalfile.o \
evalstring.o exec.o \
exit.o fc.o fg_bg.o hash.o help.o history.o jobs.o kill.o let.o \
@ -214,10 +229,20 @@ distclean maintainer-clean: clean
$(OFILES): $(MKBUILTINS) ../config.h
../version.h: ../config.h ../Makefile Makefile
-( cd ${BUILD_DIR} && ${MAKE} ${MFLAGS} version.h )
# maintainer special - for now
po: builtins.c
xgettext -L C -o $(topdir)/po/builtins.pot --keyword='N_' builtins.c 2>/dev/null
# dependencies
alias.o: alias.def
bind.o: bind.def
break.o: break.def
builtin.o: builtin.def
caller.o: caller.def
cd.o: cd.def
colon.o: colon.def
command.o: command.def
@ -263,7 +288,7 @@ bashgetopt.o: $(topdir)/command.h $(topdir)/general.h $(topdir)/xmalloc.h $(topd
bashgetopt.o: $(topdir)/variables.h $(topdir)/conftypes.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
bashgetopt.o: ../pathnames.h $(topdir)/externs.h $(srcdir)/common.h
bashgetopt.o: $(BASHINCDIR)/chartypes.h
common.o: $(topdir)/bashtypes.h $(BASHINCDIR)/posixstat.h $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h
common.o: $(topdir)/shell.h $(topdir)/syntax.h ../config.h $(topdir)/bashjmp.h $(BASHINCDIR)/posixjmp.h
@ -274,7 +299,7 @@ common.o: $(topdir)/siglist.h $(topdir)/bashhist.h $(topdir)/quit.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
common.o: $(topdir)/externs.h ../pathnames.h ./builtext.h
common.o: $(BASHINCDIR)/chartypes.h
evalfile.o: $(topdir)/bashtypes.h $(BASHINCDIR)/posixstat.h ${BASHINCDIR}/filecntl.h
evalfile.o: $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h
@ -283,7 +308,7 @@ evalfile.o: $(topdir)/command.h $(topdir)/general.h $(topdir)/xmalloc.h $(topdir
evalfile.o: $(topdir)/variables.h $(topdir)/conftypes.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: ../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
@ -303,8 +328,8 @@ getopt.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/bashjmp.h $(topdir)/com
getopt.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/error.h $(topdir)/variables.h $(topdir)/conftypes.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
getopt.o: $(topdir)/sig.h ../pathnames.h $(topdir)/externs.h
getopt.o: $(srcdir)/getopt.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
@ -331,6 +356,12 @@ 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)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
builtin.o: $(srcdir)/bashgetopt.h
caller.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
caller.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/quit.h $(topdir)/dispose_cmd.h
caller.o: $(topdir)/make_cmd.h $(topdir)/subst.h $(topdir)/externs.h
caller.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
caller.o: $(srcdir)/common.h $(BASHINCDIR)/maxpath.h ./builtext.h
caller.o: ${BASHINCDIR}/chartypes.h $(topdir)/bashtypes.h
cd.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
cd.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/quit.h $(topdir)/dispose_cmd.h
cd.o: $(topdir)/make_cmd.h $(topdir)/subst.h $(topdir)/externs.h
@ -347,6 +378,7 @@ declare.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
declare.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
declare.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
declare.o: $(topdir)/arrayfunc.h $(srcdir)/bashgetopt.h
declare.o: ./builtext.h
echo.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
echo.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/subst.h $(topdir)/externs.h
echo.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
@ -362,7 +394,7 @@ enable.o: $(topdir)/pcomplete.h
eval.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
eval.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.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)/subst.h $(topdir)/externs.h
eval.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
eval.o: $(BASHINCDIR)/maxpath.h
exec.o: $(topdir)/bashtypes.h
@ -377,7 +409,7 @@ exit.o: $(topdir)/bashtypes.h
exit.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
exit.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.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)/subst.h $(topdir)/externs.h
exit.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
exit.o: $(BASHINCDIR)/maxpath.h ./builtext.h
fc.o: $(topdir)/bashtypes.h $(BASHINCDIR)/posixstat.h
@ -416,7 +448,7 @@ history.o: $(topdir)/bashtypes.h
history.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
history.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.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)/subst.h $(topdir)/externs.h
history.o: ${BASHINCDIR}/filecntl.h $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h
history.o: $(topdir)/variables.h $(topdir)/conftypes.h $(topdir)/bashhist.h $(BASHINCDIR)/maxpath.h
inlib.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
@ -426,7 +458,7 @@ 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 $(BASHINCDIR)/memalloc.h $(topdir)/error.h
jobs.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/quit.h $(srcdir)/bashgetopt.h
jobs.o: $(BASHINCDIR)/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)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
kill.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
@ -443,13 +475,13 @@ printf.o: ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/bashjmp.h
printf.o: $(topdir)/command.h $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.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)/syntax.h $(topdir)/unwind_prot.h
printf.o: ../pathnames.h $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h
printf.o: $(topdir)/variables.h $(topdir)/conftypes.h $(BASHINCDIR)/stdc.h $(srcdir)/bashgetopt.h
printf.o: $(topdir)/bashtypes.h ${srcdir}/common.h $(BASHINCDIR)/chartypes.h
pushd.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
pushd.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.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)/subst.h $(topdir)/externs.h
pushd.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
pushd.o: $(BASHINCDIR)/maxpath.h $(srcdir)/common.h ./builtext.h
read.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
@ -474,7 +506,7 @@ setattr.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
setattr.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.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)/externs.h
setattr.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
setattr.o: $(topdir)/arrayfunc.h
shift.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
@ -487,7 +519,7 @@ source.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/fi
source.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
source.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
source.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
source.o: $(srcdir)/bashgetopt.h
source.o: $(srcdir)/bashgetopt.h $(topdir)/flags.h $(topdir)/trap.h
suspend.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
suspend.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
suspend.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
@ -541,7 +573,7 @@ shopt.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
shopt.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
shopt.o: $(srcdir)/common.h $(srcdir)/bashgetopt.h
complete.o: ../config.h
complete.o: ../config.h
complete.o: ${topdir}/shell.h $(topdir)/syntax.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
@ -550,3 +582,40 @@ 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
# libintl dependencies
bind.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
break.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
caller.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
cd.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
common.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
complete.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
declare.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
enable.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
evalfile.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
exec.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
exit.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
fc.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
fg_bg.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
getopt.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
hash.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
help.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
history.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
inlib.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
jobs.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
kill.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
let.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
mkbuiltins.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
printf.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
pushd.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
read.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
return.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
set.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
setattr.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
shift.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
shopt.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
source.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
suspend.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
type.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
ulimit.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
umask.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h

View file

@ -1,7 +1,7 @@
This file is alias.def, from which is created alias.c
It implements the builtins "alias" and "unalias" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -44,6 +44,7 @@ $END
#endif
# include "../bashansi.h"
# include "../bashintl.h"
# include <stdio.h>
# include "../shell.h"
@ -51,17 +52,23 @@ $END
# include "common.h"
# include "bashgetopt.h"
static void print_alias __P((alias_t *));
/* Flags for print_alias */
#define AL_REUSABLE 0x01
static void print_alias __P((alias_t *, int));
extern int posixly_correct;
/* Hack the alias command in a Korn shell way. */
int
alias_builtin (list)
WORD_LIST *list;
{
int any_failed, offset, pflag;
int any_failed, offset, pflag, dflags;
alias_t **alias_list, *t;
char *name, *value;
dflags = posixly_correct ? 0 : AL_REUSABLE;
pflag = 0;
reset_internal_getopt ();
while ((offset = internal_getopt (list, "p")) != -1)
@ -70,6 +77,7 @@ alias_builtin (list)
{
case 'p':
pflag = 1;
dflags |= AL_REUSABLE;
break;
default:
builtin_usage ();
@ -90,7 +98,7 @@ alias_builtin (list)
return (EXECUTION_SUCCESS);
for (offset = 0; alias_list[offset]; offset++)
print_alias (alias_list[offset]);
print_alias (alias_list[offset], dflags);
free (alias_list); /* XXX - Do not free the strings. */
@ -111,13 +119,19 @@ alias_builtin (list)
name[offset] = '\0';
value = name + offset + 1;
add_alias (name, value);
if (legal_alias_name (name, 0) == 0)
{
builtin_error (_("`%s': invalid alias name"), name);
any_failed++;
}
else
add_alias (name, value);
}
else
{
t = find_alias (name);
if (t)
print_alias (t);
print_alias (t, dflags);
else
{
sh_notfound (name);
@ -134,7 +148,7 @@ alias_builtin (list)
$BUILTIN unalias
$FUNCTION unalias_builtin
$DEPENDS_ON ALIAS
$SHORT_DOC unalias [-a] [name ...]
$SHORT_DOC unalias [-a] name [name ...]
Remove NAMEs from the list of defined aliases. If the -a option is given,
then remove all alias definitions.
$END
@ -171,6 +185,12 @@ unalias_builtin (list)
return (EXECUTION_SUCCESS);
}
if (list == 0)
{
builtin_usage ();
return (EX_USAGE);
}
aflag = 0;
while (list)
{
@ -192,13 +212,16 @@ unalias_builtin (list)
/* Output ALIAS in such a way as to allow it to be read back in. */
static void
print_alias (alias)
print_alias (alias, flags)
alias_t *alias;
int flags;
{
char *value;
value = sh_single_quote (alias->value);
printf ("alias %s=%s\n", alias->name, value);
if (flags & AL_REUSABLE)
printf ("alias ");
printf ("%s=%s\n", alias->name, value);
free (value);
fflush (stdout);

View file

@ -1,7 +1,7 @@
This file is bind.def, from which is created bind.c.
It implements the builtin "bind" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -72,6 +72,8 @@ extern int errno;
#include <readline/readline.h>
#include <readline/history.h>
#include "../bashintl.h"
#include "../shell.h"
#include "../bashline.h"
#include "bashgetopt.h"
@ -189,7 +191,7 @@ bind_builtin (list)
kmap = rl_get_keymap_by_name (map_name);
if (!kmap)
{
builtin_error ("`%s': invalid keymap name", map_name);
builtin_error (_("`%s': invalid keymap name"), map_name);
BIND_RETURN (EXECUTION_FAILURE);
}
}
@ -228,7 +230,7 @@ bind_builtin (list)
{
if (rl_read_init_file (initfile) != 0)
{
builtin_error ("%s: cannot read: %s", initfile, strerror (errno));
builtin_error (_("%s: cannot read: %s"), initfile, strerror (errno));
BIND_RETURN (EXECUTION_FAILURE);
}
}
@ -243,7 +245,7 @@ bind_builtin (list)
{
if (rl_set_key (remove_seq, (rl_command_func_t *)NULL, rl_get_keymap ()) != 0)
{
builtin_error ("`%s': cannot unbind", remove_seq);
builtin_error (_("`%s': cannot unbind"), remove_seq);
BIND_RETURN (EXECUTION_FAILURE);
}
}
@ -278,7 +280,7 @@ query_bindings (name)
function = rl_named_function (name);
if (function == 0)
{
builtin_error ("`%s': unknown function name", name);
builtin_error (_("`%s': unknown function name"), name);
return EXECUTION_FAILURE;
}
@ -286,11 +288,11 @@ query_bindings (name)
if (!keyseqs)
{
printf ("%s is not bound to any keys.\n", name);
printf (_("%s is not bound to any keys.\n"), name);
return EXECUTION_FAILURE;
}
printf ("%s can be invoked via ", name);
printf (_("%s can be invoked via "), name);
for (j = 0; j < 5 && keyseqs[j]; j++)
printf ("\"%s\"%s", keyseqs[j], keyseqs[j + 1] ? ", " : ".\n");
if (keyseqs[j])

View file

@ -1,7 +1,7 @@
This file is break.def, from which is created break.c.
It implements the builtins "break" and "continue" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -36,6 +36,8 @@ $END
# include <unistd.h>
#endif
#include "../bashintl.h"
#include "../shell.h"
#include "common.h"
@ -123,7 +125,7 @@ check_loop_level ()
{
#if defined (BREAK_COMPLAINS)
if (loop_level == 0 && posixly_correct == 0)
builtin_error ("only meaningful in a `for', `while', or `until' loop");
builtin_error (_("only meaningful in a `for', `while', or `until' loop"));
#endif /* BREAK_COMPLAINS */
return (loop_level);

View file

@ -68,7 +68,7 @@ builtin_builtin (list)
if (!function)
{
builtin_error ("%s: not a shell builtin", command);
sh_notbuiltin (command);
return (EXECUTION_FAILURE);
}
else

147
builtins/caller.def Normal file
View file

@ -0,0 +1,147 @@
This file is caller.def, from which is created caller.c. It implements the
builtin "caller" in Bash.
Copyright (C) 2002-2003 Rocky Bernstein for 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 caller.c
$BUILTIN caller
$FUNCTION caller_builtin
$DEPENDS_ON DEBUGGER
$SHORT_DOC caller [EXPR]
Returns the context of the current subroutine call.
Without EXPR, returns returns "$line $filename". With EXPR,
returns "$line $subroutine $filename"; this extra information
can be used used to provide a stack trace.
The value of EXPR indicates how many call frames to go back before the
current one; the top frame is frame 0.
$END
#include <config.h>
#include <stdio.h>
#include "chartypes.h"
#include "bashtypes.h"
#if defined (HAVE_UNISTD_H)
# ifdef _MINIX
# include <sys/types.h>
# endif
# include <unistd.h>
#endif
#include <errno.h>
#include "../bashintl.h"
#include "../shell.h"
#include "common.h"
#include "builtext.h"
#ifdef LOADABLE_BUILTIN
# include "builtins.h"
#endif
#if !defined (errno)
extern int errno;
#endif /* !errno */
int
caller_builtin (list)
WORD_LIST *list;
{
#if !defined (ARRAY_VARS)
printf ("1 NULL\n");
return (EXECUTION_FAILURE);
#else
SHELL_VAR *funcname_v, *bash_source_v, *bash_lineno_v;
ARRAY *funcname_a, *bash_source_a, *bash_lineno_a;
char *funcname_s, *source_s, *lineno_s;
ARRAY_ELEMENT *ae;
intmax_t num;
GET_ARRAY_FROM_VAR ("FUNCNAME", funcname_v, funcname_a);
GET_ARRAY_FROM_VAR ("BASH_SOURCE", bash_source_v, bash_source_a);
GET_ARRAY_FROM_VAR ("BASH_LINENO", bash_lineno_v, bash_lineno_a);
if (bash_lineno_a == 0 || array_empty (bash_lineno_a))
return (EXECUTION_FAILURE);
if (bash_source_a == 0 || array_empty (bash_source_a))
return (EXECUTION_FAILURE);
/* If there is no argument list, then give short form: line filename. */
if (list == 0)
{
lineno_s = array_reference (bash_lineno_a, 0);
source_s = array_reference (bash_source_a, 1);
printf("%s %s\n", lineno_s ? lineno_s : "NULL", source_s ? source_s : "NULL");
return (EXECUTION_SUCCESS);
}
if (funcname_a == 0 || array_empty (funcname_a))
return (EXECUTION_FAILURE);
if (legal_number (list->word->word, &num))
{
lineno_s = array_reference (bash_lineno_a, num);
source_s = array_reference (bash_source_a, num+1);
funcname_s = array_reference (funcname_a, num+1);
if (lineno_s == NULL|| source_s == NULL || funcname_s == NULL)
return (EXECUTION_FAILURE);
printf("%s %s %s\n", lineno_s, funcname_s, source_s);
}
else
{
sh_invalidnum (list->word->word);
builtin_usage ();
return (EXECUTION_FAILURE);
}
return (EXECUTION_SUCCESS);
#endif
}
#ifdef LOADABLE_BUILTIN
static char *caller_doc[] = {
N_("Returns the context of the current subroutine call."),
N_(""),
N_("Without EXPR, returns returns \"$line $filename\". With EXPR,"),
N_("returns \"$line $subroutine $filename\"; this extra information"),
N_("can be used used to provide a stack trace."),
N_(""),
N_("The value of EXPR indicates how many call frames to go back before the"),
N_("current one; the top frame is frame 0."),
(char *)NULL
};
struct builtin caller_struct = {
"caller",
caller_builtin,
BUILTIN_ENABLED,
caller_doc,
"caller [EXPR]",
0
};
#endif /* LOADABLE_BUILTIN */

View file

@ -1,7 +1,7 @@
This file is cd.def, from which is created cd.c. It implements the
builtins "cd" and "pwd" in Bash.
Copyright (C) 1987, 1989, 1991 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -39,6 +39,7 @@ $PRODUCES cd.c
#include <stdio.h>
#include "../bashansi.h"
#include "../bashintl.h"
#include <errno.h>
#include <tilde/tilde.h>
@ -106,28 +107,30 @@ bindpwd (no_symlinks)
array_needs_making = 0;
}
tvar = bind_variable ("PWD", dirname);
tvar = bind_variable ("PWD", dirname ? dirname : "");
if (old_anm == 0 && array_needs_making && exported_p (tvar))
{
update_export_env_inplace ("PWD=", 4, dirname);
update_export_env_inplace ("PWD=", 4, dirname ? dirname : "");
array_needs_making = 0;
}
if (dirname && dirname != the_current_working_directory)
free (dirname);
return (EXECUTION_SUCCESS);
}
/* Call get_working_directory to reset the value of
the_current_working_directory () */
static char *
resetpwd ()
resetpwd (caller)
char *caller;
{
char *tdir;
FREE (the_current_working_directory);
the_current_working_directory = (char *)NULL;
tdir = get_working_directory ("cd");
tdir = get_working_directory (caller);
return (tdir);
}
@ -184,7 +187,7 @@ cd_builtin (list)
if (dirname == 0)
{
builtin_error ("HOME not set");
builtin_error (_("HOME not set"));
return (EXECUTION_FAILURE);
}
lflag = 0;
@ -196,10 +199,14 @@ cd_builtin (list)
if (dirname == 0)
{
builtin_error ("OLDPWD not set");
builtin_error (_("OLDPWD not set"));
return (EXECUTION_FAILURE);
}
#if 0
lflag = interactive ? LCD_PRINTPATH : 0;
#else
lflag = LCD_PRINTPATH; /* According to SUSv3 */
#endif
}
else if (absolute_pathname (list->word->word))
dirname = list->word->word;
@ -222,8 +229,8 @@ cd_builtin (list)
is used to find the directory to change to, the new
directory name is echoed to stdout, whether or not
the shell is interactive. */
if (opt)
printf ("%s\n", no_symlinks ? temp : the_current_working_directory);
if (opt && (path = no_symlinks ? temp : the_current_working_directory))
printf ("%s\n", path);
free (temp);
/* Posix.2 says that after using CDPATH, the resultant
@ -332,6 +339,12 @@ pwd_builtin (list)
directory = tcwd ? (verbatim_pwd ? sh_physpath (tcwd, 0) : tcwd)
: get_working_directory ("pwd");
/* Try again using getcwd() if canonicalization fails (for instance, if
the file system has changed state underneath bash). */
if (tcwd && directory == 0)
directory = resetpwd ("pwd");
#undef tcwd
if (directory)
@ -342,9 +355,11 @@ pwd_builtin (list)
fflush (stdout);
if (ferror (stdout))
{
builtin_error ("write error: %s", strerror (errno));
builtin_error (_("write error: %s"), strerror (errno));
clearerr (stdout);
return (EXECUTION_FAILURE);
}
return (EXECUTION_SUCCESS);
}
else
@ -363,7 +378,7 @@ change_to_directory (newdir, nolinks)
int nolinks;
{
char *t, *tdir;
int err, canon_failed;
int err, canon_failed, r;
tdir = (char *)NULL;
@ -398,7 +413,12 @@ change_to_directory (newdir, nolinks)
resolved path doesn't exist), fail immediately. */
if (posixly_correct && nolinks == 0 && canon_failed)
{
errno = ENOENT;
#if defined ENAMETOOLONG
if (errno != ENOENT && errno != ENAMETOOLONG)
#else
if (errno != ENOENT)
#endif
errno = ENOTDIR;
return (0);
}
@ -408,12 +428,13 @@ change_to_directory (newdir, nolinks)
/* If canonicalization failed, but the chdir succeeded, reset the
shell's idea of the_current_working_directory. */
if (canon_failed)
resetpwd ();
else
{
FREE (the_current_working_directory);
the_current_working_directory = tdir;
t = resetpwd ("cd");
if (t == 0)
set_working_directory (tdir);
}
else
set_working_directory (tdir);
return (1);
}
@ -424,23 +445,28 @@ change_to_directory (newdir, nolinks)
return (0);
err = errno;
free (tdir);
/* We're not in physical mode (nolinks == 0), but we failed to change to
the canonicalized directory name (TDIR). Try what the user passed
verbatim. If we succeed, reinitialize the_current_working_directory. */
if (chdir (newdir) == 0)
{
tdir = resetpwd ();
FREE (tdir);
t = resetpwd ("cd");
if (t == 0)
set_working_directory (tdir);
else
free (t);
return (1);
r = 1;
}
else
{
errno = err;
return (0);
r = 0;
}
free (tdir);
return r;
}
/* Code for cd spelling correction. Original patch submitted by

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1987-2002 Free Software Foundation, Inc.
/* Copyright (C) 1987-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -40,6 +40,7 @@
#endif
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "maxpath.h"
@ -129,7 +130,7 @@ no_args (list)
{
if (list)
{
builtin_error ("too many arguments");
builtin_error (_("too many arguments"));
jump_to_top_level (DISCARD);
}
}
@ -153,21 +154,21 @@ void
sh_needarg (s)
char *s;
{
builtin_error ("%s: option requires an argument", s);
builtin_error (_("%s: option requires an argument"), s);
}
void
sh_neednumarg (s)
char *s;
{
builtin_error ("%s: numeric argument required", s);
builtin_error (_("%s: numeric argument required"), s);
}
void
sh_notfound (s)
char *s;
{
builtin_error ("%s: not found", s);
builtin_error (_("%s: not found"), s);
}
/* Function called when one of the builtin commands detects an invalid
@ -176,49 +177,49 @@ void
sh_invalidopt (s)
char *s;
{
builtin_error ("%s: invalid option", s);
builtin_error (_("%s: invalid option"), s);
}
void
sh_invalidoptname (s)
char *s;
{
builtin_error ("%s: invalid option name", s);
builtin_error (_("%s: invalid option name"), s);
}
void
sh_invalidid (s)
char *s;
{
builtin_error ("`%s': not a valid identifier", s);
builtin_error (_("`%s': not a valid identifier"), s);
}
void
sh_invalidnum (s)
char *s;
{
builtin_error ("%s: invalid number", s);
builtin_error (_("%s: invalid number"), s);
}
void
sh_invalidsig (s)
char *s;
{
builtin_error ("%s: invalid signal specification", s);
builtin_error (_("%s: invalid signal specification"), s);
}
void
sh_badpid (s)
char *s;
{
builtin_error ("`%s': not a pid or valid job spec", s);
builtin_error (_("`%s': not a pid or valid job spec"), s);
}
void
sh_readonly (s)
const char *s;
{
builtin_error ("%s: readonly variable", s);
builtin_error (_("%s: readonly variable"), s);
}
void
@ -226,9 +227,9 @@ sh_erange (s, desc)
char *s, *desc;
{
if (s)
builtin_error ("%s: %s out of range", s, desc ? desc : "argument");
builtin_error (_("%s: %s out of range"), s, desc ? desc : _("argument"));
else
builtin_error ("%s out of range", desc ? desc : "argument");
builtin_error (_("%s out of range"), desc ? desc : _("argument"));
}
#if defined (JOB_CONTROL)
@ -236,7 +237,7 @@ void
sh_badjob (s)
char *s;
{
builtin_error ("%s: no such job", s);
builtin_error (_("%s: no such job"), s);
}
void
@ -244,9 +245,9 @@ sh_nojobs (s)
char *s;
{
if (s)
builtin_error ("%s: no job control");
builtin_error (_("%s: no job control"), s);
else
builtin_error ("no job control");
builtin_error (_("no job control"));
}
#endif
@ -256,12 +257,19 @@ sh_restricted (s)
char *s;
{
if (s)
builtin_error ("%s: restricted", s);
builtin_error (_("%s: restricted"), s);
else
builtin_error ("restricted");
builtin_error (_("restricted"));
}
#endif
void
sh_notbuiltin (s)
char *s;
{
builtin_error (_("%s: not a shell builtin"), s);
}
/* **************************************************************** */
/* */
/* Shell positional parameter manipulation */
@ -454,28 +462,22 @@ get_working_directory (for_whom)
char *for_whom;
{
char *directory;
size_t dsize;
if (no_symbolic_links)
{
if (the_current_working_directory)
free (the_current_working_directory);
FREE (the_current_working_directory);
the_current_working_directory = (char *)NULL;
}
if (the_current_working_directory == 0)
{
the_current_working_directory = (char *)xmalloc (PATH_MAX);
the_current_working_directory[0] = '\0';
directory = getcwd (the_current_working_directory, PATH_MAX);
if (directory == 0)
the_current_working_directory = getcwd (0, 0);
if (the_current_working_directory == 0)
{
fprintf (stderr, "%s: could not get current directory: %s: %s\n",
fprintf (stderr, _("%s: error retrieving current directory: %s: %s\n"),
(for_whom && *for_whom) ? for_whom : get_name_for_error (),
bash_getcwd_errstr, strerror (errno));
free (the_current_working_directory);
the_current_working_directory = (char *)NULL;
_(bash_getcwd_errstr), strerror (errno));
return (char *)NULL;
}
}
@ -537,9 +539,9 @@ get_job_by_name (name, flags)
else if (job != NO_JOB)
{
if (this_shell_builtin)
builtin_error ("%s: ambiguous job spec", name);
builtin_error (_("%s: ambiguous job spec"), name);
else
report_error ("%s: ambiguous job spec", name);
report_error (_("%s: ambiguous job spec"), name);
return (DUP_JOB);
}
else
@ -565,7 +567,7 @@ get_job_spec (list)
word = list->word->word;
if (*word == '\0')
return (current_job);
return (NO_JOB);
if (*word == '%')
word++;
@ -573,17 +575,14 @@ get_job_spec (list)
if (DIGIT (*word) && all_digits (word))
{
job = atoi (word);
#if 0
return (job >= job_slots ? NO_JOB : job - 1);
#else
return (job > job_slots ? NO_JOB : job - 1);
#endif
}
jflags = 0;
switch (*word)
{
case 0:
return NO_JOB;
case '%':
case '+':
return (current_job);
@ -602,6 +601,9 @@ get_job_spec (list)
}
#endif /* JOB_CONTROL */
/*
* NOTE: `kill' calls this function with forcecols == 0
*/
int
display_signal_list (list, forcecols)
WORD_LIST *list;
@ -609,8 +611,7 @@ display_signal_list (list, forcecols)
{
register int i, column;
char *name;
int result;
int signum;
int result, signum, dflags;
intmax_t lsignum;
result = EXECUTION_SUCCESS;
@ -623,7 +624,13 @@ display_signal_list (list, forcecols)
continue;
if (posixly_correct && !forcecols)
printf ("%s%s", name, (i == NSIG - 1) ? "" : " ");
{
/* This is for the kill builtin. POSIX.2 says the signal names
are displayed without the `SIG' prefix. */
if (STREQN (name, "SIG", 3))
name += 3;
printf ("%s%s", name, (i == NSIG - 1) ? "" : " ");
}
else
{
printf ("%2d) %s", i, name);
@ -677,7 +684,10 @@ display_signal_list (list, forcecols)
}
else
{
signum = decode_signal (list->word->word);
dflags = DSIG_NOCASE;
if (posixly_correct == 0 || this_shell_builtin != kill_builtin)
dflags |= DSIG_SIGPREFIX;
signum = decode_signal (list->word->word, dflags);
if (signum == NO_SIG)
{
sh_invalidsig (list->word->word);

View file

@ -1,6 +1,6 @@
/* common.h -- extern declarations for functions defined in common.c. */
/* Copyright (C) 1993-2002 Free Software Foundation, Inc.
/* Copyright (C) 1993-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -30,6 +30,7 @@
#define SEVAL_INTERACT 0x002
#define SEVAL_NOHIST 0x004
#define SEVAL_NOFREE 0x008
#define SEVAL_RESETLINE 0x010
/* Flags for describe_command, shared between type.def and command.def */
#define CDESC_ALL 0x001 /* type -a */
@ -74,6 +75,7 @@ extern void sh_badjob __P((char *));
extern void sh_readonly __P((const char *));
extern void sh_nojobs __P((char *));
extern void sh_restricted __P((char *));
extern void sh_notbuiltin __P((char *));
extern char **make_builtin_argv __P((WORD_LIST *, int *));
extern void remember_args __P((WORD_LIST *, int));
@ -105,6 +107,9 @@ extern sh_builtin_func_t *builtin_address __P((char *));
extern sh_builtin_func_t *find_special_builtin __P((char *));
extern void initialize_shell_builtins __P((void));
/* Functions from exit.def */
extern void bash_logout __P((void));
/* Functions from getopts.def */
extern void getopts_reset __P((int));
@ -150,7 +155,7 @@ extern void parse_and_execute_cleanup __P((void));
/* Functions from evalfile.c */
extern int maybe_execute_file __P((const char *, int));
extern int source_file __P((const char *));
extern int source_file __P((const char *, int));
extern int fc_execute_file __P((const char *));
#endif /* !__COMMON_H */

View file

@ -1,7 +1,7 @@
This file is complete.def, from which is created complete.c.
It implements the builtins "complete" and "compgen" in Bash.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Copyright (C) 1999-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -43,10 +43,12 @@ $END
#endif
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "../builtins.h"
#include "../pcomplete.h"
#include "../bashline.h"
#include "common.h"
#include "bashgetopt.h"
@ -106,10 +108,12 @@ static struct _compopt {
char *optname;
int optflag;
} compopts[] = {
{ "bashdefault", COPT_BASHDEFAULT },
{ "default", COPT_DEFAULT },
{ "dirnames", COPT_DIRNAMES },
{ "filenames",COPT_FILENAMES},
{ "nospace", COPT_NOSPACE },
{ "plusdirs", COPT_PLUSDIRS },
{ (char *)NULL, 0 },
};
@ -244,7 +248,7 @@ build_actions (list, pp, rp, actp, optp)
ind = find_compact (list_optarg);
if (ind < 0)
{
builtin_error ("%s: invalid action name", list_optarg);
builtin_error (_("%s: invalid action name"), list_optarg);
return (EX_USAGE);
}
acts |= compacts[ind].actflag;
@ -374,7 +378,7 @@ remove_cmd_completions (list)
{
if (progcomp_remove (l->word->word) == 0)
{
builtin_error ("%s: no completion specification", l->word->word);
builtin_error (_("%s: no completion specification"), l->word->word);
ret = EXECUTION_FAILURE;
}
}
@ -428,10 +432,12 @@ print_one_completion (cmd, cs)
copts = cs->options;
/* First, print the -o options. */
PRINTCOMPOPT (COPT_BASHDEFAULT, "bashdefault");
PRINTCOMPOPT (COPT_DEFAULT, "default");
PRINTCOMPOPT (COPT_DIRNAMES, "dirnames");
PRINTCOMPOPT (COPT_FILENAMES, "filenames");
PRINTCOMPOPT (COPT_NOSPACE, "nospace");
PRINTCOMPOPT (COPT_PLUSDIRS, "plusdirs");
acts = cs->actions;
@ -515,7 +521,7 @@ print_cmd_completions (list)
print_one_completion (l->word->word, cs);
else
{
builtin_error ("%s: no completion specification", l->word->word);
builtin_error (_("%s: no completion specification"), l->word->word);
ret = EXECUTION_FAILURE;
}
}
@ -540,7 +546,7 @@ compgen_builtin (list)
unsigned long acts, copts;
COMPSPEC *cs;
STRINGLIST *sl;
char *word;
char *word, **matches;
if (list == 0)
return (EXECUTION_SUCCESS);
@ -562,9 +568,9 @@ compgen_builtin (list)
word = (list && list->word) ? list->word->word : "";
if (Farg)
internal_warning ("compgen: -F option may not work as you expect");
builtin_error (_("warning: -F option may not work as you expect"));
if (Carg)
internal_warning ("compgen: -C option may not work as you expect");
builtin_error (_("warning: -C option may not work as you expect"));
/* If we get here, we need to build a compspec and evaluate it. */
cs = compspec_create ();
@ -583,12 +589,19 @@ compgen_builtin (list)
rval = EXECUTION_FAILURE;
sl = gen_compspec_completions (cs, "compgen", word, 0, 0);
/* If the compspec wants the bash default completions, temporarily
turn off programmable completion and call the bash completion code. */
if ((sl == 0 || sl->list_len == 0) && (copts & COPT_BASHDEFAULT))
{
matches = bash_default_completion (word, 0, 0, 0, 0);
sl = completions_to_stringlist (matches);
strvec_dispose (matches);
}
/* This isn't perfect, but it's the best we can do, given what readline
exports from its set of completion utility functions. */
if ((sl == 0 || sl->list_len == 0) && (copts & COPT_DEFAULT))
{
char **matches;
matches = rl_completion_matches (word, rl_filename_completion_function);
sl = completions_to_stringlist (matches);
strvec_dispose (matches);

View file

@ -1,7 +1,7 @@
This file is declare.def, from which is created declare.c.
It implements the builtins "declare" and "local" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -23,7 +23,7 @@ $PRODUCES declare.c
$BUILTIN declare
$FUNCTION declare_builtin
$SHORT_DOC declare [-afFirtx] [-p] name[=value] ...
$SHORT_DOC declare [-afFirtx] [-p] [name[=value] ...]
Declare variables and/or give them attributes. If no NAMEs are
given, then display the values of variables instead. The -p option
will display the attributes and values of each NAME.
@ -32,7 +32,8 @@ The flags are:
-a to make NAMEs arrays (if supported)
-f to select from among function names only
-F to display function names without definitions
-F to display function names (and line number and source file name if
debugging) without definitions
-i to make NAMEs have the `integer' attribute
-r to make NAMEs readonly
-t to make NAMEs have the `trace' attribute
@ -67,6 +68,7 @@ $END
#include <stdio.h>
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "common.h"
@ -100,7 +102,7 @@ local_builtin (list)
return (declare_internal (list, 1));
else
{
builtin_error ("can only be used in a function");
builtin_error (_("can only be used in a function"));
return (EXECUTION_FAILURE);
}
}
@ -120,6 +122,7 @@ declare_internal (list, local_var)
int flags_on, flags_off, *flags, any_failed, assign_error, pflag, nodefs, opt;
char *t, *subscript_start;
SHELL_VAR *var;
FUNCTION_DEF *shell_fn;
flags_on = flags_off = any_failed = assign_error = pflag = nodefs = 0;
reset_internal_getopt ();
@ -225,7 +228,7 @@ declare_internal (list, local_var)
#endif
name = savestring (list->word->word);
offset = assignment (name);
offset = assignment (name, 0);
if (offset) /* declare [-afFirx] name=value */
{
@ -289,7 +292,7 @@ declare_internal (list, local_var)
{
if (offset) /* declare -f [-rix] foo=bar */
{
builtin_error ("cannot use `-f' to make functions");
builtin_error (_("cannot use `-f' to make functions"));
free (name);
return (EXECUTION_FAILURE);
}
@ -301,7 +304,7 @@ declare_internal (list, local_var)
{
if (readonly_p (var) && (flags_off & att_readonly))
{
builtin_error ("%s: readonly function", name);
builtin_error (_("%s: readonly function"), name);
any_failed++;
NEXT_VARIABLE ();
}
@ -309,9 +312,22 @@ declare_internal (list, local_var)
/* declare -[Ff] name [name...] */
if (flags_on == att_function && flags_off == 0)
{
t = nodefs ? var->name
: named_function_string (name, function_cell (var), 1);
printf ("%s\n", t);
#if defined (DEBUGGER)
if (nodefs && debugging_mode)
{
shell_fn = find_function_def (var->name);
if (shell_fn)
printf ("%s %d %s\n", var->name, shell_fn->line, shell_fn->source_file);
else
printf ("%s\n", var->name);
}
else
#endif /* DEBUGGER */
{
t = nodefs ? var->name
: named_function_string (name, function_cell (var), 1);
printf ("%s\n", t);
}
}
else /* declare -[fF] -[rx] name [name...] */
{
@ -370,7 +386,7 @@ declare_internal (list, local_var)
/* Cannot use declare +a name to remove an array variable. */
if ((flags_off & att_array) && array_p (var))
{
builtin_error ("%s: cannot destroy array variables in this way", name);
builtin_error (_("%s: cannot destroy array variables in this way"), name);
any_failed++;
NEXT_VARIABLE ();
}

View file

@ -133,6 +133,8 @@ echo_builtin (list)
just_echo:
clearerr (stdout); /* clear error before writing and testing success */
while (list)
{
i = len = 0;

View file

@ -1,7 +1,7 @@
This file is enable.def, from which is created enable.c.
It implements the builtin "enable" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -50,6 +50,8 @@ $END
#include <stdio.h>
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "../builtins.h"
#include "../flags.h"
@ -123,7 +125,7 @@ enable_builtin (list)
filename = list_optarg;
break;
#else
builtin_error ("dynamic loading not available");
builtin_error (_("dynamic loading not available"));
return (EX_USAGE);
#endif
#if defined (HAVE_DLCLOSE)
@ -131,7 +133,7 @@ enable_builtin (list)
flags |= DFLAG;
break;
#else
builtin_error ("dynamic loading not available");
builtin_error (_("dynamic loading not available"));
return (EX_USAGE);
#endif /* HAVE_DLCLOSE */
default:
@ -197,7 +199,7 @@ enable_builtin (list)
if (opt == EXECUTION_FAILURE)
{
builtin_error ("%s: not a shell builtin", list->word->word);
sh_notbuiltin (list->word->word);
result = EXECUTION_FAILURE;
}
list = list->next;
@ -298,7 +300,7 @@ dyn_load_builtin (list, flags, filename)
if (handle == 0)
{
builtin_error ("cannot open shared object %s: %s", filename, dlerror ());
builtin_error (_("cannot open shared object %s: %s"), filename, dlerror ());
return (EXECUTION_FAILURE);
}
@ -321,8 +323,8 @@ dyn_load_builtin (list, flags, filename)
b = (struct builtin *)dlsym (handle, struct_name);
if (b == 0)
{
builtin_error ("cannot find %s in shared object %s: %s", struct_name,
filename, dlerror ());
builtin_error (_("cannot find %s in shared object %s: %s"),
struct_name, filename, dlerror ());
free (struct_name);
continue;
}
@ -440,12 +442,12 @@ dyn_unload_builtin (name)
b = builtin_address_internal (name, 1);
if (b == 0)
{
builtin_error ("%s: not a shell builtin", name);
sh_notbuiltin (name);
return (EXECUTION_FAILURE);
}
if (b->flags & STATIC_BUILTIN)
{
builtin_error ("%s: not dynamically loaded", name);
builtin_error (_("%s: not dynamically loaded"), name);
return (EXECUTION_FAILURE);
}
@ -460,7 +462,7 @@ dyn_unload_builtin (name)
using it drops to zero. */
if (ref == 1 && local_dlclose (handle) != 0)
{
builtin_error ("%s: cannot delete: %s", name, dlerror ());
builtin_error (_("%s: cannot delete: %s"), name, dlerror ());
return (EXECUTION_FAILURE);
}

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1996 Free Software Foundation, Inc.
/* Copyright (C) 1996-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -31,6 +31,7 @@
#include <errno.h>
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "../jobs.h"
@ -58,6 +59,7 @@ extern int errno;
#define FEVAL_HISTORY 0x020
#define FEVAL_CHECKBINARY 0x040
#define FEVAL_REGFILE 0x080
#define FEVAL_NOPUSHARGS 0x100
extern int posixly_correct;
extern int indirection_level, startup_state, subshell_environment;
@ -79,9 +81,28 @@ _evalfile (filename, flags)
struct stat finfo;
size_t file_size;
sh_vmsg_func_t *errfunc;
#if defined (ARRAY_VARS)
SHELL_VAR *funcname_v, *bash_source_v, *bash_lineno_v;
ARRAY *funcname_a, *bash_source_a, *bash_lineno_a;
# if defined (DEBUGGER)
SHELL_VAR *bash_argv_v, *bash_argc_v;
ARRAY *bash_argv_a, *bash_argc_a;
# endif
char *t, tt[2];
#endif
USE_VAR(pflags);
#if defined (ARRAY_VARS)
GET_ARRAY_FROM_VAR ("FUNCNAME", funcname_v, funcname_a);
GET_ARRAY_FROM_VAR ("BASH_SOURCE", bash_source_v, bash_source_a);
GET_ARRAY_FROM_VAR ("BASH_LINENO", bash_lineno_v, bash_lineno_a);
# if defined (DEBUGGER)
GET_ARRAY_FROM_VAR ("BASH_ARGV", bash_argv_v, bash_argv_a);
GET_ARRAY_FROM_VAR ("BASH_ARGC", bash_argc_v, bash_argc_a);
# endif
#endif
fd = open (filename, O_RDONLY);
if (fd < 0 || (fstat (fd, &finfo) == -1))
@ -104,12 +125,12 @@ file_error_and_exit:
if (S_ISDIR (finfo.st_mode))
{
(*errfunc) ("%s: is a directory", filename);
(*errfunc) (_("%s: is a directory"), filename);
return ((flags & FEVAL_BUILTIN) ? EXECUTION_FAILURE : -1);
}
else if ((flags & FEVAL_REGFILE) && S_ISREG (finfo.st_mode) == 0)
{
(*errfunc) ("%s: not a regular file", filename);
(*errfunc) (_("%s: not a regular file"), filename);
return ((flags & FEVAL_BUILTIN) ? EXECUTION_FAILURE : -1);
}
@ -117,7 +138,7 @@ file_error_and_exit:
/* Check for overflow with large files. */
if (file_size != finfo.st_size || file_size + 1 < file_size)
{
(*errfunc) ("%s: file is too large", filename);
(*errfunc) (_("%s: file is too large"), filename);
return ((flags & FEVAL_BUILTIN) ? EXECUTION_FAILURE : -1);
}
@ -176,8 +197,27 @@ file_error_and_exit:
return_catch_flag++;
sourcelevel++;
#if defined (ARRAY_VARS)
array_push (bash_source_a, (char *)filename);
t = itos (executing_line_number ());
array_push (bash_lineno_a, t);
free (t);
array_push (funcname_a, "source"); /* not exactly right */
# if defined (DEBUGGER)
/* Have to figure out a better way to do this when `source' is supplied
arguments */
if ((flags & FEVAL_NOPUSHARGS) == 0)
{
array_push (bash_argv_a, (char *)filename);
tt[0] = '1'; tt[1] = '\0';
array_push (bash_argc_a, tt);
}
# endif
#endif
/* set the flags to be passed to parse_and_execute */
pflags = (flags & FEVAL_HISTORY) ? 0 : SEVAL_NOHIST;
pflags = SEVAL_RESETLINE;
pflags |= (flags & FEVAL_HISTORY) ? 0 : SEVAL_NOHIST;
if (flags & FEVAL_BUILTIN)
result = EXECUTION_SUCCESS;
@ -205,6 +245,19 @@ file_error_and_exit:
COPY_PROCENV (old_return_catch, return_catch);
}
#if defined (ARRAY_VARS)
array_pop (bash_source_a);
array_pop (bash_lineno_a);
array_pop (funcname_a);
# if defined (DEBUGGER)
if ((flags & FEVAL_NOPUSHARGS) == 0)
{
array_pop (bash_argc_a);
array_pop (bash_argv_a);
}
# endif
#endif
return ((flags & FEVAL_BUILTIN) ? result : 1);
}
@ -240,14 +293,20 @@ fc_execute_file (filename)
#endif /* HISTORY */
int
source_file (filename)
source_file (filename, sflags)
const char *filename;
int sflags;
{
int flags;
int flags, rval;
flags = FEVAL_BUILTIN|FEVAL_UNWINDPROT|FEVAL_NONINT;
if (sflags)
flags |= FEVAL_NOPUSHARGS;
/* POSIX shells exit if non-interactive and file error. */
if (posixly_correct && !interactive_shell)
flags |= FEVAL_LONGJMP;
return (_evalfile (filename, flags));
rval = _evalfile (filename, flags);
run_return_trap ();
return rval;
}

View file

@ -84,6 +84,7 @@ parse_and_execute_cleanup ()
(flags & SEVAL_INTERACT) -> interactive = 1;
(flags & SEVAL_NOHIST) -> call bash_history_disable ()
(flags & SEVAL_NOFREE) -> don't free STRING when finished
(flags & SEVAL_RESETLINE) -> reset line_number to 1
*/
int
@ -92,7 +93,7 @@ parse_and_execute (string, from_file, flags)
const char *from_file;
int flags;
{
int code, x;
int code, x, lreset;
volatile int should_jump_to_top_level, last_result;
char *orig_string;
COMMAND *volatile command;
@ -107,6 +108,8 @@ parse_and_execute (string, from_file, flags)
if (flags & (SEVAL_NONINT|SEVAL_INTERACT))
unwind_protect_int (interactive);
lreset = flags & SEVAL_RESETLINE;
#if defined (HISTORY)
unwind_protect_int (remember_on_history); /* can be used in scripts */
# if defined (BANG_HISTORY)
@ -129,7 +132,15 @@ parse_and_execute (string, from_file, flags)
end_unwind_frame ();
parse_and_execute_level++;
push_stream (1); /* reset the line number */
/* Reset the line number if the caller wants us to. If we don't reset the
line number, we have to subtract one, because we will add one just
before executing the next command (resetting the line number sets it to
0; the first line number is 1). */
push_stream (lreset);
if (lreset == 0)
line_number--;
indirection_level++;
if (flags & (SEVAL_NONINT|SEVAL_INTERACT))
interactive = (flags & SEVAL_NONINT) ? 0 : 1;
@ -141,11 +152,12 @@ parse_and_execute (string, from_file, flags)
code = should_jump_to_top_level = 0;
last_result = EXECUTION_SUCCESS;
command = (COMMAND *)NULL;
with_input_from_string (string, from_file);
while (*(bash_input.location.string))
{
command = (COMMAND *)NULL;
if (interrupt_state)
{
last_result = EXECUTION_FAILURE;
@ -163,15 +175,18 @@ parse_and_execute (string, from_file, flags)
switch (code)
{
case FORCE_EOF:
case ERREXIT:
case EXITPROG:
run_unwind_frame ("pe_dispose");
if (command)
run_unwind_frame ("pe_dispose");
/* Remember to call longjmp (top_level) after the old
value for it is restored. */
should_jump_to_top_level = 1;
goto out;
case DISCARD:
run_unwind_frame ("pe_dispose");
if (command)
run_unwind_frame ("pe_dispose");
last_result = last_command_exit_value = EXECUTION_FAILURE; /* XXX */
if (subshell_environment)
{

View file

@ -1,7 +1,7 @@
This file is exec.def, from which is created exec.c.
It implements the builtin "exec" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -46,6 +46,7 @@ $END
#endif
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "../execute_cmd.h"
@ -201,15 +202,14 @@ exec_builtin (list)
if (executable_file (command) == 0)
{
builtin_error ("%s: cannot execute: %s", command, strerror (errno));
builtin_error (_("%s: cannot execute: %s"), command, strerror (errno));
exit_value = EX_NOEXEC; /* As per Posix.2, 3.14.6 */
}
else
file_error (command);
failed_exec:
if (command)
free (command);
FREE (command);
if (subshell_environment || (interactive == 0 && no_exit_on_failed_exec == 0))
exit_shell (exit_value);

View file

@ -1,7 +1,7 @@
This file is exit.def, from which is created exit.c.
It implements the builtins "exit", and "logout" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -37,6 +37,8 @@ $END
# include <unistd.h>
#endif
#include "../bashintl.h"
#include "../shell.h"
#include "../jobs.h"
@ -44,6 +46,7 @@ $END
#include "builtext.h" /* for jobs_builtin */
extern int last_command_exit_value;
extern int running_trap, trap_saved_exit_value;
extern int subshell_environment;
extern sh_builtin_func_t *this_shell_builtin;
extern sh_builtin_func_t *last_shell_builtin;
@ -77,7 +80,7 @@ logout_builtin (list)
{
if (login_shell == 0 /* && interactive */)
{
builtin_error ("not login shell: use `exit'");
builtin_error (_("not login shell: use `exit'"));
return (EXECUTION_FAILURE);
}
else
@ -105,7 +108,7 @@ exit_or_logout (list)
for (i = 0; i < job_slots; i++)
if (jobs[i] && STOPPED (i))
{
fprintf (stderr, "There are stopped jobs.\n");
fprintf (stderr, _("There are stopped jobs.\n"));
/* This is NOT superfluous because EOF can get here without
going through the command parser. Set both last and this
@ -120,8 +123,24 @@ exit_or_logout (list)
/* Get return value if present. This means that you can type
`logout 5' to a shell, and it returns 5. */
exit_value = get_exitstat (list);
/* If we're running the exit trap (running_trap == 1, since running_trap
gets set to SIG+1), and we don't have a argument given to `exit'
(list == 0), use the exit status we saved before running the trap
commands (trap_saved_exit_value). */
exit_value = (running_trap == 1 && list == 0) ? trap_saved_exit_value : get_exitstat (list);
bash_logout ();
last_command_exit_value = exit_value;
/* Exit the program. */
jump_to_top_level (EXITPROG);
/*NOTREACHED*/
}
void
bash_logout ()
{
/* Run our `~/.bash_logout' file if it exists, and this is a login shell. */
if (login_shell && sourced_logout++ == 0 && subshell_environment == 0)
{
@ -130,10 +149,4 @@ exit_or_logout (list)
maybe_execute_file (SYS_BASH_LOGOUT, 1);
#endif
}
last_command_exit_value = exit_value;
/* Exit the program. */
jump_to_top_level (EXITPROG);
/*NOTREACHED*/
}

View file

@ -1,7 +1,7 @@
This file is fc.def, from which is created fc.c.
It implements the builtin "fc" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -25,7 +25,6 @@ $BUILTIN fc
$FUNCTION fc_builtin
$DEPENDS_ON HISTORY
$SHORT_DOC fc [-e ename] [-nlr] [first] [last] or fc -s [pat=rep] [cmd]
fc is used to list or edit and re-execute commands from the history list.
FIRST and LAST can be numbers specifying the range, or FIRST can be a
string, which means the most recent command beginning with that
@ -54,7 +53,7 @@ $END
#endif
#include "../bashtypes.h"
#include "posixstat.h"
#ifndef _MINIX
#if ! defined(_MINIX) && defined (HAVE_SYS_FILE_H)
# include <sys/file.h>
#endif
@ -66,6 +65,7 @@ $END
#include <chartypes.h>
#include "../bashansi.h"
#include "../bashintl.h"
#include <errno.h>
#include "../shell.h"
@ -249,7 +249,7 @@ fc_builtin (list)
if (command == NULL)
{
builtin_error ("no command found");
builtin_error (_("no command found"));
if (rlist)
FREE_RLIST ();
@ -314,7 +314,7 @@ fc_builtin (list)
/* We print error messages for line specifications out of range. */
if ((histbeg < 0) || (histend < 0))
{
sh_erange ((char *)NULL, "history specification");
sh_erange ((char *)NULL, _("history specification"));
return (EXECUTION_FAILURE);
}
@ -335,7 +335,7 @@ fc_builtin (list)
stream = sh_mktmpfp ("bash-fc", MT_USERANDOM|MT_USETMPDIR, &fn);
if (stream == 0)
{
builtin_error ("cannot open temp file %s", fn ? fn : "");
builtin_error (_("%s: cannot open temp file: %s"), fn ? fn : "", strerror (errno));
FREE (fn);
return (EXECUTION_FAILURE);
}

View file

@ -1,7 +1,7 @@
This file is fg_bg.def, from which is created fg_bg.c.
It implements the builtins "bg" and "fg" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -39,6 +39,8 @@ $END
# include <unistd.h>
#endif
#include "../bashintl.h"
#include "../shell.h"
#include "../jobs.h"
#include "common.h"
@ -128,7 +130,7 @@ fg_bg (list, foreground)
/* Or if jobs[job]->pgrp == shell_pgrp. */
if (IS_JOBCONTROL (job) == 0)
{
builtin_error ("job %%%d started without job control", job + 1);
builtin_error (_("job %d started without job control"), job + 1);
goto failure;
}

View file

@ -28,6 +28,7 @@
#include <stdio.h>
#include "memalloc.h"
#include "../bashintl.h"
#include "../shell.h"
#include "getopt.h"
@ -105,8 +106,8 @@ int sh_badopt = 0;
ARGV-element, is returned in `sh_optarg'. */
/* 1003.2 specifies the format of this message. */
#define BADOPT(x) fprintf (stderr, "%s: illegal option -- %c\n", argv[0], x)
#define NEEDARG(x) fprintf (stderr, "%s: option requires an argument -- %c\n", argv[0], x)
#define BADOPT(x) fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], x)
#define NEEDARG(x) fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], x)
int
sh_getopt (argc, argv, optstring)

View file

@ -44,7 +44,7 @@ seen, getopts places the option character found into OPTARG. If a
required argument is not found, getopts places a ':' into NAME and
sets OPTARG to the option character found. If getopts is not in
silent mode, and an invalid option is seen, getopts places '?' into
NAME and unsets OPTARG. If a required option is not found, a '?'
NAME and unsets OPTARG. If a required argument is not found, a '?'
is placed in NAME, OPTARG is unset, and a diagnostic message is
printed.
@ -245,6 +245,7 @@ dogetopts (argc, argv)
if (ret == G_EOF)
{
unbind_variable ("OPTARG");
getopts_bind_variable (name, "?");
return (EXECUTION_FAILURE);
}

View file

@ -1,7 +1,7 @@
This file is hash.def, from which is created hash.c.
It implements the builtin "hash" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -49,6 +49,7 @@ $END
#include <errno.h>
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "../builtins.h"
@ -79,7 +80,7 @@ hash_builtin (list)
if (hashing_enabled == 0)
{
builtin_error ("hashing disabled");
builtin_error (_("hashing disabled"));
return (EXECUTION_FAILURE);
}
@ -124,7 +125,7 @@ hash_builtin (list)
if (list == 0 && expunge_hash_table == 0)
{
if (print_hashed_commands (list_portably) == 0)
printf ("%s: hash table empty\n", this_command_name);
printf (_("%s: hash table empty\n"), this_command_name);
return (EXECUTION_SUCCESS);
}

View file

@ -1,7 +1,7 @@
This file is help.def, from which is created help.c.
It implements the builtin "help" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -48,6 +48,8 @@ $END
#include <filecntl.h>
#include "../bashintl.h"
#include "../shell.h"
#include "../builtins.h"
#include "../pathexp.h"
@ -102,7 +104,10 @@ help_builtin (list)
if (glob_pattern_p (list->word->word))
{
printf ("Shell commands matching keyword%s `", list->next ? "s" : "");
if (list->next)
printf (_("Shell commands matching keywords `"));
else
printf (_("Shell commands matching keyword `"));
print_word_list (list, ", ");
printf ("'\n\n");
}
@ -130,7 +135,7 @@ help_builtin (list)
if (match_found == 0)
{
builtin_error ("no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'.", pattern, pattern, pattern);
builtin_error (_("no help topics match `%s'. Try `help help' or `man -k %s' or `info %s'."), pattern, pattern, pattern);
return (EXECUTION_FAILURE);
}
@ -156,7 +161,7 @@ show_longdoc (i)
fd = open (doc[0], O_RDONLY);
if (fd == -1)
{
builtin_error ("%s: cannot open: %s", doc[0], strerror (errno));
builtin_error (_("%s: cannot open: %s"), doc[0], strerror (errno));
return;
}
zcatfd (fd, 1, doc[0]);
@ -164,7 +169,7 @@ show_longdoc (i)
}
else
for (j = 0; doc[j]; j++)
printf (" %s\n", doc[j]);
printf (" %s\n", _(doc[j]));
}
static void
@ -174,13 +179,13 @@ show_builtin_command_help ()
char blurb[36];
printf (
"These shell commands are defined internally. Type `help' to see this list.\n\
_("These shell commands are defined internally. Type `help' to see this list.\n\
Type `help name' to find out more about the function `name'.\n\
Use `info bash' to find out more about the shell in general.\n\
Use `man -k' or `info' to find out more about commands not in this list.\n\
\n\
A star (*) next to a name means that the command is disabled.\n\
\n");
\n"));
for (i = 0; i < num_shell_builtins; i++)
{

View file

@ -1,7 +1,7 @@
This file is history.def, from which is created history.c.
It implements the builtin "history" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -34,20 +34,25 @@ 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.
Argument `-n' means to read all history lines not already read
from the history file and append them to the history list. If
FILENAME is given, then that is used as the history file else
from the history file and append them to the history list.
If FILENAME is given, then that is used as the history file else
if $HISTFILE has a value, that is used, else ~/.bash_history.
If the -s option is supplied, the non-option ARGs are appended to
the history list as a single entry. The -p option means to perform
history expansion on each ARG and display the result, without storing
anything in the history list.
If the $HISTTIMEFORMAT variable is set and not null, its value is used
as a format string for strftime(3) to print the time stamp associated
with each displayed history entry. No time stamps are printed otherwise.
$END
#include <config.h>
#if defined (HISTORY)
#include "../bashtypes.h"
#ifndef _MINIX
#if ! defined(_MINIX) && defined (HAVE_SYS_FILE_H)
# include <sys/file.h>
#endif
#include "posixstat.h"
@ -59,6 +64,7 @@ $END
#endif
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "../bashhist.h"
@ -72,6 +78,7 @@ extern int errno;
extern int current_command_line_count;
static char *histtime __P((HIST_ENTRY *, const char *));
static void display_history __P((WORD_LIST *));
static int delete_histent __P((int));
static int delete_last_history __P((void));
@ -91,7 +98,7 @@ int
history_builtin (list)
WORD_LIST *list;
{
int flags, opt, result, old_history_lines;
int flags, opt, result, old_history_lines, obase;
char *filename, *delete_arg;
intmax_t delete_offset;
@ -138,7 +145,7 @@ history_builtin (list)
opt = flags & (AFLAG|RFLAG|WFLAG|NFLAG);
if (opt && opt != AFLAG && opt != RFLAG && opt != WFLAG && opt != NFLAG)
{
builtin_error ("cannot use more than one of -anrw");
builtin_error (_("cannot use more than one of -anrw"));
return (EXECUTION_FAILURE);
}
@ -170,7 +177,7 @@ history_builtin (list)
|| (delete_offset < history_base)
|| (delete_offset > (history_base + history_length)))
{
sh_erange (delete_arg, "history position");
sh_erange (delete_arg, _("history position"));
return (EXECUTION_FAILURE);
}
opt = delete_offset;
@ -200,11 +207,23 @@ history_builtin (list)
{
/* Read all of the lines in the file that we haven't already read. */
old_history_lines = history_lines_in_file;
obase = history_base;
using_history ();
result = read_history_range (filename, history_lines_in_file, -1);
using_history ();
history_lines_in_file = where_history ();
history_lines_this_session += history_lines_in_file - old_history_lines;
/* The question is whether we reset history_lines_this_session to 0,
losing any history entries we had before we read the new entries
from the history file, or whether we count the new entries we just
read from the file as history lines added during this session.
Right now, we do the latter. This will cause these history entries
to be written to the history file along with any intermediate entries
we add when we do a `history -a', but the alternative is losing
them altogether. */
history_lines_this_session += history_lines_in_file - old_history_lines +
history_base - obase;
}
return (result ? EXECUTION_FAILURE : EXECUTION_SUCCESS);
@ -214,6 +233,22 @@ history_builtin (list)
#define histline(i) (hlist[(i)]->line)
#define histdata(i) (hlist[(i)]->data)
static char *
histtime (hlist, histtimefmt)
HIST_ENTRY *hlist;
const char *histtimefmt;
{
static char timestr[128];
time_t t;
t = history_get_time (hlist);
if (t)
strftime (timestr, sizeof (timestr), histtimefmt, localtime (&t));
else
strcpy (timestr, "??");
return timestr;
}
static void
display_history (list)
WORD_LIST *list;
@ -221,6 +256,7 @@ display_history (list)
register int i;
intmax_t limit;
HIST_ENTRY **hlist;
char *histtimefmt, *timestr;
if (list)
{
@ -243,11 +279,17 @@ display_history (list)
else
i = 0;
histtimefmt = get_string_value ("HISTTIMEFORMAT");
while (hlist[i])
{
QUIT;
printf ("%5d%c %s\n", i + history_base,
timestr = (histtimefmt && *histtimefmt) ? histtime (hlist[i], histtimefmt) : (char *)NULL;
printf ("%5d%c %s%s\n", i + history_base,
histdata(i) ? '*' : ' ',
((timestr && *timestr) ? timestr : ""),
histline(i));
i++;
}
@ -263,11 +305,8 @@ delete_histent (i)
discard = remove_history (i);
if (discard)
{
if (discard->line)
free (discard->line);
free ((char *) discard);
}
free_history_entry (discard);
return 1;
}
@ -276,6 +315,7 @@ delete_last_history ()
{
register int i;
HIST_ENTRY **hlist, *histent;
int r;
hlist = history_list ();
if (hlist == NULL)
@ -290,7 +330,12 @@ delete_last_history ()
if (histent == NULL)
return 0;
return (delete_histent (i));
r = delete_histent (i);
if (where_history () > history_length)
history_set_pos (history_length);
return r;
}
/* Remove the last entry in the history list and add each argument in
@ -342,7 +387,7 @@ expand_and_print_history (list)
r = history_expand (list->word->word, &s);
if (r < 0)
{
builtin_error ("%s: history expansion failed", list->word->word);
builtin_error (_("%s: history expansion failed"), list->word->word);
result = EXECUTION_FAILURE;
}
else

View file

@ -1,7 +1,7 @@
This file is jobs.def, from which is created jobs.c.
It implements the builtins "jobs" and "disown" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -46,6 +46,7 @@ $END
#endif
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "../jobs.h"
@ -74,9 +75,6 @@ jobs_builtin (list)
int form, execute, state, opt, any_failed, job;
sigset_t set, oset;
if (job_control == 0 && interactive_shell == 0)
return (EXECUTION_SUCCESS);
execute = any_failed = 0;
form = JLIST_STANDARD;
state = JSTATE_ANY;
@ -98,7 +96,7 @@ jobs_builtin (list)
case 'x':
if (form != JLIST_STANDARD)
{
builtin_error ("no other options allowed with `-x'");
builtin_error (_("no other options allowed with `-x'"));
return (EXECUTION_FAILURE);
}
execute++;
@ -163,6 +161,7 @@ execute_list_with_replacements (list)
{
register WORD_LIST *l;
int job, result;
COMMAND *command;
/* First do the replacement of job specifications with pids. */
for (l = list; l; l = l->next)
@ -182,21 +181,18 @@ execute_list_with_replacements (list)
/* Next make a new simple command and execute it. */
begin_unwind_frame ("jobs_builtin");
{
COMMAND *command = (COMMAND *)NULL;
add_unwind_protect (dispose_command, command);
command = make_bare_simple_command ();
command->value.Simple->words = copy_word_list (list);
command->value.Simple->redirects = (REDIRECT *)NULL;
command->flags |= CMD_INHIBIT_EXPANSION;
command->value.Simple->flags |= CMD_INHIBIT_EXPANSION;
command = make_bare_simple_command ();
command->value.Simple->words = copy_word_list (list);
command->value.Simple->redirects = (REDIRECT *)NULL;
command->flags |= CMD_INHIBIT_EXPANSION;
command->value.Simple->flags |= CMD_INHIBIT_EXPANSION;
add_unwind_protect (dispose_command, command);
result = execute_command (command);
dispose_command (command);
result = execute_command (command);
}
run_unwind_frame ("jobs_builtin");
discard_unwind_frame ("jobs_builtin");
return (result);
}
#endif /* JOB_CONTROL */

View file

@ -1,7 +1,7 @@
This file is kill.def, from which is created kill.c.
It implements the builtin "kill" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -23,7 +23,6 @@ $PRODUCES kill.c
$BUILTIN kill
$FUNCTION kill_builtin
$DEPENDS_ON JOB_CONTROL
$SHORT_DOC kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l [sigspec]
Send the processes named by PID (or JOB) the signal SIGSPEC. If
SIGSPEC is not present, then SIGTERM is assumed. An argument of `-l'
@ -46,6 +45,7 @@ $END
#endif
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "../trap.h"
@ -57,9 +57,10 @@ $END
extern int errno;
#endif /* !errno */
#if defined (JOB_CONTROL)
extern int posixly_correct;
static void kill_error __P((pid_t, int));
#if !defined (CONTINUE_AFTER_KILL_ERROR)
# define CONTINUE_OR_FAIL return (EXECUTION_FAILURE)
#else
@ -73,7 +74,7 @@ int
kill_builtin (list)
WORD_LIST *list;
{
int sig, any_succeeded, listing, saw_signal;
int sig, any_succeeded, listing, saw_signal, dflags;
char *sigspec, *word;
pid_t pid;
intmax_t pid_value;
@ -88,6 +89,7 @@ kill_builtin (list)
sig = SIGTERM;
sigspec = "TERM";
dflags = DSIG_NOCASE | ((posixly_correct == 0) ? DSIG_SIGPREFIX : 0);
/* Process options. */
while (list)
{
@ -107,7 +109,7 @@ kill_builtin (list)
if (sigspec[0] == '0' && sigspec[1] == '\0')
sig = 0;
else
sig = decode_signal (sigspec);
sig = decode_signal (sigspec, dflags);
list = list->next;
}
else
@ -132,7 +134,7 @@ kill_builtin (list)
else if ((*word == '-') && !saw_signal)
{
sigspec = word + 1;
sig = decode_signal (sigspec);
sig = decode_signal (sigspec, dflags);
saw_signal++;
list = list->next;
}
@ -169,16 +171,23 @@ kill_builtin (list)
pid = (pid_t) pid_value;
if ((pid < -1 ? kill_pid (-pid, sig, 1) : kill_pid (pid, sig, 0)) < 0)
goto signal_error;
{
if (errno == EINVAL)
sh_invalidsig (sigspec);
else
kill_error (pid, errno);
CONTINUE_OR_FAIL;
}
else
any_succeeded++;
}
#if defined (JOB_CONTROL)
else if (*list->word->word && *list->word->word != '%')
{
builtin_error ("%s: no such pid", list->word->word);
builtin_error (_("%s: arguments must be process or job IDs"), list->word->word);
CONTINUE_OR_FAIL;
}
else if (*word && (interactive || job_control))
else if (*word)
/* Posix.2 says you can kill without job control active (4.32.4) */
{ /* Must be a job spec. Check it out. */
int job;
@ -205,16 +214,16 @@ kill_builtin (list)
if (kill_pid (pid, sig, 1) < 0)
{
signal_error:
if (errno == EINVAL)
sh_invalidsig (sigspec);
else
builtin_error ("(%ld) - %s", (long)pid, strerror (errno));
kill_error (pid, errno);
CONTINUE_OR_FAIL;
}
else
any_succeeded++;
}
#endif /* !JOB_CONTROL */
else
{
sh_badpid (list->word->word);
@ -226,4 +235,16 @@ kill_builtin (list)
return (any_succeeded ? EXECUTION_SUCCESS : EXECUTION_FAILURE);
}
#endif /* JOB_CONTROL */
static void
kill_error (pid, e)
pid_t pid;
int e;
{
char *x;
x = strerror (e);
if (x == 0)
x = _("Unknown error");
builtin_error ("(%ld) - %s", (long)pid, x);
}

View file

@ -45,7 +45,7 @@ The levels are listed in order of decreasing precedence.
&& logical AND
|| logical OR
expr ? expr : expr
conditional expression
conditional operator
=, *=, /=, %=,
+=, -=, <<=, >>=,
&=, ^=, |= assignment
@ -72,6 +72,8 @@ $END
# include <unistd.h>
#endif
#include "../bashintl.h"
#include "../shell.h"
#include "common.h"
@ -89,7 +91,7 @@ let_builtin (list)
if (list == 0)
{
builtin_error ("expression expected");
builtin_error (_("expression expected"));
return (EXECUTION_FAILURE);
}
@ -114,7 +116,7 @@ exp_builtin (list)
if (list == 0)
{
builtin_error ("expression expected");
builtin_error (_("expression expected"));
return (EXECUTION_FAILURE);
}

View file

@ -29,8 +29,10 @@ Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#endif
#ifndef _MINIX
#include "../bashtypes.h"
#include <sys/file.h>
# include "../bashtypes.h"
# if defined (HAVE_SYS_FILE_H)
# include <sys/file.h>
# endif
#endif
#include "posixstat.h"
@ -1127,6 +1129,9 @@ write_file_headers (structfile, externfile)
fprintf (structfile, "#include \"%s\"\n",
extern_filename ? extern_filename : "builtext.h");
fprintf (structfile, "#include \"bashintl.h\"\n");
fprintf (structfile, "\nstruct builtin static_shell_builtins[] = {\n");
}
@ -1367,8 +1372,9 @@ write_documentation (stream, documentation, indentation, flags)
continue;
}
/* prefix with N_( for gettext */
if (string_array)
fprintf (stream, " \"");
fprintf (stream, " N_(\"");
if (indentation)
for (j = 0; j < indentation; j++)
@ -1390,7 +1396,8 @@ write_documentation (stream, documentation, indentation, flags)
}
}
fprintf (stream, "\",\n");
/* closing right paren for gettext */
fprintf (stream, "\"),\n");
}
else if (texinfo)
{

View file

@ -1,7 +1,7 @@
This file is printf.def, from which is created printf.c.
It implements the builtin "printf" in Bash.
Copyright (C) 1997-2002 Free Software Foundation, Inc.
Copyright (C) 1997-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -55,6 +55,7 @@ $END
#endif
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "stdc.h"
@ -105,7 +106,7 @@ extern int errno;
static void printf_erange __P((char *));
static void printstr __P((char *, char *, int, int, int));
static int tescape __P((char *, int, char *, int *));
static int tescape __P((char *, char *, int *));
static char *bexpand __P((char *, int, int *, int *));
static char *mklong __P((char *, char *, size_t));
static int getchr __P((void));
@ -114,7 +115,7 @@ static int getint __P((void));
static intmax_t getintmax __P((void));
static uintmax_t getuintmax __P((void));
#if defined (HAVE_LONG_DOUBLE) && HAVE_DECL_STRTOLD
#if defined (HAVE_LONG_DOUBLE) && HAVE_DECL_STRTOLD && !defined(STRTOLD_BROKEN)
typedef long double floatmax_t;
# define FLOATMAX_CONV "L"
# define strtofltmax strtold
@ -182,13 +183,12 @@ printf_builtin (list)
precision = fieldwidth = 0;
have_fieldwidth = have_precision = 0;
if (*fmt == '\\')
{
fmt++;
/* A NULL fourth argument to tescape means to not do special
processing for \c. */
fmt += tescape (fmt, 1, &nextch, (int *)NULL);
/* A NULL third argument to tescape means to bypass the
special processing for arguments to %b. */
fmt += tescape (fmt, &nextch, (int *)NULL);
putchar (nextch);
fmt--; /* for loop will increment it for us again */
continue;
@ -246,7 +246,7 @@ printf_builtin (list)
if (*fmt == 0)
{
builtin_error ("`%s': missing format character", start);
builtin_error (_("`%s': missing format character"), start);
PRETURN (EXECUTION_FAILURE);
}
@ -405,7 +405,7 @@ printf_builtin (list)
/* We don't output unrecognized format characters; we print an
error message and return a failure exit status. */
default:
builtin_error ("`%c': invalid format character", convch);
builtin_error (_("`%c': invalid format character"), convch);
PRETURN (EXECUTION_FAILURE);
}
@ -531,6 +531,7 @@ printstr (fmt, string, len, fieldwidth, precision)
/* Convert STRING by expanding the escape sequences specified by the
POSIX standard for printf's `%b' format string. If SAWC is non-null,
perform the processing appropriate for %b arguments. In particular,
recognize `\c' and use that as a string terminator. If we see \c, set
*SAWC to 1 before returning. LEN is the length of STRING. */
@ -540,11 +541,10 @@ printstr (fmt, string, len, fieldwidth, precision)
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. */
sequence; we also bypass the other processing specific to %b arguments. */
static int
tescape (estart, trans_squote, cp, sawc)
tescape (estart, cp, sawc)
char *estart;
int trans_squote;
char *cp;
int *sawc;
{
@ -576,14 +576,13 @@ tescape (estart, trans_squote, cp, sawc)
case 'v': *cp = '\v'; break;
/* %b octal constants are `\0' followed by one, two, or three
octal digits... */
case '0':
/* 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'), evalue = c - '0'; ISOCTAL (*p) && temp--; p++)
/* The octal escape sequences are `\0' followed by up to three octal
digits (if SAWC), or `\' followed by up to three octal digits (if
!SAWC). As an extension, we allow the latter form even if SAWC. */
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
evalue = OCTVALUE (c);
for (temp = 2 + (!evalue && !!sawc); ISOCTAL (*p) && temp--; p++)
evalue = (evalue * 8) + OCTVALUE (*p);
*cp = evalue & 0xFF;
break;
@ -591,11 +590,15 @@ tescape (estart, trans_squote, cp, sawc)
/* And, as another extension, we allow \xNNN, where each N is a
hex digit. */
case 'x':
#if 0
for (evalue = 0; ISXDIGIT ((unsigned char)*p); p++)
#else
for (temp = 2, evalue = 0; ISXDIGIT ((unsigned char)*p) && temp--; p++)
#endif
evalue = (evalue * 16) + HEXVALUE (*p);
if (temp == 2)
if (p == estart + 1)
{
builtin_error ("missing hex digit for \\x");
builtin_error (_("missing hex digit for \\x"));
*cp = '\\';
return 0;
}
@ -606,8 +609,11 @@ tescape (estart, trans_squote, cp, sawc)
*cp = c;
break;
case '\'': /* TRANS_SQUOTE != 0 means \' -> ' */
if (trans_squote)
/* SAWC == 0 means that \', \", and \? are recognized as escape
sequences, though the only processing performed is backslash
removal. */
case '\'': case '"': case '?':
if (!sawc)
*cp = c;
else
{
@ -657,7 +663,7 @@ bexpand (string, len, sawc, lenp)
continue;
}
temp = 0;
s += tescape (s, 0, &c, &temp);
s += tescape (s, &c, &temp);
if (temp)
{
if (sawc)

View file

@ -1,7 +1,7 @@
This file is pushd.def, from which is created pushd.c. It implements the
builtins "pushd", "popd", and "dirs" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -107,6 +107,7 @@ $END
#endif
#include "../bashansi.h"
#include "../bashintl.h"
#include <errno.h>
@ -164,7 +165,7 @@ pushd_builtin (list)
{
if (directory_list_offset == 0)
{
builtin_error ("no other directory");
builtin_error (_("no other directory"));
return (EXECUTION_FAILURE);
}
@ -431,7 +432,7 @@ dirs_builtin (list)
{
temp = get_working_directory ("dirs");
if (temp == 0)
temp = savestring ("<no current directory>");
temp = savestring (_("<no current directory>"));
if (vflag & 2)
printf ("%2d %s", 0, DIRSTACK_FORMAT (temp));
else
@ -648,66 +649,66 @@ get_directory_stack ()
#ifdef LOADABLE_BUILTIN
static char *dirs_doc[] = {
"Display the list of currently remembered directories. Directories",
"find their way onto the list with the `pushd' command; you can get",
"back up through the list with the `popd' command.",
"",
"The -l flag specifies that `dirs' should not print shorthand versions",
"of directories which are relative to your home directory. This means",
"that `~/bin' might be displayed as `/homes/bfox/bin'. The -v flag",
"causes `dirs' to print the directory stack with one entry per line,",
"prepending the directory name with its position in the stack. The -p",
"flag does the same thing, but the stack position is not prepended.",
"The -c flag clears the directory stack by deleting all of the elements.",
"",
"+N displays the Nth entry counting from the left of the list shown by",
" dirs when invoked without options, starting with zero.",
"",
"-N displays the Nth entry counting from the right of the list shown by",
" dirs when invoked without options, starting with zero.",
N_("Display the list of currently remembered directories. Directories"),
N_("find their way onto the list with the `pushd' command; you can get"),
N_("back up through the list with the `popd' command."),
N_(""),
N_("The -l flag specifies that `dirs' should not print shorthand versions"),
N_("of directories which are relative to your home directory. This means"),
N_("that `~/bin' might be displayed as `/homes/bfox/bin'. The -v flag"),
N_("causes `dirs' to print the directory stack with one entry per line,"),
N_("prepending the directory name with its position in the stack. The -p"),
N_("flag does the same thing, but the stack position is not prepended."),
N_("The -c flag clears the directory stack by deleting all of the elements."),
N_(""),
N_("+N displays the Nth entry counting from the left of the list shown by"),
N_(" dirs when invoked without options, starting with zero."),
N_(""),
N_("-N displays the Nth entry counting from the right of the list shown by"),
N_(" dirs when invoked without options, starting with zero."),
(char *)NULL
};
static char *pushd_doc[] = {
"Adds a directory to the top of the directory stack, or rotates",
"the stack, making the new top of the stack the current working",
"directory. With no arguments, exchanges the top two directories.",
"",
"+N Rotates the stack so that the Nth directory (counting",
" from the left of the list shown by `dirs', starting with",
" zero) is at the top.",
"",
"-N Rotates the stack so that the Nth directory (counting",
" from the right of the list shown by `dirs', starting with",
" zero) is at the top.",
"",
"-n suppress the normal change of directory when adding directories",
" to the stack, so only the stack is manipulated.",
"",
"dir adds DIR to the directory stack at the top, making it the",
" new current working directory.",
"",
"You can see the directory stack with the `dirs' command.",
N_("Adds a directory to the top of the directory stack, or rotates"),
N_("the stack, making the new top of the stack the current working"),
N_("directory. With no arguments, exchanges the top two directories."),
N_(""),
N_("+N Rotates the stack so that the Nth directory (counting"),
N_(" from the left of the list shown by `dirs', starting with"),
N_(" zero) is at the top."),
N_(""),
N_("-N Rotates the stack so that the Nth directory (counting"),
N_(" from the right of the list shown by `dirs', starting with"),
N_(" zero) is at the top."),
N_(""),
N_("-n suppress the normal change of directory when adding directories"),
N_(" to the stack, so only the stack is manipulated."),
N_(""),
N_("dir adds DIR to the directory stack at the top, making it the"),
N_(" new current working directory."),
N_(""),
N_("You can see the directory stack with the `dirs' command."),
(char *)NULL
};
static char *popd_doc[] = {
"Removes entries from the directory stack. With no arguments,",
"removes the top directory from the stack, and cd's to the new",
"top directory.",
"",
"+N removes the Nth entry counting from the left of the list",
" shown by `dirs', starting with zero. For example: `popd +0'",
" removes the first directory, `popd +1' the second.",
"",
"-N removes the Nth entry counting from the right of the list",
" shown by `dirs', starting with zero. For example: `popd -0'",
" removes the last directory, `popd -1' the next to last.",
"",
"-n suppress the normal change of directory when removing directories",
" from the stack, so only the stack is manipulated.",
"",
"You can see the directory stack with the `dirs' command.",
N_("Removes entries from the directory stack. With no arguments,"),
N_("removes the top directory from the stack, and cd's to the new"),
N_("top directory."),
N_(""),
N_("+N removes the Nth entry counting from the left of the list"),
N_(" shown by `dirs', starting with zero. For example: `popd +0'"),
N_(" removes the first directory, `popd +1' the second."),
N_(""),
N_("-N removes the Nth entry counting from the right of the list"),
N_(" shown by `dirs', starting with zero. For example: `popd -0'"),
N_(" removes the last directory, `popd -1' the next to last."),
N_(""),
N_("-n suppress the normal change of directory when removing directories"),
N_(" from the stack, so only the stack is manipulated."),
N_(""),
N_("You can see the directory stack with the `dirs' command."),
(char *)NULL
};

View file

@ -1,7 +1,7 @@
This file is read.def, from which is created read.c.
It implements the builtin "read" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -66,6 +66,8 @@ $END
# include <io.h>
#endif
#include "../bashintl.h"
#include "../shell.h"
#include "common.h"
#include "bashgetopt.h"
@ -202,7 +204,7 @@ read_builtin (list)
code = legal_number (list_optarg, &intval);
if (code == 0 || intval < 0 || intval != (unsigned int)intval)
{
builtin_error ("%s: invalid timeout specification", list_optarg);
builtin_error (_("%s: invalid timeout specification"), list_optarg);
return (EXECUTION_FAILURE);
}
else
@ -225,14 +227,14 @@ read_builtin (list)
code = legal_number (list_optarg, &intval);
if (code == 0 || intval < 0 || intval != (int)intval)
{
builtin_error ("%s: invalid file descriptor specification", list_optarg);
builtin_error (_("%s: invalid file descriptor specification"), list_optarg);
return (EXECUTION_FAILURE);
}
else
fd = intval;
if (sh_validfd (fd) == 0)
{
builtin_error ("%d: invalid file descriptor: %s", fd, strerror (errno));
builtin_error (_("%d: invalid file descriptor: %s"), fd, strerror (errno));
return (EXECUTION_FAILURE);
}
break;
@ -458,7 +460,7 @@ read_builtin (list)
#if 1
if (retval < 0)
{
builtin_error ("read error: %d: %s", fd, strerror (errno));
builtin_error (_("read error: %d: %s"), fd, strerror (errno));
return (EXECUTION_FAILURE);
}
#endif
@ -497,6 +499,13 @@ read_builtin (list)
an assign them to `arrayname' in turn. */
if (arrayname)
{
if (legal_identifier (arrayname) == 0)
{
sh_invalidid (arrayname);
xfree (input_string);
return (EXECUTION_FAILURE);
}
var = find_or_make_array_variable (arrayname, 1);
if (var == 0)
return EXECUTION_FAILURE; /* readonly or noassign */
@ -505,6 +514,7 @@ read_builtin (list)
alist = list_string (input_string, ifs_chars, 0);
if (alist)
{
word_list_remove_quoted_nulls (alist);
assign_array_var_from_word_list (var, alist);
dispose_words (alist);
}

View file

@ -1,7 +1,7 @@
This file is return.def, from which is created return.c.
It implements the builtin "return" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -38,6 +38,8 @@ $END
# include <unistd.h>
#endif
#include "../bashintl.h"
#include "../shell.h"
#include "common.h"
@ -58,7 +60,7 @@ return_builtin (list)
longjmp (return_catch, 1);
else
{
builtin_error ("can only `return' from a function or sourced script");
builtin_error (_("can only `return' from a function or sourced script"));
return (EXECUTION_FAILURE);
}
}

View file

@ -33,6 +33,7 @@ $PRODUCES set.c
#include <stdio.h>
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "../flags.h"
@ -77,6 +78,8 @@ $SHORT_DOC set [--abefhkmnptuvxBCHP] [-o option] [arg ...]
emacs use an emacs-style line editing interface
#endif /* READLINE */
errexit same as -e
errtrace same as -E
functrace same as -T
hashall same as -h
#if defined (BANG_HISTORY)
histexpand same as -H
@ -97,6 +100,9 @@ $SHORT_DOC set [--abefhkmnptuvxBCHP] [-o option] [arg ...]
nounset same as -u
onecmd same as -t
physical same as -P
pipefail the return value of a pipeline is the status of
the last command to exit with a non-zero status,
or zero if no command exited with a non-zero status
posix change the behavior of bash where the default
operation differs from the 1003.2 standard to
match the standard
@ -119,12 +125,14 @@ $SHORT_DOC set [--abefhkmnptuvxBCHP] [-o option] [arg ...]
#endif /* BRACE_EXPANSION */
-C If set, disallow existing regular files to be overwritten
by redirection of output.
-E If set, the ERR trap is inherited by shell functions.
#if defined (BANG_HISTORY)
-H Enable ! style history substitution. This flag is on
by default.
#endif /* BANG_HISTORY */
-P If set, do not follow symbolic links when executing commands
such as cd which change the current directory.
-T If set, the DEBUG trap is inherited by shell functions.
Using + rather than - causes these flags to be turned off. The
flags can also be used upon invocation of the shell. The current
@ -172,6 +180,8 @@ struct {
{ "emacs", '\0', (int *)NULL, set_edit_mode, get_edit_mode },
#endif
{ "errexit", 'e', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
{ "errtrace", 'E', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
{ "functrace", 'T', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
{ "hashall", 'h', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
#if defined (BANG_HISTORY)
{ "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
@ -195,6 +205,7 @@ struct {
{ "nounset", 'u', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
{ "onecmd", 't', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
{ "physical", 'P', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
{ "pipefail", '\0', &pipefail_opt, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
{ "posix", '\0', &posixly_correct, set_posix_mode, (setopt_get_func_t *)NULL },
{ "privileged", 'p', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
{ "verbose", 'v', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
@ -729,7 +740,7 @@ unset_builtin (list)
if (unset_function && unset_variable)
{
builtin_error ("cannot simultaneously unset a function and a variable");
builtin_error (_("cannot simultaneously unset a function and a variable"));
return (EXECUTION_FAILURE);
}
@ -766,14 +777,14 @@ unset_builtin (list)
if (var && !unset_function && non_unsettable_p (var))
{
builtin_error ("%s: cannot unset", name);
builtin_error (_("%s: cannot unset"), name);
NEXT_VARIABLE ();
}
/* Posix.2 says that unsetting readonly variables is an error. */
if (var && readonly_p (var))
{
builtin_error ("%s: cannot unset: readonly %s",
builtin_error (_("%s: cannot unset: readonly %s"),
name, unset_function ? "function" : "variable");
NEXT_VARIABLE ();
}
@ -784,7 +795,7 @@ unset_builtin (list)
{
if (array_p (var) == 0)
{
builtin_error ("%s: not an array variable", name);
builtin_error (_("%s: not an array variable"), name);
NEXT_VARIABLE ();
}
else

View file

@ -1,7 +1,7 @@
This file is setattr.def, from which is created setattr.c.
It implements the builtins "export" and "readonly", in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -32,6 +32,7 @@ $PRODUCES setattr.c
#include <stdio.h>
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "common.h"
@ -75,13 +76,12 @@ export_builtin (list)
$BUILTIN readonly
$FUNCTION readonly_builtin
$SHORT_DOC readonly [-anf] [name[=value] ...] or readonly -p
$SHORT_DOC readonly [-af] [name[=value] ...] or readonly -p
The given NAMEs are marked readonly and the values of these NAMEs may
not be changed by subsequent assignment. If the -f option is given,
then functions corresponding to the NAMEs are so marked. If no
arguments are given, or if `-p' is given, a list of all readonly names
is printed. An argument of `-n' says to remove the readonly property
from subsequent NAMEs. The `-a' option means to treat each NAME as
is printed. The `-a' option means to treat each NAME as
an array variable. An argument of `--' disables further option
processing.
$END
@ -103,7 +103,7 @@ readonly_builtin (list)
/* For each variable name in LIST, make that variable have the specified
ATTRIBUTE. An arg of `-n' says to remove the attribute from the the
remaining names in LIST. */
remaining names in LIST (doesn't work for readonly). */
int
set_or_show_attributes (list, attribute, nodefs)
register WORD_LIST *list;
@ -162,7 +162,7 @@ set_or_show_attributes (list, attribute, nodefs)
var = find_function (name);
if (var == 0)
{
builtin_error ("%s: not a function", name);
builtin_error (_("%s: not a function"), name);
any_failed++;
}
else
@ -173,7 +173,7 @@ set_or_show_attributes (list, attribute, nodefs)
}
/* xxx [-np] name[=value] */
assign = assignment (name);
assign = assignment (name, 0);
if (assign)
name[assign] = '\0';

View file

@ -1,7 +1,7 @@
This file is shift.def, from which is created shift.c.
It implements the builtin "shift" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -31,6 +31,7 @@ $PRODUCES shift.c
#endif
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "common.h"
@ -62,13 +63,13 @@ shift_builtin (list)
return (EXECUTION_SUCCESS);
else if (times < 0)
{
sh_erange (list->word->word, "shift count");
sh_erange (list ? list->word->word : NULL, _("shift count"));
return (EXECUTION_FAILURE);
}
else if (times > number_of_args ())
{
if (print_shift_error)
sh_erange (list->word->word, "shift count");
sh_erange (list ? list->word->word : NULL, _("shift count"));
return (EXECUTION_FAILURE);
}

View file

@ -1,7 +1,7 @@
This file is shopt.def, from which is created shopt.c.
It implements the Bash `shopt' builtin.
Copyright (C) 1994-2002 Free Software Foundation, Inc.
Copyright (C) 1994-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -45,6 +45,8 @@ $END
#include <stdio.h>
#include "../bashintl.h"
#include "../shell.h"
#include "../flags.h"
#include "common.h"
@ -55,15 +57,17 @@ $END
#define OPTFMT "%-15s\t%s\n"
extern int allow_null_glob_expansion, glob_dot_filenames;
extern int allow_null_glob_expansion, fail_glob_expansion, glob_dot_filenames;
extern int cdable_vars, mail_warning, source_uses_path;
extern int no_exit_on_failed_exec, print_shift_error;
extern int check_hashed_filenames, promptvars;
extern int cdspelling, expand_aliases;
extern int extended_quote;
extern int check_window_size;
extern int glob_ignore_case;
extern int hup_on_exit;
extern int xpg_echo;
extern int gnu_error_format;
#if defined (EXTENDED_GLOB)
extern int extended_glob;
@ -77,6 +81,7 @@ extern int force_append_history;
#if defined (READLINE)
extern int hist_verify, history_reediting, perform_hostname_completion;
extern int no_empty_command_completion;
extern int force_fignore;
extern int enable_hostname_completion __P((int));
#endif
@ -88,9 +93,13 @@ extern int prog_completion_enabled;
extern char *shell_name;
#endif
#if defined (DEBUGGER)
extern int debugging_mode;
#endif
static void shopt_error __P((char *));
static int set_interactive_comments __P((int));
static int set_shellopts_after_change __P((int));
#if defined (RESTRICTED_SHELL)
static int set_restricted_shell __P((int));
@ -115,10 +124,17 @@ static struct {
{ "dotglob", &glob_dot_filenames, (shopt_set_func_t *)NULL },
{ "execfail", &no_exit_on_failed_exec, (shopt_set_func_t *)NULL },
{ "expand_aliases", &expand_aliases, (shopt_set_func_t *)NULL },
#if defined (DEBUGGER)
{ "extdebug", &debugging_mode, (shopt_set_func_t *)NULL },
#endif
#if defined (EXTENDED_GLOB)
{ "extglob", &extended_glob, (shopt_set_func_t *)NULL },
#endif
{ "extquote", &extended_quote, (shopt_set_func_t *)NULL },
{ "failglob", &fail_glob_expansion, (shopt_set_func_t *)NULL },
#if defined (READLINE)
{ "force_fignore", &force_fignore, (shopt_set_func_t *)NULL },
{ "gnu_errfmt", &gnu_error_format, (shopt_set_func_t *)NULL },
{ "histreedit", &history_reediting, (shopt_set_func_t *)NULL },
#endif
#if defined (HISTORY)
@ -129,7 +145,7 @@ static struct {
{ "hostcomplete", &perform_hostname_completion, enable_hostname_completion },
#endif
{ "huponexit", &hup_on_exit, (shopt_set_func_t *)NULL },
{ "interactive_comments", &interactive_comments, set_interactive_comments },
{ "interactive_comments", &interactive_comments, set_shellopts_after_change },
#if defined (HISTORY)
{ "lithist", &literal_history, (shopt_set_func_t *)NULL },
#endif
@ -207,7 +223,7 @@ shopt_builtin (list)
if ((flags & (SFLAG|UFLAG)) == (SFLAG|UFLAG))
{
builtin_error ("cannot set and unset shell options simultaneously");
builtin_error (_("cannot set and unset shell options simultaneously"));
return (EXECUTION_FAILURE);
}
@ -272,7 +288,7 @@ static void
shopt_error (s)
char *s;
{
builtin_error ("%s: invalid shell option name", s);
builtin_error (_("%s: invalid shell option name"), s);
}
static int
@ -435,7 +451,7 @@ set_shopt_o_options (mode, list, quiet)
/* If we set or unset interactive_comments with shopt, make sure the
change is reflected in $SHELLOPTS. */
static int
set_interactive_comments (mode)
set_shellopts_after_change (mode)
int mode;
{
set_shellopts ();

View file

@ -1,7 +1,7 @@
This file is source.def, from which is created source.c.
It implements the builtins "." and "source" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -23,16 +23,20 @@ $PRODUCES source.c
$BUILTIN source
$FUNCTION source_builtin
$SHORT_DOC source filename
$SHORT_DOC source filename [arguments]
Read and execute commands from FILENAME and return. The pathnames
in $PATH are used to find the directory containing FILENAME.
in $PATH are used to find the directory containing FILENAME. If any
ARGUMENTS are supplied, they become the positional parameters when
FILENAME is executed.
$END
$BUILTIN .
$DOCNAME dot
$FUNCTION source_builtin
$SHORT_DOC . filename
$SHORT_DOC . filename [arguments]
Read and execute commands from FILENAME and return. The pathnames
in $PATH are used to find the directory containing FILENAME.
in $PATH are used to find the directory containing FILENAME. If any
ARGUMENTS are supplied, they become the positional parameters when
FILENAME is executed.
$END
/* source.c - Implements the `.' and `source' builtins. */
@ -41,7 +45,7 @@ $END
#include "../bashtypes.h"
#include "posixstat.h"
#include "filecntl.h"
#ifndef _MINIX
#if ! defined(_MINIX) && defined (HAVE_SYS_FILE_H)
# include <sys/file.h>
#endif
#include <errno.h>
@ -51,11 +55,14 @@ $END
#endif
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "../flags.h"
#include "../findcmd.h"
#include "common.h"
#include "bashgetopt.h"
#include "../trap.h"
#if !defined (errno)
extern int errno;
@ -85,6 +92,8 @@ maybe_pop_dollar_vars ()
dispose_saved_dollar_vars ();
else
pop_dollar_vars ();
if (debugging_mode)
pop_args (); /* restore BASH_ARGC and BASH_ARGV */
set_dollar_vars_unchanged ();
}
@ -97,7 +106,7 @@ source_builtin (list)
WORD_LIST *list;
{
int result;
char *filename;
char *filename, *debug_trap;
if (no_options (list))
return (EX_USAGE);
@ -105,7 +114,7 @@ source_builtin (list)
if (list == 0)
{
builtin_error ("filename argument required");
builtin_error (_("filename argument required"));
builtin_usage ();
return (EX_USAGE);
}
@ -125,7 +134,7 @@ source_builtin (list)
{
if (source_searches_cwd == 0)
{
builtin_error ("%s: file not found", list->word->word);
builtin_error (_("%s: file not found"), list->word->word);
return (EXECUTION_FAILURE);
}
else
@ -140,10 +149,24 @@ source_builtin (list)
push_dollar_vars ();
add_unwind_protect ((Function *)maybe_pop_dollar_vars, (char *)NULL);
remember_args (list->next, 1);
if (debugging_mode)
push_args (list->next); /* Update BASH_ARGV and BASH_ARGC */
}
set_dollar_vars_unchanged ();
result = source_file (filename);
/* Don't inherit the DEBUG trap unless function_trace_mode (overloaded)
is set. XXX - should sourced files inherit the RETURN trap? Functions
don't. */
debug_trap = TRAP_STRING (DEBUG_TRAP);
if (debug_trap && function_trace_mode == 0)
{
debug_trap = savestring (debug_trap);
add_unwind_protect (xfree, debug_trap);
add_unwind_protect (set_debug_trap, debug_trap);
restore_default_signal (DEBUG_TRAP);
}
result = source_file (filename, (list && list->next));
run_unwind_frame ("source");

View file

@ -1,7 +1,7 @@
This file is suspend.def, from which is created suspend.c.
It implements the builtin "suspend" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -42,6 +42,7 @@ $END
#include "../bashtypes.h"
#include <signal.h>
#include "../bashintl.h"
#include "../shell.h"
#include "../jobs.h"
#include "common.h"
@ -89,7 +90,7 @@ suspend_builtin (list)
if (job_control == 0)
{
sh_nojobs ("cannot suspend");
sh_nojobs (_("cannot suspend"));
return (EXECUTION_FAILURE);
}
@ -99,11 +100,14 @@ suspend_builtin (list)
if (login_shell)
{
builtin_error ("cannot suspend a login shell");
builtin_error (_("cannot suspend a login shell"));
return (EXECUTION_FAILURE);
}
}
/* XXX - should we put ourselves back into the original pgrp now? If so,
call end_job_control() here and do the right thing in suspend_continue
(that is, call restart_job_control()). */
old_cont = (SigHandler *)set_signal_handler (SIGCONT, suspend_continue);
#if 0
old_stop = (SigHandler *)set_signal_handler (SIGSTOP, SIG_DFL);

View file

@ -1,7 +1,7 @@
This file is trap.def, from which is created trap.c.
It implements the builtin "trap" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -23,20 +23,21 @@ $PRODUCES trap.c
$BUILTIN trap
$FUNCTION trap_builtin
$SHORT_DOC trap [arg] [signal_spec ...] or trap -l
$SHORT_DOC trap [-lp] [[arg] signal_spec ...]
The command ARG is to be read and executed when the shell receives
signal(s) SIGNAL_SPEC. If ARG is absent all specified signals are
reset to their original values. If ARG is the null string each
SIGNAL_SPEC is ignored by the shell and by the commands it invokes.
If a SIGNAL_SPEC is EXIT (0) the command ARG is executed on exit from
the shell. If a SIGNAL_SPEC is DEBUG, ARG is executed after every
command. If ARG is `-p' then the trap commands associated with
each SIGNAL_SPEC are displayed. If no arguments are supplied or if
only `-p' is given, trap prints the list of commands associated with
each signal number. Each SIGNAL_SPEC is either a signal name in <signal.h>
or a signal number. `trap -l' prints a list of signal names and their
corresponding numbers. Note that a signal can be sent to the shell
with "kill -signal $$".
signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC
is supplied) or `-', each specified signal is reset to its original
value. If ARG is the null string each SIGNAL_SPEC is ignored by the
shell and by the commands it invokes. If a SIGNAL_SPEC is EXIT (0)
the command ARG is executed on exit from the shell. If a SIGNAL_SPEC
is DEBUG, ARG is executed after every simple command. If the`-p' option
is supplied then the trap commands associated with each SIGNAL_SPEC are
displayed. If no arguments are supplied or if only `-p' is given, trap
prints the list of commands associated with each signal. Each SIGNAL_SPEC
is either a signal name in <signal.h> or a signal number. Signal names
are case insensitive and the SIG prefix is optional. `trap -l' prints
a list of signal names and their corresponding numbers. Note that a
signal can be sent to the shell with "kill -signal $$".
$END
#include <config.h>
@ -108,6 +109,8 @@ trap_builtin (list)
}
list = loptend;
opt = DSIG_NOCASE|DSIG_SIGPREFIX; /* flags for decode_signal */
if (list_signal_names)
return (display_signal_list ((WORD_LIST *)NULL, 1));
else if (display || list == 0)
@ -119,13 +122,22 @@ trap_builtin (list)
operation = SET;
first_arg = list->word->word;
if (first_arg && *first_arg && (*first_arg != '-' || first_arg[1]) &&
signal_object_p (first_arg))
/* When in posix mode, the historical behavior of looking for a
missing first argument is disabled. To revert to the original
signal handling disposition, use `-' as the first argument. */
if (posixly_correct == 0 && first_arg && *first_arg &&
(*first_arg != '-' || first_arg[1]) &&
signal_object_p (first_arg, opt) && list->next == 0)
operation = REVERT;
else
{
list = list->next;
if (*first_arg == '\0')
if (list == 0)
{
builtin_usage ();
return (EX_USAGE);
}
else if (*first_arg == '\0')
operation = IGNORE;
else if (first_arg[0] == '-' && !first_arg[1])
operation = REVERT;
@ -133,7 +145,7 @@ trap_builtin (list)
while (list)
{
sig = decode_signal (list->word->word);
sig = decode_signal (list->word->word, opt);
if (sig == NO_SIG)
{
@ -235,7 +247,7 @@ display_traps (list)
for (result = EXECUTION_SUCCESS; list; list = list->next)
{
i = decode_signal (list->word->word);
i = decode_signal (list->word->word, DSIG_NOCASE|DSIG_SIGPREFIX);
if (i == NO_SIG)
{
sh_invalidsig (list->word->word);

View file

@ -58,6 +58,7 @@ $END
#include <stdio.h>
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "../findcmd.h"
@ -73,6 +74,7 @@ $END
extern int find_reserved_word __P((char *));
extern char *this_command_name;
extern int expand_aliases;
/* 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
@ -221,12 +223,12 @@ describe_command (command, dflags)
#if defined (ALIAS)
/* Command is an alias? */
if (((dflags & CDESC_FORCE_PATH) == 0) && (alias = find_alias (command)))
if (((dflags & CDESC_FORCE_PATH) == 0) && expand_aliases && (alias = find_alias (command)))
{
if (dflags & CDESC_TYPE)
puts ("alias");
else if (dflags & CDESC_SHORTDESC)
printf ("%s is aliased to `%s'\n", command, alias->value);
printf (_("%s is aliased to `%s'\n"), command, alias->value);
else if (dflags & CDESC_REUSABLE)
{
x = sh_single_quote (alias->value);
@ -247,7 +249,7 @@ describe_command (command, dflags)
if (dflags & CDESC_TYPE)
puts ("keyword");
else if (dflags & CDESC_SHORTDESC)
printf ("%s is a shell keyword\n", command);
printf (_("%s is a shell keyword\n"), command);
else if (dflags & CDESC_REUSABLE)
printf ("%s\n", command);
@ -267,7 +269,7 @@ describe_command (command, dflags)
#define PRETTY_PRINT_FUNC 1
char *result;
printf ("%s is a function\n", command);
printf (_("%s is a function\n"), command);
/* We're blowing away THE_PRINTED_COMMAND here... */
@ -292,7 +294,7 @@ describe_command (command, dflags)
if (dflags & CDESC_TYPE)
puts ("builtin");
else if (dflags & CDESC_SHORTDESC)
printf ("%s is a shell builtin\n", command);
printf (_("%s is a shell builtin\n"), command);
else if (dflags & CDESC_REUSABLE)
printf ("%s\n", command);
@ -313,7 +315,7 @@ describe_command (command, dflags)
if (dflags & CDESC_TYPE)
puts ("file");
else if (dflags & CDESC_SHORTDESC)
printf ("%s is %s\n", command, command);
printf (_("%s is %s\n"), command, command);
else if (dflags & (CDESC_REUSABLE|CDESC_PATH_ONLY))
printf ("%s\n", command);
@ -333,7 +335,7 @@ describe_command (command, dflags)
if (dflags & CDESC_TYPE)
puts ("file");
else if (dflags & CDESC_SHORTDESC)
printf ("%s is hashed (%s)\n", command, full_path);
printf (_("%s is hashed (%s)\n"), command, full_path);
else if (dflags & (CDESC_REUSABLE|CDESC_PATH_ONLY))
printf ("%s\n", full_path);

View file

@ -1,7 +1,7 @@
This file is ulimit.def, from which is created ulimit.c.
It implements the builtin "ulimit" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -70,6 +70,8 @@ $END
#include <stdio.h>
#include <errno.h>
#include "../bashintl.h"
#include "../shell.h"
#include "common.h"
#include "bashgetopt.h"
@ -327,7 +329,7 @@ ulimit_builtin (list)
{
if (STREQ (list->word->word, "unlimited") == 0)
{
builtin_error ("%s: invalid limit argument", list->word->word);
builtin_error (_("%s: invalid limit argument"), list->word->word);
return (EXECUTION_FAILURE);
}
return (set_all_limits (mode == 0 ? LIMIT_SOFT|LIMIT_HARD : mode, RLIM_INFINITY));
@ -353,7 +355,7 @@ ulimit_builtin (list)
limind = _findlim (cmdlist[c].cmd);
if (limind == -1)
{
builtin_error ("`%c': bad command", cmdlist[c].cmd);
builtin_error (_("`%c': bad command"), cmdlist[c].cmd);
return (EX_USAGE);
}
}
@ -382,7 +384,7 @@ ulimit_internal (cmd, cmdarg, mode, multiple)
opt = get_limit (limind, &soft_limit, &hard_limit);
if (opt < 0)
{
builtin_error ("%s: cannot get limit: %s", limits[limind].description,
builtin_error (_("%s: cannot get limit: %s"), limits[limind].description,
strerror (errno));
return (EXECUTION_FAILURE);
}
@ -420,7 +422,7 @@ ulimit_internal (cmd, cmdarg, mode, multiple)
if (set_limit (limind, real_limit, mode) < 0)
{
builtin_error ("%s: cannot modify limit: %s", limits[limind].description,
builtin_error (_("%s: cannot modify limit: %s"), limits[limind].description,
strerror (errno));
return (EXECUTION_FAILURE);
}

View file

@ -1,7 +1,7 @@
This file is umask.def, from which is created umask.c.
It implements the builtin "umask" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -37,7 +37,7 @@ $END
#include "../bashtypes.h"
#include "filecntl.h"
#ifndef _MINIX
#if ! defined(_MINIX) && defined (HAVE_SYS_FILE_H)
# include <sys/file.h>
#endif
@ -48,6 +48,8 @@ $END
#include <stdio.h>
#include <chartypes.h>
#include "../bashintl.h"
#include "../shell.h"
#include "posixstat.h"
#include "common.h"
@ -107,7 +109,7 @@ umask_builtin (list)
is lousy. */
if (umask_value == -1)
{
sh_erange (list->word->word, "octal number");
sh_erange (list->word->word, _("octal number"));
return (EXECUTION_FAILURE);
}
}
@ -221,7 +223,7 @@ parse_symbolic_mode (mode, initial_bits)
case '=':
break;
default:
builtin_error ("`%c': invalid symbolic mode operator", op);
builtin_error (_("`%c': invalid symbolic mode operator"), op);
return (-1);
}
@ -260,6 +262,8 @@ parse_symbolic_mode (mode, initial_bits)
bits &= ~perm;
break;
case '=':
if (who == 0)
who = S_IRWXU | S_IRWXG | S_IRWXO;
bits &= ~who;
bits |= perm;
break;
@ -274,7 +278,7 @@ parse_symbolic_mode (mode, initial_bits)
}
else
{
builtin_error ("`%c': invalid symbolic mode character", *s);
builtin_error (_("`%c': invalid symbolic mode character"), *s);
return (-1);
}
}
@ -298,7 +302,7 @@ symbolic_umask (list)
/* All work is done with the complement of the umask -- it's
more intuitive and easier to deal with. It is complemented
again before being returned. */
bits = parse_symbolic_mode (list->word->word, ~um);
bits = parse_symbolic_mode (list->word->word, ~um & 0777);
if (bits == -1)
return (-1);

View file

@ -1,7 +1,7 @@
This file is wait.def, from which is created wait.c.
It implements the builtin "wait" in Bash.
Copyright (C) 1987-2002 Free Software Foundation, Inc.
Copyright (C) 1987-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -141,7 +141,7 @@ wait_builtin (list)
}
}
#if defined (JOB_CONTROL)
else if (job_control && *w)
else if (*w && *w == '%')
/* Must be a job spec. Check it out. */
{
int job;
@ -164,12 +164,6 @@ wait_builtin (list)
UNBLOCK_CHILD (oset);
status = wait_for_job (job);
}
else if (job_control == 0 && *w == '%')
{
/* can't use jobspecs as arguments if job control is not active. */
sh_nojobs ((char *)NULL);
status = EXECUTION_FAILURE;
}
#endif /* JOB_CONTROL */
else
{

View file

@ -67,14 +67,17 @@ enum command_type { cm_for, cm_case, cm_while, cm_if, cm_simple, cm_select,
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. */
#define W_QUOTED 0x02 /* Some form of quote character is present. */
#define W_ASSIGNMENT 0x04 /* This word is a variable assignment. */
#define W_GLOBEXP 0x08 /* This word is the result of a glob expansion. */
#define W_NOSPLIT 0x10 /* Do not perform word splitting on this word. */
#define W_NOGLOB 0x20 /* Do not perform globbing on this word. */
#define W_NOSPLIT2 0x40 /* Don't split word except for $@ expansion. */
#define W_TILDEEXP 0x80 /* Tilde expand this assignment word */
#define W_HASDOLLAR 0x0001 /* Dollar sign present. */
#define W_QUOTED 0x0002 /* Some form of quote character is present. */
#define W_ASSIGNMENT 0x0004 /* This word is a variable assignment. */
#define W_GLOBEXP 0x0008 /* This word is the result of a glob expansion. */
#define W_NOSPLIT 0x0010 /* Do not perform word splitting on this word. */
#define W_NOGLOB 0x0020 /* Do not perform globbing on this word. */
#define W_NOSPLIT2 0x0040 /* Don't split word except for $@ expansion. */
#define W_TILDEEXP 0x0080 /* Tilde expand this assignment word */
#define W_DOLLARAT 0x0100 /* $@ and its special handling */
#define W_DOLLARSTAR 0x0200 /* $* and its special handling */
#define W_NOCOMSUB 0x0400 /* Don't perform command substitution on this word */
/* Possible values for subshell_environment */
#define SUBSHELL_ASYNC 0x01 /* subshell caused by `command &' */
@ -195,6 +198,7 @@ typedef struct pattern_list {
/* The CASE command. */
typedef struct case_com {
int flags; /* See description of CMD flags. */
int line; /* line number the `case' keyword appears on */
WORD_DESC *word; /* The thing to test. */
PATTERN_LIST *clauses; /* The clauses to test against, or NULL. */
} CASE_COM;
@ -202,6 +206,7 @@ typedef struct case_com {
/* FOR command. */
typedef struct for_com {
int flags; /* See description of CMD flags. */
int line; /* line number the `for' keyword appears on */
WORD_DESC *name; /* The variable name to get mapped over. */
WORD_LIST *map_list; /* The things to map over. This is never NULL. */
COMMAND *action; /* The action to execute.
@ -224,6 +229,7 @@ typedef struct arith_for_com {
/* KSH SELECT command. */
typedef struct select_com {
int flags; /* See description of CMD flags. */
int line; /* line number the `select' keyword appears on */
WORD_DESC *name; /* The variable name to get mapped over. */
WORD_LIST *map_list; /* The things to map over. This is never NULL. */
COMMAND *action; /* The action to execute.
@ -253,8 +259,8 @@ typedef struct while_com {
time being. */
typedef struct arith_com {
int flags;
WORD_LIST *exp;
int line;
WORD_LIST *exp;
} ARITH_COM;
#endif /* DPAREN_ARITHMETIC */
@ -278,18 +284,19 @@ typedef struct cond_com {
/* The "simple" command. Just a collection of words and redirects. */
typedef struct simple_com {
int flags; /* See description of CMD flags. */
int line; /* line number the command starts on */
WORD_LIST *words; /* The program name, the arguments,
variable assignments, etc. */
REDIRECT *redirects; /* Redirections to perform. */
int line; /* line number the command starts on */
} SIMPLE_COM;
/* The "function definition" command. */
typedef struct function_def {
int flags; /* See description of CMD flags. */
int line; /* Line number the function def starts on. */
WORD_DESC *name; /* The name of the function. */
COMMAND *command; /* The parsed execution tree. */
int line; /* Line number the function def starts on. */
char *source_file; /* file in which function was defined, if any */
} FUNCTION_DEF;
/* A command that is `grouped' allows pipes and redirections to affect all
@ -316,6 +323,9 @@ extern COMMAND *global_command;
/* Forward declarations of functions declared in copy_cmd.c. */
extern FUNCTION_DEF *copy_function_def_contents __P((FUNCTION_DEF *, FUNCTION_DEF *));
extern FUNCTION_DEF *copy_function_def __P((FUNCTION_DEF *));
extern WORD_DESC *copy_word __P((WORD_DESC *));
extern WORD_LIST *copy_word_list __P((WORD_LIST *));
extern REDIRECT *copy_redirect __P((REDIRECT *));

View file

@ -19,11 +19,51 @@
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
/*********************************************************/
/* Modify or set defines based on the configure results. */
/*********************************************************/
#if !defined (HAVE_VPRINTF) && defined (HAVE_DOPRNT)
# define USE_VFPRINTF_EMULATION
# define HAVE_VPRINTF
#endif
#if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_GETRLIMIT)
# define HAVE_RESOURCE
#endif
#if !defined (GETPGRP_VOID)
# define HAVE_BSD_PGRP
#endif
/* Try this without testing __STDC__ for the time being. */
#if defined (HAVE_STDARG_H)
# define PREFER_STDARG
# define USE_VARARGS
#else
# if defined (HAVE_VARARGS_H)
# define PREFER_VARARGS
# define USE_VARARGS
# endif
#endif
#if defined (HAVE_SYS_SOCKET_H) && defined (HAVE_GETPEERNAME) && defined (HAVE_NETINET_IN_H)
# define HAVE_NETWORK
#endif
#if defined (HAVE_REGEX_H) && defined (HAVE_REGCOMP) && defined (HAVE_REGEXEC)
# define HAVE_POSIX_REGEXP
#endif
/* backwards compatibility between different autoconf versions */
#if HAVE_DECL_SYS_SIGLIST && !defined (SYS_SIGLIST_DECLARED)
# define SYS_SIGLIST_DECLARED
#endif
/***********************************************************************/
/* Unset defines based on what configure reports as missing or broken. */
/***********************************************************************/
/* Ultrix botches type-ahead when switching from canonical to
non-canonical mode, at least through version 4.3 */
#if !defined (HAVE_TERMIOS_H) || !defined (HAVE_TCGETATTR) || defined (ultrix)
@ -36,23 +76,31 @@
# undef HAVE_GETCWD
#endif
#if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_GETRLIMIT)
# define HAVE_RESOURCE
#endif
#if !defined (GETPGRP_VOID)
# define HAVE_BSD_PGRP
#endif
#if !defined (HAVE_DEV_FD) && defined (NAMED_PIPES_MISSING)
# undef PROCESS_SUBSTITUTION
#endif
#if defined (JOB_CONTROL_MISSING)
# undef JOB_CONTROL
#endif
#if defined (STRCOLL_BROKEN)
# undef HAVE_STRCOLL
#endif
#if !defined (HAVE_POSIX_REGEXP)
# undef COND_REGEXP
#endif
/* If the shell is called by this name, it will become restricted. */
#if defined (RESTRICTED_SHELL)
# define RESTRICTED_SHELL_NAME "rbash"
#endif
/***********************************************************/
/* Make sure feature defines have necessary prerequisites. */
/***********************************************************/
/* BANG_HISTORY requires HISTORY. */
#if defined (BANG_HISTORY) && !defined (HISTORY)
# define HISTORY
@ -70,28 +118,6 @@
# undef DEFAULT_ECHO_TO_XPG
#endif
#if defined (JOB_CONTROL_MISSING)
# undef JOB_CONTROL
#endif
#if defined (__STDC__) && defined (HAVE_STDARG_H)
# define PREFER_STDARG
# define USE_VARARGS
#else
# if defined (HAVE_VARARGS_H)
# define PREFER_VARARGS
# define USE_VARARGS
# endif
#endif
#if defined (STRCOLL_BROKEN)
# 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 "$ "
@ -107,11 +133,18 @@
#if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H)
# include <wchar.h>
# include <wctype.h>
# if defined (HAVE_MBSRTOWCS) /* system is supposed to support XPG5 */
# if defined (HAVE_MBSRTOWCS) && defined (HAVE_MBRTOWC) && defined (HAVE_MBRLEN) && defined (HAVE_WCWIDTH)
/* system is supposed to support XPG5 */
# define HANDLE_MULTIBYTE 1
# endif
#endif
/* If we don't want multibyte chars even on a system that supports them, let
the configuring user turn multibyte support off. */
#if defined (NO_MULTIBYTE_SUPPORT)
# undef HANDLE_MULTIBYTE
#endif
/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
#if HANDLE_MULTIBYTE && !defined (HAVE_MBSTATE_T)
# define wcsrtombs(dest, src, len, ps) (wcsrtombs) (dest, src, len, 0)
@ -137,3 +170,12 @@
/************************************************/
/* end of multibyte capability checks for I18N */
/************************************************/
/******************************************************************/
/* Placeholder for builders to #undef any unwanted features from */
/* config-top.h or created by configure (such as the default mail */
/* file for mail checking). */
/******************************************************************/
/* If you don't want bash to provide a default mail file to check. */
/* #undef DEFAULT_MAIL_DIRECTORY */

View file

@ -52,14 +52,14 @@
/* The default value of the PATH variable. */
#ifndef DEFAULT_PATH_VALUE
#define DEFAULT_PATH_VALUE \
"/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:."
"/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:."
#endif
/* The value for PATH when invoking `command -p'. This is only used when
the Posix.2 confstr () function, or CS_PATH define are not present. */
#ifndef STANDARD_UTILS_PATH
#define STANDARD_UTILS_PATH \
"/bin:/usr/bin:/usr/ucb:/sbin:/usr/sbin:/etc:/usr/etc"
"/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc"
#endif
/* Default primary and secondary prompt strings. */

View file

@ -1,6 +1,6 @@
/* config.h -- Configuration file for bash. */
/* Copyright (C) 1987-2002 Free Software Foundation, Inc.
/* Copyright (C) 1987-2004 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -119,6 +119,10 @@
command. */
#undef COND_COMMAND
/* Define COND_REGEXP if you want extended regular expression matching and the
=~ binary operator in the [[...]] conditional command. */
#define COND_REGEXP
/* Define ARITH_FOR_COMMAND if you want the ksh93-style
for (( init; test; step )) do list; done
arithmetic for command. */
@ -132,6 +136,14 @@
and the complete builtin. */
#undef PROGRAMMABLE_COMPLETION
/* Define NO_MULTIBYTE_SUPPORT to not compile in support for multibyte
characters, even if the OS supports them. */
#undef NO_MULTIBYTE_SUPPORT
/* Define DEBUGGER if you want to compile in some features used only by the
bash debugger. */
#undef DEBUGGER
/* Define MEMSCRAMBLE if you want the bash malloc and free to scramble
memory contents on malloc() and free(). */
#undef MEMSCRAMBLE
@ -139,6 +151,8 @@
/* Define AFS if you are using Transarc's AFS. */
#undef AFS
#undef ENABLE_NLS
/* End of configuration settings controllable by autoconf. */
/* Other settable options appear in config-top.h. */
@ -314,6 +328,7 @@
libraries. */
/* Define if `sys_siglist' is declared by <signal.h> or <unistd.h>. */
#undef HAVE_DECL_SYS_SIGLIST
#undef SYS_SIGLIST_DECLARED
/* Define if `_sys_siglist' is declared by <signal.h> or <unistd.h>. */
@ -325,16 +340,16 @@
#undef HAVE_SYS_ERRLIST
#undef HAVE_TIMEVAL
#undef HAVE_TZNAME
/* Characteristics of some of the system structures. */
#undef STRUCT_DIRENT_HAS_D_INO
#undef HAVE_STRUCT_DIRENT_D_INO
#undef STRUCT_DIRENT_HAS_D_FILENO
#undef HAVE_STRUCT_DIRENT_D_FILENO
#undef HAVE_STRUCT_DIRENT_D_NAMLEN
#undef TIOCSTAT_IN_SYS_IOCTL
@ -359,6 +374,10 @@
#undef HAVE_STRUCT_TM_TM_ZONE
#undef HAVE_TM_ZONE
#undef HAVE_TIMEVAL
#undef HAVE_STRUCT_TIMEZONE
/* Characteristics of definitions in the system header files. */
#undef HAVE_GETPW_DECLS
@ -380,6 +399,7 @@
#undef HAVE_DECL_STRTOLD
#undef STRTOLD_BROKEN
#undef HAVE_MBSTATE_T
@ -420,6 +440,8 @@
#undef HAVE_PRINTF_A_FORMAT
#undef CTYPE_NON_ASCII
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
#undef HAVE_LANGINFO_CODESET
@ -465,9 +487,6 @@
/* Define if you have the bcopy function. */
#undef HAVE_BCOPY
/* Define if you have the bindtextdomain function. */
#undef HAVE_BINDTEXTDOMAIN
/* Define if you have the bzero function. */
#undef HAVE_BZERO
@ -525,9 +544,6 @@
/* Define if you have the getservent function. */
#undef HAVE_GETSERVENT
/* Define if you have the gettext function. */
#undef HAVE_GETTEXT
/* Define if you have the gettimeofday function. */
#undef HAVE_GETTIMEOFDAY
@ -564,6 +580,12 @@
/* Define if you have the lstat function. */
#undef HAVE_LSTAT
/* Define if you have the mbrlen function. */
#undef HAVE_MBRLEN
/* Define if you have the mbrtowc function. */
#undef HAVE_MBRTOWC
/* Define if you have the mbsrtowcs function. */
#undef HAVE_MBSRTOWCS
@ -585,6 +607,12 @@
/* Define if you have the readlink function. */
#undef HAVE_READLINK
/* Define if you have the regcomp function. */
#undef HAVE_REGCOMP
/* Define if you have the regexec function. */
#undef HAVE_REGEXEC
/* Define if you have the rename function. */
#undef HAVE_RENAME
@ -639,6 +667,9 @@
/* Define if you have the strpbrk function. */
#undef HAVE_STRPBRK
/* Define if you have the strstr function. */
#undef HAVE_STRSTR
/* Define if you have the strtod function. */
#undef HAVE_STRTOD
@ -672,9 +703,6 @@
/* Define if you have the tcgetpgrp function. */
#undef HAVE_TCGETPGRP
/* Define if you have the textdomain function. */
#undef HAVE_TEXTDOMAIN
/* Define if you have the times function. */
#undef HAVE_TIMES
@ -708,6 +736,12 @@
/* Define if you have the wait3 function. */
#undef HAVE_WAIT3
/* Define if you have the wcsdup function. */
#undef HAVE_WCSDUP
/* Define if you have the wctomb function. */
#undef HAVE_WCTOMB
/* Define if you have the wcwidth function. */
#undef HAVE_WCWIDTH
@ -749,6 +783,9 @@
/* Define if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define if you have the <regex.h> header file. */
#undef HAVE_REGEX_H
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
@ -797,6 +834,9 @@
/* Define if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define if you have the <sys/stream.h> header file. */
#undef HAVE_SYS_STREAM_H
@ -808,6 +848,9 @@
/* Define if you have <sys/times.h> */
#undef HAVE_SYS_TIMES_H
/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
@ -873,6 +916,61 @@
#undef GETCWD_BROKEN
/* Additional defines for configuring lib/intl, maintained by autoscan/autoheader */
/* Define if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H
/* Define if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define if you have the <stdio_ext.h> header file. */
#undef HAVE_STDIO_EXT_H
/* Define if you have the `dcgettext' function. */
#undef HAVE_DCGETTEXT
/* Define if your system has a working `malloc' function. */
/* #undef HAVE_MALLOC */
/* Define if you have the `mempcpy' function. */
#undef HAVE_MEMPCPY
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define if you have the `munmap' function. */
#undef HAVE_MUNMAP
/* Define if you have the `nl_langinfo' function. */
#undef HAVE_NL_LANGINFO
/* Define if you have the `stpcpy' function. */
#undef HAVE_STPCPY
/* Define if you have the `strcspn' function. */
#undef HAVE_STRCSPN
/* Define if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define if you have the `__argz_count' function. */
#undef HAVE___ARGZ_COUNT
/* Define if you have the `__argz_next' function. */
#undef HAVE___ARGZ_NEXT
/* Define if you have the `__argz_stringify' function. */
#undef HAVE___ARGZ_STRINGIFY
/* End additions for lib/intl */
#include "config-bot.h"
#endif /* _CONFIG_H_ */

19906
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,11 @@
dnl
dnl Configure script for bash-2.05
dnl Configure script for bash-3.0
dnl
dnl report bugs to chet@po.cwru.edu
dnl
dnl Process this file with autoconf to produce a configure script.
# Copyright (C) 1987-2002 Free Software Foundation, Inc.
# Copyright (C) 1987-2004 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
@ -22,9 +22,12 @@ dnl Process this file with autoconf to produce a configure script.
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
AC_REVISION([for Bash 2.05b, version 2.144, from autoconf version] AC_ACVERSION)dnl
AC_REVISION([for Bash 3.0, version 3.166, from autoconf version] AC_ACVERSION)dnl
AC_INIT(bash, 2.05b, bug-bash@gnu.org)
define(bashvers, 3.0)
define(relstatus, release)
AC_INIT(bash, bashvers-relstatus, bug-bash@gnu.org)
dnl make sure we are using a recent autoconf version
AC_PREREQ(2.50)
@ -35,8 +38,8 @@ AC_CONFIG_AUX_DIR(./support)
AC_CONFIG_HEADERS(config.h)
dnl checks for version info
BASHVERS=2.05b
RELSTATUS=release
BASHVERS=bashvers
RELSTATUS=relstatus
dnl defaults for debug settings
case "$RELSTATUS" in
@ -70,6 +73,7 @@ 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*-gnu) opt_bash_malloc=no ;; # there's some undetermined problem here
#*-freebsd*) opt_bash_malloc=no ;; # they claim it's better; I disagree
*-openbsd*) opt_bash_malloc=no ;; # they claim it needs eight-bit alignment
*-aix*) opt_bash_malloc=no ;; # AIX machines
@ -92,6 +96,12 @@ sco3.2v5*|sco3.2v4*) opt_memscramble=no ;;
*) opt_memscramble=yes ;;
esac
dnl
dnl macros for the bash debugger
dnl
AM_PATH_LISPDIR
AC_ARG_VAR(DEBUGGER_START_FILE, [location of bash debugger initialization file])
dnl arguments to configure
dnl packages
AC_ARG_WITH(afs, AC_HELP_STRING([--with-afs], [if you are running AFS]), opt_afs=$withval)
@ -138,6 +148,10 @@ if test "$opt_curses" = yes; then
prefer_curses=yes
fi
if test -z "${DEBUGGER_START_FILE}"; then
DEBUGGER_START_FILE=${ac_default_prefix}/lib/bashdb/bashdb-main.inc
fi
dnl optional shell features in config.h.in
opt_minimal_config=no
@ -160,10 +174,13 @@ opt_disabled_builtins=no
opt_command_timing=yes
opt_xpg_echo=no
opt_cond_command=yes
opt_cond_regexp=yes
opt_arith_for_command=yes
opt_net_redirs=yes
opt_progcomp=yes
opt_separate_help=no
opt_multibyte=yes
opt_debugger=yes
dnl options that affect how bash is compiled and linked
opt_static_link=no
@ -182,6 +199,7 @@ if test $opt_minimal_config = yes; then
opt_brace_expansion=no opt_disabled_builtins=no opt_command_timing=no
opt_extended_glob=no opt_cond_command=no opt_arith_for_command=no
opt_net_redirs=no opt_progcomp=no opt_separate_help=no
opt_multibyte=yes opt_cond_regexp=no
fi
AC_ARG_ENABLE(alias, AC_HELP_STRING([--enable-alias], [enable shell aliases]), opt_alias=$enableval)
@ -191,6 +209,8 @@ AC_ARG_ENABLE(bang-history, AC_HELP_STRING([--enable-bang-history], [turn on csh
AC_ARG_ENABLE(brace-expansion, AC_HELP_STRING([--enable-brace-expansion], [include brace expansion]), opt_brace_expansion=$enableval)
AC_ARG_ENABLE(command-timing, AC_HELP_STRING([--enable-command-timing], [enable the time reserved word and command timing]), opt_command_timing=$enableval)
AC_ARG_ENABLE(cond-command, AC_HELP_STRING([--enable-cond-command], [enable the conditional command]), opt_cond_command=$enableval)
AC_ARG_ENABLE(cond-regexp, AC_HELP_STRING([--enable-cond-regexp], [enable extgended regular expression matching in conditional commands]), opt_cond_regexp=$enableval)
AC_ARG_ENABLE(debugger, AC_HELP_STRING([--enable-debugger], [enable support for bash debugger]), opt_debugger=$enableval)
AC_ARG_ENABLE(directory-stack, AC_HELP_STRING([--enable-directory-stack], [enable builtins pushd/popd/dirs]), opt_dirstack=$enableval)
AC_ARG_ENABLE(disabled-builtins, AC_HELP_STRING([--enable-disabled-builtins], [allow disabled builtins to still be invoked]), opt_disabled_builtins=$enableval)
AC_ARG_ENABLE(dparen-arithmetic, AC_HELP_STRING([--enable-dparen-arithmetic], [include ((...)) command]), opt_dparen_arith=$enableval)
@ -198,6 +218,7 @@ AC_ARG_ENABLE(extended-glob, AC_HELP_STRING([--enable-extended-glob], [include k
AC_ARG_ENABLE(help-builtin, AC_HELP_STRING([--enable-help-builtin], [include the help builtin]), opt_help=$enableval)
AC_ARG_ENABLE(history, AC_HELP_STRING([--enable-history], [turn on command history]), opt_history=$enableval)
AC_ARG_ENABLE(job-control, AC_HELP_STRING([--enable-job-control], [enable job control features]), opt_job_control=$enableval)
AC_ARG_ENABLE(multibyte, AC_HELP_STRING([--enable-multibyte], [enable multibyte characters if OS supports them]), opt_multibyte=$enableval)
AC_ARG_ENABLE(net-redirections, AC_HELP_STRING([--enable-net-redirections], [enable /dev/tcp/host/port redirection]), opt_net_redirs=$enableval)
AC_ARG_ENABLE(process-substitution, AC_HELP_STRING([--enable-process-substitution], [enable process substitution]), opt_process_subst=$enableval)
AC_ARG_ENABLE(progcomp, AC_HELP_STRING([--enable-progcomp], [enable programmable completion and the complete builtin]), opt_progcomp=$enableval)
@ -265,6 +286,9 @@ fi
if test $opt_cond_command = yes ; then
AC_DEFINE(COND_COMMAND)
fi
if test $opt_cond_regexp = yes ; then
AC_DEFINE(COND_REGEXP)
fi
if test $opt_arith_for_command = yes; then
AC_DEFINE(ARITH_FOR_COMMAND)
fi
@ -274,6 +298,12 @@ fi
if test $opt_progcomp = yes; then
AC_DEFINE(PROGRAMMABLE_COMPLETION)
fi
if test $opt_multibyte = no; then
AC_DEFINE(NO_MULTIBYTE_SUPPORT)
fi
if test $opt_debugger = yes; then
AC_DEFINE(DEBUGGER)
fi
if test $opt_memscramble = yes; then
AC_DEFINE(MEMSCRAMBLE)
@ -403,7 +433,14 @@ if test "$opt_static_link" = yes; then
fi
fi
test -z "$CPPFLAGS_FOR_BUILD" && CPPFLAGS_FOR_BUILD="$CPPFLAGS"
if test "X$cross_compiling" = "Xno"; then
CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-"$CPPFLAGS"}
LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-'$(LDFLAGS)'}
else
CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-""}
LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-""}
fi
test -z "$CFLAGS_FOR_BUILD" && CFLAGS_FOR_BUILD="-g"
AC_SUBST(CFLAGS)
@ -430,7 +467,7 @@ then
RL_LIB_READLINE_VERSION
case "$ac_cv_rl_version" in
4.[[3-9]]*|5*|6*|7*|8*|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)
@ -442,9 +479,13 @@ if test $opt_readline = yes; then
AC_DEFINE(READLINE)
READLINE_LIB=-lreadline
if test "$opt_with_installed_readline" != "no" ; then
case "$RL_INCLUDEDIR" in
/usr/include) ;;
*) RL_INCLUDE='-I${RL_INCLUDEDIR}'
case "$opt_with_installed_readline" in
yes) RL_INCLUDE= ;;
*) case "$RL_INCLUDEDIR" in
/usr/include) ;;
*) RL_INCLUDE='-I${RL_INCLUDEDIR}' ;;
esac
;;
esac
READLINE_DEP=
else
@ -466,9 +507,13 @@ if test $opt_history = yes || test $opt_bang_history = yes; then
if test "$opt_with_installed_readline" != "no"; then
HIST_LIBDIR=$RL_LIBDIR
HISTORY_DEP=
case "$RL_INCLUDEDIR" in
/usr/include) ;;
*) RL_INCLUDE='-I${RL_INCLUDEDIR}'
case "$opt_with_installed_readline" in
yes) RL_INCLUDE= ;;
*) case "$RL_INCLUDEDIR" in
/usr/include) ;;
*) RL_INCLUDE='-I${RL_INCLUDEDIR}' ;;
esac
;;
esac
else
HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
@ -517,6 +562,9 @@ AC_C_LONG_DOUBLE
AC_C_PROTOTYPES
AC_C_CHAR_UNSIGNED
dnl initialize GNU gettext
AM_GNU_GETTEXT([no-libtool], [need-ngettext], [lib/intl])
dnl header files
AC_HEADER_DIRENT
AC_HEADER_TIME
@ -525,10 +573,10 @@ BASH_HEADER_INTTYPES
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 stdint.h netdb.h grp.h strings.h)
stddef.h stdint.h netdb.h grp.h strings.h regex.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)
sys/resource.h sys/param.h sys/socket.h sys/stat.h \
sys/time.h sys/times.h sys/types.h sys/wait.h)
AC_CHECK_HEADERS(netinet/in.h arpa/inet.h)
dnl special checks for libc functions
@ -588,9 +636,9 @@ AC_CHECK_FUNCS(bcopy bzero confstr sysconf pathconf setenv putenv unsetenv \
setlinebuf setvbuf setlocale strchr tcgetattr uname \
ulimit tzset siginterrupt memmove ttyname times \
getaddrinfo gethostbyname getservbyname getservent inet_aton \
vsnprintf snprintf vasprintf asprintf fnmatch)
vsnprintf snprintf vasprintf asprintf fnmatch regcomp regexec)
AC_CHECK_FUNCS(isascii isblank isgraph isprint isspace isxdigit)
AC_REPLACE_FUNCS(getcwd strcasecmp strerror strftime strpbrk memset)
AC_REPLACE_FUNCS(getcwd strcasecmp strerror strftime strpbrk memset strstr)
AC_REPLACE_FUNCS(strtod strtol strtoul strtoll strtoull strtoimax strtoumax)
AC_CHECK_DECLS([confstr])
@ -598,7 +646,24 @@ AC_CHECK_DECLS([printf])
AC_CHECK_DECLS([sbrk])
AC_CHECK_DECLS([strcpy])
AC_CHECK_DECLS([strsignal])
AC_CHECK_DECLS([strtold])
dnl Extra test to detect the horribly broken HP/UX 11.00 strtold(3)
AC_CHECK_DECLS([strtold], [
AC_MSG_CHECKING([for broken strtold])
AC_CACHE_VAL(bash_cv_strtold_broken,
[AC_TRY_COMPILE(
[#include <stdlib.h>],
[int main() { long double r; char *foo, bar; r = strtold(foo, &bar);}],
bash_cv_strtold_broken=no, bash_cv_strtold_broken=yes,
[AC_MSG_WARN(cannot check for broken strtold if cross-compiling, defaulting to no)])
]
)
AC_MSG_RESULT($bash_cv_strtold_broken)
if test "$bash_cv_strtold_broken" = "yes" ; then
AC_DEFINE(STRTOLD_BROKEN)
fi
])
BASH_CHECK_DECL(strtoimax)
BASH_CHECK_DECL(strtol)
@ -609,18 +674,31 @@ BASH_CHECK_DECL(strtoumax)
AC_FUNC_MKTIME
dnl checks for locale functions
AC_CHECK_HEADERS(libintl.h)
AC_CHECK_FUNCS(gettext textdomain bindtextdomain)
dnl
dnl Checks for lib/intl and related code (uses some of the output from
dnl AM_GNU_GETTEXT)
dnl
dnl check for GNU libintl if gettext/textdomain/bindtextdomain
dnl are not found in libc
if test "$ac_cv_func_bindtextdomain" = "no"; then
AC_CHECK_LIB(intl,bindtextdomain)
if test "$ac_cv_lib_intl" = "yes"; then
AC_CHECK_FUNCS(gettext textdomain bindtextdomain)
fi
AC_CHECK_HEADERS([argz.h errno.h fcntl.h malloc.h stdio_ext.h])
dnl AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify dcgettext mempcpy \
munmap stpcpy strcspn strdup])
INTL_DEP= INTL_INC= LIBINTL_H=
if test "x$USE_INCLUDED_LIBINTL" = "xyes"; then
INTL_DEP='${INTL_LIBDIR}/libintl.a'
INTL_INC='-I${INTL_LIBSRC} -I${INTL_BUILDDIR}'
LIBINTL_H='${INTL_BUILDDIR}/libintl.h'
fi
AC_SUBST(INTL_DEP)
AC_SUBST(INTL_INC)
AC_SUBST(LIBINTL_H)
dnl
dnl End of checks needed by files in lib/intl
dnl
BASH_CHECK_MULTIBYTE
@ -702,6 +780,7 @@ BASH_FUNC_LSTAT
fi
dnl behavior of system calls and library functions
BASH_FUNC_CTYPE_NONASCII
BASH_FUNC_DUP2_CLOEXEC_CHECK
BASH_SYS_PGRP_SYNC
BASH_SYS_SIGNAL_VINTAGE
@ -728,11 +807,13 @@ BASH_STRUCT_TERMIOS_LDISC
BASH_STRUCT_TERMIO_LDISC
BASH_STRUCT_DIRENT_D_INO
BASH_STRUCT_DIRENT_D_FILENO
BASH_STRUCT_DIRENT_D_NAMLEN
BASH_STRUCT_WINSIZE
BASH_STRUCT_TIMEVAL
AC_CHECK_MEMBERS([struct stat.st_blocks])
AC_STRUCT_TM
AC_STRUCT_TIMEZONE
BASH_STRUCT_TIMEZONE
dnl presence and behavior of C library functions
BASH_FUNC_STRSIGNAL
@ -759,18 +840,6 @@ else
AC_DEFINE(HAVE_STD_UNSETENV)
fi
dnl I have removed this check. The existing libc FNM_EXTMATCH implementation
dnl (glibc-2.2.4) disagrees with bash on the matching of incorrectly-formed
dnl patterns (bash treats them as strings or characters to be matched without
dnl any special meaning) and has one outright bug: a[X-]b should match
dnl both a-b and aXb.
dnl
dnl Once Ulrich and I get together on this, the check can return
dnl
dnl chet 10/31/2001
dnl
dnl BASH_FUNC_FNMATCH_EXTMATCH
BASH_FUNC_PRINTF_A_FORMAT
dnl presence and behavior of OS functions
@ -851,7 +920,7 @@ lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
linux*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading
*qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
powerux*) LOCAL_LIBS="-lgen" ;;
cygwin*) LOCAL_LIBS="-luser32" ;;
cygwin*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
opennt*|interix*) LOCAL_CFLAGS="-DNO_MAIN_ENV_ARG -DBROKEN_DIRENT_D_INO" ;;
esac
@ -946,9 +1015,11 @@ AC_SUBST(LOCAL_DEFS)
#AC_SUBST(ALLOCA_OBJECT)
AC_OUTPUT([Makefile builtins/Makefile lib/readline/Makefile lib/glob/Makefile \
lib/intl/Makefile \
lib/malloc/Makefile lib/sh/Makefile lib/termcap/Makefile \
lib/tilde/Makefile doc/Makefile support/Makefile \
examples/loadables/Makefile examples/loadables/perl/Makefile],
lib/tilde/Makefile doc/Makefile support/Makefile po/Makefile.in \
examples/loadables/Makefile examples/loadables/perl/Makefile \
pathnames.h],
[
# Makefile uses this timestamp file to record whether config.h is up to date.
echo timestamp > stamp-h

View file

@ -50,7 +50,6 @@ static ARITH_COM *copy_arith_command __P((ARITH_COM *));
static COND_COM *copy_cond_command __P((COND_COM *));
#endif
static SIMPLE_COM *copy_simple_command __P((SIMPLE_COM *));
static FUNCTION_DEF *copy_function_def __P((FUNCTION_DEF *));
WORD_DESC *
copy_word (w)
@ -166,6 +165,7 @@ copy_for_command (com)
new_for = (FOR_COM *)xmalloc (sizeof (FOR_COM));
new_for->flags = com->flags;
new_for->line = com->line;
new_for->name = copy_word (com->name);
new_for->map_list = copy_word_list (com->map_list);
new_for->action = copy_command (com->action);
@ -221,6 +221,7 @@ copy_case_command (com)
new_case = (CASE_COM *)xmalloc (sizeof (CASE_COM));
new_case->flags = com->flags;
new_case->line = com->line;
new_case->word = copy_word (com->word);
new_case->clauses = copy_case_clauses (com->clauses);
return (new_case);
@ -302,17 +303,26 @@ copy_simple_command (com)
return (new_simple);
}
static FUNCTION_DEF *
FUNCTION_DEF *
copy_function_def_contents (old, new_def)
FUNCTION_DEF *old, *new_def;
{
new_def->name = copy_word (old->name);
new_def->command = old->command ? copy_command (old->command) : old->command;
new_def->flags = old->flags;
new_def->line = old->line;
new_def->source_file = old->source_file ? savestring (old->source_file) : old->source_file;
return (new_def);
}
FUNCTION_DEF *
copy_function_def (com)
FUNCTION_DEF *com;
{
FUNCTION_DEF *new_def;
new_def = (FUNCTION_DEF *)xmalloc (sizeof (FUNCTION_DEF));
new_def->name = copy_word (com->name);
new_def->command = copy_command (com->command);
new_def->flags = com->flags;
new_def->line = com->line;
new_def = copy_function_def_contents (com, new_def);
return (new_def);
}

View file

@ -186,9 +186,7 @@ dispose_command (command)
register FUNCTION_DEF *c;
c = command->value.Function_def;
dispose_word (c->name);
dispose_command (c->command);
free (c);
dispose_function_def (c);
break;
}
@ -218,6 +216,23 @@ dispose_cond_node (cond)
}
#endif /* COND_COMMAND */
void
dispose_function_def_contents (c)
FUNCTION_DEF *c;
{
dispose_word (c->name);
dispose_command (c->command);
FREE (c->source_file);
}
void
dispose_function_def (c)
FUNCTION_DEF *c;
{
dispose_function_def_contents (c);
free (c);
}
/* How to free a WORD_DESC. */
void
dispose_word (w)

View file

@ -33,4 +33,7 @@ extern void dispose_redirects __P((REDIRECT *));
extern void dispose_cond_node __P((COND_COM *));
#endif
extern void dispose_function_def_contents __P((FUNCTION_DEF *));
extern void dispose_function_def __P((FUNCTION_DEF *));
#endif /* !_DISPOSE_CMD_H_ */

244
doc/FAQ
View file

@ -1,4 +1,4 @@
This is the Bash FAQ, version 3.20, for Bash version 2.05b.
This is the Bash FAQ, version 3.27, for Bash version 3.0.
This document contains a set of frequently-asked questions concerning
Bash, the GNU Bourne-Again Shell. Bash is a freely-available command
@ -31,13 +31,13 @@ A6) How can I build bash with gcc?
A7) How can I make bash my login shell?
A8) I just changed my login shell to bash, and now I can't FTP into my
machine. Why not?
A9) What's the `POSIX 1003.2 standard'?
A9) What's the `POSIX Shell and Utilities standard'?
A10) What is the bash `posix mode'?
Section B: The latest version
B1) What's new in version 2.05b?
B2) Are there any user-visible incompatibilities between bash-2.05b and
B1) What's new in version 3.0?
B2) Are there any user-visible incompatibilities between bash-3.0 and
bash-1.14.7?
Section C: Differences from other Unix shells
@ -75,6 +75,9 @@ E8) Why does the arithmetic evaluation code complain about `08'?
E9) Why does the pattern matching expression [A-Z]* match files beginning
with every letter except `z'?
E10) Why does `cd //' leave $PWD as `//'?
E11) If I resize my xterm while another program is running, why doesn't bash
notice the change?
E12) Why don't negative offsets in substring expansion work like I expect?
Section F: Things to watch out for on certain Unix versions
@ -137,30 +140,29 @@ of Case Western Reserve University.
A2) What's the latest version?
The latest version is 2.05b, first made available on Wednesday, 17
July, 2002.
The latest version is 3.0, first made available on 27 July, 2004.
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.05b:
The following URLs tell how to get version 3.0:
ftp://ftp.gnu.org/pub/gnu/bash/bash-2.05b.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-2.05b.tar.gz
ftp://ftp.gnu.org/pub/gnu/bash/bash-3.0.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-3.0.tar.gz
Formatted versions of the documentation are available with the URLs:
ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-2.05b.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-2.05b.tar.gz
ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-3.0.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-3.0.tar.gz
A4) On what machines will bash run?
Bash has been ported to nearly every version of UNIX. All you
Bash has been ported to nearly every version of Unix. All you
should have to do to build it on a machine for which a port
exists is to type `configure' and then `make'. The build process
will attempt to discover the version of UNIX you have and tailor
will attempt to discover the version of Unix you have and tailor
itself accordingly, using a script created by GNU autoconf.
More information appears in the file `INSTALL' in the distribution.
@ -190,13 +192,8 @@ early GNU-Win32 (the original name) releases. Cygnus has also done a
port of bash-2.05 to the CYGWIN environment, and it is available as
part of their current release.
Bash-2.05b 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
ftp://ftp.gnustep.org//pub/win32/bash-alpha-nt-1.01.tar.gz
Bash-2.05b and later versions should require no local Cygnus changes to
build and run under CYGWIN.
DJ Delorie has a port of bash-2.x which runs under MS-DOS, as part
of the DJGPP project. For more information on the project, see
@ -212,19 +209,10 @@ ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204b.zip binary
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204d.zip documentation
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204s.zip source
Mark has begun to work with bash-2.05, but I don't know the status.
Mark began to work with bash-2.05, but I don't know the current status.
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
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.
Bash-3.0 compiles and runs with no modifications under Microsoft's Services
for Unix (SFU), once known as Interix.
A6) How can I build bash with gcc?
@ -271,7 +259,8 @@ it is invoked as a login shell.
Next, add a line similar to the above to ~/.profile:
[ -f /usr/gnu/bin/bash ] && exec /usr/gnu/bin/bash --login
[ -f /usr/gnu/bin/bash ] && [ -x /usr/gnu/bin/bash ] && \
exec /usr/gnu/bin/bash --login
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
@ -325,7 +314,7 @@ this before you can make bash your login shell.
Most versions of ftpd use this file to prohibit `special' users
such as `uucp' and `news' from using FTP.
A9) What's the `POSIX 1003.2 standard'?
A9) What's the `POSIX Shell and Utilities standard'?
POSIX is a name originally coined by Richard Stallman for a
family of open system standards based on UNIX. There are a
@ -335,44 +324,49 @@ call and C library level to applications and tools to system
administration and management. Each area of standardization is
assigned to a working group in the 1003 series.
The POSIX Shell and Utilities standard has been developed by IEEE
Working Group 1003.2 (POSIX.2). It concentrates on the command
interpreter interface and utility programs commonly executed from
the command line or by other programs. An initial version of the
standard has been approved and published by the IEEE, and work is
currently underway to update it.
The POSIX Shell and Utilities standard was originally developed by
IEEE Working Group 1003.2 (POSIX.2). Today it has been merged with
the original 1003.1 Working Group and is maintained by the Austin
Group (a joint working group of the IEEE, The Open Group and
ISO/IEC SC22/WG15). Today the Shell and Utilities are a volume
within the set of documents that make up IEEE Std 1003.1-2001, and
thus now the former POSIX.2 (from 1992) is now part of the current
POSIX.1 standard (POSIX 1003.1-2001).
Bash is concerned with the aspects of the shell's behavior
defined by POSIX.2. The shell command language has of course
been standardized, including the basic flow control and program
execution constructs, I/O redirection and pipelining, argument
handling, variable expansion, and quoting.
The Shell and Utilities volume concentrates on the command
interpreter interface and utility programs commonly executed from
the command line or by other programs. The standard is freely
available on the web at http://www.UNIX-systems.org/version3/ .
Work continues at the Austin Group on maintenance issues; see
http://www.opengroup.org/austin/ to join the discussions.
Bash is concerned with the aspects of the shell's behavior defined
by the POSIX Shell and Utilities volume. The shell command
language has of course been standardized, including the basic flow
control and program execution constructs, I/O redirection and
pipelining, argument handling, variable expansion, and quoting.
The `special' builtins, which must be implemented as part of the
shell to provide the desired functionality, are specified as
being part of the shell; examples of these are `eval' and
`export'. Other utilities appear in the sections of POSIX.2 not
`export'. Other utilities appear in the sections of POSIX not
devoted to the shell which are commonly (and in some cases must
be) implemented as builtin commands, such as `read' and `test'.
POSIX.2 also specifies aspects of the shell's interactive
POSIX also specifies aspects of the shell's interactive
behavior as part of the UPE, including job control and command
line editing. Only vi-style line editing commands have been
standardized; emacs editing commands were left out due to
objections.
The Open Group has made an older version of its Single Unix
Specification (version 2), which is very similar to POSIX.2,
available on the web at
The latest version of the POSIX Shell and Utilities standard is
available (now updated to the 2004 Edition) as part of the Single
UNIX Specification Version 3 at
http://www.opengroup.org/onlinepubs/007908799/
The Single Unix Specification, version 3, is available on the web at
http://www.opengroup.org/onlinepubs/007904975/
http://www.UNIX-systems.org/version3/
A10) What is the bash `posix mode'?
Although bash is an implementation of the POSIX.2 shell
Although bash is an implementation of the POSIX shell
specification, there are areas where the bash default behavior
differs from that spec. The bash `posix mode' changes the bash
behavior in these areas so that it obeys the spec more closely.
@ -387,18 +381,48 @@ They are also listed in a section in the Bash Reference Manual
Section B: The latest version
B1) What's new in version 2.05b?
B1) What's new in version 3.0?
The raison d'etre for bash-2.05b is to make a second intermediate
release containing the first of the new features to be available
in bash-3.0 and get feedback on those features before proceeding.
The major new feature is multibyte character support in both Bash
and Readline.
Bash-3.0 is the third major release of bash. The features introduced
in the intermediate releases following bash-2.05 have been completed.
Support for the bash debugger (a separate project) has been integrated.
Bash-2.05b contains the following new features (see the manual page for
complete descriptions and the CHANGES and NEWS files in the bash-2.05b
Bash-3.0 contains the following new features (see the manual page for
complete descriptions and the CHANGES and NEWS files in the bash-3.0
distribution):
o Features to support the bash debugger have been implemented, and there
is a new `extdebug' option to turn the non-default options on
o HISTCONTROL is now a colon-separated list of options and has been
extended with a new `erasedups' option that will result in only one
copy of a command being kept in the history list
o Brace expansion has been extended with a new {x..y} form, producing
sequences of digits or characters
o Timestamps are now kept with history entries, with an option to save
and restore them from the history file; there is a new HISTTIMEFORMAT
variable describing how to display the timestamps when listing history
entries
o The `[[' command can now perform extended regular expression (egrep-like)
matching, with matched subexpressions placed in the BASH_REMATCH array
variable
o A new `pipefail' option causes a pipeline to return a failure status if
any command in it fails
o The `jobs', `kill', and `wait' builtins now accept job control notation
in their arguments even if job control is not enabled
o The `gettext' package and libintl have been integrated, and the shell
messages may be translated into other languages
A short feature history dating from Bash-2.0:
Bash-2.05b introduced the following new features:
o support for multibyte characters has been added to both bash and readline
o the DEBUG trap is now run *before* simple commands, ((...)) commands,
@ -427,9 +451,6 @@ o the expansion of $LINENO inside a shell function is only relative to the
script, $LINENO expands to the line number in the script. This is as
POSIX-2001 requires
A short feature history dating from Bash-2.0:
Bash-2.05a introduced the following new features:
o The `printf' builtin has undergone major work
@ -607,10 +628,10 @@ grammar tighter and smaller (66 reduce-reduce conflicts gone)
lots of code now smaller and faster
test suite greatly expanded
B2) Are there any user-visible incompatibilities between bash-2.05b and
B2) Are there any user-visible incompatibilities between bash-3.0 and
bash-1.14.7?
There are a few incompatibilities between version 1.14.7 and version 2.05b.
There are a few incompatibilities between version 1.14.7 and version 3.0.
They are detailed in the file COMPAT in the bash distribution. That file
is not meant to be all-encompassing; send mail to bash-maintainers@gnu.org
if if you find something that's not mentioned there.
@ -696,6 +717,9 @@ Things bash has that sh does not:
posix mode
redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr,
/dev/tcp/host/port, /dev/udp/host/port
debugger support, including `caller' builtin and new variables
RETURN trap
Things sh has that bash does not:
uses variable SHACCT to do shell accounting
@ -768,6 +792,10 @@ Things bash has or uses that ksh88 does not:
redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr
arrays of unlimited size
TMOUT is default timeout for `read' and `select'
debugger support, including the `caller' builtin
RETURN trap
Timestamps in history entries
{x..y} brace expansion
Things ksh88 has or uses that bash does not:
tracked aliases (alias -t)
@ -776,9 +804,9 @@ Things ksh88 has or uses that bash does not:
weirdly-scoped functions
typeset +f to list all function names without definitions
text of command history kept in a file, not memory
builtins: alias -x, cd old new, fc -e -, newgrp, print,
builtins: alias -x, cd old new, newgrp, print,
read -p/-s/var?prompt, set -A/-o gmacs/
-o bgnice/-o markdirs/-o nolog/-o trackall/-o viraw/-s,
-o bgnice/-o markdirs/-o trackall/-o viraw/-s,
typeset -H/-L/-R/-Z/-A/-ft/-fu/-fx/-l/-u/-t, whence
using environment to pass attributes of exported variables
arithmetic evaluation done on arguments to some builtins
@ -795,7 +823,7 @@ 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.05b:
New things in ksh-93 not in bash-3.0:
associative arrays
floating point arithmetic and variables
math library functions
@ -814,15 +842,15 @@ New things in ksh-93 not in bash-2.05b:
`fc' has been renamed to `hist'
`.' can execute shell functions
exit statuses between 0 and 255
set -o pipefail
`+=' variable assignment operator
FPATH and PATH mixing
getopts -a
-I invocation option
DEBUG trap now executed before each simple command, instead of after
printf %H, %P, %T, %Z modifiers, output base for %d
lexical scoping for local variables in `ksh' functions
no scoping for local variables in `POSIX' functions
New things in ksh-93 present in bash-2.05b:
New things in ksh-93 present in bash-3.0:
[n]<&word- and [n]>&word- redirections (combination dup and close)
for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command
?:, ++, --, `expr1 , expr2' arithmetic operators
@ -847,6 +875,7 @@ New things in ksh-93 present in bash-2.05b:
command and arithmetic substitution performed on PS1, PS4, and ENV
command name completion
ENV processed only for interactive shells
set -o pipefail
Section D: Why does bash do some things differently than other Unix shells?
@ -1235,9 +1264,9 @@ subdirs-clean:
( cd $$d && ${MAKE} ${MFLAGS} clean ) \
done
The latest drafts of the updated POSIX standard have changed this: the
word list is no longer required. Bash versions 2.05a and later accept
the new syntax.
The latest updated POSIX standard has changed this: the word list
is no longer required. Bash versions 2.05a and later accept the
new syntax.
E8) Why does the arithmetic evaluation code complain about `08'?
@ -1305,6 +1334,49 @@ This is, I presume, for historical compatibility. Certain versions of
Unix, and early network file systems, used paths of the form
//hostname/path to access `path' on server `hostname'.
E11) If I resize my xterm while another program is running, why doesn't bash
notice the change?
This is another issue that deals with job control.
The kernel maintains a notion of a current terminal process group. Members
of this process group (processes whose process group ID is equal to the
current terminal process group ID) receive terminal-generated signals like
SIGWINCH. (For more details, see the JOB CONTROL section of the bash
man page.)
If a terminal is resized, the kernel sends SIGWINCH to each member of
the terminal's current process group (the `foreground' process group).
When bash is running with job control enabled, each pipeline (which may be
a single command) is run in its own process group, different from bash's
process group. This foreground process group receives the SIGWINCH; bash
does not. Bash has no way of knowing that the terminal has been resized.
There is a `checkwinsize' option, settable with the `shopt' builtin, that
will cause bash to check the window size and adjust its idea of the
terminal's dimensions each time a process stops or exits and returns control
of the terminal to bash. Enable it with `shopt -s checkwinsize'.
E12) Why don't negative offsets in substring expansion work like I expect?
When substring expansion of the form ${param:offset[:length} is used,
an `offset' that evaluates to a number less than zero counts back from
the end of the expanded value of $param.
When a negative `offset' begins with a minus sign, however, unexpected things
can happen. Consider
a=12345678
echo ${a:-4}
intending to print the last four characters of $a. The problem is that
${param:-word} already has a well-defined meaning: expand to word if the
expanded value of param is unset or null, and $param otherwise.
To use negative offsets that begin with a minus sign, separate the
minus sign and the colon with a space.
Section F: Things to watch out for on certain Unix versions
F1) Why can't I use command line editing in my `cmdtool'?
@ -1410,7 +1482,7 @@ comp.unix.shell). While most commands of the form
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.05a distribution is an
The file CWRU/sh-redir-hack in the bash 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
@ -1671,11 +1743,17 @@ 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.
The GNU Bash Reference Manual has been published as a printed book by
Network Theory Ltd (Paperback, ISBN: 0-9541617-7-7, Feb 2003). It covers
bash-2.0 and is available from most online bookstores (see
http://www.network-theory.co.uk/bash/manual/ for details). The publisher
will donate $1 to the Free Software Foundation for each copy sold.
H3) What's coming in future versions?
These are features I hope to include in a future version of bash.
a better bash debugger (a minimally-tested version is included with bash-2.05b)
Rocky Bernstein's bash debugger (support is included with bash-3.0)
associative arrays
co-processes, but with a new-style syntax that looks like function declaration
@ -1685,7 +1763,6 @@ These are features that may or may not appear in a future version of bash.
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'
date-stamped command history
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
@ -1698,10 +1775,9 @@ Some of the new ksh93 pattern matching operators, like backreferencing
H5) When will the next release appear?
The next version will appear sometime in 2002. Never make predictions.
The next version will appear sometime in 2005. Never make predictions.
This document is Copyright 1995-2002 by Chester Ramey.
This document is Copyright 1995-2004 by Chester Ramey.
Permission is hereby granted, without written agreement and
without license or royalty fees, to use, copy, and distribute

View file

@ -1,6 +1,6 @@
# This Makefile is for the Bash/documentation directory -*- text -*-.
#
# Copyright (C) 1996 Free Software Foundation, Inc.
# Copyright (C) 2003 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
@ -16,6 +16,14 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
PACKAGE = @PACKAGE_NAME@
VERSION = @PACKAGE_VERSION@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_VERSION = @PACKAGE_VERSION@
#
SHELL = @MAKE_SHELL@
RM = rm -f
@ -47,6 +55,8 @@ INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
BUILD_DIR = @BUILD_DIR@
SUPPORT_SRCDIR = $(topdir)/support
# bad style
RL_LIBDIR = $(topdir)/lib/readline
@ -55,21 +65,24 @@ TEXINDEX = texindex
TEX = tex
MAKEINFO = makeinfo
TEXI2DVI = ${topdir}/support/texi2dvi
TEXI2HTML = ${topdir}/support/texi2html
TEXI2DVI = ${SUPPORT_SRCDIR}/texi2dvi
TEXI2HTML = ${SUPPORT_SRCDIR}/texi2html
MAN2HTML = ${BUILD_DIR}/support/man2html
HTMLPOST = ${srcdir}/htmlpost.sh
INFOPOST = ${srcdir}/infopost.sh
QUIETPS = #set this to -q to shut up dvips
PAPERSIZE = letter # change to a4 for A4-size paper
PSDPI = 300 # could be 600 if you like
PSDPI = 600 # could be 300 if you like
DVIPS = dvips -D ${PSDPI} $(QUIETPS) -t ${PAPERSIZE} -o $@ # tricky
TEXINPUTDIR = $(RL_LIBDIR)/doc
SET_TEXINPUTS = TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS
# These tools might not be available; they're not required
DVIPDF = dvipdfm -o $@ -p ${PAPERSIZE}
PSPDF = gs -sPAPERSIZE=${PAPERSIZE} -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@
MKDIRS = ${topdir}/support/mkdirs
MKDIRS = ${SUPPORT_SRCDIR}/mkdirs
# This should be a program that converts troff to an ascii-readable format
NROFF = groff -Tascii
@ -77,8 +90,10 @@ NROFF = groff -Tascii
# This should be a program that converts troff to postscript
GROFF = groff
HSUSER = $(RL_LIBDIR)/doc/hsuser.texinfo
RLUSER = $(RL_LIBDIR)/doc/rluser.texinfo
HSUSER = $(RL_LIBDIR)/doc/hsuser.texi
RLUSER = $(RL_LIBDIR)/doc/rluser.texi
BASHREF_FILES = $(srcdir)/bashref.texi $(srcdir)/version.texi
.SUFFIXES: .0 .1 .3 .ms .ps .txt .dvi .html .pdf
@ -122,10 +137,14 @@ RLUSER = $(RL_LIBDIR)/doc/rluser.texinfo
$(RM) $@
-${DVIPDF} $<
.dvi.ps:
${RM} $@
-${DVIPS} $<
all: ps info dvi text html
nodvi: ps info text html
PSFILES = bash.ps bashbug.ps article.ps builtins.ps rbash.ps
PSFILES = bash.ps bashbug.ps article.ps builtins.ps rbash.ps
DVIFILES = bashref.dvi bashref.ps
INFOFILES = bashref.info
MAN0FILES = bash.0 bashbug.0 builtins.0 rbash.0
@ -139,35 +158,17 @@ text: ${MAN0FILES}
html: ${HTMLFILES}
pdf: ${PDFFILES}
bashref.dvi: $(srcdir)/bashref.texi $(HSUSER) $(RLUSER)
TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/bashref.texi
bashref.dvi: $(BASHREF_FILES) $(HSUSER) $(RLUSER)
${SET_TEXINPUTS} $(TEXI2DVI) $(srcdir)/bashref.texi
bashref.ps: bashref.dvi
$(RM) $@
$(DVIPS) bashref.dvi
bashref.info: $(srcdir)/bashref.texi $(HSUSER) $(RLUSER)
bashref.info: $(BASHREF_FILES) $(HSUSER) $(RLUSER)
$(MAKEINFO) --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi
bashref.html: bashref.texi $(HSUSER) $(RLUSER)
bashref.html: $(BASHREF_FILES) $(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
#
#bashman.ps: bash.dvi
# $(RM) $@
# $(DVIPS) bash.dvi
bash.info: bashref.info
${SHELL} ${INFOPOST} < $(srcdir)/bashref.info > $@ ; \
bash.txt: bash.1
bash.ps: bash.1
@ -181,6 +182,8 @@ builtins.0: builtins.1 bash.1
rbash.0: rbash.1 bash.1
article.ps: article.ms
bashref.ps: bashref.dvi
article.pdf: article.ps
bashref.pdf: bashref.dvi
bash.pdf: bash.ps
@ -211,18 +214,18 @@ maybe-clean:
fi
installdirs:
-test -d $(man1dir) || $(SHELL) ${MKDIRS} $(DESTDIR)$(man1dir)
-test -d $(infodir) || $(SHELL) ${MKDIRS} $(DESTDIR)$(infodir)
-$(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(man1dir)
-$(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(infodir)
-if test -n "$(htmldir)" ; then \
test -d $(htmldir) || $(SHELL) ${MKDIRS} $(DESTDIR)$(htmldir) ; \
$(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(htmldir) ; \
fi
install: info installdirs
install: info installdirs bash.info
-$(INSTALL_DATA) $(srcdir)/bash.1 $(DESTDIR)$(man1dir)/bash${man1ext}
-$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext}
# uncomment the next line to install the builtins man page
# -$(INSTALL_DATA) $(srcdir)/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
-$(INSTALL_DATA) $(srcdir)/bashref.info $(DESTDIR)$(infodir)/bash.info
-$(INSTALL_DATA) $(srcdir)/bash.info $(DESTDIR)$(infodir)/bash.info
# run install-info if it is present to update the info directory
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/bash.info; \
@ -285,4 +288,4 @@ rbash: bashref.texi
cmp -s RBASH ../RBASH || mv RBASH ../RBASH
$(RM) RBASH
xdist: inst posix rbash
xdist: pdf inst posix rbash

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 "2001 November 27" "GNU Bash-2.05a"
.TH BASH_BUILTINS 1 "2004 Apr 20" "GNU Bash-3.0"
.SH NAME
bash, :, ., [, alias, bg, bind, break, builtin, cd, command, compgen, complete,
continue, declare, dirs, disown, echo, enable, eval, exec, exit,

452
doc/fdl.texi Normal file
View file

@ -0,0 +1,452 @@
@node GNU Free Documentation License
@appendixsec GNU Free Documentation License
@cindex FDL, GNU Free Documentation License
@center Version 1.2, November 2002
@display
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
@enumerate 0
@item
PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document @dfn{free} in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
@item
APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The ``Document'', below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as ``you''. You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A ``Secondary Section'' is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject. (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
@sc{ascii} without markup, Texinfo input format, La@TeX{} input
format, @acronym{SGML} or @acronym{XML} using a publicly available
@acronym{DTD}, and standard-conforming simple @acronym{HTML},
PostScript or @acronym{PDF} designed for human modification. Examples
of transparent image formats include @acronym{PNG}, @acronym{XCF} and
@acronym{JPG}. Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, @acronym{SGML} or
@acronym{XML} for which the @acronym{DTD} and/or processing tools are
not generally available, and the machine-generated @acronym{HTML},
PostScript or @acronym{PDF} produced by some word processors for
output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
A section ``Entitled XYZ'' means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as ``Acknowledgements'',
``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
of such a section when you modify the Document means that it remains a
section ``Entitled XYZ'' according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
@item
VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
@item
COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
@item
MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
@enumerate A
@item
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
@item
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
@item
State on the Title page the name of the publisher of the
Modified Version, as the publisher.
@item
Preserve all the copyright notices of the Document.
@item
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
@item
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
@item
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
@item
Include an unaltered copy of this License.
@item
Preserve the section Entitled ``History'', Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
@item
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the ``History'' section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
@item
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
dedications given therein.
@item
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
@item
Delete any section Entitled ``Endorsements''. Such a section
may not be included in the Modified Version.
@item
Do not retitle any existing section to be Entitled ``Endorsements'' or
to conflict in title with any Invariant Section.
@item
Preserve any Warranty Disclaimers.
@end enumerate
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
@item
COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled ``History''
in the various original documents, forming one section Entitled
``History''; likewise combine any sections Entitled ``Acknowledgements'',
and any sections Entitled ``Dedications''. You must delete all
sections Entitled ``Endorsements.''
@item
COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
@item
AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an ``aggregate'' if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
@item
TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled ``Acknowledgements'',
``Dedications'', or ``History'', the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
@item
TERMINATION
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
@item
FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
@uref{http://www.gnu.org/copyleft/}.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License ``or any later version'' applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
@end enumerate
@page
@appendixsubsec ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
@smallexample
@group
Copyright (C) @var{year} @var{your name}.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end group
@end smallexample
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the ``with...Texts.'' line with this:
@smallexample
@group
with the Invariant Sections being @var{list their titles}, with
the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
being @var{list}.
@end group
@end smallexample
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
@c Local Variables:
@c ispell-local-pdict: "ispell-dict"
@c End:

397
doc/fdl.txt Normal file
View file

@ -0,0 +1,397 @@
GNU Free Documentation License
Version 1.2, November 2002
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The "Document", below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as "you". You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (Thus, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML, PostScript or PDF designed for human modification. Examples of
transparent image formats include PNG, XCF and JPG. Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
A section "Entitled XYZ" means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".) To "Preserve the Title"
of such a section when you modify the Document means that it remains a
section "Entitled XYZ" according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled "History", Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled "History" in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the "History" section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
K. For any section Entitled "Acknowledgements" or "Dedications",
Preserve the Title of the section, and preserve in the section all
the substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements". Such a section
may not be included in the Modified Version.
N. Do not retitle any existing section to be Entitled "Endorsements"
or to conflict in title with any Invariant Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled "History"
in the various original documents, forming one section Entitled
"History"; likewise combine any sections Entitled "Acknowledgements",
and any sections Entitled "Dedications". You must delete all sections
Entitled "Endorsements".
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an "aggregate" if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the "with...Texts." line with this:
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.

8
doc/infopost.sh Executable file
View file

@ -0,0 +1,8 @@
#! /bin/sh
#
# Some of these should really be done by options to makeinfo or by
# using @setfilename, but this way we can have both bashref.info and
# bash.info (for installing)
#
sed -e 's|bashref.info|bash.info|g'

View file

@ -1,4 +1,4 @@
.TH RBASH 1 "1999 Nov 29" GNU
.TH RBASH 1 "2004 Apr 20" "GNU Bash-3.0"
.SH NAME
rbash \- restricted bash, see \fBbash\fR(1)
.SH RESTRICTED SHELL

File diff suppressed because it is too large Load diff

10
doc/version.texi Normal file
View file

@ -0,0 +1,10 @@
@ignore
Copyright (C) 1988-2004 Free Software Foundation, Inc.
@end ignore
@set EDITION 3.0
@set VERSION 3.0
@set UPDATED 27 July 2004
@set UPDATED-MONTH July 2004
@set LASTCHANGE Tue Jul 27 09:12:07 EDT 2004

78
error.c
View file

@ -1,5 +1,5 @@
/* error.c -- Functions for handling errors. */
/* Copyright (C) 1993 Free Software Foundation, Inc.
/* Copyright (C) 1993-2003 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@ -40,11 +40,10 @@ extern int errno;
#endif /* !errno */
#include "bashansi.h"
#include "bashintl.h"
#include "shell.h"
#include "flags.h"
#include "error.h"
#include "command.h"
#include "general.h"
#include "externs.h"
#include "input.h"
#if defined (HISTORY)
@ -61,6 +60,10 @@ extern pid_t shell_pgrp;
extern int give_terminal_to __P((pid_t, int));
#endif /* JOB_CONTROL */
#if defined (ARRAY_VARS)
extern char *bash_badsub_errmsg;
#endif
static void error_prolog __P((int));
/* The current maintainer of the shell. You change this in the
@ -71,20 +74,22 @@ static void error_prolog __P((int));
char *the_current_maintainer = MAINTAINER;
int gnu_error_format = 0;
static void
error_prolog (print_lineno)
int print_lineno;
{
char *ename;
int line;
fprintf (stderr, "%s: ", get_name_for_error ());
ename = get_name_for_error ();
line = (print_lineno && interactive_shell == 0) ? executing_line_number () : -1;
if (print_lineno && interactive_shell == 0)
{
line = executing_line_number ();
if (line > 0)
fprintf (stderr, "line %d: ", line);
}
if (line > 0)
fprintf (stderr, "%s:%s%d: ", ename, gnu_error_format ? "" : " line ", line);
else
fprintf (stderr, "%s: ", ename);
}
/* Return the name of the shell or the shell script for error reporting. */
@ -92,10 +97,23 @@ char *
get_name_for_error ()
{
char *name;
#if defined (ARRAY_VARS)
SHELL_VAR *bash_source_v;
ARRAY *bash_source_a;
#endif
name = (char *)NULL;
if (interactive_shell == 0)
name = dollar_vars[0];
{
#if defined (ARRAY_VARS)
bash_source_v = find_variable ("BASH_SOURCE");
if (bash_source_v && array_p (bash_source_v) &&
(bash_source_a = array_cell (bash_source_v)))
name = array_reference (bash_source_a, 0);
if (name == 0)
#endif
name = dollar_vars[0];
}
if (name == 0 && shell_name && *shell_name)
name = base_pathname (shell_name);
if (name == 0)
@ -144,7 +162,7 @@ programming_error (format, va_alist)
if (remember_on_history)
{
h = last_history_line ();
fprintf (stderr, "last command: %s\n", h ? h : "(null)");
fprintf (stderr, _("last command: %s\n"), h ? h : "(null)");
}
#endif
@ -152,7 +170,7 @@ programming_error (format, va_alist)
fprintf (stderr, "Report this to %s\n", the_current_maintainer);
#endif
fprintf (stderr, "Stopping myself...");
fprintf (stderr, _("Aborting..."));
fflush (stderr);
abort ();
@ -182,7 +200,7 @@ report_error (format, va_alist)
va_end (args);
if (exit_immediately_on_error)
sh_exit (1);
exit_shell (1);
}
void
@ -239,7 +257,7 @@ internal_warning (format, va_alist)
{
va_list args;
fprintf (stderr, "%s: warning: ", get_name_for_error ());
fprintf (stderr, _("%s: warning: "), get_name_for_error ());
SH_VA_START (args, format);
@ -299,11 +317,11 @@ parser_error (lineno, format, va_alist)
if (interactive)
fprintf (stderr, "%s: ", ename);
else if (interactive_shell)
fprintf (stderr, "%s: %s: line %d: ", ename, iname, lineno);
fprintf (stderr, "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : " line ", lineno);
else if (STREQ (ename, iname))
fprintf (stderr, "%s: line %d: ", ename, lineno);
fprintf (stderr, "%s:%s%d: ", ename, gnu_error_format ? "" : " line ", lineno);
else
fprintf (stderr, "%s: %s: line %d: ", ename, iname, lineno);
fprintf (stderr, "%s: %s:%s%d: ", ename, iname, gnu_error_format ? "" : " line ", lineno);
SH_VA_START (args, format);
@ -313,7 +331,7 @@ parser_error (lineno, format, va_alist)
va_end (args);
if (exit_immediately_on_error)
sh_exit (2);
exit_shell (2);
}
#ifdef DEBUG
@ -384,10 +402,10 @@ trace (format, va_alist)
static char *cmd_error_table[] = {
"unknown command error", /* CMDERR_DEFAULT */
"bad command type", /* CMDERR_BADTYPE */
"bad connector", /* CMDERR_BADCONN */
"bad jump", /* CMDERR_BADJUMP */
N_("unknown command error"), /* CMDERR_DEFAULT */
N_("bad command type"), /* CMDERR_BADTYPE */
N_("bad connector"), /* CMDERR_BADCONN */
N_("bad jump"), /* CMDERR_BADJUMP */
0
};
@ -399,7 +417,7 @@ command_error (func, code, e, flags)
if (code > CMDERR_LAST)
code = CMDERR_DEFAULT;
programming_error ("%s: %s: %d", func, cmd_error_table[code], e);
programming_error ("%s: %s: %d", func, _(cmd_error_table[code]), e);
}
char *
@ -409,7 +427,7 @@ command_errstr (code)
if (code > CMDERR_LAST)
code = CMDERR_DEFAULT;
return (cmd_error_table[code]);
return (_(cmd_error_table[code]));
}
#ifdef ARRAY_VARS
@ -417,7 +435,7 @@ void
err_badarraysub (s)
const char *s;
{
report_error ("%s: bad array subscript", s);
report_error ("%s: %s", s, _(bash_badsub_errmsg));
}
#endif
@ -425,12 +443,12 @@ void
err_unboundvar (s)
const char *s;
{
report_error ("%s: unbound variable", s);
report_error (_("%s: unbound variable"), s);
}
void
err_readonly (s)
const char *s;
{
report_error ("%s: readonly variable", s);
report_error (_("%s: readonly variable"), s);
}

6
eval.c
View file

@ -30,6 +30,8 @@
#include "bashansi.h"
#include <stdio.h>
#include "bashintl.h"
#include "shell.h"
#include "flags.h"
#include "trap.h"
@ -88,6 +90,7 @@ reader_loop ()
{
/* Some kind of throw to top_level has occured. */
case FORCE_EOF:
case ERREXIT:
case EXITPROG:
current_command = (COMMAND *)NULL;
if (exit_immediately_on_error)
@ -169,7 +172,8 @@ static sighandler
alrm_catcher(i)
int i;
{
printf ("\007timed out waiting for input: auto-logout\n");
printf (_("\007timed out waiting for input: auto-logout\n"));
bash_logout (); /* run ~/.bash_logout if this is a login shell */
jump_to_top_level (EXITPROG);
SIGRETURN (0);
}

Binary file not shown.

View file

@ -63,7 +63,7 @@ function coprocess ()
shift
local old_trap=$(trap -p SIGPIPE)
trap 'coprocess close -SIGPIPE' SIGPIPE
if [ $# -eq 1 -a "$1" = "--stdin" ] ; then
if [ $# -eq 1 ] && [ "$1" = "--stdin" ] ; then
cat >&61
else
echo "$@" >&61
@ -106,4 +106,3 @@ function coprocess ()
coprocess status
return $?
}

View file

@ -33,15 +33,16 @@ function alias ()
then
declare -f $1
else
echo $2 | egrep -s '(\!|#)' 2>/dev/null
if [ $? -eq 0 ]
then
case $2 in
*[#\!]*)
comm=$(echo $2 | sed 's/\\!\*/\"$\@\"/g
s/\\!:\([1-9]\)/\"$\1\"/g
s/#/\\#/g')
else
comm="$2 \"\$@\""
fi
;;
*)
comm="$2 \"\$@\"" ;;
esac
eval function $1 \(\) "{" command "$comm" "; }"
fi
}

View file

@ -8,7 +8,7 @@ function check_exit_status ()
local status="$?"
local signal=""
if [ ${status} -ne 0 -a ${status} != 128 ]; then
if [ ${status} -ne 0 ] && [ ${status} != 128 ]; then
# If process exited by a signal, determine name of signal.
if [ ${status} -gt 128 ]; then
signal="$(builtin kill -l $((${status} - 128)) 2>/dev/null)"

View file

@ -134,7 +134,7 @@ function getoptex()
let OPTIND || OPTIND=1
[ $OPTIND -lt $# ] || return 1
shift $OPTIND
if [ "$1" != "-" -a "$1" != "${1#-}" ]
if [ "$1" != "-" ] && [ "$1" != "${1#-}" ]
then OPTIND=$[OPTIND+1]; if [ "$1" != "--" ]
then
local o
@ -299,4 +299,3 @@ function getopt()
#**************************************
#*** (end of getopt2) ***

View file

@ -207,7 +207,7 @@ substring ()
;;
esac
# test for too few or too many arguments
if [ x"$1" = x -o $# -gt 2 ]; then
if [ x"$1" = x ] || [ $# -gt 2 ]; then
print -u2 'substring: bad argument count'
return 1
fi

View file

@ -70,7 +70,7 @@ function whatis ()
function apropos ()
{
whatis_internal "$1" "fgrep"
whatis_internal "$1" "grep -F"
}
# Note: "-" and "-t" together not supported. This man could be
@ -102,7 +102,7 @@ function man ()
g="grep -w"
a=$(basename "$2")
else
g=fgrep
g="grep -F"
a="$2"
fi
whatis_internal "$a" "$g"

View file

@ -44,15 +44,15 @@ function recurse
if cd "$1" ; then
for file in $2; do
if [ -f "$file" -o -d "$file" ]; then
if [ -f "$file" ] || [ -d "$file" ]; then
eval "$3"
fi
done
for file in .* * ; do
if [ "$file" = "." -o "$file" = ".." ] ; then
if [ "$file" = "." ] || [ "$file" = ".." ] ; then
continue
fi
if [ -d "$file" -a ! -L "$file" ]; then
if [ -d "$file" ] && [ ! -L "$file" ]; then
recurse "$file" "$2" "$3" "$path"
fi
done
@ -61,4 +61,3 @@ function recurse
}
recurse "$1" "$2" 'echo "$path$file"'

View file

@ -30,7 +30,7 @@ substr()
;;
esac
if [ "$#" -eq 0 -o "$#" -gt 2 ] ; then
if [ "$#" -eq 0 ] || [ "$#" -gt 2 ] ; then
echo "substr: bad argument count"
return 2
fi

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