Commit 28161460 authored by Daniel Kahn Gillmor's avatar Daniel Kahn Gillmor

Import Upstream version 2.0

parent 60f42358
This diff is collapsed.
This document details the incompatibilites between this version of bash,
bash-2.0, and the previous version, bash-1.14. These were discovered
by alpha and beta testers, so they will likely be encountered by a
significant number of users.
1. Bash now 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
a variable whose name is the value of a second variable:
eval var2=$"$var1"
you will have to change to a different syntax.
This capability is directly supported by bash-2.0:
var2=${!var1}
This alternate syntax will work portably between bash-1.14 and bash-2.0:
eval var2=\$${var1}
2. One of the bugs fixed in the YACC grammar tightens up the rules
concerning group commands ( {...} ). The `list' that composes the
body of the group command must be terminated by a newline or
semicolon. That's because the braces are reserved words, and are
recognized as such only when a reserved word is legal. This means
that while bash-1.14 accepted shell function definitions like this:
foo() { : }
bash-2.0 requires this:
foo() { :; }
This is also an issue for commands like this:
mkdir dir || { echo 'could not mkdir' ; exit 1; }
The syntax required by bash-2.0 is also accepted by bash-1.14.
3. The options to `bind' have changed to make them more consistent with
the rest of the bash builtins. If you are using `bind -d' to list
the readline keybindings in a form that can be re-read, use `bind -p'
instead. If you were using `bind -v' to list the keybindings, use
`bind -P' instead.
4. The `long' invocation options must now be prefixed by `--' instead
of `-'. (The old form is still accepted, for the time being.)
5. There was a bug in the version of readline distributed with bash-1.14
that caused it to write badly-formatted key bindings when using
`bind -d'. The only key sequences that were affected are C-\ (which
should appear as \C-\\ in a key binding) and C-" (which should appear
as \C-\"). If these key sequences appear in your inputrc, as, for
example,
"\C-\": self-insert
they will need to be changed to something like the following:
"\C-\\": self-insert
6. A number of people complained above having to use ESC to terminate an
incremental search, and asked for an alternate mechanism. Bash-2.0
allows ^J to terminate the search without accepting the line. Use
^M to terminate the search and accept the line, as in bash-1.14.
7. Some variables have been removed: MAIL_WARNING, notify, history_control,
command_oriented_history, glob_dot_filenames, allow_null_glob_expansion,
nolinks, hostname_completion_file, noclobber, no_exit_on_failed_exec, and
cdable_vars. Most of them are now implemented with the new `shopt'
builtin; others were already implemented by `set'.
8. The `ulimit' builtins now sets both hard and soft limits and reports the
soft limit by default (when neither -H nor -S is specified). This is
compatible with versions of sh and ksh that implement `ulimit'.
This diff is collapsed.
The version of bash in this directory has been compiled on the
following systems:
Sun 690 SunOS 4.1.2
Sparcstation SunOS 5.3
Sparcstation NetBSD 0.9a
386 BSDI BSD/386 1.0, 1.1
NeXTstation NeXT OS 2.1
IBM RT IBM/4.3 (AOS)
Motorola Delta 88K SVR3.2
Decstation 3100 Ultrix 4.3
Dec 4000 Alpha AXP DEC OSF/1 V1.3
386 ISC UNIX 3.0.1
386 FreeBSD 1.1
IBM RS/6000 AIX 3.2
Amiga Amiga UNIX 2.1
Sony NEWS 841 NEWS OS
HP 9000/834 HP/UX 7.0
By chet:
SunOS 4.1.4
SunOS 5.5
BSDI BSD/OS 2.1
Motorola SVR3.2
FreeBSD 2.1.5
AIX 4.2
HP/UX 9.05, 10.01, 10.10, 10.20
By other testers:
SCO ODT 2.0
SCO 3.2v5.0, 3.2v4.2
SunOS 5.3
SunOS 5.5
BSD/OS 2.1
FreeBSD 2.2
SunOS 4.1.3
Irix 5.3
Irix 6.2
Linux 2.0 (unknown distribution)
Digital OSF/1 3.2
GNU Hurd 0.1
SVR4.2
Starting bash with the `-posix' command-line option or setting the variable
POSIXLY_CORRECT while bash is running will cause bash to conform more
closely to the Posix.2 standard by changing the behavior to match that
specified by Posix.2 in areas where the bash default differs.
Bash POSIX Mode
===============
The following list is what's changed when `posixly_correct' is enabled:
Starting Bash with the `--posix' command-line option or executing `set
-o posix' while Bash is running will cause Bash to conform more closely
to the POSIX.2 standard by changing the behavior to match that
specified by POSIX.2 in areas where the Bash default differs.
1. When a command in the hash table no longer exists, bash will re-search
$PATH to find the new location.
The following list is what's changed when `POSIX mode' is in effect:
2. The >& redirection does not redirect stdout and stderr.
1. When a command in the hash table no longer exists, Bash will
re-search `$PATH' to find the new location. This is also
available with `shopt -s checkhash'.
3. The message printed by the job control code and builtins when a job
exits with a non-zero status is `Done(status)'.
2. The `>&' redirection does not redirect stdout and stderr.
4. The <> redirection does not open a file for both stdin and stdout, but
rather opens it for read-write on fd 0.
3. The message printed by the job control code and builtins when a job
exits with a non-zero status is `Done(status)'.
5. Reserved words may not be aliased.
4. Reserved words may not be aliased.
6. The Posix.2 PS1 and PS2 expansions of `!' -> history number and `!!' -> `!'
are enabled.
5. The POSIX.2 `PS1' and `PS2' expansions of `!' to the history
number and `!!' to `!' are enabled, and parameter expansion is
performed on the value regardless of the setting of the
`promptvars' option.
7. Interactive comments are enabled by default. (Note that this version has
them on by default anyway.)
6. Interactive comments are enabled by default. (Note that Bash has
them on by default anyway.)
8. The Posix.2 startup files are executed ($ENV) rather than the normal bash
files.
7. The POSIX.2 startup files are executed (`$ENV') rather than the
normal Bash files.
9. Tilde expansion is only performed on assignments preceding a command name,
rather than on all assignment statements on the line.
8. Tilde expansion is only performed on assignments preceding a
command name, rather than on all assignment statements on the line.
10. The default history file is ~/.sh_history (default value of $HISTFILE).
9. The default history file is `~/.sh_history' (this is the default
value of `$HISTFILE').
11. The output of `kill -l' prints all the signal names on a single line,
separated by spaces.
10. The output of `kill -l' prints all the signal names on a single
line, separated by spaces.
12. Non-interactive shells exit if `file' in `. file' is not found.
11. Non-interactive shells exit if FILENAME in `.' FILENAME is not
found.
13. Redirection operators do not perform pathname expansion on the word
in the redirection unless the shell is interactive
12. Redirection operators do not perform filename expansion on the word
in the redirection unless the shell is interactive.
14. Function names must be valid shell identifiers. That is, they may not
contain characters other than letters, digits, and underscores, and
may not start with a digit
13. Function names must be valid shell `name's. That is, they may not
contain characters other than letters, digits, and underscores, and
may not start with a digit. Declaring a function with an illegal
name causes a fatal syntax error in non-interactive shells.
There is other Posix.2 behavior that bash does not implement. Specifically:
14. POSIX.2 `special' builtins are found before shell functions during
command lookup.
1. There are no `special builtins' and `regular builtins'. All builtins
are equivalent. This means that:
15. If a POSIX.2 special builtin returns an error status, a
non-interactive shell exits. The fatal errors are those listed in
the POSIX.2 standard, and include things like passing incorrect
options, redirection errors, variable assignment errors for
assignments preceding the command name, and so on.
o assignment statements affect the execution environment of all
builtins, not just special ones
o temporary assignments do not persist after Posix.2 special
builtins complete
o Functions are found before Posix.2 special builtins
o The shell does not exit upon errors while executing Posix.2
special builtins
16. If the `cd' builtin finds a directory to change to using
`$CDPATH', the value it assigns to the `PWD' variable does not
contain any symbolic links, as if `cd -P' had been executed.
2. $LINENO does not represent the line number of a command within a function
17. A non-interactive shell exits with an error status if a variable
assignment error occurs when no command name follows the assignment
statements. A variable assignment error occurs, for example, when
trying to assign a value to a read-only variable.
18. A non-interactive shell exits with an error status if the iteration
variable in a `for' statement or the selection variable in a
`select' statement is a read-only variable.
19. Process substitution is not available.
20. Assignment statements preceding POSIX.2 `special' builtins persist
in the shell environment after the builtin completes.
There is other POSIX.2 behavior that Bash does not implement.
Specifically:
1. Assignment statements affect the execution environment of all
builtins, not just special ones.
3. The arithmetic evaluator does not implement the `e ? e1 : e2' conditional
expression
Notes:
ISC 386 machines must compile test.c without -O. The resultant shell dumps
core when test is invoked.
There have been reports that SCO 3.2v4.2 requires -DPRGP_PIPE in SCO_CFLAGS,
and that it has too many -D defines for SCO's cc (rcc works).
Contents of this directory:
CWRU.chlog - my change log since the last release
KSH.README - list of similarities with ksh. Slightly out of date
PLATFORMS.113 - list of platforms I have built this release on
changelog - my change log since the last release
POSIX.NOTES - list of what changes for `posix mode'
README - this file
RSH.README - explanation of the bash `restricted shell' mode
misc - directory with some useful tools
The following are distributed `as-is'. They will not apply without some
modification.
sh-redir-hack - diff to parse.y to get redirections before
compound commands
misc - directory with some useful tools
OS-BUGS - directory with messages detailing some OS bugs and
the bash workarounds
mh-folder-comp - diffs that reportedly add MH folder completion
This diff is collapsed.
This diff is collapsed.
/* ************************ */
/* */
/* A/UX 3.0 System */
/* */
/* ************************ */
#if defined (mc68k32) && !defined (M_MACHINE)
# define M_MACHINE "Macintosh"
# define M_OS "AUX"
# define SYSDEP_CFLAGS -ZP -DUSG -DHAVE_BCOPY -DHAVE_UID_T -DNSIG=32 \
-DHAVE_GETDTABLESIZE
# define SYSDEP_LDFLAGS -ZP
# define HAVE_DIRENT
# define HAVE_POSIX_SIGNALS
# define HAVE_VFPRINTF
# define VOID_SIGHANDLER
# define HAVE_GETGROUPS
# undef HAVE_RESOURCE
# undef HAVE_ALLOCA
# define REQUIRED_LIBRARIES -lc_s
#endif /* A/UX */
This diff is collapsed.
This diff is collapsed.
# Hey Emacs, this Makefile is in -*- makefile -*- mode!
#
# Makefile for Bash.
# If your cpp doesn't like -P, just get rid of it (the -P, not cpp).
# If you wish to use Gcc, then type `make CC=gcc CPPNAME='$(CC) -E''.
# If you wish to use GNU's Make, then change `MAKE'.
# If you don't like the destination, then change `bindir'.
# The file that you most likely want to look at is cpp-Makefile.
#
# If you haven't read README, now might be a good time.
# Include some boilerplate Gnu makefile definitions.
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
srcdir = .
VPATH = $(srcdir)
# MAKE = make
RM = rm -f
SHELL = /bin/sh
GAWK = awk
# GAWK = gawk
# Force CPPNAME to be the name of your C preprocesor if Bash can't
# find it. For instance, `CPPNAME=/usr/libexec/cpp' on 4.4 BSD.
# If all else fails, set CPPNAME=$(CC) -E
CPPNAME =
CPP = `$(SHELL) $(CPPMAGIC) $(GETCPPSYMS) "$(CPPNAME)"` -P
CPP_MAKEFILE = $(srcdir)/cpp-Makefile
ANSI_MAKEFILE = ansi-Makefile
# CPPFLAGS = $(SYSTEM) $(CPP_DEFINES)
CPPFLAGS = $(CPP_DEFINES) -I. -I$(srcdir)
CPP_ARGS = -DCPP_CC="$(CC)"
SUPPORTDIR = ./support/
SUPPORTSRC = $(srcdir)/support/
MKSYSDEFS = $(SUPPORTSRC)mksysdefs
CPPMAGIC = $(SUPPORTSRC)cppmagic
CAT_S = $(SUPPORTSRC)cat-s
GETCPPSYMS = $(SUPPORTDIR)getcppsyms
GETCPPSYMS_SRC = $(SUPPORTSRC)getcppsyms.c
# Here is a command which compresses runs of multiple blank lines to a
# single blank line. "cat -s" works for BSD systems, but not for USG
# systems. You can use an awk script if you like. If you have too
# much trouble with this, just forget it. It is for making
# bash-Makefile pretty and readable; something that isn't strictly
# necessary.
# SQUASH_BLANKS = cat -s
#
SQUASH_BLANKS = $(GAWK) -f $(CAT_S)
all: .notified bash-Makefile
$(MAKE) -f bash-Makefile $(MFLAGS) $(MAKEARGS) srcdir=$(srcdir)
bash-Makefile: $(CPP_MAKEFILE) Makefile machines.h sysdefs.h config.h
@-if [ -f ansi-Makefile ]; then \
echo "cp ansi-Makefile tmp-Makefile.c"; \
cp ansi-Makefile tmp-Makefile.c; else \
echo "cp $(CPP_MAKEFILE) tmp-Makefile.c"; \
cp $(CPP_MAKEFILE) tmp-Makefile.c; \
fi
$(RM) $(GETCPPSYMS)
$(SHELL) $(SUPPORTSRC)mkdirs support
$(CC) -o $(GETCPPSYMS) $(GETCPPSYMS_SRC)
rm -f bash-Makefile
@$(SHELL) -c 'echo $(CPP) $(CPPFLAGS) $(CPP_ARGS) tmp-Makefile.c \| $(SQUASH_BLANKS) \> bash-Makefile'
@$(SHELL) -c '$(CPP) $(CPPFLAGS) $(CPP_ARGS) tmp-Makefile.c | $(SQUASH_BLANKS) >bash-Makefile'
rm -f tmp-Makefile.c
@test -s bash-Makefile || { rm -f bash-Makefile ; exit 1; }
sysdefs.h: $(MKSYSDEFS)
$(SHELL) $(MKSYSDEFS) -s $(srcdir)
# This is also performed by support/mksysdefs, but there's no way to change
# it if cpp-Makefile is changed without changing anything else, since there
# are no dependencies. This lets you run `make ansi-Makefile'.
ansi-Makefile: $(CPP_MAKEFILE)
grep -v '/\*\*/' $(CPP_MAKEFILE) > $@
# Subsequent lines contain targets that are correctly handled by an
# existing bash-Makefile.
install uninstall newversion architecture: bash-Makefile
$(MAKE) -f bash-Makefile $(MFLAGS) $(MAKEARGS) bindir=$(bindir) \
prefix=$(prefix) $@
tests DEFINES tags documentation: bash-Makefile directory-frob
$(MAKE) -f bash-Makefile $(MFLAGS) $(MAKEARGS) $@
clean distclean realclean mostlyclean maintainer-clean: bash-Makefile directory-frob
rm -f .notified
$(MAKE) -f bash-Makefile $(MFLAGS) $(MAKEARGS) $@
directory-frob:
.NOEXPORT:
.notified:
@echo ""
@echo " You are about to make this version of GNU Bash for"
@echo " this architecture for the first time. If you haven't"
@echo " yet read the README file, you may want to do so. If"
@echo " you wish to report a bug in Bash, or in the installation"
@echo " procedure, please run the bashbug script and include:"
@echo ""
@echo " * a description of the bug,"
@echo " * a recipe for recreating the bug reliably,"
@echo " * a fix for the bug if you have one!"
@echo ""
@touch .notified
This diff is collapsed.
This diff is collapsed.
Platform-Specific Configuration Notes
=====================================
1. configure --without-gnu-malloc on:
alpha running OSF/1
alpha running Linux
next running NeXT/OS
all machines running SunOS YP code: SunOS4, SunOS5, HP/UX
linux (optional)
QNX 4.2
other OSF/1 machines (KSR/1, HP, IBM AIX/ESA)
AIX
sparc SVR4, SVR4.2 (ICL reference port)
DG/UX
Cray
NetBSD/sparc (malloc needs 8-byte alignment; GNU malloc has 4-byte)
BSD/OS 2.1 if you want to use loadable builtins
If you are using GNU libc, especially on a linux system
(Configuring --without-gnu-malloc will still result in lib/malloc/libmalloc.a
being built and linked against, but there is only a stub file in the archive.)
2. configure using shlicc on BSD/OS 2.1 to use loadable builtins
3. Bash cannot be built in a directory separate from the source directory
using configure --srcdir=... unless the version of `make' you're using
does $VPATH handling right. The SunOS make, for one, does not seem to
do it right. The script support/mkclone can be used to create a
`build tree' using symlinks to get around this.
4. I've had reports that username completion does not work on IRIX 5.3
when linking with -lnsl. This is only a problem when you're running
NIS. Editing the Makefile after configure runs and removing the
`-lnsl' from the assignment to `LIBS' fixes the problem.
This README file is in -*- text -*- mode, because Emacs likes it that way.
Introduction
============
This is GNU Bash, version 1.14. Bash is the GNU Project's Bourne
Again SHell, an interactive shell with Bourne shell syntax (/bin/sh);
This is GNU Bash, version 2.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 history features and brace
expansion, and a slew of other stuff. For more information on the
features of Bash that are new to this type of shell, see the file
`documentation/features.texi'. There is also a DVI file there, as
well as a large man page.
architectures that support it, csh-like features such as history
substitution and brace expansion, and a slew of other features.
For more information on the features of Bash that are new to this
type of shell, see the file `doc/features.texi'. There is also a
large man page. The manual page is the definitive description of
the shell's features.
To compile it, try typing `make'. Bash auto-configures the build
process, so no intervention should be necessary. If you want to
use gcc, type `make CC=gcc CPPNAME='$(CC) -E''.
See the file CWRU/POSIX.NOTES for a discussion of how Bash differs
from the POSIX.2 spec and a description of the Bash `posix mode'.
You may want to read the file INSTALL in this directory for more
information if the make fails.
There are some user-visible incompatibilities between this version
of Bash and the previous version, bash-1.14. For details, see the
file COMPAT.
Bash is free software, distributed under the terms of the GNU Public
License, version 2. For more information, see the file COPYING.
To compile Bash, try typing `./configure', then `make'. Bash
auto-configures the build process, so no further intervention
should be necessary. Bash builds with `gcc' by default if it is
available. If you want to use `cc' instead, type
CC=cc ./configure
if you are using a Bourne-style shell. If you are not, the following
may work:
env CC=cc ./configure
Read the file INSTALL in this directory for more information about how
to customize and control the build process. The file NOTES contains
platform-specific installation and configuration information.
If you are a csh user and wish to convert your csh aliases to Bash
aliases, you may wish to use the script in examples/alias-conv.sh
aliases, you may wish to use the script `examples/misc/alias-conv.sh'
as a starting point.
Bug reports for 1.14 should be sent to:
Reporting Bugs
==============
Bug reports for 2.0 should be sent to:
bug-bash@prep.ai.mit.edu
using the `bashbug' program that is built and installed at the same
time as bash.
The discussion list "bug-bash@prep.ai.mit.edu" often contains information
about new ports of Bash, or discussions of new features or behavior
changes that people would like. This mailing list is also available
as a usenet newsgroup: gnu.bash.bug.