From chak@enki.cse.unsw.edu.au Mon Oct 02 20:14:46 2000
Received: from note.orchestra.cse.unsw.edu.au ([129.94.242.29])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13gFjJ-00008N-00
	for <bug-bash@gnu.org>; Mon, 02 Oct 2000 20:14:46 -0400
Received: From FateAmenableToChange.cse.unsw.edu.au ([129.94.172.152]) By note With
	Smtp ; Tue, 3 Oct 2000 11:14:30 +1100 
Received: from enki.cse.unsw.edu.au (IDENT:root@enki.cse.unsw.EDU.AU [129.94.172.151])
	by FateAmenableToChange.cse.unsw.edu.au (8.9.3/8.9.3) with ESMTP id LAA11019
	for <bug-bash@gnu.org>; Tue, 3 Oct 2000 11:14:46 +1100
Received: (from chak@localhost)
	by enki.cse.unsw.edu.au (8.11.0/8.11.0) id e930FmY07560;
	Tue, 3 Oct 2000 11:15:48 +1100
From: chak@cse.unsw.edu.au
To: bug-bash@gnu.org
Date: Tue, 3 Oct 2000 11:15:48 +1100
Message-Id: <200010030015.e930FmY07560@enki.cse.unsw.edu.au>
Subject: Parameter expansion problem involving ${*#*--}
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DSHELL -DHAVE_CONFIG_H  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -I.  -I. -I./include -I./lib -I/usr/include -O2 -march=i386 -mcpu=i686
uname output: Linux enki 2.2.16-22 #1 Tue Aug 22 16:49:06 EDT 2000 i686 unknown
Machine Type: i386-redhat-linux-gnu

Bash Version: 2.04
Patch Level: 11
Release Status: release

Description:
	Parameter expansion including pattern matching misbehaves in an
	admittedly obscure case.  More precisely, the expansion of

	  ${*#*--}

	returns the wrong value for certain values of $* containing more than
	one occurrence of the substring `--'.  The problem seems to be
	confined to the special variable $* and does not occur with "normal"
	(alphanumeric) variables.

Repeat-By:
	The problem can be reproduced using the following shell script:

	  #!/bin/bash

	  echo 'Value of ${*}:      ' ${*}
	  echo 'Value of ${*#*--}:  ' ${*#*--}
	  echo 'Assigning $* to $bla'
	  bla="$*"
	  echo 'Value of ${bla}:    ' ${bla}
	  echo 'Value of ${bla#*--}:' ${bla#*--}

        Assuming that the script is stored in an executable file called
        `bash-bug', upon execution of

	  % bash-bug -- --delete

	the output is

	  Value of ${*}:       -- --delete
	  Value of ${*#*--}:   delete
	  Assigning $* to $bla
	  Value of ${bla}:     -- --delete
	  Value of ${bla#*--}: --delete

        Note the difference in the expansion of ${*#*--} and ${bla#*--}.


From chet@nike.ins.cwru.edu Tue Oct 03 11:37:30 2000
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13gU8I-0005Tz-00
	for <bug-bash@gnu.org>; Tue, 03 Oct 2000 11:37:30 -0400
Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi)
	id LAA10923; Tue, 3 Oct 2000 11:37:13 -0400 (EDT) (from chet)
Date: Tue, 3 Oct 2000 11:31:04 -0400
From: Chet Ramey <chet@nike.ins.cwru.edu>
To: chak@cse.unsw.edu.au
Subject: Re: Parameter expansion problem involving ${*#*--}
Cc: bug-bash@gnu.org, chet@po.cwru.edu
Reply-To: chet@po.CWRU.Edu
Message-ID: <1001003153104.AA10912.SM@nike.ins.cwru.edu>
Read-Receipt-To: chet@po.CWRU.Edu
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-In-Reply-To:  Message from chak@cse.unsw.edu.au of Tue, 3 Oct 2000 11:15:48 +1100 (id <200010030015.e930FmY07560@enki.cse.unsw.edu.au>)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

> Machine Type: i386-redhat-linux-gnu
> 
> Bash Version: 2.04
> Patch Level: 11
> Release Status: release
> 
> Description:
> 	Parameter expansion including pattern matching misbehaves in an
> 	admittedly obscure case.  More precisely, the expansion of
> 
> 	  ${*#*--}
> 
> 	returns the wrong value for certain values of $* containing more than
> 	one occurrence of the substring `--'.  The problem seems to be
> 	confined to the special variable $* and does not occur with "normal"
> 	(alphanumeric) variables.

No, bash is behaving properly.  You have encountered the difference between
unquoted and quoted expansions of $*.

> Repeat-By:
> 	The problem can be reproduced using the following shell script:
> 
> 	  #!/bin/bash
> 
> 	  echo 'Value of ${*}:      ' ${*}
> 	  echo 'Value of ${*#*--}:  ' ${*#*--}
> 	  echo 'Assigning $* to $bla'
> 	  bla="$*"
> 	  echo 'Value of ${bla}:    ' ${bla}
> 	  echo 'Value of ${bla#*--}:' ${bla#*--}
> 
>         Assuming that the script is stored in an executable file called
>         `bash-bug', upon execution of
> 
> 	  % bash-bug -- --delete
> 
> 	the output is
> 
> 	  Value of ${*}:       -- --delete

${*} is a list, not a single word.

> 	  Value of ${*#*--}:   delete

The manual page says, in the description of the ${parameter#word} expansion:

	If parameter is @ or *, the pattern removal operation is applied
	to each positional parameter in turn, and the expansion is the
	resultant list.

The first word is `--', and is removed completely.  The second word is
--delete, and is converted to delete.  This is the output you get.

> 	  Assigning $* to $bla
> 	  Value of ${bla}:     -- --delete

By using the double quotes, you just converted a list into a string.
(Actually, it would have behaved the same without the double quotes,
since variable assignment doesn't perform word splitting and you
haven't changed $IFS.)

> 	  Value of ${bla#*--}: --delete

This is an operation on a single string.

>         Note the difference in the expansion of ${*#*--} and ${bla#*--}.

As the man page documents.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


From chet@granite.ins.cwru.edu Mon Oct 02 10:02:45 2000
Received: from granite.ins.cwru.edu ([129.22.8.228])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13g68S-0000qZ-00
	for <bug-bash@prep.ai.mit.edu>; Mon, 02 Oct 2000 10:00:04 -0400
Received: (chet@localhost) by granite.INS.CWRU.Edu (8.8.8+cwru/CWRU-2.5-bsdi)
	id KAA10230; Mon, 2 Oct 2000 10:00:01 -0400 (EDT) (from chet)
Message-Id: <200010021400.KAA10230@granite.INS.CWRU.Edu>
Date: Mon, 2 Oct 2000 10:00:01 -0400 (EDT)
From: chet@po.cwru.edu (Chet Ramey)
To: bug-bash@prep.ai.mit.edu
Subject: BASH Frequently-Asked Questions (FAQ version 3.9)
Reply-To: chet@po.cwru.edu
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Archive-name: unix-faq/shell/bash
Posting-Frequency: monthly
Submitted-By: chet@po.cwru.edu (Chet Ramey)
Last-Modified: Thu May 18 13:08:48 EDT 2000
FAQ-Version: 3.9
Bash-Version: 2.04
URL: ftp://ftp.cwru.edu/pub/bash/FAQ
Maintainer: chet@po.cwru.edu (Chet Ramey)

This is the Bash FAQ, version 3.9, for Bash version 2.04.

This document contains a set of frequently-asked questions concerning
Bash, the GNU Bourne-Again Shell.  Bash is a freely-available command
interpreter with advanced features for both interactive use and shell
programming.

Another good source of basic information about shells is the collection
of FAQ articles periodically posted to comp.unix.shell.

Questions and comments concerning this document should be sent to
chet@po.cwru.edu.

This document is available for anonymous FTP with the URL

ftp://ftp.cwru.edu/pub/bash/FAQ

The Bash home page is http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html

----------
Contents:

Section A:  The Basics

A1) What is it?
A2) What's the latest version?
A3) Where can I get it?
A4) On what machines will bash run?
A5) Will bash run on operating systems other than Unix?
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'?
A10) What is the bash `posix mode'?

Section B:  The latest version

B1) What's new in version 2.04?
B2) Are there any user-visible incompatibilities between bash-2.04 and
    bash-1.14.7?

Section C:  Differences from other Unix shells

C1) How does bash differ from sh, the Bourne shell?
C2) How does bash differ from the Korn shell, version ksh88?
C3) Which new features in ksh-93 are not in bash, and which are?

Section D:  Why does bash do some things differently than other Unix shells?

D1) Why does bash run a different version of `command' than
    `which command' says it will?
D2) Why doesn't bash treat brace expansions exactly like csh?
D3) Why doesn't bash have csh variable modifiers?
D4) How can I make my csh aliases work when I convert to bash?
D5) How can I pipe standard output and standard error from one command to
    another, like csh does with `|&'?
D6) Now that I've converted from ksh to bash, are there equivalents to
    ksh features like autoloaded functions and the `whence' command?

Section E:  Why does bash do certain things the way it does?

E1) Why is the bash builtin `test' slightly different from /bin/test?
E2) Why does bash sometimes say `Broken pipe'?
E3) When I have terminal escape sequences in my prompt, why does bash
    wrap lines at the wrong column?
E4) If I pipe the output of a command into `read variable', why doesn't
    the output show up in $variable when the read command finishes?
E5) I have a bunch of shell scripts that use backslash-escaped characters
    in arguments to `echo'.  Bash doesn't interpret these characters.  Why
    not, and how can I make it understand them?
E6) Why doesn't a while or for loop get suspended when I type ^Z?
E7) What about empty for loops in Makefiles?
E8) Why does the arithmetic evaluation code complain about `08'?

Section F:  Things to watch out for on certain Unix versions

F1) Why can't I use command line editing in my `cmdtool'?
F2) I built bash on Solaris 2.  Why do globbing expansions and filename
    completion chop off the first few characters of each filename?
F3) Why does bash dump core after I interrupt username completion or
    `~user' tilde expansion on a machine running NIS?
F4) I'm running SVR4.2.  Why is the line erased every time I type `@'?
F5) Why does bash report syntax errors when my C News scripts use a
    redirection before a subshell command?
F6) Why can't I use vi-mode editing on Red Hat Linux 6.1?

Section G:  How can I get bash to do certain common things?

G1) How can I get bash to read and display eight-bit characters?
G2) How do I write a function `x' to replace builtin command `x', but
    still invoke the command from within the function?
G3) How can I find the value of a shell variable whose name is the value
    of another shell variable?
G4) How can I make the bash `time' reserved word print timing output that
    looks like the output from my system's /usr/bin/time?
G5) How do I get the current directory into my prompt?
G6) How can I rename "*.foo" to "*.bar"?
G7) How can I translate a filename from uppercase to lowercase?
G8) How can I write a filename expansion (globbing) pattern that will match
    all files in the current directory except "." and ".."?

Section H:  Where do I go from here?

H1) How do I report bugs in bash, and where should I look for fixes and
    advice?
H2) What kind of bash documentation is there?
H3) What's coming in future versions?
H4) What's on the bash `wish list'?
H5) When will the next release appear?

----------
Section A:  The Basics

A1)  What is it?

Bash is a Unix command interpreter (shell).  It is an implementation of
the Posix 1003.2 shell standard, and resembles the Korn and System V
shells.

Bash contains a number of enhancements over those shells, both
for interactive use and shell programming.  Features geared
toward interactive use include command line editing, command
history, job control, aliases, and prompt expansion.  Programming
features include additional variable expansions, shell
arithmetic, and a number of variables and options to control
shell behavior.

Bash was originally written by Brian Fox of the Free Software
Foundation.  The current developer and maintainer is Chet Ramey
of Case Western Reserve University.

A2)  What's the latest version?

The latest version is 2.04, first made available on Friday, 17 March 2000.

A3)  Where can I get it?

Bash is the GNU project's shell, and so is available from the
master GNU archive site, ftp.gnu.org, and its mirrors.  The
latest version is also available for FTP from ftp.cwru.edu.
The following URLs tell how to get version 2.04:

ftp://ftp.gnu.org/pub/gnu/bash/bash-2.04.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-2.04.tar.gz

Formatted versions of the documentation are available with the URLs:

ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-2.04.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-2.04.tar.gz

A4)  On what machines will bash run?

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
itself accordingly, using a script created by GNU autoconf.

More information appears in the file `INSTALL' in the distribution.

A5) Will bash run on operating systems other than Unix?

Configuration specifics for Unix-like systems such as QNX and
LynxOS are included in the distribution.  Bash-2.04 should 
compile and run on Minix 2.0 (patches were contributed), but I
don't believe anyone has built bash-2.x on earlier Minix versions
yet.

Bash has been ported to versions of Windows implementing the Win32
programming interface.  This includes Windows 95 and Windows NT.
The port was done by Cygnus Solutions as part of their CYGWIN
project.  For more information about the project, look at the URL

http:/sourceware.cygnus.com/cygwin

Cygnus originally ported bash-1.14.7, and that port was part of their
early GNU-Win32 (the original name) releases.  Cygnus has also done a
port of bash-2.02.1 to the CYGWIN environment, and it is available as
part of their current release.  (They may have upgraded by now.)

Bash-2.04 should require no local Cygnus changes to build and run under
CYGWIN.

The Cygnus port works only on Intel machines.  There is a port of bash
(I don't know which version) to the alpha/NT environment available from

ftp://ftp.gnustep.org//pub/win32/bash-alpha-nt-1.01.tar.gz

Softway Systems has ported bash-2.01 to their Interix (nee OpenNT)
system, a Unix subsystem for NT that replaces the Microsoft POSIX
subsystem.  Check out http://www.interix.com for more information.
Some support for Interix has been incorporated into bash, beginning
with Bash-2.03.  It should be easier to build bash on Interix now,
but Interix users should fetch

ftp://ftp.interix.com/pub/tw/unsup/bash.diffs.tar.gz

and read the README.OpenNT file in that archive.  It will detail the
arguments `configure' needs to build on Interix.  A configure cache
file for Interix is in the bash distribution in cross-build/opennt.cache;
copy that to `config.cache' before starting configure.

DJ Delorie has a port of bash-1.14.7 which runs under MS-DOS, as part
of the DJGPP project.  For more information on the project, see

http://www.delorie.com/djgpp/

I have been told that the original DJGPP port was done by Daisuke Aoyama.

I picked up a binary of bash-1.14.7 that is purported to work with
the DJGPP V2 environment from

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147b.zip

The corresponding source is

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147s.zip

Mark Elbrecht <snowball3@bigfoot.com> has sent me notice that bash-2.03
has become available for DJGPP V2.  The files are available as:

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203b.zip	binary
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203d.zip	documentation
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203s.zip	source

Mark has begun to work with bash-2.04.

Ports of bash-1.12 and bash-2.0 are available for OS/2 from

ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash_112.zip
ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash-2.0(253).zip

I haven't looked at either, but the second appears to be a binary-only
distribution.  Beware.

I have received word that Bash (I'm not sure which version, but I
believe that it's at least bash-2.02.1) is the standard shell on
BeOS.

A6) How can I build bash with gcc? 

Bash configures to use gcc by default if it is available.  Read the
file INSTALL in the distribution for more information.

A7)  How can I make bash my login shell?

Some machines let you use `chsh' to change your login shell.  Other
systems use `passwd -s' or `passwd -e'.  If one of these works for
you, that's all you need.  Note that many systems require the full
pathname to a shell to appear in /etc/shells before you can make it
your login shell.  For this, you may need the assistance of your
friendly local system administrator. 

If you cannot do this, you can still use bash as your login shell, but
you need to perform some tricks.  The basic idea is to add a command
to your login shell's startup file to replace your login shell with
bash.

For example, if your login shell is csh or tcsh, and you have installed
bash in /usr/gnu/bin/bash, add the following line to ~/.login:

	if ( -f /usr/gnu/bin/bash ) exec /usr/gnu/bin/bash --login

(the `--login' tells bash that it is a login shell).

It's not a good idea to put this command into ~/.cshrc, because every
csh you run without the `-f' option, even ones started to run csh scripts,
reads that file.  If you must put the command in ~/.cshrc, use something
like

	if ( $?prompt ) exec /usr/gnu/bin/bash --login

to ensure that bash is exec'd only when the csh is interactive.

If your login shell is sh or ksh, you have to do two things.

First, create an empty file in your home directory named `.bash_profile'.
The existence of this file will prevent the exec'd bash from trying to
read ~/.profile, and re-execing itself over and over again.  ~/.bash_profile
is the first file bash tries to read initialization commands from when
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

This will cause login shells to replace themselves with bash running as
a login shell.  Once you have this working, you can copy your initialization
code from ~/.profile to ~/.bash_profile.

I have received word that the recipe supplied above is insufficient for
machines running CDE.  CDE has a maze of twisty little startup files, all
slightly different.

If you cannot change your login shell in the password file to bash, you
will have to (apparently) live with CDE using the shell in the password
file to run its startup scripts.  If you have changed your shell to bash,
there is code in the CDE startup files (on Solaris, at least) to do the
right thing. 

`dtterm' claims to use $SHELL as the default program to start, so if you
can change $SHELL in the CDE startup files, you should be able to use bash
in your terminal windows.

Setting DTSOURCEPROFILE in ~/.dtprofile will cause the `Xsession' program
to read your login shell's startup files.  You may be able to use bash for
the rest of the CDE programs by setting SHELL to bash in ~/.dtprofile as
well, but I have not tried this.

You can use the above `exec' recipe to start bash when not logging in with
CDE by testing the value of the DT variable:

	if [ -n "$DT" ]; then
	        [ -f /usr/gnu/bin/bash ] && exec /usr/gnu/bin/bash --login
	fi


A8) I just changed my login shell to bash, and now I can't FTP into my
   machine.  Why not?

You must add the full pathname to bash to the file /etc/shells.  As
noted in the answer to the previous question, many systems require
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'?

POSIX is a name originally coined by Richard Stallman for a
family of open system standards based on UNIX.  There are a
number of aspects of UNIX under consideration for
standardization, from the basic system services at the system
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. 

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 `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
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
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.

A10)  What is the bash `posix mode'?

Although bash is an implementation of the POSIX.2 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. 

Posix mode is entered by starting bash with the --posix option or
executing `set -o posix' after bash is running.

The specific aspects of bash which change when posix mode is
active are listed in the file CWRU/POSIX.NOTES in the bash
distribution.  They are also listed in a section in the Bash
Reference Manual.

Section B:  The latest version

B1) What's new in version 2.04?

Bash-2.04 contains the following new features (see the manual page for
complete descriptions and the CHANGES and NEWS files in the bash-2.04
distribution):

o Programmable word completion with the new `complete' and `compgen' builtins;
  examples are provided in examples/complete/complete-examples
o `history' has a new `-d' option to delete a history entry
o `bind' has a new `-x' option to bind key sequences to shell commands
o The prompt expansion code has new `\j' and `\l' escape sequences
o The `no_empty_cmd_completion' shell option, if enabled, inhibits
  command completion when TAB is typed on an empty line
o `help' has a new `-s' option to print a usage synopsis
o New arithmetic operators: var++, var--, ++var, --var, expr1,expr2 (comma)
o New ksh93-style arithmetic for command:
	for ((expr1 ; expr2; expr3 )); do list; done
o `read' has new options: `-t', `-n', `-d', `-s'
o The redirection code handles several filenames specially:  /dev/fd/N,
  /dev/stdin, /dev/stdout, /dev/stderr
o The redirection code now recognizes /dev/tcp/HOST/PORT and
  /dev/udp/HOST/PORT and tries to open a TCP or UDP socket, respectively,
  to the specified port on the specified host
o The ${!prefix*} expansion has been implemented
o A new FUNCNAME variable, which expands to the name of a currently-executing
  function
o The GROUPS variable is no longer readonly
o A new shopt `xpg_echo' variable, to control the behavior of echo with
  respect to backslash-escape sequences at runtime
o The NON_INTERACTIVE_LOGIN_SHELLS #define has returned

The version of Readline released with Bash-2.04, Readline-4.1, has several
new features as well:

o Parentheses matching is always compiled into readline, and controllable
  with the new `blink-matching-paren' variable
o The history-search-forward and history-search-backward functions now leave
  point at the end of the line when the search string is empty, like
  reverse-search-history, and forward-search-history
o A new function for applications:  rl_on_new_line_with_prompt()
o New variables for applications:  rl_already_prompted, and rl_gnu_readline_p


A short feature history dating from bash-2.0:

Bash-2.03 had very few new features, in keeping with the convention
that odd-numbered releases provide mainly bug fixes.  A number of new
features were added to Readline, mostly at the request of the Cygnus
folks.

A new shopt option, `restricted_shell', so that startup files can test
	whether or not the shell was started in restricted mode
Filename generation is now performed on the words between ( and ) in
	compound array assignments (this is really a bug fix)
OLDPWD is now auto-exported, as POSIX.2 requires
ENV and BASH_ENV are read-only variables in a restricted shell
Bash may now be linked against an already-installed Readline library,
	as long as the Readline library is version 4 or newer
All shells begun with the `--login' option will source the login shell
	startup files, even if the shell is not interactive

There were lots of changes to the version of the Readline library released
along with Bash-2.03.  For a complete list of the changes, read the file
CHANGES in the Bash-2.03 distribution.

Bash-2.02 contained the following new features:

a new version of malloc (based on the old GNU malloc code in previous
	bash versions) that is more page-oriented, more conservative
	with memory usage, does not `orphan' large blocks when they
	are freed, is usable on 64-bit machines, and has allocation
	checking turned on unconditionally
POSIX.2-style globbing character classes ([:alpha:], [:alnum:], etc.)
POSIX.2-style globbing equivalence classes
POSIX.2-style globbing collating symbols
the ksh [[...]] extended conditional command
the ksh egrep-style extended pattern matching operators
a new `printf' builtin
the ksh-like $(<filename) command substitution, which is equivalent to
	$(cat filename)
new tilde prefixes that expand to directories from the directory stack
new `**' arithmetic operator to do exponentiation
case-insensitive globbing (filename expansion)
menu completion a la tcsh
`magic-space' history expansion function like tcsh
the readline inputrc `language' has a new file inclusion directive ($include)

Bash-2.01 contained only a few new features:

new `GROUPS' builtin array variable containing the user's group list
new bindable readline commands: history-and-alias-expand-line and
	alias-expand-line

Bash-2.0 contained extensive changes and new features from bash-1.14.7.
Here's a short list:

new `time' reserved word to time pipelines, shell builtins, and
	shell functions
one-dimensional arrays with a new compound assignment statement,
        appropriate expansion constructs and modifications to some
	of the builtins (read, declare, etc.) to use them
new quoting syntaxes for ANSI-C string expansion and locale-specific
	string translation
new expansions to do substring extraction, pattern replacement, and
	indirect variable expansion
new builtins: `disown' and `shopt'
new variables: HISTIGNORE, SHELLOPTS, PIPESTATUS, DIRSTACK, GLOBIGNORE,
	       MACHTYPE, BASH_VERSINFO
special handling of many unused or redundant variables removed
	(e.g., $notify, $glob_dot_filenames, $no_exit_on_failed_exec)
dynamic loading of new builtin commands; many loadable examples provided
new prompt expansions: \a, \e, \n, \H, \T, \@, \v, \V
history and aliases available in shell scripts
new readline variables: enable-keypad, mark-directories, input-meta,
	visible-stats, disable-completion, comment-begin
new readline commands to manipulate the mark and operate on the region
new readline emacs mode commands and bindings for ksh-88 compatibility
updated and extended builtins
new DEBUG trap
expanded (and now documented) restricted shell mode

implementation stuff:	
autoconf-based configuration
nearly all of the bugs reported since version 1.14 have been fixed
most builtins converted to use builtin `getopt' for consistency
most builtins use -p option to display output in a reusable form
	(for consistency)
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.04 and
    bash-1.14.7?

There are a few incompatibilities between version 1.14.7 and version 2.04.
They are detailed in the file COMPAT in the bash-2.04 distribution.

Section C:  Differences from other Unix shells

C1) How does bash differ from sh, the Bourne shell?

This is a non-comprehensive list of features that differentiate bash
from the SVR4.2 shell.  The bash manual page explains these more
completely.

Things bash has that sh does not:
	long invocation options
	`!' reserved word to invert pipeline return value
	`time' reserved word to time pipelines and shell builtins
	the `function' reserved word
	the `select' compound command and reserved word
	arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
	new $'...' and $"..." quoting
	the $(...) form of command substitution
	the $(<filename) form of command substitution, equivalent to
		$(cat filename)
	the ${#param} parameter value length operator
	the ${!param} indirect parameter expansion operator
	the ${!param*} prefix expansion operator
	the ${param:length[:offset]} parameter substring operator
	the ${param/pat[/string]} parameter pattern substitution operator
	expansions to perform substring removal (${p%[%]w}, ${p#[#]w})
	expansion of positional parameters beyond $9 with ${num}
	variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, REPLY,
		   TIMEFORMAT, PPID, PWD, OLDPWD, SHLVL, RANDOM, SECONDS,
		   LINENO, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE, HOSTNAME,
		   ENV, PS3, PS4, DIRSTACK, PIPESTATUS, HISTSIZE, HISTFILE,
		   HISTFILESIZE, HISTCONTROL, HISTIGNORE, GLOBIGNORE, GROUPS,
		   PROMPT_COMMAND, FCEDIT, FIGNORE, IGNOREEOF, INPUTRC,
		   SHELLOPTS, OPTERR, HOSTFILE, TMOUT, FUNCNAME, histchars,
		   auto_resume
	DEBUG trap
	variable arrays with new compound assignment syntax
	redirections: <>, &>, >|
	prompt string special char translation and variable expansion
	auto-export of variables in initial environment
	command search finds functions before builtins
	bash return builtin will exit a file sourced with `.'
	builtins: cd -/-L/-P, exec -l/-c/-a, echo -e/-E, hash -p.
		  export -n/-f/-p/name=value, pwd -L/-P,
		  read -e/-p/-a/-t/-n/-d/-s,
		  readonly -a/-f/name=value, trap -l, set +o,
		  set -b/-m/-o option/-h/-p/-B/-C/-H/-P,
		  unset -f/-v, ulimit -m/-p/-u,
		  type -a/-p/-t, suspend -f, kill -n,
		  test -o optname/s1 == s2/s1 < s2/s1 > s2/-nt/-ot/-ef/-O/-G/-S
	bash reads ~/.bashrc for interactive shells, $ENV for non-interactive
	bash restricted shell mode is more extensive
	bash allows functions and variables with the same name
	brace expansion
	tilde expansion
	arithmetic expansion with $((...)) and `let' builtin
	the `[[...]]' extended conditional command
	process substitution
	aliases and alias/unalias builtins
	local variables in functions and `local' builtin
	readline and command-line editing with programmable completion
	command history and history/fc builtins
	csh-like history expansion
	other new bash builtins: bind, command, compgen, complete, builtin,
				 declare/typeset, dirs, enable, fc, help,
				 history, logout, popd, pushd, disown, shopt,
				 printf
	exported functions
	filename generation when using output redirection (command >a*)
	POSIX.2-style globbing character classes
	POSIX.2-style globbing equivalence classes
	POSIX.2-style globbing collating symbols
	egrep-like extended pattern matching operators
	case-insensitive pattern matching and globbing
	variable assignments preceding commands affect only that command,
		even for builtins and functions
	posix mode
	redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr,
		/dev/tcp/host/port, /dev/udp/host/port

Things sh has that bash does not:
	uses variable SHACCT to do shell accounting
	includes `stop' builtin (bash can use alias stop='kill -s STOP')
	`newgrp' builtin
	turns on job control if called as `jsh'
	$TIMEOUT (like bash $TMOUT)
	`^' is a synonym for `|'
	new SVR4.2 sh builtins: mldmode, priv

Implementation differences:
	redirection to/from compound commands causes sh to create a subshell
	bash does not allow unbalanced quotes; sh silently inserts them at EOF
	bash does not mess with signal 11
	sh sets (euid, egid) to (uid, gid) if -p not supplied and uid < 100
	bash splits only the results of expansions on IFS, using POSIX.2
		field splitting rules; sh splits all words on IFS
	sh does not allow MAILCHECK to be unset (?)
	sh does not allow traps on SIGALRM or SIGCHLD
	bash allows multiple option arguments when invoked (e.g. -x -v);
		sh allows only a single option argument (`sh -x -v' attempts
		to open a file named `-v', and, on SunOS 4.1.4, dumps core.
		On Solaris 2.4 and earlier versions, sh goes into an infinite
		loop.)
	sh exits a script if any builtin fails; bash exits only if one of
		the POSIX.2 `special' builtins fails

C2)  How does bash differ from the Korn shell, version ksh88?

Things bash has or uses that ksh88 does not:
	long invocation options
	`!' reserved word
	arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
	posix mode and posix conformance
	command hashing
	tilde expansion for assignment statements that look like $PATH
	process substitution with named pipes if /dev/fd is not available
	the ${!param} indirect parameter expansion operator
	the ${!param*} prefix expansion operator
	the ${param:length[:offset]} parameter substring operator
	the ${param/pat[/string]} parameter pattern substitution operator
	variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, SHLVL,
		   TIMEFORMAT, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE,
		   HISTFILESIZE, HISTIGNORE, HISTCONTROL, PROMPT_COMMAND,
		   IGNOREEOF, FIGNORE, INPUTRC, HOSTFILE, DIRSTACK,
		   PIPESTATUS, HOSTNAME, OPTERR, SHELLOPTS, GLOBIGNORE,
		   GROUPS, FUNCNAME, histchars, auto_resume
	prompt expansion with backslash escapes and command substitution
	redirection: &> (stdout and stderr)
	more extensive and extensible editing and programmable completion
	builtins: bind, builtin, command, declare, dirs, echo -e/-E, enable,
		  exec -l/-c/-a, fc -s, export -n/-f/-p, hash, help, history,
		  jobs -x/-r/-s, kill -s/-n/-l, local, logout, popd, pushd,
		  read -e/-p/-a/-t/-n/-d/-s, readonly -a/-n/-f/-p,
		  set -o braceexpand/-o histexpand/-o interactive-comments/
		  -o notify/-o physical/-o posix/-o hashall/-o onecmd/
		  -h/-B/-C/-b/-H/-P, set +o, suspend, trap -l, type,
		  typeset -a/-F/-p, ulimit -u, umask -S, alias -p, shopt,
		  disown, printf, complete, compgen
	`!' csh-style history expansion
	POSIX.2-style globbing character classes
	POSIX.2-style globbing equivalence classes
	POSIX.2-style globbing collating symbols
	egrep-like extended pattern matching operators
	case-insensitive pattern matching and globbing
	`**' arithmetic operator to do exponentiation
	redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr

Things ksh88 has or uses that bash does not:
	tracked aliases
	variables: ERRNO, FPATH, EDITOR, VISUAL
	co-processes (|&, >&p, <&p)
	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,
		  read -p/-s/-u/var?prompt, set -A/-o gmacs/
		  -o bgnice/-o markdirs/-o nolog/-o trackall/-o viraw/-s,
		  typeset -H/-L/-R/-A/-ft/-fu/-fx/-l/-u/-t, whence

Implementation differences:
	ksh runs last command of a pipeline in parent shell context
	bash has brace expansion by default (ksh88 compile-time option)
	bash has fixed startup file for all interactive shells; ksh reads $ENV
	bash has exported functions
	bash command search finds functions before builtins

C3)  Which new features in ksh-93 are not in bash, and which are?

New things in ksh-93 not in bash-2.04:
	associative arrays
	floating point arithmetic
	math library functions
	${!name[sub]} name of subscript for associative array
	`.' is allowed in variable names to create a hierarchical namespace
	more extensive compound assignment syntax
	discipline functions
	`sleep' and `getconf' builtins (bash has loadable versions)
	typeset -n and `nameref' variables
	KEYBD trap
	variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, .sh.version,
		   .sh.name, .sh.subscript, .sh.value, HISTEDIT
	backreferences in pattern matching
	print -f (bash uses printf)
	`fc' has been renamed to `hist'
	`.' can execute shell functions

New things in ksh-93 present in bash-2.04:
        for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command
        ?:, ++, --, `expr1 , expr2' arithmetic operators
	expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]},
		    ${!param*}
	compound array assignment
	the `!' reserved word
	loadable builtins -- but ksh uses `builtin' while bash uses `enable'
	`command', `builtin', `disown' builtins
	new $'...' and $"..." quoting
	FIGNORE (but bash uses GLOBIGNORE), HISTCMD
	set -o notify/-C
	changes to kill builtin
	read -A (bash uses read -a)
        read -t/-d
	trap -p
	exec -c/-a
	`.' restores the positional parameters when it completes
	POSIX.2 `test'
	umask -S
	unalias -a
	command and arithmetic substitution performed on PS1, PS4, and ENV
	command name completion
	ENV processed only for interactive shells

Section D:  Why does bash do some things differently than other Unix shells?

D1) Why does bash run a different version of `command' than
    `which command' says it will?

On many systems, `which' is actually a csh script that assumes
you're running csh.  In tcsh, `which' and its cousin `where'
are builtins.  On other Unix systems, `which' is a perl script
that uses the PATH environment variable.

The csh script version reads the csh startup files from your
home directory and uses those to determine which `command' will
be invoked.  Since bash doesn't use any of those startup files,
there's a good chance that your bash environment differs from
your csh environment.  The bash `type' builtin does everything
`which' does, and will report correct results for the running
shell.  If you're really wedded to the name `which', try adding
the following function definition to your .bashrc:

	which()
	{
		builtin type "$@"
	}

If you're moving from tcsh and would like to bring `where' along
as well, use this function:

	where()
	{
		builtin type -a "$@"
	}

D2) Why doesn't bash treat brace expansions exactly like csh?

The only difference between bash and csh brace expansion is that
bash requires a brace expression to contain at least one unquoted
comma if it is to be expanded.  Any brace-surrounded word not
containing an unquoted comma is left unchanged by the brace
expansion code.  This affords the greatest degree of sh
compatibility. 

Bash, ksh, zsh, and pd-ksh all implement brace expansion this way. 

D3) Why doesn't bash have csh variable modifiers?

Posix has specified a more powerful, albeit somewhat more cryptic,
mechanism cribbed from ksh, and bash implements it.

${parameter%word}
        Remove smallest suffix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        smallest portion of the suffix matched by the pattern deleted.

        x=file.c
        echo ${x%.c}.o
        -->file.o

${parameter%%word}

        Remove largest suffix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        largest portion of the suffix matched by the pattern deleted.

        x=posix/src/std
        echo ${x%%/*}
        -->posix

${parameter#word}
        Remove smallest prefix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        smallest portion of the prefix matched by the pattern deleted.

        x=$HOME/src/cmd
        echo ${x#$HOME}
        -->/src/cmd

${parameter##word}
        Remove largest prefix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        largest portion of the prefix matched by the pattern deleted.

        x=/one/two/three
        echo ${x##*/}
        -->three


Given
	a=/a/b/c/d
	b=b.xxx

	csh			bash		result
	---			----		------
	$a:h			${a%/*}		   /a/b/c
	$a:t			${a##*/}	   d
	$b:r			${b%.*}		   b
	$b:e			${b##*.}	   xxx


D4) How can I make my csh aliases work when I convert to bash?

Bash uses a different syntax to support aliases than csh does. 
The details can be found in the documentation.  We have provided
a shell script which does most of the work of conversion for you;
this script can be found in ./examples/misc/alias-conv.sh.  Here is
how you use it:
  
Start csh in the normal way for you.  (e.g., `csh')
  
Pipe the output of `alias' through `alias-conv.sh', saving the
results into `bash_aliases':
  
	alias | alias-conv.sh >bash_aliases
  
Edit `bash_aliases', carefully reading through any created
functions.  You will need to change the names of some csh specific
variables to the bash equivalents.  The script converts $cwd to
$PWD, $term to $TERM, $home to $HOME, $user to $USER, and $prompt
to $PS1.  You may also have to add quotes to avoid unwanted
expansion.

For example, the csh alias:
  
	alias cd 'cd \!*; echo $cwd'
  
is converted to the bash function:

	cd () { command cd "$@"; echo $PWD ; }

The only thing that needs to be done is to quote $PWD:
  
	cd () { command cd "$@"; echo "$PWD" ; }
  
Merge the edited file into your ~/.bashrc.

There is an additional, more ambitious, script in
examples/misc/cshtobash that attempts to convert your entire csh
environment to its bash equivalent.  This script can be run as
simply `cshtobash' to convert your normal interactive
environment, or as `cshtobash ~/.login' to convert your login
environment. 

D5) How can I pipe standard output and standard error from one command to
    another, like csh does with `|&'?

Use
	command 2>&1 | command2

The key is to remember that piping is performed before redirection, so
file descriptor 1 points to the pipe when it is duplicated onto file
descriptor 2.

D6) Now that I've converted from ksh to bash, are there equivalents to
    ksh features like autoloaded functions and the `whence' command?

There are features in ksh-88 and ksh-93 that do not have direct bash
equivalents.  Most, however, can be emulated with very little trouble.

ksh-88 feature		Bash equivalent
--------------		---------------
compiled-in aliases	set up aliases in .bashrc; some ksh aliases are
			bash builtins (hash, history, type)
coprocesses		named pipe pairs (one for read, one for write)
typeset +f		declare -F
cd, print, whence	function substitutes in examples/functions/kshenv
autoloaded functions	examples/functions/autoload is the same as typeset -fu
read var?prompt		read -p prompt var

ksh-93 feature		Bash equivalent
--------------		---------------
sleep, getconf		Bash has loadable versions in examples/loadables
${.sh.version}		$BASH_VERSION
print -f		printf
hist			alias fc=hist
$HISTEDIT		$FCEDIT

Section E:  How can I get bash to do certain things, and why does bash do
	    things the way it does?

E1) Why is the bash builtin `test' slightly different from /bin/test?

The specific example used here is [ ! x -o x ], which is false.

Bash's builtin `test' implements the Posix.2 spec, which can be
summarized as follows (the wording is due to David Korn):
   
Here is the set of rules for processing test arguments.
  
    0 Args: False
    1 Arg:  True iff argument is not null.
    2 Args: If first arg is !, True iff second argument is null.
	    If first argument is unary, then true if unary test is true
	    Otherwise error.
    3 Args: If second argument is a binary operator, do binary test of $1 $3
	    If first argument is !, negate two argument test of $2 $3
	    If first argument is `(' and third argument is `)', do the
	    one-argument test of the second argument.
	    Otherwise error.
    4 Args: If first argument is !, negate three argument test of $2 $3 $4.
	    Otherwise unspecified
    5 or more Args: unspecified.  (Historical shells would use their
    current algorithm).
   
The operators -a and -o are considered binary operators for the purpose
of the 3 Arg case.
   
As you can see, the test becomes (not (x or x)), which is false.

E2) Why does bash sometimes say `Broken pipe'?

If a sequence of commands appears in a pipeline, and one of the
reading commands finishes before the writer has finished, the
writer receives a SIGPIPE signal.  Many other shells special-case
SIGPIPE as an exit status in the pipeline and do not report it. 
For example, in:
  
      ps -aux | head
  
`head' can finish before `ps' writes all of its output, and ps
will try to write on a pipe without a reader.  In that case, bash
will print `Broken pipe' to stderr when ps is killed by a
SIGPIPE. 

You can build a version of bash that will not report SIGPIPE errors
by uncommenting the definition of DONT_REPORT_SIGPIPE in the file
config-top.h.

E3) When I have terminal escape sequences in my prompt, why does bash
    wrap lines at the wrong column?

Readline, the line editing library that bash uses, does not know
that the terminal escape sequences do not take up space on the
screen.  The redisplay code assumes, unless told otherwise, that
each character in the prompt is a `printable' character that
takes up one character position on the screen. 

You can use the bash prompt expansion facility (see the PROMPTING
section in the manual page) to tell readline that sequences of
characters in the prompt strings take up no screen space. 

Use the \[ escape to begin a sequence of non-printing characters,
and the \] escape to signal the end of such a sequence. 

E4) If I pipe the output of a command into `read variable', why doesn't
    the output show up in $variable when the read command finishes?

This has to do with the parent-child relationship between Unix
processes. 

Each element of a pipeline runs in a separate process, a child of
the shell running the pipeline.  A subprocess cannot affect its
parent's environment.  When the `read' command sets the variable
to the input, that variable is set only in the subshell, not the
parent shell.  When the subshell exits, the value of the variable
is lost. 

Many pipelines that end with `read variable' can be converted
into command substitutions, which will capture the output of
a specified command.  The output can then be assigned to a
variable:

	grep ^gnu /usr/lib/news/active | wc -l | read ngroup

can be converted into

	ngroup=$(grep ^gnu /usr/lib/news/active | wc -l)

This does not, unfortunately, work to split the text among
multiple variables, as read does when given multiple variable
arguments.  If you need to do this, you can either use the
command substitution above to read the output into a variable
and chop up the variable using the bash pattern removal
expansion operators or use some variant of the following
approach.

Say /usr/local/bin/ipaddr is the following shell script:

#! /bin/sh
host `hostname` | awk '/address/ {print $NF}'

Instead of using

	/usr/local/bin/ipaddr | read A B C D

to break the local machine's IP address into separate octets, use

	OIFS="$IFS"
	IFS=.
	set -- $(/usr/local/bin/ipaddr)
	IFS="$OIFS"
	A="$1" B="$2" C="$3" D="$4"

Beware, however, that this will change the shell's positional
parameters.  If you need them, you should save them before doing
this.

This is the general approach -- in most cases you will not need to
set $IFS to a different value.

E5) I have a bunch of shell scripts that use backslash-escaped characters
    in arguments to `echo'.  Bash doesn't interpret these characters.  Why
    not, and how can I make it understand them?

This is the behavior of echo on most Unix System V machines.

The bash builtin `echo' is modeled after the 9th Edition
Research Unix version of `echo'.  It does not interpret
backslash-escaped characters in its argument strings by default;
it requires the use of the -e option to enable the
interpretation.  The System V echo provides no way to disable the
special characters; the bash echo has a -E option to disable
them. 

There is a configuration option that will make bash behave like
the System V echo and interpret things like `\t' by default.  Run
configure with the --enable-usg-echo-default option to turn this
on.  Be aware that this will cause some of the tests run when you
type `make tests' to fail.

There is a shell option, `xpg_echo', settable with `shopt' that will
change the behavior of echo at runtime.  Enabling this option turns
on expansion of backslash-escape sequences.

E6) Why doesn't a while or for loop get suspended when I type ^Z?

This is a consequence of how job control works on Unix.  The only
thing that can be suspended is the process group.  This is a single
command or pipeline of commands that the shell forks and executes.

When you run a while or for loop, the only thing that the shell forks
and executes are any commands in the while loop test and commands in
the loop bodies.  These, therefore, are the only things that can be
suspended when you type ^Z.

If you want to be able to stop the entire loop, you need to put it
within parentheses, which will force the loop into a subshell that
may be stopped (and subsequently restarted) as a single unit.

E7) What about empty for loops in Makefiles?

It's fairly common to see constructs like this in automatically-generated
Makefiles:

SUBDIRS = @SUBDIRS@

	...

subdirs-clean:
	for d in $SUBDIRS; do \
		( cd $$d && ${MAKE} ${MFLAGS} clean ) \
	done

When SUBDIRS is empty, this results in a command like this being passed to
bash:

	for d in ; do
		( cd $$d && ${MAKE} ${MFLAGS} clean )
	done

This is a syntax error.  If the reserved word `in' is present, a word must
follow it before the semicolon or newline.  The language in the manual page
referring to the list of words being empty refers to the list after it is
expanded.  There must be at least one word following the `in' when the
construct is parsed.

The idiomatic Makefile solution is something like:

SUBDIRS = @SUBDIRS@

subdirs-clean:
	subdirs=$SUBDIRS ; for d in $$subdirs; do \
		( cd $$d && ${MAKE} ${MFLAGS} clean ) \
	done


The POSIX.2 interpretation committee has considered this issue and declared
that the bash implemenation is correct, according to the standard:

http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-169.html

E8) Why does the arithmetic evaluation code complain about `08'?

The bash arithmetic evaluation code (used for `let', $(()), (()), and in
other places), interprets a leading `0' in numeric constants as denoting
an octal number, and a leading `0x' as denoting hexadecimal.  This is
in accordance with the POSIX.2 spec, section 2.9.2.1, which states that
arithmetic constants should be handled as signed long integers as defined
by the ANSI/ISO C standard.

The POSIX.2 interpretation committee has confirmed this:

http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-173.html

Section F:  Things to watch out for on certain Unix versions

F1) Why can't I use command line editing in my `cmdtool'?

The problem is `cmdtool' and bash fighting over the input.  When
scrolling is enabled in a cmdtool window, cmdtool puts the tty in
`raw mode' to permit command-line editing using the mouse for
applications that cannot do it themselves.  As a result, bash and
cmdtool each try to read keyboard input immediately, with neither
getting enough of it to be useful.

This mode also causes cmdtool to not implement many of the
terminal functions and control sequences appearing in the
`sun-cmd' termcap entry.  For a more complete explanation, see
that file examples/suncmd.termcap in the bash distribution. 

`xterm' is a better choice, and gets along with bash much more
smoothly.

If you must use cmdtool, you can use the termcap description in
examples/suncmd.termcap.  Set the TERMCAP variable to the terminal
description contained in that file, i.e.

TERMCAP='Mu|sun-cmd:am:bs:km:pt:li#34:co#80:cl=^L:ce=\E[K:cd=\E[J:rs=\E[s:'

Then export TERMCAP and start a new cmdtool window from that shell.
The bash command-line editing should behave better in the new
cmdtool.  If this works, you can put the assignment to TERMCAP
in your bashrc file.

F2) I built bash on Solaris 2.  Why do globbing expansions and filename
    completion chop off the first few characters of each filename?

This is the consequence of building bash on SunOS 5 and linking
with the libraries in /usr/ucblib, but using the definitions
and structures from files in /usr/include. 

The actual conflict is between the dirent structure in
/usr/include/dirent.h and the struct returned by the version of
`readdir' in libucb.a (a 4.3-BSD style `struct direct'). 

Make sure you've got /usr/ccs/bin ahead of /usr/ucb in your $PATH
when configuring and building bash.  This will ensure that you
use /usr/ccs/bin/cc or acc instead of /usr/ucb/cc and that you
link with libc before libucb. 

If you have installed the Sun C compiler, you may also need to
put /usr/ccs/bin and /opt/SUNWspro/bin into your $PATH before
/usr/ucb.

F3) Why does bash dump core after I interrupt username completion or
    `~user' tilde expansion on a machine running NIS?

This is a famous and long-standing bug in the SunOS YP (sorry, NIS)
client library, which is part of libc.

The YP library code keeps static state -- a pointer into the data
returned from the server.  When YP initializes itself (setpwent),
it looks at this pointer and calls free on it if it's non-null. 
So far, so good. 

If one of the YP functions is interrupted during getpwent (the
exact function is interpretwithsave()), and returns NULL, the
pointer is freed without being reset to NULL, and the function
returns.  The next time getpwent is called, it sees that this
pointer is non-null, calls free, and the bash free() blows up
because it's being asked to free freed memory. 

The traditional Unix mallocs allow memory to be freed multiple
times; that's probably why this has never been fixed.  You can
run configure with the `--without-gnu-malloc' option to use
the C library malloc and avoid the problem.

F4) I'm running SVR4.2.  Why is the line erased every time I type `@'?

The `@' character is the default `line kill' character in most
versions of System V, including SVR4.2.  You can change this
character to whatever you want using `stty'.  For example, to
change the line kill character to control-u, type

	stty kill ^U

where the `^' and `U' can be two separate characters.

F5) Why does bash report syntax errors when my C News scripts use a
    redirection before a subshell command?

The actual command in question is something like

	< file ( command )

According to the grammar given in the POSIX.2 standard, this construct
is, in fact, a syntax error.  Redirections may only precede `simple
commands'.  A subshell construct such as the above is one of the shell's
`compound commands'.  A redirection may only follow a compound command.

This affects the mechanical transformation of commands that use `cat'
to pipe a file into a command (a favorite Useless-Use-Of-Cat topic on
comp.unix.shell).  While most commands of the form

	cat file | command

can be converted to `< file command', shell control structures such as
loops and subshells require `command < file'.

The file CWRU/sh-redir-hack in the bash-2.04 distribution is an
(unofficial) patch to parse.y that will modify the grammar to
support this construct.  It will not apply with `patch'; you must
modify parse.y by hand.  Note that if you apply this, you must
recompile with -DREDIRECTION_HACK.  This introduces a large
number of reduce/reduce conflicts into the shell grammar. 

F6) Why can't I use vi-mode editing on Red Hat Linux 6.1?

The short answer is that Red Hat screwed up.

The long answer is that they shipped an /etc/inputrc that only works
for emacs mode editing, and then screwed all the vi users by setting
INPUTRC to /etc/inputrc in /etc/profile.

The short fix is to do one of the following: remove or rename
/etc/inputrc, set INPUTRC=~/.inputrc in ~/.bashrc (or .bash_profile,
but make sure you export it if you do), remove the assignment to
INPUTRC from /etc/profile, add

        set keymap emacs

to the beginning of /etc/inputrc, or bracket the key bindings in
/etc/inputrc with these lines

	$if mode=emacs
		[...]
	$endif

Section G:  How can I get bash to do certain common things?

G1) How can I get bash to read and display eight-bit characters?

This is a process requiring several steps.

First, you must ensure that the `physical' data path is a full eight
bits.  For xterms, for example, the `vt100' resources `eightBitInput'
and `eightBitOutput' should be set to `true'.

Once you have set up an eight-bit path, you must tell the kernel and
tty driver to leave the eighth bit of characters alone when processing
keyboard input.  Use `stty' to do this:

	stty cs8 -istrip -parenb

For old BSD-style systems, you can use

	stty pass8

You may also need

	stty even odd

Finally, you need to tell readline that you will be inputting and
displaying eight-bit characters.  You use readline variables to do
this.  These variables can be set in your .inputrc or using the bash
`bind' builtin.  Here's an example using `bind':

	bash$ bind 'set convert-meta off'
	bash$ bind 'set meta-flag on'
	bash$ bind 'set output-meta on'

The `set' commands between the single quotes may also be placed
in ~/.inputrc.

G2) How do I write a function `x' to replace builtin command `x', but
    still invoke the command from within the function?

This is why the `command' and `builtin' builtins exist.  The
`command' builtin executes the command supplied as its first
argument, skipping over any function defined with that name.  The
`builtin' builtin executes the builtin command given as its first
argument directly. 

For example, to write a function to replace `cd' that writes the
hostname and current directory to an xterm title bar, use
something like the following:

	cd()
	{
		builtin cd "$@" && xtitle "$HOST: $PWD"
	}

This could also be written using `command' instead of `builtin';
the version above is marginally more efficient. 

G3) How can I find the value of a shell variable whose name is the value
    of another shell variable?

Versions of Bash newer than Bash-2.0 support this directly.  You can use 

	${!var}

For example, the following sequence of commands will echo `z':

	var1=var2
	var2=z
	echo ${!var1}

For sh compatibility, use the `eval' builtin.  The important
thing to remember is that `eval' expands the arguments you give
it again, so you need to quote the parts of the arguments that
you want `eval' to act on. 

For example, this expression prints the value of the last positional
parameter:

	eval echo \"\$\{$#\}\"

The expansion of the quoted portions of this expression will be
deferred until `eval' runs, while the `$#' will be expanded
before `eval' is executed.  In versions of bash later than bash-2.0,

	echo ${!#}

does the same thing.

G4) How can I make the bash `time' reserved word print timing output that
     looks like the output from my system's /usr/bin/time?

The bash command timing code looks for a variable `TIMEFORMAT' and
uses its value as a format string to decide how to display the
timing statistics.

The value of TIMEFORMAT is a string with `%' escapes expanded in a
fashion similar in spirit to printf(3).  The manual page explains
the meanings of the escape sequences in the format string.

If TIMEFORMAT is not set, bash acts as if the following assignment had
been performed:

	TIMEFORMAT=$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'

The POSIX.2 default time format (used by `time -p command') is

	TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S'

The BSD /usr/bin/time format can be emulated with:

	TIMEFORMAT=$'\t%1R real\t%1U user\t%1S sys'

The System V /usr/bin/time format can be emulated with:

	TIMEFORMAT=$'\nreal\t%1R\nuser\t%1U\nsys\t%1S'

The ksh format can be emulated with:

	TIMEFORMAT=$'\nreal\t%2lR\nuser\t%2lU\nsys\t%2lS'

G5) How do I get the current directory into my prompt?

Bash provides a number of backslash-escape sequences which are expanded
when the prompt string (PS1 or PS2) is displayed.  The full list is in
the manual page.

The \w expansion gives the full pathname of the current directory, with
a tilde (`~') substituted for the current value of $HOME.  The \W
expansion gives the basename of the current directory.  To put the full
pathname of the current directory into the path without any tilde
subsitution, use $PWD.  Here are some examples:

	PS1='\w$ '	# current directory with tilde
	PS1='\W$ '	# basename of current directory
	PS1='$PWD$ '	# full pathname of current directory

The single quotes are important in the final example to prevent $PWD from
being expanded when the assignment to PS1 is performed.

G6) How can I rename "*.foo" to "*.bar"?

Use the pattern removal functionality described in D3.  The following `for'
loop will do the trick:

	for f in *.foo; do
		mv $f ${f%foo}bar
	done

G7) How can I translate a filename from uppercase to lowercase?

The script examples/functions/lowercase, originally written by John DuBois,
will do the trick.  The converse is left as an exercise.

G8) How can I write a filename expansion (globbing) pattern that will match
    all files in the current directory except "." and ".."?

You must have set the `extglob' shell option using `shopt -s extglob' to use
this:

	echo .!(.|) *

A solution that works without extended globbing is given in the Unix Shell
FAQ, posted periodically to comp.unix.shell.

Section H:  Where do I go from here?

H1) How do I report bugs in bash, and where should I look for fixes and
    advice?

Use the `bashbug' script to report bugs.  It is built and
installed at the same time as bash.  It provides a standard
template for reporting a problem and automatically includes
information about your configuration and build environment. 

`bashbug' sends its reports to bug-bash@gnu.org, which
is a large mailing list gatewayed to the usenet newsgroup gnu.bash.bug. 

Bug fixes, answers to questions, and announcements of new releases
are all posted to gnu.bash.bug.  Discussions concerning bash features
and problems also take place there.

To reach the bash maintainers directly, send mail to
bash-maintainers@gnu.org.

H2) What kind of bash documentation is there?

First, look in the doc directory in the bash distribution.  It should
contain at least the following files:

bash.1		an extensive, thorough Unix-style manual page
builtins.1	a manual page covering just bash builtin commands
bashref.texi	a reference manual in GNU tex`info format
bashref.info	an info version of the reference manual
FAQ		this file
article.ms	text of an article written for The Linux Journal
readline.3	a man page describing readline

Postscript, HTML, and ASCII files created from the above source are
available in the documentation distribution.

There is additional documentation available for anonymous FTP from host
ftp.cwru.edu in the `pub/bash' directory.

Cameron Newham and Bill Rosenblatt have written a book on bash, published
by O'Reilly and Associates.  The book is based on Bill Rosenblatt's Korn
Shell book.  The title is ``Learning the Bash Shell'', and the ISBN number
is 1-56592-147-X.  Look for it in fine bookstores near you.  This book
covers bash-1.14, but has an appendix describing some of the new features
in bash-2.0.  

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.

H3) What's coming in future versions?

These are features I plan to include in a future version of bash.

a bash debugger (a minimally-tested version is included with bash-2.04)
associative arrays

H4) What's on the bash `wish list' for future versions?

These are features that may or may not appear in a future version of bash.

breaking some of the shell functionality into embeddable libraries
a module system like zsh's, using dynamic loading like builtins
better internationalization using GNU `gettext'
an option to use external files for the long `help' text
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
	variables (contributions gratefully accepted)

H5) When will the next release appear?

The next version will appear sometime in 2000 or 2001.  Never make
predictions. 


This document is Copyright 1995-2000 by Chester Ramey.

Permission is hereby granted, without written agreement and
without license or royalty fees, to use, copy, and distribute
this document for any purpose, provided that the above copyright
notice appears in all copies of this document and that the
contents of this document remain unaltered.


From schwab@suse.de Wed Oct 04 04:24:03 2000
Received: from cantor.suse.de ([194.112.123.193])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13gjqN-0000JE-00
	for <bug-bash@gnu.org>; Wed, 04 Oct 2000 04:24:03 -0400
Received: from Hermes.suse.de (Hermes.suse.de [194.112.123.136])
	by Cantor.suse.de (Postfix) with ESMTP id 69F321E193
	for <bug-bash@gnu.org>; Wed,  4 Oct 2000 10:24:02 +0200 (MEST)
Received: from Wotan.suse.de (Wotan.suse.de [10.10.0.1])
	by Hermes.suse.de (Postfix) with ESMTP id 62A443E492
	for <bug-bash@gnu.org>; Wed,  4 Oct 2000 10:24:02 +0200 (MEST)
Received: from hawking.suse.de (Hawking.suse.de [10.10.0.89])
	by Wotan.suse.de (Postfix) with ESMTP id 292671C807F
	for <bug-bash@gnu.org>; Wed,  4 Oct 2000 10:24:02 +0200 (CEST)
Received: (from schwab@localhost)
	by hawking.suse.de (8.10.2/8.10.2/SuSE Linux 8.10.0-0.3) id e948O1512833;
	Wed, 4 Oct 2000 10:24:01 +0200
Date: Wed, 4 Oct 2000 10:24:01 +0200
From: Andreas Schwab <schwab@suse.de>
Message-Id: <200010040824.e948O1512833@hawking.suse.de>
To: bug-bash@gnu.org
Subject: Job control bug wrt. command substitution
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux' -DCONF_MACHTYPE='i386-suse-linux' -DCONF_VENDOR='suse' -DSHELL -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=64  -I. -I/usr/include -I. -I./include -I./lib -I/usr/include -O2 -m486 -D_GNU_SOURCE -Wall -pipe
uname output: Linux hawking 2.2.16 #1 Wed Aug 2 20:22:26 GMT 2000 i686 unknown
Machine Type: i386-suse-linux

Bash Version: 2.04
Patch Level: 0
Release Status: release

Description:
	A simple command running in a command substitution does not have
	the correct process group if the command substitution is a
	parameter of a command on the left side of a pipeline.

Repeat-By:
	# This is correct
	$ echo "`ps jft 8`"
	 PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
	 9386  9387  9387  9387 pts/8     9387 S      597   0:00 -bash
	 9387 12761  9387  9387 pts/8     9387 R      597   0:00 ps jft 8
	# This is wrong
	$ echo "`ps jft 8`" | cat
	 PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
	 9386  9387  9387  9387 pts/8    12769 S      597   0:00 -bash
	 9387 12769 12769  9387 pts/8    12769 S      597   0:00 -bash
	12769 12771  9387  9387 pts/8    12769 R      597   0:00  \_ ps jft 8
	 9387 12770 12769  9387 pts/8    12769 S      597   0:00 cat
	# This is correct(?)
	$ echo "`ps jft 8; echo`" | cat
	 PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
	 9386  9387  9387  9387 pts/8    12794 S      597   0:00 -bash
	 9387 12794 12794  9387 pts/8    12794 S      597   0:00 -bash
	12794 12796  9387  9387 pts/8    12794 S      597   0:00  \_ -bash
	12796 12797 12794  9387 pts/8    12794 R      597   0:00      \_ ps jft 8
	 9387 12795 12794  9387 pts/8    12794 S      597   0:00 cat
	# This is the problem
	$ echo "`cat`" | cat
	cat: -: Input/output error



From matt@curiousnetworks.com Wed Oct 04 18:49:32 2000
Received: from supernova.curiousnetworks.com ([63.239.183.2] helo=curiousnetworks.com)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13gxLv-0005ro-00
	for <bug-bash@prep.ai.mit.edu>; Wed, 04 Oct 2000 18:49:31 -0400
Received: (from matt@localhost)
	by curiousnetworks.com (8.9.3/8.9.3) id RAA26885
	for bug-bash@prep.ai.mit.edu; Wed, 4 Oct 2000 17:51:05 -0500
Date: Wed, 4 Oct 2000 17:51:05 -0500
From: matt@curiousnetworks.com
Message-Id: <200010042251.RAA26885@curiousnetworks.com>
To: bug-bash@prep.ai.mit.edu
Subject: bash coredumps when trying to enter a search in vi editing-mode.
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: Linux
Compiler: gcc
Compilation CFLAGS:   -DHAVE_VFPRINTF -DHAVE_UNISTD_H -DHAVE_STDLIB_H -DHAVE_LIMITS_H        -DHAVE_GETGROUPS -DHAVE_RESOURCE -DHAVE_SYS_PARAM -DVOID_SIGHANDLER -DHAVE_GETDTABLESIZE -DHAVE_BCOPY -DHAVE_GETPW_DECLS -DHAVE_GETHOSTNAME -DHAVE_WAIT_H         -DHAVE_DUP2 -DHAVE_STRERROR  -DHAVE_DIRENT_H -DHAVE_STRING_H        -DHAVE_VARARGS_H -DHAVE_STRCHR  -DHAVE_DEV_FD        -Di386 -DLinux -DSHELL -DHAVE_ALLOCA -DHAVE_ALLOCA_H 	   -O2 -m486 -fno-strength-reduce
uname output: Linux virus 2.2.14-6.1.1 #1 Thu Apr 13 20:01:58 EDT 2000 i686 unknown

Bash Version: 1.14
Patch Level: 7

Description:
		i use vi editing-mode, and when i am in a certain directory
		(/home/matt/dev/drano/sdk/src/com/curious/sdk/translator/ast), if
		i hit escape followed by /, bash coredumps and dies. this also
		seems to happen in sibling directories (i.e. other subdirs of 
		translator), but it doesn't happen in translator.

		my prompt contains the full directory path, and so is quite long.

Repeat-By:
		see descriptoin.


From helsten@inconnect.com Thu Oct 05 23:05:24 2000
Received: from mail.inconnect.com ([209.140.64.7])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13hNp6-0003YQ-00
	for <bug-bash@gnu.org>; Thu, 05 Oct 2000 23:05:24 -0400
Received: (qmail 11105 invoked from network); 6 Oct 2000 03:05:22 -0000
Received: from helsten.dsl.inconnect.com (HELO helsten) (209.140.78.46)
  by mail with SMTP; 6 Oct 2000 03:05:22 -0000
Date: Thu, 5 Oct 2000 21:05:21 -0600
Reply-To: Lance Finn Helsten <helsten@inconnect.com>
Content-Type: text/plain;
	charset=us-ascii
X-Mailer: Apple Mail (2.337)
From: Lance Finn Helsten <helsten@inconnect.com>
To: bug-bash@gnu.org
Mime-Version: 1.0 (Apple Message framework v337)
Content-Transfer-Encoding: quoted-printable
Subject: Darwin (Mac OS X) port
Message-Id: <E13hNp6-0003YQ-00@fencepost.gnu.org>
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: powerpc
OS: darwin1.2
Compiler: cc
Compilation CFLAGS:  -DPROGRAM=3D'bash' -DCONF_HOSTTYPE=3D'powerpc' =
-DCONF_OSTYPE=3D'd
arwin1.2' -DCONF_MACHTYPE=3D'powerpc-apple-darwin1.2' =
-DCONF_VENDOR=3D'apple' -DSHEL
L -DHAVE_CONFIG_H   -I.  -I. -I./lib -I/usr/local/include -g -O2
uname output: Darwin helsten 1.2 Darwin Kernel Version 1.2: Wed Aug 30 =
23:32:53
PDT 2000; root:xnu/xnu-103.obj~1/RELEASE_PPC  Power Macintosh powerpc
Machine Type: powerpc-apple-darwin1.2

Bash Version: 2.03
Patch Level: 0
Release Status: release

Description:
        Enclosed are the context diffs to fix the configuration scripts =
for Darwin.

Repeat-By:
	N/A

Fix:

*** configure.old       Mon Oct  2 20:06:22 2000
--- configure   Mon Oct  2 20:04:04 2000
***************
*** 736,742 ****
  #*-freebsd*)  opt_gnu_malloc=3Dno ;;    # they claim it's better
  *-aix*)               opt_gnu_malloc=3Dno ;;    # AIX machines
  *-nextstep*)  opt_gnu_malloc=3Dno ;;    # NeXT machines running =
NeXTstep
! *-rhapsody*)  opt_gnu_malloc=3Dno ;;    # Apple Rhapsody
  *-dgux*)      opt_gnu_malloc=3Dno ;;    # DG/UX machines
  *-qnx*)               opt_gnu_malloc=3Dno ;;    # QNX 4.2
  *-machten4)   opt_gnu_malloc=3Dno ;;    # MachTen 4.x
--- 736,743 ----
  #*-freebsd*)  opt_gnu_malloc=3Dno ;;    # they claim it's better
  *-aix*)               opt_gnu_malloc=3Dno ;;    # AIX machines
  *-nextstep*)  opt_gnu_malloc=3Dno ;;    # NeXT machines running =
NeXTstep
! *-rhapsody*)  opt_gnu_malloc=3Dno ;;    # Apple MacOS X Server =
(Rhapsody)
! *-darwin*)    opt_gnu_malloc=3Dno ;;    # Apple MacOS X (Darwin)
  *-dgux*)      opt_gnu_malloc=3Dno ;;    # DG/UX machines
  *-qnx*)               opt_gnu_malloc=3Dno ;;    # QNX 4.2
  *-machten4)   opt_gnu_malloc=3Dno ;;    # MachTen 4.x

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
*** support/config.guess.old    Mon Oct  2 20:06:58 2000
--- support/config.guess        Mon Oct  2 20:02:39 2000
***************
*** 330,340 ****
        echo m88k-unknown-openbsd${UNAME_RELEASE}
        exit 0 ;;
      Power?Macintosh:Rhapsody:*:*)
!       echo powerpc-apple-rhapsody${UNAME_RELEASE}
!       exit 0 ;;
      *:Rhapsody:*:*)
!       echo ${UNAME_MACHINE}-unknown-rhapsody${UNAME_RELEASE}
!       exit 0 ;;
      powerpc:machten:*:*)
        echo powerpc-apple-machten${UNAME_RELEASE}
        exit 0 ;;
--- 330,343 ----
        echo m88k-unknown-openbsd${UNAME_RELEASE}
        exit 0 ;;
      Power?Macintosh:Rhapsody:*:*)
!         echo powerpc-apple-rhapsody${UNAME_RELEASE}
!         exit 0 ;;
      *:Rhapsody:*:*)
!         echo ${UNAME_MACHINE}-unknown-rhapsody${UNAME_RELEASE}
!         exit 0 ;;
!     Power\ Macintosh:Darwin:*:*)
!       echo powerpc-apple-darwin${UNAME_RELEASE}
!       exit 0 ;;
      powerpc:machten:*:*)
        echo powerpc-apple-machten${UNAME_RELEASE}
        exit 0 ;;

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
*** support/config.sub.old      Mon Oct  2 20:07:20 2000
--- support/config.sub  Mon Oct  2 20:03:20 2000
***************
*** 745,751 ****
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
              | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* =
\
              | -linux-gnu* | -uxpv* | -qnx* | -powerux* | -beos* | =
-rhapsody* \
!             | -superux* )
        # Remember, each alternative MUST END IN *, to match a version =
number.
                ;;
        -linux*)
--- 745,751 ----
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
              | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* =
\
              | -linux-gnu* | -uxpv* | -qnx* | -powerux* | -beos* | =
-rhapsody* \
!             | -darwin* | -superux* )
        # Remember, each alternative MUST END IN *, to match a version =
number.
                ;;
        -linux*)


From chet@nike.ins.cwru.edu Fri Oct 06 11:10:35 2000
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13hZ8s-0007Nk-00
	for <bug-bash@gnu.org>; Fri, 06 Oct 2000 11:10:34 -0400
Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi)
	id LAA52072; Fri, 6 Oct 2000 11:10:26 -0400 (EDT) (from chet)
Date: Fri, 6 Oct 2000 11:09:59 -0400
From: Chet Ramey <chet@nike.ins.cwru.edu>
To: helsten@inconnect.com
Subject: Re: Darwin (Mac OS X) port
Cc: bug-bash@gnu.org, chet@po.cwru.edu
Reply-To: chet@po.CWRU.Edu
Message-ID: <1001006150959.AA52066.SM@nike.ins.cwru.edu>
Read-Receipt-To: chet@po.CWRU.Edu
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-In-Reply-To:  Message from helsten@inconnect.com of Thu, 5 Oct 2000 21:05:21 -0600 (id <E13hNp6-0003YQ-00@fencepost.gnu.org>)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

> Bash Version: 2.03
> Patch Level: 0
> Release Status: release
> 
> Description:
>         Enclosed are the context diffs to fix the configuration scripts =
> for Darwin.

Bash-2.04 (the current release) already has the changes for Darwin.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


From riccy.sidoli@btinternet.com Sat Oct 07 10:09:03 2000
Received: from tantalum.btinternet.com ([194.73.73.80])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13hues-0006RN-00
	for <bug-bash@gnu.org>; Sat, 07 Oct 2000 10:09:02 -0400
Received: from [213.1.203.249] (helo=v2j1x8)
	by tantalum.btinternet.com with smtp (Exim 3.03 #83)
	id 13hueh-0004iP-00
	for bug-bash@gnu.org; Sat, 07 Oct 2000 15:08:52 +0100
Message-ID: <000e01c03068$3655d260$f9cb01d5@v2j1x8>
From: "Riccy Sidoli" <riccy.sidoli@btinternet.com>
To: <bug-bash@gnu.org>
Subject: Problem with pipeline character on UK Keyboard
Date: Sat, 7 Oct 2000 15:08:40 +0100
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0005_01C03070.7A1D8800"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C03070.7A1D8800
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Configuration Information [Automatically generated, do not change]:
Machine: i586
OS: cygwin
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM=3D'bash.exe' -DCONF_HOSTTYPE=3D'i586' =
-DCONF_OSTYPE=3D'cygwin' -DCONF_MACHTYPE=3D'i586-pc-cygwin' =
-DCONF_VENDOR=3D'pc' -DSHELL -DHAVE_CONFIG_H -DPATCH_ARRAY   -I.  -I. =
-I./include -I./lib -I/usr/include -g -O2
uname output: CYGWIN_98-4.10 V2J1X8 1.1.4(0.26/3/2) 2000-08-03 20:53 =
i586 unknown
Machine Type: i586-pc-cygwin

Bash Version: 2.04
Patch Level: 0
Release Status: release

Description:
 When I try to type the pipeline character on my UK keyboard it ignores =
it i.e I get nothing. This happens when I use the default key which is =
"SHIFT \". VIM correctly gets it therefore I can only assume it is some =
default setting in bash. This also only happens on Windows 98 not NT 4.0 =
which I also use.

The keyboard setup on Win 98 is:

 kyeb uk,,C:\WINDOWS\COMMAND\keyboard.sysConfiguration Information =
[Automatically generated, do not change]:
Machine: i586
OS: cygwin
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM=3D'bash.exe' -DCONF_HOSTTYPE=3D'i586' =
-DCONF_OSTYPE=3D'cygwin' -DCONF_MACHTYPE=3D'i586-pc-cygwin' =
-DCONF_VENDOR=3D'pc' -DSHELL -DHAVE_CONFIG_H -DPATCH_ARRAY   -I.  -I. =
-I./include -I./lib -I/usr/include -g -O2
uname output: CYGWIN_98-4.10 V2J1X8 1.1.4(0.26/3/2) 2000-08-03 20:53 =
i586 unknown
Machine Type: i586-pc-cygwin

Bash Version: 2.04
Patch Level: 0
Release Status: release

Description:
 When I try to type the pipeline character on my UK keyboard it ignores =
it i.e I get nothing. This happens when I use the default key which is =
"SHIFT \". VIM correctly gets it therefore I can only assume it is some =
default setting in bash. This also only happens on Windows 98 not NT 4.0 =
which I also use.

The keyboard setup on Win 98 is:

 kyeb uk,,C:\WINDOWS\COMMAND\keyboard.sys

------=_NextPart_000_0005_01C03070.7A1D8800
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Configuration Information =
[Automatically generated,=20
do not change]:<BR>Machine: i586<BR>OS: cygwin<BR>Compiler: =
gcc<BR>Compilation=20
CFLAGS:&nbsp; -DPROGRAM=3D'bash.exe' -DCONF_HOSTTYPE=3D'i586' =
-DCONF_OSTYPE=3D'cygwin'=20
-DCONF_MACHTYPE=3D'i586-pc-cygwin' -DCONF_VENDOR=3D'pc' -DSHELL =
-DHAVE_CONFIG_H=20
-DPATCH_ARRAY&nbsp;&nbsp; -I.&nbsp; -I. -I./include -I./lib =
-I/usr/include -g=20
-O2<BR>uname output: CYGWIN_98-4.10 V2J1X8 1.1.4(0.26/3/2) 2000-08-03 =
20:53 i586=20
unknown<BR>Machine Type: i586-pc-cygwin</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Bash Version: 2.04<BR>Patch Level: =
0<BR>Release=20
Status: release</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Description:<BR>&nbsp;When I try to =
type the=20
pipeline character on my UK keyboard it ignores it i.e I get nothing. =
This=20
happens when I use the default key which is "SHIFT \". VIM correctly =
gets it=20
therefore I can only assume it is some default setting in bash. This =
also only=20
happens on Windows 98 not NT 4.0 which I also use.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The keyboard setup on Win 98 =
is:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;kyeb=20
uk,,C:\WINDOWS\COMMAND\keyboard.sysConfiguration Information =
[Automatically=20
generated, do not change]:<BR>Machine: i586<BR>OS: cygwin<BR>Compiler:=20
gcc<BR>Compilation CFLAGS:&nbsp; -DPROGRAM=3D'bash.exe' =
-DCONF_HOSTTYPE=3D'i586'=20
-DCONF_OSTYPE=3D'cygwin' -DCONF_MACHTYPE=3D'i586-pc-cygwin' =
-DCONF_VENDOR=3D'pc'=20
-DSHELL -DHAVE_CONFIG_H -DPATCH_ARRAY&nbsp;&nbsp; -I.&nbsp; -I. =
-I./include=20
-I./lib -I/usr/include -g -O2<BR>uname output: CYGWIN_98-4.10 V2J1X8=20
1.1.4(0.26/3/2) 2000-08-03 20:53 i586 unknown<BR>Machine Type:=20
i586-pc-cygwin</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Bash Version: 2.04<BR>Patch Level: =
0<BR>Release=20
Status: release</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Description:<BR>&nbsp;When I try to =
type the=20
pipeline character on my UK keyboard it ignores it i.e I get nothing. =
This=20
happens when I use the default key which is "SHIFT \". VIM correctly =
gets it=20
therefore I can only assume it is some default setting in bash. This =
also only=20
happens on Windows 98 not NT 4.0 which I also use.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The keyboard setup on Win 98 =
is:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;kyeb=20
uk,,C:\WINDOWS\COMMAND\keyboard.sys</FONT></DIV></BODY></HTML>

------=_NextPart_000_0005_01C03070.7A1D8800--



From klausf@pool.informatik.rwth-aachen.de Sat Oct 07 12:43:18 2000
Received: from nets5.rz.rwth-aachen.de ([137.226.144.13])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13hx49-0007U1-00
	for <bug-bash@gnu.org>; Sat, 07 Oct 2000 12:43:17 -0400
Received: from campino.informatik.rwth-aachen.de (campino.Informatik.RWTH-Aachen.DE [137.226.116.240])
	by nets5.rz.rwth-aachen.de (8.10.1/8.10.1/5) with ESMTP id e97GhGS08129
	for <bug-bash@gnu.org>; Sat, 7 Oct 2000 18:43:16 +0200 (MET DST)
Received: from jennifer.informatik.rwth-aachen.de (klausf@jennifer.Informatik.RWTH-Aachen.DE [137.226.116.82])
	by campino.informatik.rwth-aachen.de (8.9.1a/8.9.1/3) with ESMTP id SAA01803
	for <bug-bash@gnu.org>; Sat, 7 Oct 2000 18:43:15 +0200 (MET DST)
From: klausf@Pool.Informatik.RWTH-Aachen.DE
Received: (from klausf@localhost)
	by jennifer.informatik.rwth-aachen.de (8.9.1a/8.9.1/1) id SAA16458;
	Sat, 7 Oct 2000 18:40:44 +0200 (MET DST)
Date: Sat, 7 Oct 2000 18:40:44 +0200 (MET DST)
Message-Id: <200010071640.SAA16458@jennifer.informatik.rwth-aachen.de>
To: bug-bash@gnu.org
Subject: unterminated eval recursion crashes
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.6
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc' -DCONF_OSTYPE='solaris2.6' -DCONF_MACHTYPE='sparc-sun-solaris2.6' -DCONF_VENDOR='sun' -DSHELL  -DHAVE_CONFIG_H  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I.  -I. -I./include -I./lib -I/usr/local/include -g -O2
uname output: SunOS jennifer 5.6 Generic_105181-13 sun4u sparc SUNW,Ultra-1
Machine Type: sparc-sun-solaris2.6

Bash Version: 2.04
Patch Level: 0
Release Status: release

Description:
	Maybe it's right to abort() intentionally if some nesting level
	is exceeded. Currently, the shell gets a SIGSEGV.

	A useful recursive eval command would contain a termination condition.

Repeat-By:
	set eval '"$@"';"$@"


From klausf@pool.informatik.rwth-aachen.de Sat Oct 07 12:46:17 2000
Received: from nets5.rz.rwth-aachen.de ([137.226.144.13])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13hx73-0007Uo-00
	for <bug-bash@gnu.org>; Sat, 07 Oct 2000 12:46:17 -0400
Received: from campino.informatik.rwth-aachen.de (campino.Informatik.RWTH-Aachen.DE [137.226.116.240])
	by nets5.rz.rwth-aachen.de (8.10.1/8.10.1/5) with ESMTP id e97GkGS08393
	for <bug-bash@gnu.org>; Sat, 7 Oct 2000 18:46:16 +0200 (MET DST)
Received: from jennifer.informatik.rwth-aachen.de (klausf@jennifer.Informatik.RWTH-Aachen.DE [137.226.116.82])
	by campino.informatik.rwth-aachen.de (8.9.1a/8.9.1/3) with ESMTP id SAA01807
	for <bug-bash@gnu.org>; Sat, 7 Oct 2000 18:46:16 +0200 (MET DST)
From: klausf@Pool.Informatik.RWTH-Aachen.DE
Received: (from klausf@localhost)
	by jennifer.informatik.rwth-aachen.de (8.9.1a/8.9.1/1) id SAA16497;
	Sat, 7 Oct 2000 18:43:45 +0200 (MET DST)
Date: Sat, 7 Oct 2000 18:43:45 +0200 (MET DST)
Message-Id: <200010071643.SAA16497@jennifer.informatik.rwth-aachen.de>
To: bug-bash@gnu.org
Subject: unlimited function recursion crashes
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.6
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc' -DCONF_OSTYPE='solaris2.6' -DCONF_MACHTYPE='sparc-sun-solaris2.6' -DCONF_VENDOR='sun' -DSHELL  -DHAVE_CONFIG_H  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I.  -I. -I./include -I./lib -I/usr/local/include -g -O2
uname output: SunOS jennifer 5.6 Generic_105181-13 sun4u sparc SUNW,Ultra-1
Machine Type: sparc-sun-solaris2.6

Bash Version: 2.04
Patch Level: 0
Release Status: release

Description:
	Unlimited nesting of shell function calls leads to a crash.
	The shell should safely abort() if it the nesting exceeds some limit.

Repeat-By:
	f(){ f;};f


From schwab@suse.de Mon Oct 09 06:59:24 2000
Received: from cantor.suse.de ([194.112.123.193])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13iaeR-0005xK-00
	for <bug-bash@gnu.org>; Mon, 09 Oct 2000 06:59:23 -0400
Received: from Hermes.suse.de (Hermes.suse.de [194.112.123.136])
	by Cantor.suse.de (Postfix) with ESMTP
	id 197561E0B9; Mon,  9 Oct 2000 12:59:22 +0200 (MEST)
Received: from Wotan.suse.de (Wotan.suse.de [10.10.0.1])
	by Hermes.suse.de (Postfix) with ESMTP
	id BCD6F3E44F; Mon,  9 Oct 2000 12:59:21 +0200 (MEST)
Received: from hawking.suse.de (Hawking.suse.de [10.10.0.89])
	by Wotan.suse.de (Postfix) with ESMTP
	id 6F3091C8080; Mon,  9 Oct 2000 12:59:20 +0200 (CEST)
Received: (from schwab@localhost)
	by hawking.suse.de (8.10.2/8.10.2/SuSE Linux 8.10.0-0.3) id e99AxJ025468;
	Mon, 9 Oct 2000 12:59:19 +0200
Date: Mon, 9 Oct 2000 12:59:19 +0200
Message-Id: <200010091059.e99AxJ025468@hawking.suse.de>
X-Authentication-Warning: hawking.suse.de: schwab set sender to schwab@suse.de using -f
To: unruh@physics.ubc.ca (Bill Unruh)
Cc: bug-bash@gnu.org
Subject: Re: bash builtin test changes in 2.04
References: <8rqsef$cac$1@nntp.itservices.ubc.ca>
X-Yow: Everywhere I look I see NEGATIVITY and ASPHALT...
From: Andreas Schwab <schwab@suse.de>
In-Reply-To: unruh@physics.ubc.ca's message of "8 Oct 2000 22:28:31 GMT"
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.90
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Lines: 19
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

unruh@physics.ubc.ca (Bill Unruh) writes:

|> There seems to have been a change in teh behaviour of the bash builtin
|> test or [
|> In particular, the ( EXPRESSION ) syntax seems to have changed so that
|> [ ! ( -z "$USER" -o -z $PS1 ) ] 
|> gives and error when it worked in 2.03. It forthermore works for the gnu
|> /usr/bin/test. Has tehre been a change and why?

I doubt it has ever worked, because `(' and `)' are meta characters that
must be quoted if used outside their dedicated places in the syntax.

Andreas.

-- 
Andreas Schwab                                  "And now for something
SuSE Labs                                        completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg


From irmag@inkjetfills.com Mon Oct 09 10:36:40 2000
Received: from [63.174.85.42] (helo=inkjetfills.com)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13ie2i-0000kU-00
	for <bug-bash@gnu.org>; Mon, 09 Oct 2000 10:36:40 -0400
Date: Mon, 9 Oct 2000 09:46:59 -0500
From: "Irma Garcia" <irmag@inkjetfills.com>
Message-ID: <B6074493.F1EE30@[63.174.85.42]>
To: bug-bash@gnu.org
Subject: ALBAAT Inkjet News v17/EA-2/B
X-Mailer: eMerge 1.62
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

ALBAAT has become an expert in the ink jet cartridge remanufacturing
industry.  We can manufacture over 65 inkjet cartridges with state of t=
he
art equipment. 

http://www.inkjetfills.com/free.html

Send us your empty cartridge, and we will gladlly recycle it for you an=
d
save you money. Simply request one of our Free Ink Jet prepaid shipping=

labels.

If for any reason you are not interested in using remanufactured
cartridges=8A Please use our Free Ink Jet Recycling Kit,  Just put all =
your
empties into the kit, seal it and Drop into the nearest mailbox.  ALBAA=
T
will gladly donate $.50-$1.00 for your empty.

You are receiving this email because you are a past or current customer=
 ,
vendor , or have either inquired about or requested information from th=
is
company. If you wish for us to remove you from our customer list, pleas=
e
reply to this message to let us know and we will honor your request to
exclude you from further mailings.

Sincerely, 
Irma A. Garcia
irmag@inkjetfills.com

Ph#512-219-9800 
Fx# 512-219-1198
Toll Free: 888-4 ALBAAT
http://www.inkjetfills.com/free.html
ALBAAT INKJET FILLS
12129 North Highway 620 #540
Austin, Texas  78750



From irmag@inkjetfills.com Mon Oct 09 10:36:42 2000
Received: from [63.174.85.42] (helo=inkjetfills.com)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13ie2j-0000kb-00
	for <bug-bash@prep.ai.mit.edu>; Mon, 09 Oct 2000 10:36:41 -0400
Date: Mon, 9 Oct 2000 09:47:01 -0500
From: "Irma Garcia" <irmag@inkjetfills.com>
Message-ID: <B6074495.F1EEA6@[63.174.85.42]>
To: bug-bash@prep.ai.mit.edu
Subject: ALBAAT Inkjet News v17/EA-2/B
X-Mailer: eMerge 1.62
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

ALBAAT has become an expert in the ink jet cartridge remanufacturing
industry.  We can manufacture over 65 inkjet cartridges with state of t=
he
art equipment. 

http://www.inkjetfills.com/free.html

Send us your empty cartridge, and we will gladlly recycle it for you an=
d
save you money. Simply request one of our Free Ink Jet prepaid shipping=

labels.

If for any reason you are not interested in using remanufactured
cartridges=8A Please use our Free Ink Jet Recycling Kit,  Just put all =
your
empties into the kit, seal it and Drop into the nearest mailbox.  ALBAA=
T
will gladly donate $.50-$1.00 for your empty.

You are receiving this email because you are a past or current customer=
 ,
vendor , or have either inquired about or requested information from th=
is
company. If you wish for us to remove you from our customer list, pleas=
e
reply to this message to let us know and we will honor your request to
exclude you from further mailings.

Sincerely, 
Irma A. Garcia
irmag@inkjetfills.com

Ph#512-219-9800 
Fx# 512-219-1198
Toll Free: 888-4 ALBAAT
http://www.inkjetfills.com/free.html
ALBAAT INKJET FILLS
12129 North Highway 620 #540
Austin, Texas  78750



From chet@nike.ins.cwru.edu Mon Oct 09 10:55:05 2000
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13ieKX-00016W-00
	for <bug-bash@gnu.org>; Mon, 09 Oct 2000 10:55:05 -0400
Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi)
	id KAA66157; Mon, 9 Oct 2000 10:54:55 -0400 (EDT) (from chet)
Date: Mon, 9 Oct 2000 10:50:56 -0400
From: Chet Ramey <chet@nike.ins.cwru.edu>
To: unruh@physics.ubc.ca
Subject: Re: bash builtin test changes in 2.04
Cc: chet@po.cwru.edu, bug-bash@gnu.org
Reply-To: chet@po.CWRU.Edu
Message-ID: <1001009145056.AA66138.SM@nike.ins.cwru.edu>
Read-Receipt-To: chet@po.CWRU.Edu
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-In-Reply-To:  Message from unruh@physics.ubc.ca of 8 Oct 2000 22:28:31 GMT (id <8rqsef$cac$1@nntp.itservices.ubc.ca>)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

> There seems to have been a change in teh behaviour of the bash builtin
> test or [
> In particular, the ( EXPRESSION ) syntax seems to have changed so that
> [ ! ( -z "$USER" -o -z $PS1 ) ] 
> gives and error when it worked in 2.03. It forthermore works for the gnu
> /usr/bin/test. Has tehre been a change and why?

First, you need to quote the `(' and `)' so the shell parser doesn't
grab them.  Then, you need to quote the $PS1, so, if it's null, the
`)' is not taken as the argument to -z.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


From nobody@webmail.rmci.net Mon Oct 09 21:56:30 2000
Received: from halcyon.rmci.net ([205.162.184.63] helo=mx20.rmci.net)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13ioec-0004Ne-00
	for <bug-bash@gnu.org>; Mon, 09 Oct 2000 21:56:30 -0400
Received: (qmail 21616 invoked from network); 10 Oct 2000 01:56:18 -0000
Received: from webmail.rmci.net (205.162.184.25)
  by mx20.rmci.net with SMTP; 10 Oct 2000 01:56:18 -0000
Received: (from nobody@localhost)
	by webmail.rmci.net (8.9.3/8.9.3) id TAA21162;
	Mon, 9 Oct 2000 19:56:17 -0600
Date: Mon, 9 Oct 2000 19:56:17 -0600
Message-Id: <200010100156.TAA21162@webmail.rmci.net>
To: bug-bash@gnu.org
Subject: Bash Core
From: term <term@rmci.net>
Cc: 
X-Mailer: WebMail : term@rmci.net
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

[neuromancer:~]# bash --version
GNU bash, version 2.04.0(1)-release (i386-pc-openbsd2.7)
Copyright 1999 Free Software Foundation, Inc.
[neuromancer:~]# uname -a
OpenBSD neuromancer 2.7 GENERIC#25 i386
[neuromancer:~]# 

Core was generated by `bash'.
Program terminated with signal 6, Abort trap.
Reading symbols from /usr/libexec/ld.so...done.
Reading symbols from /usr/lib/libtermcap.so.7.1...done.
Reading symbols from /usr/lib/libc.so.25.0...done.
#0  0x4013117f in kill ()
(gdb) bt
#0  0x4013117f in kill ()
#1  0x40130b1c in abort ()
#2  0x15f3f in programming_error (format=0x60044 "free: called with already freed block argument") at error.c:258
#3  0x6013d in free (mem=0x10696c) at malloc.c:691
#4  0xd6ad in dispose_word (w=0x1069ac) at dispose_cmd.c:224
#5  0xd6df in dispose_words (list=0x10698c) at dispose_cmd.c:239
#6  0x25227 in run_unwind_protects_internal () at unwind_prot.c:187
#7  0x250bd in without_interrupts (function=0x25204 <run_unwind_protects_internal>, arg1=0x0, arg2=0x0) at unwind_prot.c:82
#8  0x25188 in run_unwind_protects () at unwind_prot.c:136
#9  0x25d61 in throw_to_top_level () at sig.c:373
#10 0x1899f in make_child (command=0xbd34c "xlock -mode galaxy", async_p=0) at jobs.c:1126
#11 0x1136e in execute_disk_command (words=0x106c8c, redirects=0x0, command_line=0xbd30c "xlock -mode galaxy", pipe_in=-1, 
    pipe_out=-1, async=0, fds_to_close=0x1069cc, cmdflags=0) at execute_cmd.c:3096
#12 0x10ac4 in execute_simple_command (simple_command=0x7acec, pipe_in=-1, pipe_out=-1, async=0, fds_to_close=0x1069cc)
    at execute_cmd.c:2640
#13 0xdf82 in execute_command_internal (command=0x7cc0c, asynchronous=0, pipe_in=-1, pipe_out=-1, fds_to_close=0x1069cc)
    at execute_cmd.c:583
#14 0xd8e4 in execute_command (command=0x7cc0c) at execute_cmd.c:280
#15 0x39d1 in reader_loop () at eval.c:139
#16 0x1f01 in main (argc=4, argv=0x7ce4c, env=0xdb00c) at shell.c:628
(gdb) 


From aprakash@me.iitb.ernet.in Tue Oct 10 10:37:39 2000
Received: from mailhost.iitb.ac.in ([203.197.74.142])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13j0XA-0000XM-00
	for <bug-bash@prep.ai.mit.edu>; Tue, 10 Oct 2000 10:37:38 -0400
Received: (qmail 8674 invoked from network); 10 Oct 2000 14:40:38 -0000
Received: from epsilon.me.iitb.ernet.in (qmailr@144.16.101.16)
  by mailhost.iitb.ac.in with SMTP; 10 Oct 2000 14:40:38 -0000
Received: (qmail 1084 invoked by uid 172); 10 Oct 2000 14:33:23 -0000
Date: 10 Oct 2000 14:33:23 -0000
Message-ID: <20001010143323.1083.qmail@epsilon.me.iitb.ernet.in>
From: aprakash@me.iitb.ernet.in
To: bug-bash@prep.ai.mit.edu
Subject: [50 character or so descriptive subject here (for reference)]
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.6
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DHOSTTYPE='sparc' -DOSTYPE='solaris2.6' -DMACHTYPE='sparc-sun-solaris2.6' -DSHELL  -DHAVE_CONFIG_H   -I. -I. -I./lib -g -O2
uname output: SunOS epsilon 5.6 Generic_105181-19 sun4u sparc SUNW,Ultra-2
Machine Type: sparc-sun-solaris2.6

Bash Version: 2.01
Patch Level: 1
Release Status: release

Description:
	[Detailed description of the problem, suggestion, or complaint.]

Repeat-By:
	[Describe the sequence of events that causes the problem
	to occur.]

Fix:
	[Description of how to fix the problem.  If you don't know a
	fix for the problem, don't include this section.]










































From news@nntp.itservices.ubc.ca Sun Oct 08 18:28:43 2000
Received: from chx400.switch.ch ([130.59.10.2])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13iOvz-0001fl-00
	for <bug-bash@prep.ai.mit.edu>; Sun, 08 Oct 2000 18:28:43 -0400
Received: from mail-relay.ubc.ca ([137.82.1.2])
	by chx400.switch.ch with esmtp (Exim 3.15 #3)
	id 13iOvw-0000DW-00
	for gnu-bash-bug@moderators.isc.org; Mon, 09 Oct 2000 00:28:41 +0200
Received: from nntp.itservices.ubc.ca (nntp.itservices.ubc.ca [137.82.194.1])
	by mail-relay.ubc.ca [137.82.1.2] (8.11.0/8.11.0) with ESMTP id e98MSXo26175
	for <gnu-bash-bug@moderators.isc.org>; Sun, 8 Oct 2000 15:28:34 -0700 (PDT)
Received: (from news@localhost)
	by nntp.itservices.ubc.ca (8.9.3+Sun/8.9.3) id PAA12623
	for gnu-bash-bug@moderators.isc.org; Sun, 8 Oct 2000 15:28:32 -0700 (PDT)
To: gnu-bash-bug@moderators.isc.org
Path: unruh
From: unruh@physics.ubc.ca (Bill Unruh)
Newsgroups: gnu.bash.bug
Subject: bash builtin test changes in 2.04
Date: 8 Oct 2000 22:28:31 GMT
Organization: ITServices, University of British Columbia
Lines: 6
Message-ID: <8rqsef$cac$1@nntp.itservices.ubc.ca>
X-Trace: nntp.itservices.ubc.ca 971044111 12620 142.103.234.10 (8 Oct 2000 22:28:31 GMT)
X-Complaints-To: abuse@interchange.ubc.ca
Summary: bash builtin test changes
Keywords: bash, test, [,
X-Newsreader: NN version 6.5.0 CURRENT #3
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

There seems to have been a change in teh behaviour of the bash builtin
test or [
In particular, the ( EXPRESSION ) syntax seems to have changed so that
[ ! ( -z "$USER" -o -z $PS1 ) ] 
gives and error when it worked in 2.03. It forthermore works for the gnu
/usr/bin/test. Has tehre been a change and why?


From chet@granite.ins.cwru.edu Mon Oct 09 10:00:20 2000
Received: from granite.ins.cwru.edu ([129.22.8.228])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13idTH-0000BF-00
	for <bug-bash@prep.ai.mit.edu>; Mon, 09 Oct 2000 10:00:04 -0400
Received: (chet@localhost) by granite.INS.CWRU.Edu (8.8.8+cwru/CWRU-2.5-bsdi)
	id KAA22582; Mon, 9 Oct 2000 10:00:01 -0400 (EDT) (from chet)
Message-Id: <200010091400.KAA22582@granite.INS.CWRU.Edu>
Date: Mon, 9 Oct 2000 10:00:01 -0400 (EDT)
From: chet@po.cwru.edu (Chet Ramey)
To: bug-bash@prep.ai.mit.edu
Subject: BASH Frequently-Asked Questions (FAQ version 3.9)
Reply-To: chet@po.cwru.edu
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Archive-name: unix-faq/shell/bash
Posting-Frequency: monthly
Submitted-By: chet@po.cwru.edu (Chet Ramey)
Last-Modified: Thu May 18 13:08:48 EDT 2000
FAQ-Version: 3.9
Bash-Version: 2.04
URL: ftp://ftp.cwru.edu/pub/bash/FAQ
Maintainer: chet@po.cwru.edu (Chet Ramey)

This is the Bash FAQ, version 3.9, for Bash version 2.04.

This document contains a set of frequently-asked questions concerning
Bash, the GNU Bourne-Again Shell.  Bash is a freely-available command
interpreter with advanced features for both interactive use and shell
programming.

Another good source of basic information about shells is the collection
of FAQ articles periodically posted to comp.unix.shell.

Questions and comments concerning this document should be sent to
chet@po.cwru.edu.

This document is available for anonymous FTP with the URL

ftp://ftp.cwru.edu/pub/bash/FAQ

The Bash home page is http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html

----------
Contents:

Section A:  The Basics

A1) What is it?
A2) What's the latest version?
A3) Where can I get it?
A4) On what machines will bash run?
A5) Will bash run on operating systems other than Unix?
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'?
A10) What is the bash `posix mode'?

Section B:  The latest version

B1) What's new in version 2.04?
B2) Are there any user-visible incompatibilities between bash-2.04 and
    bash-1.14.7?

Section C:  Differences from other Unix shells

C1) How does bash differ from sh, the Bourne shell?
C2) How does bash differ from the Korn shell, version ksh88?
C3) Which new features in ksh-93 are not in bash, and which are?

Section D:  Why does bash do some things differently than other Unix shells?

D1) Why does bash run a different version of `command' than
    `which command' says it will?
D2) Why doesn't bash treat brace expansions exactly like csh?
D3) Why doesn't bash have csh variable modifiers?
D4) How can I make my csh aliases work when I convert to bash?
D5) How can I pipe standard output and standard error from one command to
    another, like csh does with `|&'?
D6) Now that I've converted from ksh to bash, are there equivalents to
    ksh features like autoloaded functions and the `whence' command?

Section E:  Why does bash do certain things the way it does?

E1) Why is the bash builtin `test' slightly different from /bin/test?
E2) Why does bash sometimes say `Broken pipe'?
E3) When I have terminal escape sequences in my prompt, why does bash
    wrap lines at the wrong column?
E4) If I pipe the output of a command into `read variable', why doesn't
    the output show up in $variable when the read command finishes?
E5) I have a bunch of shell scripts that use backslash-escaped characters
    in arguments to `echo'.  Bash doesn't interpret these characters.  Why
    not, and how can I make it understand them?
E6) Why doesn't a while or for loop get suspended when I type ^Z?
E7) What about empty for loops in Makefiles?
E8) Why does the arithmetic evaluation code complain about `08'?

Section F:  Things to watch out for on certain Unix versions

F1) Why can't I use command line editing in my `cmdtool'?
F2) I built bash on Solaris 2.  Why do globbing expansions and filename
    completion chop off the first few characters of each filename?
F3) Why does bash dump core after I interrupt username completion or
    `~user' tilde expansion on a machine running NIS?
F4) I'm running SVR4.2.  Why is the line erased every time I type `@'?
F5) Why does bash report syntax errors when my C News scripts use a
    redirection before a subshell command?
F6) Why can't I use vi-mode editing on Red Hat Linux 6.1?

Section G:  How can I get bash to do certain common things?

G1) How can I get bash to read and display eight-bit characters?
G2) How do I write a function `x' to replace builtin command `x', but
    still invoke the command from within the function?
G3) How can I find the value of a shell variable whose name is the value
    of another shell variable?
G4) How can I make the bash `time' reserved word print timing output that
    looks like the output from my system's /usr/bin/time?
G5) How do I get the current directory into my prompt?
G6) How can I rename "*.foo" to "*.bar"?
G7) How can I translate a filename from uppercase to lowercase?
G8) How can I write a filename expansion (globbing) pattern that will match
    all files in the current directory except "." and ".."?

Section H:  Where do I go from here?

H1) How do I report bugs in bash, and where should I look for fixes and
    advice?
H2) What kind of bash documentation is there?
H3) What's coming in future versions?
H4) What's on the bash `wish list'?
H5) When will the next release appear?

----------
Section A:  The Basics

A1)  What is it?

Bash is a Unix command interpreter (shell).  It is an implementation of
the Posix 1003.2 shell standard, and resembles the Korn and System V
shells.

Bash contains a number of enhancements over those shells, both
for interactive use and shell programming.  Features geared
toward interactive use include command line editing, command
history, job control, aliases, and prompt expansion.  Programming
features include additional variable expansions, shell
arithmetic, and a number of variables and options to control
shell behavior.

Bash was originally written by Brian Fox of the Free Software
Foundation.  The current developer and maintainer is Chet Ramey
of Case Western Reserve University.

A2)  What's the latest version?

The latest version is 2.04, first made available on Friday, 17 March 2000.

A3)  Where can I get it?

Bash is the GNU project's shell, and so is available from the
master GNU archive site, ftp.gnu.org, and its mirrors.  The
latest version is also available for FTP from ftp.cwru.edu.
The following URLs tell how to get version 2.04:

ftp://ftp.gnu.org/pub/gnu/bash/bash-2.04.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-2.04.tar.gz

Formatted versions of the documentation are available with the URLs:

ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-2.04.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-2.04.tar.gz

A4)  On what machines will bash run?

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
itself accordingly, using a script created by GNU autoconf.

More information appears in the file `INSTALL' in the distribution.

A5) Will bash run on operating systems other than Unix?

Configuration specifics for Unix-like systems such as QNX and
LynxOS are included in the distribution.  Bash-2.04 should 
compile and run on Minix 2.0 (patches were contributed), but I
don't believe anyone has built bash-2.x on earlier Minix versions
yet.

Bash has been ported to versions of Windows implementing the Win32
programming interface.  This includes Windows 95 and Windows NT.
The port was done by Cygnus Solutions as part of their CYGWIN
project.  For more information about the project, look at the URL

http:/sourceware.cygnus.com/cygwin

Cygnus originally ported bash-1.14.7, and that port was part of their
early GNU-Win32 (the original name) releases.  Cygnus has also done a
port of bash-2.02.1 to the CYGWIN environment, and it is available as
part of their current release.  (They may have upgraded by now.)

Bash-2.04 should require no local Cygnus changes to build and run under
CYGWIN.

The Cygnus port works only on Intel machines.  There is a port of bash
(I don't know which version) to the alpha/NT environment available from

ftp://ftp.gnustep.org//pub/win32/bash-alpha-nt-1.01.tar.gz

Softway Systems has ported bash-2.01 to their Interix (nee OpenNT)
system, a Unix subsystem for NT that replaces the Microsoft POSIX
subsystem.  Check out http://www.interix.com for more information.
Some support for Interix has been incorporated into bash, beginning
with Bash-2.03.  It should be easier to build bash on Interix now,
but Interix users should fetch

ftp://ftp.interix.com/pub/tw/unsup/bash.diffs.tar.gz

and read the README.OpenNT file in that archive.  It will detail the
arguments `configure' needs to build on Interix.  A configure cache
file for Interix is in the bash distribution in cross-build/opennt.cache;
copy that to `config.cache' before starting configure.

DJ Delorie has a port of bash-1.14.7 which runs under MS-DOS, as part
of the DJGPP project.  For more information on the project, see

http://www.delorie.com/djgpp/

I have been told that the original DJGPP port was done by Daisuke Aoyama.

I picked up a binary of bash-1.14.7 that is purported to work with
the DJGPP V2 environment from

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147b.zip

The corresponding source is

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147s.zip

Mark Elbrecht <snowball3@bigfoot.com> has sent me notice that bash-2.03
has become available for DJGPP V2.  The files are available as:

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203b.zip	binary
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203d.zip	documentation
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203s.zip	source

Mark has begun to work with bash-2.04.

Ports of bash-1.12 and bash-2.0 are available for OS/2 from

ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash_112.zip
ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash-2.0(253).zip

I haven't looked at either, but the second appears to be a binary-only
distribution.  Beware.

I have received word that Bash (I'm not sure which version, but I
believe that it's at least bash-2.02.1) is the standard shell on
BeOS.

A6) How can I build bash with gcc? 

Bash configures to use gcc by default if it is available.  Read the
file INSTALL in the distribution for more information.

A7)  How can I make bash my login shell?

Some machines let you use `chsh' to change your login shell.  Other
systems use `passwd -s' or `passwd -e'.  If one of these works for
you, that's all you need.  Note that many systems require the full
pathname to a shell to appear in /etc/shells before you can make it
your login shell.  For this, you may need the assistance of your
friendly local system administrator. 

If you cannot do this, you can still use bash as your login shell, but
you need to perform some tricks.  The basic idea is to add a command
to your login shell's startup file to replace your login shell with
bash.

For example, if your login shell is csh or tcsh, and you have installed
bash in /usr/gnu/bin/bash, add the following line to ~/.login:

	if ( -f /usr/gnu/bin/bash ) exec /usr/gnu/bin/bash --login

(the `--login' tells bash that it is a login shell).

It's not a good idea to put this command into ~/.cshrc, because every
csh you run without the `-f' option, even ones started to run csh scripts,
reads that file.  If you must put the command in ~/.cshrc, use something
like

	if ( $?prompt ) exec /usr/gnu/bin/bash --login

to ensure that bash is exec'd only when the csh is interactive.

If your login shell is sh or ksh, you have to do two things.

First, create an empty file in your home directory named `.bash_profile'.
The existence of this file will prevent the exec'd bash from trying to
read ~/.profile, and re-execing itself over and over again.  ~/.bash_profile
is the first file bash tries to read initialization commands from when
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

This will cause login shells to replace themselves with bash running as
a login shell.  Once you have this working, you can copy your initialization
code from ~/.profile to ~/.bash_profile.

I have received word that the recipe supplied above is insufficient for
machines running CDE.  CDE has a maze of twisty little startup files, all
slightly different.

If you cannot change your login shell in the password file to bash, you
will have to (apparently) live with CDE using the shell in the password
file to run its startup scripts.  If you have changed your shell to bash,
there is code in the CDE startup files (on Solaris, at least) to do the
right thing. 

`dtterm' claims to use $SHELL as the default program to start, so if you
can change $SHELL in the CDE startup files, you should be able to use bash
in your terminal windows.

Setting DTSOURCEPROFILE in ~/.dtprofile will cause the `Xsession' program
to read your login shell's startup files.  You may be able to use bash for
the rest of the CDE programs by setting SHELL to bash in ~/.dtprofile as
well, but I have not tried this.

You can use the above `exec' recipe to start bash when not logging in with
CDE by testing the value of the DT variable:

	if [ -n "$DT" ]; then
	        [ -f /usr/gnu/bin/bash ] && exec /usr/gnu/bin/bash --login
	fi


A8) I just changed my login shell to bash, and now I can't FTP into my
   machine.  Why not?

You must add the full pathname to bash to the file /etc/shells.  As
noted in the answer to the previous question, many systems require
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'?

POSIX is a name originally coined by Richard Stallman for a
family of open system standards based on UNIX.  There are a
number of aspects of UNIX under consideration for
standardization, from the basic system services at the system
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. 

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 `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
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
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.

A10)  What is the bash `posix mode'?

Although bash is an implementation of the POSIX.2 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. 

Posix mode is entered by starting bash with the --posix option or
executing `set -o posix' after bash is running.

The specific aspects of bash which change when posix mode is
active are listed in the file CWRU/POSIX.NOTES in the bash
distribution.  They are also listed in a section in the Bash
Reference Manual.

Section B:  The latest version

B1) What's new in version 2.04?

Bash-2.04 contains the following new features (see the manual page for
complete descriptions and the CHANGES and NEWS files in the bash-2.04
distribution):

o Programmable word completion with the new `complete' and `compgen' builtins;
  examples are provided in examples/complete/complete-examples
o `history' has a new `-d' option to delete a history entry
o `bind' has a new `-x' option to bind key sequences to shell commands
o The prompt expansion code has new `\j' and `\l' escape sequences
o The `no_empty_cmd_completion' shell option, if enabled, inhibits
  command completion when TAB is typed on an empty line
o `help' has a new `-s' option to print a usage synopsis
o New arithmetic operators: var++, var--, ++var, --var, expr1,expr2 (comma)
o New ksh93-style arithmetic for command:
	for ((expr1 ; expr2; expr3 )); do list; done
o `read' has new options: `-t', `-n', `-d', `-s'
o The redirection code handles several filenames specially:  /dev/fd/N,
  /dev/stdin, /dev/stdout, /dev/stderr
o The redirection code now recognizes /dev/tcp/HOST/PORT and
  /dev/udp/HOST/PORT and tries to open a TCP or UDP socket, respectively,
  to the specified port on the specified host
o The ${!prefix*} expansion has been implemented
o A new FUNCNAME variable, which expands to the name of a currently-executing
  function
o The GROUPS variable is no longer readonly
o A new shopt `xpg_echo' variable, to control the behavior of echo with
  respect to backslash-escape sequences at runtime
o The NON_INTERACTIVE_LOGIN_SHELLS #define has returned

The version of Readline released with Bash-2.04, Readline-4.1, has several
new features as well:

o Parentheses matching is always compiled into readline, and controllable
  with the new `blink-matching-paren' variable
o The history-search-forward and history-search-backward functions now leave
  point at the end of the line when the search string is empty, like
  reverse-search-history, and forward-search-history
o A new function for applications:  rl_on_new_line_with_prompt()
o New variables for applications:  rl_already_prompted, and rl_gnu_readline_p


A short feature history dating from bash-2.0:

Bash-2.03 had very few new features, in keeping with the convention
that odd-numbered releases provide mainly bug fixes.  A number of new
features were added to Readline, mostly at the request of the Cygnus
folks.

A new shopt option, `restricted_shell', so that startup files can test
	whether or not the shell was started in restricted mode
Filename generation is now performed on the words between ( and ) in
	compound array assignments (this is really a bug fix)
OLDPWD is now auto-exported, as POSIX.2 requires
ENV and BASH_ENV are read-only variables in a restricted shell
Bash may now be linked against an already-installed Readline library,
	as long as the Readline library is version 4 or newer
All shells begun with the `--login' option will source the login shell
	startup files, even if the shell is not interactive

There were lots of changes to the version of the Readline library released
along with Bash-2.03.  For a complete list of the changes, read the file
CHANGES in the Bash-2.03 distribution.

Bash-2.02 contained the following new features:

a new version of malloc (based on the old GNU malloc code in previous
	bash versions) that is more page-oriented, more conservative
	with memory usage, does not `orphan' large blocks when they
	are freed, is usable on 64-bit machines, and has allocation
	checking turned on unconditionally
POSIX.2-style globbing character classes ([:alpha:], [:alnum:], etc.)
POSIX.2-style globbing equivalence classes
POSIX.2-style globbing collating symbols
the ksh [[...]] extended conditional command
the ksh egrep-style extended pattern matching operators
a new `printf' builtin
the ksh-like $(<filename) command substitution, which is equivalent to
	$(cat filename)
new tilde prefixes that expand to directories from the directory stack
new `**' arithmetic operator to do exponentiation
case-insensitive globbing (filename expansion)
menu completion a la tcsh
`magic-space' history expansion function like tcsh
the readline inputrc `language' has a new file inclusion directive ($include)

Bash-2.01 contained only a few new features:

new `GROUPS' builtin array variable containing the user's group list
new bindable readline commands: history-and-alias-expand-line and
	alias-expand-line

Bash-2.0 contained extensive changes and new features from bash-1.14.7.
Here's a short list:

new `time' reserved word to time pipelines, shell builtins, and
	shell functions
one-dimensional arrays with a new compound assignment statement,
        appropriate expansion constructs and modifications to some
	of the builtins (read, declare, etc.) to use them
new quoting syntaxes for ANSI-C string expansion and locale-specific
	string translation
new expansions to do substring extraction, pattern replacement, and
	indirect variable expansion
new builtins: `disown' and `shopt'
new variables: HISTIGNORE, SHELLOPTS, PIPESTATUS, DIRSTACK, GLOBIGNORE,
	       MACHTYPE, BASH_VERSINFO
special handling of many unused or redundant variables removed
	(e.g., $notify, $glob_dot_filenames, $no_exit_on_failed_exec)
dynamic loading of new builtin commands; many loadable examples provided
new prompt expansions: \a, \e, \n, \H, \T, \@, \v, \V
history and aliases available in shell scripts
new readline variables: enable-keypad, mark-directories, input-meta,
	visible-stats, disable-completion, comment-begin
new readline commands to manipulate the mark and operate on the region
new readline emacs mode commands and bindings for ksh-88 compatibility
updated and extended builtins
new DEBUG trap
expanded (and now documented) restricted shell mode

implementation stuff:	
autoconf-based configuration
nearly all of the bugs reported since version 1.14 have been fixed
most builtins converted to use builtin `getopt' for consistency
most builtins use -p option to display output in a reusable form
	(for consistency)
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.04 and
    bash-1.14.7?

There are a few incompatibilities between version 1.14.7 and version 2.04.
They are detailed in the file COMPAT in the bash-2.04 distribution.

Section C:  Differences from other Unix shells

C1) How does bash differ from sh, the Bourne shell?

This is a non-comprehensive list of features that differentiate bash
from the SVR4.2 shell.  The bash manual page explains these more
completely.

Things bash has that sh does not:
	long invocation options
	`!' reserved word to invert pipeline return value
	`time' reserved word to time pipelines and shell builtins
	the `function' reserved word
	the `select' compound command and reserved word
	arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
	new $'...' and $"..." quoting
	the $(...) form of command substitution
	the $(<filename) form of command substitution, equivalent to
		$(cat filename)
	the ${#param} parameter value length operator
	the ${!param} indirect parameter expansion operator
	the ${!param*} prefix expansion operator
	the ${param:length[:offset]} parameter substring operator
	the ${param/pat[/string]} parameter pattern substitution operator
	expansions to perform substring removal (${p%[%]w}, ${p#[#]w})
	expansion of positional parameters beyond $9 with ${num}
	variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, REPLY,
		   TIMEFORMAT, PPID, PWD, OLDPWD, SHLVL, RANDOM, SECONDS,
		   LINENO, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE, HOSTNAME,
		   ENV, PS3, PS4, DIRSTACK, PIPESTATUS, HISTSIZE, HISTFILE,
		   HISTFILESIZE, HISTCONTROL, HISTIGNORE, GLOBIGNORE, GROUPS,
		   PROMPT_COMMAND, FCEDIT, FIGNORE, IGNOREEOF, INPUTRC,
		   SHELLOPTS, OPTERR, HOSTFILE, TMOUT, FUNCNAME, histchars,
		   auto_resume
	DEBUG trap
	variable arrays with new compound assignment syntax
	redirections: <>, &>, >|
	prompt string special char translation and variable expansion
	auto-export of variables in initial environment
	command search finds functions before builtins
	bash return builtin will exit a file sourced with `.'
	builtins: cd -/-L/-P, exec -l/-c/-a, echo -e/-E, hash -p.
		  export -n/-f/-p/name=value, pwd -L/-P,
		  read -e/-p/-a/-t/-n/-d/-s,
		  readonly -a/-f/name=value, trap -l, set +o,
		  set -b/-m/-o option/-h/-p/-B/-C/-H/-P,
		  unset -f/-v, ulimit -m/-p/-u,
		  type -a/-p/-t, suspend -f, kill -n,
		  test -o optname/s1 == s2/s1 < s2/s1 > s2/-nt/-ot/-ef/-O/-G/-S
	bash reads ~/.bashrc for interactive shells, $ENV for non-interactive
	bash restricted shell mode is more extensive
	bash allows functions and variables with the same name
	brace expansion
	tilde expansion
	arithmetic expansion with $((...)) and `let' builtin
	the `[[...]]' extended conditional command
	process substitution
	aliases and alias/unalias builtins
	local variables in functions and `local' builtin
	readline and command-line editing with programmable completion
	command history and history/fc builtins
	csh-like history expansion
	other new bash builtins: bind, command, compgen, complete, builtin,
				 declare/typeset, dirs, enable, fc, help,
				 history, logout, popd, pushd, disown, shopt,
				 printf
	exported functions
	filename generation when using output redirection (command >a*)
	POSIX.2-style globbing character classes
	POSIX.2-style globbing equivalence classes
	POSIX.2-style globbing collating symbols
	egrep-like extended pattern matching operators
	case-insensitive pattern matching and globbing
	variable assignments preceding commands affect only that command,
		even for builtins and functions
	posix mode
	redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr,
		/dev/tcp/host/port, /dev/udp/host/port

Things sh has that bash does not:
	uses variable SHACCT to do shell accounting
	includes `stop' builtin (bash can use alias stop='kill -s STOP')
	`newgrp' builtin
	turns on job control if called as `jsh'
	$TIMEOUT (like bash $TMOUT)
	`^' is a synonym for `|'
	new SVR4.2 sh builtins: mldmode, priv

Implementation differences:
	redirection to/from compound commands causes sh to create a subshell
	bash does not allow unbalanced quotes; sh silently inserts them at EOF
	bash does not mess with signal 11
	sh sets (euid, egid) to (uid, gid) if -p not supplied and uid < 100
	bash splits only the results of expansions on IFS, using POSIX.2
		field splitting rules; sh splits all words on IFS
	sh does not allow MAILCHECK to be unset (?)
	sh does not allow traps on SIGALRM or SIGCHLD
	bash allows multiple option arguments when invoked (e.g. -x -v);
		sh allows only a single option argument (`sh -x -v' attempts
		to open a file named `-v', and, on SunOS 4.1.4, dumps core.
		On Solaris 2.4 and earlier versions, sh goes into an infinite
		loop.)
	sh exits a script if any builtin fails; bash exits only if one of
		the POSIX.2 `special' builtins fails

C2)  How does bash differ from the Korn shell, version ksh88?

Things bash has or uses that ksh88 does not:
	long invocation options
	`!' reserved word
	arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
	posix mode and posix conformance
	command hashing
	tilde expansion for assignment statements that look like $PATH
	process substitution with named pipes if /dev/fd is not available
	the ${!param} indirect parameter expansion operator
	the ${!param*} prefix expansion operator
	the ${param:length[:offset]} parameter substring operator
	the ${param/pat[/string]} parameter pattern substitution operator
	variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, SHLVL,
		   TIMEFORMAT, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE,
		   HISTFILESIZE, HISTIGNORE, HISTCONTROL, PROMPT_COMMAND,
		   IGNOREEOF, FIGNORE, INPUTRC, HOSTFILE, DIRSTACK,
		   PIPESTATUS, HOSTNAME, OPTERR, SHELLOPTS, GLOBIGNORE,
		   GROUPS, FUNCNAME, histchars, auto_resume
	prompt expansion with backslash escapes and command substitution
	redirection: &> (stdout and stderr)
	more extensive and extensible editing and programmable completion
	builtins: bind, builtin, command, declare, dirs, echo -e/-E, enable,
		  exec -l/-c/-a, fc -s, export -n/-f/-p, hash, help, history,
		  jobs -x/-r/-s, kill -s/-n/-l, local, logout, popd, pushd,
		  read -e/-p/-a/-t/-n/-d/-s, readonly -a/-n/-f/-p,
		  set -o braceexpand/-o histexpand/-o interactive-comments/
		  -o notify/-o physical/-o posix/-o hashall/-o onecmd/
		  -h/-B/-C/-b/-H/-P, set +o, suspend, trap -l, type,
		  typeset -a/-F/-p, ulimit -u, umask -S, alias -p, shopt,
		  disown, printf, complete, compgen
	`!' csh-style history expansion
	POSIX.2-style globbing character classes
	POSIX.2-style globbing equivalence classes
	POSIX.2-style globbing collating symbols
	egrep-like extended pattern matching operators
	case-insensitive pattern matching and globbing
	`**' arithmetic operator to do exponentiation
	redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr

Things ksh88 has or uses that bash does not:
	tracked aliases
	variables: ERRNO, FPATH, EDITOR, VISUAL
	co-processes (|&, >&p, <&p)
	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,
		  read -p/-s/-u/var?prompt, set -A/-o gmacs/
		  -o bgnice/-o markdirs/-o nolog/-o trackall/-o viraw/-s,
		  typeset -H/-L/-R/-A/-ft/-fu/-fx/-l/-u/-t, whence

Implementation differences:
	ksh runs last command of a pipeline in parent shell context
	bash has brace expansion by default (ksh88 compile-time option)
	bash has fixed startup file for all interactive shells; ksh reads $ENV
	bash has exported functions
	bash command search finds functions before builtins

C3)  Which new features in ksh-93 are not in bash, and which are?

New things in ksh-93 not in bash-2.04:
	associative arrays
	floating point arithmetic
	math library functions
	${!name[sub]} name of subscript for associative array
	`.' is allowed in variable names to create a hierarchical namespace
	more extensive compound assignment syntax
	discipline functions
	`sleep' and `getconf' builtins (bash has loadable versions)
	typeset -n and `nameref' variables
	KEYBD trap
	variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, .sh.version,
		   .sh.name, .sh.subscript, .sh.value, HISTEDIT
	backreferences in pattern matching
	print -f (bash uses printf)
	`fc' has been renamed to `hist'
	`.' can execute shell functions

New things in ksh-93 present in bash-2.04:
        for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command
        ?:, ++, --, `expr1 , expr2' arithmetic operators
	expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]},
		    ${!param*}
	compound array assignment
	the `!' reserved word
	loadable builtins -- but ksh uses `builtin' while bash uses `enable'
	`command', `builtin', `disown' builtins
	new $'...' and $"..." quoting
	FIGNORE (but bash uses GLOBIGNORE), HISTCMD
	set -o notify/-C
	changes to kill builtin
	read -A (bash uses read -a)
        read -t/-d
	trap -p
	exec -c/-a
	`.' restores the positional parameters when it completes
	POSIX.2 `test'
	umask -S
	unalias -a
	command and arithmetic substitution performed on PS1, PS4, and ENV
	command name completion
	ENV processed only for interactive shells

Section D:  Why does bash do some things differently than other Unix shells?

D1) Why does bash run a different version of `command' than
    `which command' says it will?

On many systems, `which' is actually a csh script that assumes
you're running csh.  In tcsh, `which' and its cousin `where'
are builtins.  On other Unix systems, `which' is a perl script
that uses the PATH environment variable.

The csh script version reads the csh startup files from your
home directory and uses those to determine which `command' will
be invoked.  Since bash doesn't use any of those startup files,
there's a good chance that your bash environment differs from
your csh environment.  The bash `type' builtin does everything
`which' does, and will report correct results for the running
shell.  If you're really wedded to the name `which', try adding
the following function definition to your .bashrc:

	which()
	{
		builtin type "$@"
	}

If you're moving from tcsh and would like to bring `where' along
as well, use this function:

	where()
	{
		builtin type -a "$@"
	}

D2) Why doesn't bash treat brace expansions exactly like csh?

The only difference between bash and csh brace expansion is that
bash requires a brace expression to contain at least one unquoted
comma if it is to be expanded.  Any brace-surrounded word not
containing an unquoted comma is left unchanged by the brace
expansion code.  This affords the greatest degree of sh
compatibility. 

Bash, ksh, zsh, and pd-ksh all implement brace expansion this way. 

D3) Why doesn't bash have csh variable modifiers?

Posix has specified a more powerful, albeit somewhat more cryptic,
mechanism cribbed from ksh, and bash implements it.

${parameter%word}
        Remove smallest suffix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        smallest portion of the suffix matched by the pattern deleted.

        x=file.c
        echo ${x%.c}.o
        -->file.o

${parameter%%word}

        Remove largest suffix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        largest portion of the suffix matched by the pattern deleted.

        x=posix/src/std
        echo ${x%%/*}
        -->posix

${parameter#word}
        Remove smallest prefix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        smallest portion of the prefix matched by the pattern deleted.

        x=$HOME/src/cmd
        echo ${x#$HOME}
        -->/src/cmd

${parameter##word}
        Remove largest prefix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        largest portion of the prefix matched by the pattern deleted.

        x=/one/two/three
        echo ${x##*/}
        -->three


Given
	a=/a/b/c/d
	b=b.xxx

	csh			bash		result
	---			----		------
	$a:h			${a%/*}		   /a/b/c
	$a:t			${a##*/}	   d
	$b:r			${b%.*}		   b
	$b:e			${b##*.}	   xxx


D4) How can I make my csh aliases work when I convert to bash?

Bash uses a different syntax to support aliases than csh does. 
The details can be found in the documentation.  We have provided
a shell script which does most of the work of conversion for you;
this script can be found in ./examples/misc/alias-conv.sh.  Here is
how you use it:
  
Start csh in the normal way for you.  (e.g., `csh')
  
Pipe the output of `alias' through `alias-conv.sh', saving the
results into `bash_aliases':
  
	alias | alias-conv.sh >bash_aliases
  
Edit `bash_aliases', carefully reading through any created
functions.  You will need to change the names of some csh specific
variables to the bash equivalents.  The script converts $cwd to
$PWD, $term to $TERM, $home to $HOME, $user to $USER, and $prompt
to $PS1.  You may also have to add quotes to avoid unwanted
expansion.

For example, the csh alias:
  
	alias cd 'cd \!*; echo $cwd'
  
is converted to the bash function:

	cd () { command cd "$@"; echo $PWD ; }

The only thing that needs to be done is to quote $PWD:
  
	cd () { command cd "$@"; echo "$PWD" ; }
  
Merge the edited file into your ~/.bashrc.

There is an additional, more ambitious, script in
examples/misc/cshtobash that attempts to convert your entire csh
environment to its bash equivalent.  This script can be run as
simply `cshtobash' to convert your normal interactive
environment, or as `cshtobash ~/.login' to convert your login
environment. 

D5) How can I pipe standard output and standard error from one command to
    another, like csh does with `|&'?

Use
	command 2>&1 | command2

The key is to remember that piping is performed before redirection, so
file descriptor 1 points to the pipe when it is duplicated onto file
descriptor 2.

D6) Now that I've converted from ksh to bash, are there equivalents to
    ksh features like autoloaded functions and the `whence' command?

There are features in ksh-88 and ksh-93 that do not have direct bash
equivalents.  Most, however, can be emulated with very little trouble.

ksh-88 feature		Bash equivalent
--------------		---------------
compiled-in aliases	set up aliases in .bashrc; some ksh aliases are
			bash builtins (hash, history, type)
coprocesses		named pipe pairs (one for read, one for write)
typeset +f		declare -F
cd, print, whence	function substitutes in examples/functions/kshenv
autoloaded functions	examples/functions/autoload is the same as typeset -fu
read var?prompt		read -p prompt var

ksh-93 feature		Bash equivalent
--------------		---------------
sleep, getconf		Bash has loadable versions in examples/loadables
${.sh.version}		$BASH_VERSION
print -f		printf
hist			alias fc=hist
$HISTEDIT		$FCEDIT

Section E:  How can I get bash to do certain things, and why does bash do
	    things the way it does?

E1) Why is the bash builtin `test' slightly different from /bin/test?

The specific example used here is [ ! x -o x ], which is false.

Bash's builtin `test' implements the Posix.2 spec, which can be
summarized as follows (the wording is due to David Korn):
   
Here is the set of rules for processing test arguments.
  
    0 Args: False
    1 Arg:  True iff argument is not null.
    2 Args: If first arg is !, True iff second argument is null.
	    If first argument is unary, then true if unary test is true
	    Otherwise error.
    3 Args: If second argument is a binary operator, do binary test of $1 $3
	    If first argument is !, negate two argument test of $2 $3
	    If first argument is `(' and third argument is `)', do the
	    one-argument test of the second argument.
	    Otherwise error.
    4 Args: If first argument is !, negate three argument test of $2 $3 $4.
	    Otherwise unspecified
    5 or more Args: unspecified.  (Historical shells would use their
    current algorithm).
   
The operators -a and -o are considered binary operators for the purpose
of the 3 Arg case.
   
As you can see, the test becomes (not (x or x)), which is false.

E2) Why does bash sometimes say `Broken pipe'?

If a sequence of commands appears in a pipeline, and one of the
reading commands finishes before the writer has finished, the
writer receives a SIGPIPE signal.  Many other shells special-case
SIGPIPE as an exit status in the pipeline and do not report it. 
For example, in:
  
      ps -aux | head
  
`head' can finish before `ps' writes all of its output, and ps
will try to write on a pipe without a reader.  In that case, bash
will print `Broken pipe' to stderr when ps is killed by a
SIGPIPE. 

You can build a version of bash that will not report SIGPIPE errors
by uncommenting the definition of DONT_REPORT_SIGPIPE in the file
config-top.h.

E3) When I have terminal escape sequences in my prompt, why does bash
    wrap lines at the wrong column?

Readline, the line editing library that bash uses, does not know
that the terminal escape sequences do not take up space on the
screen.  The redisplay code assumes, unless told otherwise, that
each character in the prompt is a `printable' character that
takes up one character position on the screen. 

You can use the bash prompt expansion facility (see the PROMPTING
section in the manual page) to tell readline that sequences of
characters in the prompt strings take up no screen space. 

Use the \[ escape to begin a sequence of non-printing characters,
and the \] escape to signal the end of such a sequence. 

E4) If I pipe the output of a command into `read variable', why doesn't
    the output show up in $variable when the read command finishes?

This has to do with the parent-child relationship between Unix
processes. 

Each element of a pipeline runs in a separate process, a child of
the shell running the pipeline.  A subprocess cannot affect its
parent's environment.  When the `read' command sets the variable
to the input, that variable is set only in the subshell, not the
parent shell.  When the subshell exits, the value of the variable
is lost. 

Many pipelines that end with `read variable' can be converted
into command substitutions, which will capture the output of
a specified command.  The output can then be assigned to a
variable:

	grep ^gnu /usr/lib/news/active | wc -l | read ngroup

can be converted into

	ngroup=$(grep ^gnu /usr/lib/news/active | wc -l)

This does not, unfortunately, work to split the text among
multiple variables, as read does when given multiple variable
arguments.  If you need to do this, you can either use the
command substitution above to read the output into a variable
and chop up the variable using the bash pattern removal
expansion operators or use some variant of the following
approach.

Say /usr/local/bin/ipaddr is the following shell script:

#! /bin/sh
host `hostname` | awk '/address/ {print $NF}'

Instead of using

	/usr/local/bin/ipaddr | read A B C D

to break the local machine's IP address into separate octets, use

	OIFS="$IFS"
	IFS=.
	set -- $(/usr/local/bin/ipaddr)
	IFS="$OIFS"
	A="$1" B="$2" C="$3" D="$4"

Beware, however, that this will change the shell's positional
parameters.  If you need them, you should save them before doing
this.

This is the general approach -- in most cases you will not need to
set $IFS to a different value.

E5) I have a bunch of shell scripts that use backslash-escaped characters
    in arguments to `echo'.  Bash doesn't interpret these characters.  Why
    not, and how can I make it understand them?

This is the behavior of echo on most Unix System V machines.

The bash builtin `echo' is modeled after the 9th Edition
Research Unix version of `echo'.  It does not interpret
backslash-escaped characters in its argument strings by default;
it requires the use of the -e option to enable the
interpretation.  The System V echo provides no way to disable the
special characters; the bash echo has a -E option to disable
them. 

There is a configuration option that will make bash behave like
the System V echo and interpret things like `\t' by default.  Run
configure with the --enable-usg-echo-default option to turn this
on.  Be aware that this will cause some of the tests run when you
type `make tests' to fail.

There is a shell option, `xpg_echo', settable with `shopt' that will
change the behavior of echo at runtime.  Enabling this option turns
on expansion of backslash-escape sequences.

E6) Why doesn't a while or for loop get suspended when I type ^Z?

This is a consequence of how job control works on Unix.  The only
thing that can be suspended is the process group.  This is a single
command or pipeline of commands that the shell forks and executes.

When you run a while or for loop, the only thing that the shell forks
and executes are any commands in the while loop test and commands in
the loop bodies.  These, therefore, are the only things that can be
suspended when you type ^Z.

If you want to be able to stop the entire loop, you need to put it
within parentheses, which will force the loop into a subshell that
may be stopped (and subsequently restarted) as a single unit.

E7) What about empty for loops in Makefiles?

It's fairly common to see constructs like this in automatically-generated
Makefiles:

SUBDIRS = @SUBDIRS@

	...

subdirs-clean:
	for d in $SUBDIRS; do \
		( cd $$d && ${MAKE} ${MFLAGS} clean ) \
	done

When SUBDIRS is empty, this results in a command like this being passed to
bash:

	for d in ; do
		( cd $$d && ${MAKE} ${MFLAGS} clean )
	done

This is a syntax error.  If the reserved word `in' is present, a word must
follow it before the semicolon or newline.  The language in the manual page
referring to the list of words being empty refers to the list after it is
expanded.  There must be at least one word following the `in' when the
construct is parsed.

The idiomatic Makefile solution is something like:

SUBDIRS = @SUBDIRS@

subdirs-clean:
	subdirs=$SUBDIRS ; for d in $$subdirs; do \
		( cd $$d && ${MAKE} ${MFLAGS} clean ) \
	done


The POSIX.2 interpretation committee has considered this issue and declared
that the bash implemenation is correct, according to the standard:

http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-169.html

E8) Why does the arithmetic evaluation code complain about `08'?

The bash arithmetic evaluation code (used for `let', $(()), (()), and in
other places), interprets a leading `0' in numeric constants as denoting
an octal number, and a leading `0x' as denoting hexadecimal.  This is
in accordance with the POSIX.2 spec, section 2.9.2.1, which states that
arithmetic constants should be handled as signed long integers as defined
by the ANSI/ISO C standard.

The POSIX.2 interpretation committee has confirmed this:

http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-173.html

Section F:  Things to watch out for on certain Unix versions

F1) Why can't I use command line editing in my `cmdtool'?

The problem is `cmdtool' and bash fighting over the input.  When
scrolling is enabled in a cmdtool window, cmdtool puts the tty in
`raw mode' to permit command-line editing using the mouse for
applications that cannot do it themselves.  As a result, bash and
cmdtool each try to read keyboard input immediately, with neither
getting enough of it to be useful.

This mode also causes cmdtool to not implement many of the
terminal functions and control sequences appearing in the
`sun-cmd' termcap entry.  For a more complete explanation, see
that file examples/suncmd.termcap in the bash distribution. 

`xterm' is a better choice, and gets along with bash much more
smoothly.

If you must use cmdtool, you can use the termcap description in
examples/suncmd.termcap.  Set the TERMCAP variable to the terminal
description contained in that file, i.e.

TERMCAP='Mu|sun-cmd:am:bs:km:pt:li#34:co#80:cl=^L:ce=\E[K:cd=\E[J:rs=\E[s:'

Then export TERMCAP and start a new cmdtool window from that shell.
The bash command-line editing should behave better in the new
cmdtool.  If this works, you can put the assignment to TERMCAP
in your bashrc file.

F2) I built bash on Solaris 2.  Why do globbing expansions and filename
    completion chop off the first few characters of each filename?

This is the consequence of building bash on SunOS 5 and linking
with the libraries in /usr/ucblib, but using the definitions
and structures from files in /usr/include. 

The actual conflict is between the dirent structure in
/usr/include/dirent.h and the struct returned by the version of
`readdir' in libucb.a (a 4.3-BSD style `struct direct'). 

Make sure you've got /usr/ccs/bin ahead of /usr/ucb in your $PATH
when configuring and building bash.  This will ensure that you
use /usr/ccs/bin/cc or acc instead of /usr/ucb/cc and that you
link with libc before libucb. 

If you have installed the Sun C compiler, you may also need to
put /usr/ccs/bin and /opt/SUNWspro/bin into your $PATH before
/usr/ucb.

F3) Why does bash dump core after I interrupt username completion or
    `~user' tilde expansion on a machine running NIS?

This is a famous and long-standing bug in the SunOS YP (sorry, NIS)
client library, which is part of libc.

The YP library code keeps static state -- a pointer into the data
returned from the server.  When YP initializes itself (setpwent),
it looks at this pointer and calls free on it if it's non-null. 
So far, so good. 

If one of the YP functions is interrupted during getpwent (the
exact function is interpretwithsave()), and returns NULL, the
pointer is freed without being reset to NULL, and the function
returns.  The next time getpwent is called, it sees that this
pointer is non-null, calls free, and the bash free() blows up
because it's being asked to free freed memory. 

The traditional Unix mallocs allow memory to be freed multiple
times; that's probably why this has never been fixed.  You can
run configure with the `--without-gnu-malloc' option to use
the C library malloc and avoid the problem.

F4) I'm running SVR4.2.  Why is the line erased every time I type `@'?

The `@' character is the default `line kill' character in most
versions of System V, including SVR4.2.  You can change this
character to whatever you want using `stty'.  For example, to
change the line kill character to control-u, type

	stty kill ^U

where the `^' and `U' can be two separate characters.

F5) Why does bash report syntax errors when my C News scripts use a
    redirection before a subshell command?

The actual command in question is something like

	< file ( command )

According to the grammar given in the POSIX.2 standard, this construct
is, in fact, a syntax error.  Redirections may only precede `simple
commands'.  A subshell construct such as the above is one of the shell's
`compound commands'.  A redirection may only follow a compound command.

This affects the mechanical transformation of commands that use `cat'
to pipe a file into a command (a favorite Useless-Use-Of-Cat topic on
comp.unix.shell).  While most commands of the form

	cat file | command

can be converted to `< file command', shell control structures such as
loops and subshells require `command < file'.

The file CWRU/sh-redir-hack in the bash-2.04 distribution is an
(unofficial) patch to parse.y that will modify the grammar to
support this construct.  It will not apply with `patch'; you must
modify parse.y by hand.  Note that if you apply this, you must
recompile with -DREDIRECTION_HACK.  This introduces a large
number of reduce/reduce conflicts into the shell grammar. 

F6) Why can't I use vi-mode editing on Red Hat Linux 6.1?

The short answer is that Red Hat screwed up.

The long answer is that they shipped an /etc/inputrc that only works
for emacs mode editing, and then screwed all the vi users by setting
INPUTRC to /etc/inputrc in /etc/profile.

The short fix is to do one of the following: remove or rename
/etc/inputrc, set INPUTRC=~/.inputrc in ~/.bashrc (or .bash_profile,
but make sure you export it if you do), remove the assignment to
INPUTRC from /etc/profile, add

        set keymap emacs

to the beginning of /etc/inputrc, or bracket the key bindings in
/etc/inputrc with these lines

	$if mode=emacs
		[...]
	$endif

Section G:  How can I get bash to do certain common things?

G1) How can I get bash to read and display eight-bit characters?

This is a process requiring several steps.

First, you must ensure that the `physical' data path is a full eight
bits.  For xterms, for example, the `vt100' resources `eightBitInput'
and `eightBitOutput' should be set to `true'.

Once you have set up an eight-bit path, you must tell the kernel and
tty driver to leave the eighth bit of characters alone when processing
keyboard input.  Use `stty' to do this:

	stty cs8 -istrip -parenb

For old BSD-style systems, you can use

	stty pass8

You may also need

	stty even odd

Finally, you need to tell readline that you will be inputting and
displaying eight-bit characters.  You use readline variables to do
this.  These variables can be set in your .inputrc or using the bash
`bind' builtin.  Here's an example using `bind':

	bash$ bind 'set convert-meta off'
	bash$ bind 'set meta-flag on'
	bash$ bind 'set output-meta on'

The `set' commands between the single quotes may also be placed
in ~/.inputrc.

G2) How do I write a function `x' to replace builtin command `x', but
    still invoke the command from within the function?

This is why the `command' and `builtin' builtins exist.  The
`command' builtin executes the command supplied as its first
argument, skipping over any function defined with that name.  The
`builtin' builtin executes the builtin command given as its first
argument directly. 

For example, to write a function to replace `cd' that writes the
hostname and current directory to an xterm title bar, use
something like the following:

	cd()
	{
		builtin cd "$@" && xtitle "$HOST: $PWD"
	}

This could also be written using `command' instead of `builtin';
the version above is marginally more efficient. 

G3) How can I find the value of a shell variable whose name is the value
    of another shell variable?

Versions of Bash newer than Bash-2.0 support this directly.  You can use 

	${!var}

For example, the following sequence of commands will echo `z':

	var1=var2
	var2=z
	echo ${!var1}

For sh compatibility, use the `eval' builtin.  The important
thing to remember is that `eval' expands the arguments you give
it again, so you need to quote the parts of the arguments that
you want `eval' to act on. 

For example, this expression prints the value of the last positional
parameter:

	eval echo \"\$\{$#\}\"

The expansion of the quoted portions of this expression will be
deferred until `eval' runs, while the `$#' will be expanded
before `eval' is executed.  In versions of bash later than bash-2.0,

	echo ${!#}

does the same thing.

G4) How can I make the bash `time' reserved word print timing output that
     looks like the output from my system's /usr/bin/time?

The bash command timing code looks for a variable `TIMEFORMAT' and
uses its value as a format string to decide how to display the
timing statistics.

The value of TIMEFORMAT is a string with `%' escapes expanded in a
fashion similar in spirit to printf(3).  The manual page explains
the meanings of the escape sequences in the format string.

If TIMEFORMAT is not set, bash acts as if the following assignment had
been performed:

	TIMEFORMAT=$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'

The POSIX.2 default time format (used by `time -p command') is

	TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S'

The BSD /usr/bin/time format can be emulated with:

	TIMEFORMAT=$'\t%1R real\t%1U user\t%1S sys'

The System V /usr/bin/time format can be emulated with:

	TIMEFORMAT=$'\nreal\t%1R\nuser\t%1U\nsys\t%1S'

The ksh format can be emulated with:

	TIMEFORMAT=$'\nreal\t%2lR\nuser\t%2lU\nsys\t%2lS'

G5) How do I get the current directory into my prompt?

Bash provides a number of backslash-escape sequences which are expanded
when the prompt string (PS1 or PS2) is displayed.  The full list is in
the manual page.

The \w expansion gives the full pathname of the current directory, with
a tilde (`~') substituted for the current value of $HOME.  The \W
expansion gives the basename of the current directory.  To put the full
pathname of the current directory into the path without any tilde
subsitution, use $PWD.  Here are some examples:

	PS1='\w$ '	# current directory with tilde
	PS1='\W$ '	# basename of current directory
	PS1='$PWD$ '	# full pathname of current directory

The single quotes are important in the final example to prevent $PWD from
being expanded when the assignment to PS1 is performed.

G6) How can I rename "*.foo" to "*.bar"?

Use the pattern removal functionality described in D3.  The following `for'
loop will do the trick:

	for f in *.foo; do
		mv $f ${f%foo}bar
	done

G7) How can I translate a filename from uppercase to lowercase?

The script examples/functions/lowercase, originally written by John DuBois,
will do the trick.  The converse is left as an exercise.

G8) How can I write a filename expansion (globbing) pattern that will match
    all files in the current directory except "." and ".."?

You must have set the `extglob' shell option using `shopt -s extglob' to use
this:

	echo .!(.|) *

A solution that works without extended globbing is given in the Unix Shell
FAQ, posted periodically to comp.unix.shell.

Section H:  Where do I go from here?

H1) How do I report bugs in bash, and where should I look for fixes and
    advice?

Use the `bashbug' script to report bugs.  It is built and
installed at the same time as bash.  It provides a standard
template for reporting a problem and automatically includes
information about your configuration and build environment. 

`bashbug' sends its reports to bug-bash@gnu.org, which
is a large mailing list gatewayed to the usenet newsgroup gnu.bash.bug. 

Bug fixes, answers to questions, and announcements of new releases
are all posted to gnu.bash.bug.  Discussions concerning bash features
and problems also take place there.

To reach the bash maintainers directly, send mail to
bash-maintainers@gnu.org.

H2) What kind of bash documentation is there?

First, look in the doc directory in the bash distribution.  It should
contain at least the following files:

bash.1		an extensive, thorough Unix-style manual page
builtins.1	a manual page covering just bash builtin commands
bashref.texi	a reference manual in GNU tex`info format
bashref.info	an info version of the reference manual
FAQ		this file
article.ms	text of an article written for The Linux Journal
readline.3	a man page describing readline

Postscript, HTML, and ASCII files created from the above source are
available in the documentation distribution.

There is additional documentation available for anonymous FTP from host
ftp.cwru.edu in the `pub/bash' directory.

Cameron Newham and Bill Rosenblatt have written a book on bash, published
by O'Reilly and Associates.  The book is based on Bill Rosenblatt's Korn
Shell book.  The title is ``Learning the Bash Shell'', and the ISBN number
is 1-56592-147-X.  Look for it in fine bookstores near you.  This book
covers bash-1.14, but has an appendix describing some of the new features
in bash-2.0.  

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.

H3) What's coming in future versions?

These are features I plan to include in a future version of bash.

a bash debugger (a minimally-tested version is included with bash-2.04)
associative arrays

H4) What's on the bash `wish list' for future versions?

These are features that may or may not appear in a future version of bash.

breaking some of the shell functionality into embeddable libraries
a module system like zsh's, using dynamic loading like builtins
better internationalization using GNU `gettext'
an option to use external files for the long `help' text
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
	variables (contributions gratefully accepted)

H5) When will the next release appear?

The next version will appear sometime in 2000 or 2001.  Never make
predictions. 


This document is Copyright 1995-2000 by Chester Ramey.

Permission is hereby granted, without written agreement and
without license or royalty fees, to use, copy, and distribute
this document for any purpose, provided that the above copyright
notice appears in all copies of this document and that the
contents of this document remain unaltered.


From news@ucl.ac.uk Wed Oct 11 10:26:48 2000
Received: from backdraft.briar.org ([192.207.123.123] helo=briar.org)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13jMqE-0000OL-00
	for <bug-bash@prep.ai.mit.edu>; Wed, 11 Oct 2000 10:26:48 -0400
Received: (from smap@localhost) by briar.org (8.9.1b+Sun/8.6.12) id KAA02856 for <gnu-bash-bug@moderators.isc.org>; Wed, 11 Oct 2000 10:26:44 -0400 (EDT)
X-Authentication-Warning: backdraft.briar.org: smap set sender to <news@ucl.ac.uk> using -f
Received: from mail-b.bcc.ac.uk(144.82.100.22) by backdraft via smap (V2.1)
	id xma002853; Wed, 11 Oct 00 10:26:18 -0400
Received: from uns-a.ucl.ac.uk by mail-b.bcc.ac.uk with SMTP (Mailer) with ESMTP;
          Wed, 11 Oct 2000 15:26:13 +0100
Received: (from news@localhost) by uns-a.ucl.ac.uk (AIX4.3/8.9.3/8.7)
          id PAA22636 for gnu-bash-bug@moderators.isc.org;
          Wed, 11 Oct 2000 15:26:11 +0100
To: gnu-bash-bug@moderators.isc.org
Path: pc2990.graylab.ac.uk!pinto
From: Massimo Pinto <pinto@graylab.ac.uk>
Newsgroups: gnu.bash.bug
Subject: gnu.bash.help ?
Date: Wed, 11 Oct 2000 15:27:16 +0100
Organization: University College London
Lines: 13
Message-ID: <Pine.LNX.4.21.0010111526230.1099-100000@pc2990.graylab.ac.uk>
NNTP-Posting-Host: 193.61.195.37
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: uns-a.ucl.ac.uk 971274370 18686 193.61.195.37 (11 Oct 2000 14:26:10 GMT)
X-Complaints-To: usenet@ucl.ac.uk
NNTP-Posting-Date: 11 Oct 2000 14:26:10 GMT
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

I am trying to get some support in writing a bash script. Where should I
send my message?

Thanks,

Massimo

-- 
Massimo Pinto
Ph.D. student
Gray Laboratory Cancer Research Trust
http://www.graylab.ac.uk/usr/pinto



From christoph.gille@charite.de Thu Oct 12 06:59:33 2000
Received: from barrier-17.charite.de ([193.175.73.17] helo=mailhost.charite.de)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13jg5E-0006Sw-00
	for <bug-bash@gnu.org>; Thu, 12 Oct 2000 06:59:33 -0400
Received: by mailhost.charite.de (8.8.8/1.1.22.3/14Oct99-1029AM)
	id MAA0000005119; Thu, 12 Oct 2000 12:59:30 +0200 (MET DST)
From: <christoph.gille@charite.de>
Received: from postamt1.charite.de(193.175.70.246) by mailhost.charite.de via smap (V1.3-PCG 08/1998)
	id sma005554; Thu Oct 12 12:59:11 2000
Received: from localhost by postamt1.charite.de (8.8.8/1.1.22.3/14Jul99-0931AM)
	id MAA0000008906; Thu, 12 Oct 2000 12:59:10 +0200 (MET DST)
X-Authentication-Warning: postamt1.charite.de: cgille owned process doing -bs
Date: Thu, 12 Oct 2000 12:59:08 +0200 (MET DST)
X-Sender: cgille@postamt1.charite.de
To: bug-bash@gnu.org
Subject: huge amount of memory
Message-ID: <Pine.OSF.4.10.10010121252050.16352-100000@postamt1.charite.de>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=64  -I.
-I. -I./lib -I/usr/include -O2 -pipe -fsigned-char
uname output: Linux maria 2.2.12 #18 Mon Nov 15 18:58:28 MET 1999 i686
unknown
Machine Type: i686-pc-linux-gnu

Bash Version: 2.03
Patch Level: 0
Release Status: release

Description:
	[Since last restart each instance of the bash requires 42MB only
with one user.  Had it before but could fix it with a restart of the
machine at this time. Persists when I remove /etc/profile and ~/.bashrc or
restart the machine ]

Repeat-By:
	[Breaking down the power supply.]

Fix:
	[Logging in as an other user]




From aric@fore.com Thu Oct 12 16:31:48 2000
Received: from mailgate.pit.comms.marconi.com ([169.144.68.6])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13jp12-0005bO-00
	for <bug-bash@gnu.org>; Thu, 12 Oct 2000 16:31:48 -0400
Received: from mailman.pit.comms.marconi.com (mailman.pit.comms.marconi.com [169.144.2.12])
	by mailgate.pit.comms.marconi.com (8.9.3/8.9.3) with ESMTP id QAA24137
	for <bug-bash@gnu.org>; Thu, 12 Oct 2000 16:31:44 -0400 (EDT)
Received: from sol.eng.fore.com (sol.pit.comms.marconi.com [169.144.155.73])
	by mailman.pit.comms.marconi.com (8.9.3/8.9.3) with ESMTP id QAA13146
	for <bug-bash@gnu.org>; Thu, 12 Oct 2000 16:31:47 -0400 (EDT)
Received: from radar.eng.fore.com (radar [169.144.18.248])
	by sol.eng.fore.com (8.8.8/8.8.8) with ESMTP id QAA09055
	for <bug-bash@gnu.org>; Thu, 12 Oct 2000 16:31:46 -0400 (EDT)
Received: (from aric@localhost)
	by radar.eng.fore.com (8.11.0/8.8.7) id e9CKWJk22637;
	Thu, 12 Oct 2000 16:32:19 -0400
Date: Thu, 12 Oct 2000 16:32:19 -0400
Message-Id: <200010122032.e9CKWJk22637@radar.eng.fore.com>
From: aric@pit.comms.marconi.com
To: bug-bash@gnu.org
Subject: Bash clobbers variables that is shouldn't
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DSHELL -DHAVE_CONFIG_H  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -I.  -I. -I./include -I./lib -I/usr/include -O2 -march=i386 -mcpu=i686
uname output: Linux radar.eng.fore.com 2.2.16-22 #1 Tue Aug 22 16:49:06 EDT 2000 i686 unknown
Machine Type: i386-redhat-linux-gnu

Bash Version: 2.04
Patch Level: 11
Release Status: release

Description:
The Bourne shell does not define $OSTYPE. Bash does, but when invoked as
/bin/sh, bash tries to be as mush like the Bourne Shell as possible.
Therefore, when invoked as /bin/sh, bash should not clobber OSTYPE. This
goes for other variables that bash defines, too.  Earlier versions of
bash did not clobber OSTYPE like 2.04 does.

Repeat-By:
    % echo $OSTYPE
    dont_clobber_me
    % /bin/sh -c 'echo $OSTYPE'
    linux-gnu


Fix:
    If invoked as /bin/sh, don't clobber any environment variables
except those that the Bourne Shell does.


From root@vermont.petrologic.co.uk Fri Oct 13 10:30:19 2000
Received: from [193.119.140.100] (helo=vermont.petrologic.co.uk)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13k5qj-0000zO-00
	for <bug-bash@gnu.org>; Fri, 13 Oct 2000 10:30:19 -0400
Received: (from root@localhost)
	by vermont.petrologic.co.uk (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id PAA03142
	for bug-bash@gnu.org; Fri, 13 Oct 2000 15:31:19 +0100
Date: Fri, 13 Oct 2000 15:31:19 +0100
Message-Id: <200010131431.PAA03142@vermont.petrologic.co.uk>
From: Jonathan Amery <jon@pick.ucam.org>
To: bug-bash@gnu.org
Subject: [50 character or so descriptive subject here (for reference)]
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=64  -I.  -I. -I./lib -I/usr/include -O2 -pipe -fsigned-char
uname output: Linux vermont 2.2.13 #1 Mon Nov 8 15:51:29 CET 1999 i686 unknown
Machine Type: i686-pc-linux-gnu

Bash Version: 2.03
Patch Level: 0
Release Status: release

Description:

        The info file says that in the context of prompts:

`\w'
     The current working directory.

`\W' The basename of `$PWD'.

        However:

bash # export PS1='\[\033[1;36m\]\h:\w#\[\033[0m\] '
vermont:/ext2b/what\ the\ bloody\ hell\ is\ going\ on\ here# export PS1='\[\033[1;36m\]\h:\W#\[\033[0m\] '
vermont:what\ the\ bloody\ hell\ is\ going\ on\ here# export PS1='\[\033[1;36m\]\h:$PWD#\[\033[0m\] '
vermont:/ext2b/what the bloody hell is going on here# 

 (Namely that the quoting rules are different for \w and \W than for $PWD)

Repeat-By:

 See above

Fix:

 Correct the documentation, or rationalise the quoting rules.


From gildea@intouchsys.com Fri Oct 13 19:14:17 2000
Received: from [63.64.186.130] (helo=stay.intouchsys.com)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13kE1p-00039S-00
	for <bug-bash@gnu.org>; Fri, 13 Oct 2000 19:14:17 -0400
Received: from starbuck (starbuck.intouchsys.com [10.202.2.116])
	by stay.intouchsys.com (/) with ESMTP id e9DNEGo01101
	for <bug-bash@gnu.org>; Fri, 13 Oct 2000 19:14:16 -0400 (EDT)
Message-Id: <200010132314.e9DNEGo01101@stay.intouchsys.com>
To: bug-bash@gnu.org
Subject: "unset" return value wrong
Date: Fri, 13 Oct 2000 19:14:16 EDT
From: Stephen Gildea <gildea@intouchsys.com>
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

The exit status of the "unset" shell built-in should be 0 if given any
unsettable variable, whether or not the variable needed to be unset.

In bash 2.04, unset returns 1 if the variable wasn't set to begin with.
This isn't the correct criterion according to Posix, and it broke a
shell script of mine that didn't expect that behavior.

Furthermore, "help unset" claims that PATH and IFS cannot be unset.
After reading that, I would expect "unset PATH" to not unset PATH and
to return 1.  Instead it does unset PATH and returns 0.

 < Stephen


From datsu@roland.co.jp Wed Oct 11 20:52:47 2000
Received: from ns.roland.co.jp ([133.111.200.1])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13jWby-0004DO-00
	for <bug-bash@prep.ai.mit.edu>; Wed, 11 Oct 2000 20:52:43 -0400
Received: from ryusun1.roland.co.jp ([133.111.8.200])
	by ns.roland.co.jp (8.9.3+3.2W/3.7W) with ESMTP id JAA29281
	for <bug-bash@prep.ai.mit.edu>; Thu, 12 Oct 2000 09:52:39 +0900
Received: from rdmiya1.roland.co.jp (rdmiya1 [133.111.32.100])
	by ryusun1.roland.co.jp (8.9.3/3.7W) with SMTP id JAA05685
	for <bug-bash@prep.ai.mit.edu>; Thu, 12 Oct 2000 09:52:39 +0900
Received: from cleric.roland.co.jp (cleric.roland.co.jp) by rdmiya1.roland.co.jp (4.1/3.3W8-97080611)
	id AA03397; Thu, 12 Oct 2000 09:52:39 JST
Received: from cklnx14.roland.co.jp (cklnx14.roland.co.jp) by cleric.roland.co.jp (4.1/3.3W8-97073009)
	id AA04096; Thu, 12 Oct 2000 09:52:21 JST
Received: by cklnx14.roland.co.jp (8.9.3+3.2W/3.7W)
	id JAA00860; Thu, 12 Oct 2000 09:52:19 +0900
Date: Thu, 12 Oct 2000 09:52:19 +0900
From: Hirokazu Tsuda <datsu@roland.co.jp>
Message-Id: <200010120052.JAA00860@cklnx14.roland.co.jp>
To: datsu@roland.co.jp
Subject: [50 character or so descriptive subject here (for reference)]
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: Linux
Compiler: gcc
Compilation CFLAGS:   -DHAVE_VFPRINTF -DHAVE_UNISTD_H -DHAVE_STDLIB_H -DHAVE_LIMITS_H        -DHAVE_GETGROUPS -DHAVE_RESOURCE -DHAVE_SYS_PARAM -DVOID_SIGHANDLER -DHAVE_GETDTABLESIZE -DHAVE_BCOPY -DHAVE_GETPW_DECLS -DHAVE_GETHOSTNAME -DHAVE_WAIT_H         -DHAVE_DUP2 -DHAVE_STRERROR  -DHAVE_DIRENT_H -DHAVE_STRING_H        -DHAVE_VARARGS_H -DHAVE_STRCHR  -DHAVE_DEV_FD        -Di386 -DLinux -DSHELL -DHAVE_ALLOCA -DHAVE_ALLOCA_H 	   -g -DKANJI
uname output: Linux cklnx14.roland.co.jp 2.2.14-1vl6 #1 Tue Mar 14 09:55:12 JST 2000 i586 unknown

Bash Version: 1.14
Patch Level: 7

Description:
        [Detailed description of the problem, suggestion, or complaint.]

Repeat-By:
        [Describe the sequence of events that causes the problem
        to occur.]

Fix:
        [Description of how to fix the problem.  If you don't know a
        fix for the problem, don't include this section.]


From news@bob.news.rcn.net Thu Oct 12 13:03:47 2000
Received: from chx400.switch.ch ([130.59.10.2])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13jllf-0002kB-00
	for <bug-bash@prep.ai.mit.edu>; Thu, 12 Oct 2000 13:03:43 -0400
Received: from bob.news.rcn.net ([207.172.3.45])
	by chx400.switch.ch with esmtp (Exim 3.15 #3)
	id 13jlle-0005jl-00
	for gnu-bash-bug@moderators.isc.org; Thu, 12 Oct 2000 19:03:42 +0200
Received: from news by bob.news.rcn.net with local (Exim 2.01 #2)
	for gnu-bash-bug@moderators.isc.org
	id 13jllc-0006p3-00; Thu, 12 Oct 2000 13:03:40 -0400
To: gnu-bash-bug@moderators.isc.org
Path: not-for-mail
From: Edward Arthur <eda@ultranet.com>
Newsgroups: gnu.bash.bug
Subject: Bash crashes...
Date: Thu, 12 Oct 2000 13:03:50 -0500
Lines: 13
Message-ID: <39E5FD06.F24808B5@ultranet.com>
Reply-To: eda@ultranet.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: ewsSsLiVboEsZEZIaKNwUWxTzJ6c6J7w7m+7gxT/LRk=
X-Complaints-To: abuse@rcn.com
NNTP-Posting-Date: 12 Oct 2000 17:03:40 GMT
X-Accept-Language:  en
X-Mailer:  Mozilla 4.75 [en] (WinNT; U)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Hi,

I've just built bash 2.04 on Solaris 2.7 and we've played around with
various pre-compiled distributions 2.x and we always get the same result:

% ./bash -login
bash: /home/eda/.bashrc: line 85: syntax error near unexpected token `fi'
bash: /home/eda/.bashrc: line 85: `fi'

Version 1.14.7(1) seems to work fine though...

Thanks,
/Ed


From news@bob.news.rcn.net Thu Oct 12 13:03:58 2000
Received: from chi6-1.relay.mail.uu.net ([199.171.54.98])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13jllu-0002ka-00
	for <bug-bash@prep.ai.mit.edu>; Thu, 12 Oct 2000 13:03:58 -0400
Received: from bob.news.rcn.net by chi6sosrv11.alter.net with ESMTP 
	(peer crosschecked as: bob.news.rcn.net [207.172.3.45])
	id QQjkpo06157
	for <gnu-bash-bug@moderators.isc.org>; Thu, 12 Oct 2000 17:03:57 GMT
Received: from news by bob.news.rcn.net with local (Exim 2.01 #2)
	for gnu-bash-bug@moderators.isc.org
	id 13jllt-0006qD-00; Thu, 12 Oct 2000 13:03:57 -0400
To: gnu-bash-bug@moderators.isc.org
Path: not-for-mail
From: Edward Arthur <eda@ultranet.com>
Newsgroups: gnu.bash.bug
Subject: Bash crashes...
Date: Thu, 12 Oct 2000 13:04:12 -0500
Lines: 13
Message-ID: <39E5FD1C.78D2CF4F@ultranet.com>
Reply-To: eda@ultranet.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: ewsSsLiVboFRK1hgGg+xAlsMHPCo3eDbB7nelcwLMFc=
X-Complaints-To: abuse@rcn.com
NNTP-Posting-Date: 12 Oct 2000 17:03:56 GMT
X-Accept-Language:  en
X-Mailer:  Mozilla 4.75 [en] (WinNT; U)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Hi,

I've just built bash 2.04 on Solaris 2.7 and we've played around with
various pre-compiled distributions 2.x and we always get the same result:

% ./bash -login
bash: /home/eda/.bashrc: line 85: syntax error near unexpected token `fi'
bash: /home/eda/.bashrc: line 85: `fi'

Version 1.14.7(1) seems to work fine though...

Thanks,
/Ed


From joostvb@mdcc.cx Mon Oct 16 05:07:28 2000
Received: from cgmd81229.chello.nl ([212.83.81.229] helo=mdcc.cx)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13l6Ex-00032A-00
	for <bug-bash@gnu.org>; Mon, 16 Oct 2000 05:07:28 -0400
Received: (qmail 3971 invoked by uid 1000); 16 Oct 2000 09:06:42 -0000
Date: Mon, 16 Oct 2000 11:06:42 +0200
From: Joost van Baal <joostvb@xs4all.nl>
To: bash-maintainers@prep.ai.mit.edu
Cc: bug-bash@gnu.org
Subject: bash aborted: block on free list clobbered
Message-ID: <20001016110641.N32405@gelfand.mdcc.cx>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu' -DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=64  -I.  -I/home/swt/doko/export/packages/bash/bash-2.03 -I/home/swt/doko/export/packages/bash/bash-2.03/lib -I/usr/include -g -O2
uname output: Linux lebesgue 2.2.14 #1 Sat Apr 15 09:56:21 CEST 2000 i386 unknown
Machine Type: i386-pc-linux-gnu

Bash Version: 2.03
Patch Level: 0
Release Status: release


Hi,

When I typed `cat da<TAB>' this happened:

 root@lebesgue /etc/tinydns-int/root# cat damalloc: block on free list clobbered
 last command: make
 Report this to bash-maintainers@prep.ai.mit.edu
 Stopping myself...Aborted
 vanbaal@lebesgue ~$ 

So here's my report. I'm running 

 GNU bash, version 2.03.0(1)-release (i386-pc-linux-gnu)
 Copyright 1998 Free Software Foundation, Inc.

on a 

 Linux lebesgue 2.2.14 #1 Sat Apr 15 09:56:21 CEST 2000 i386 unknown

Please let me know if you need any more information, I'll be glad to
supply it.

PS: Shouldn't the message `Report this to bash-maintainers@prep.ai.mit.edu'
read `Use bashbug(1) to report this bug'?

Bye,

Joost

-- 
Joost                                                      http://mdcc.cx/



From bero@redhat.de Mon Oct 16 09:05:14 2000
Received: from wg.redhat.de ([193.103.254.4] helo=mail.redhat.de)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13l9x3-0002NF-00
	for <bug-bash@gnu.org>; Mon, 16 Oct 2000 09:05:13 -0400
Date: Mon, 16 Oct 2000 15:04:58 +0200 (CEST)
From: Bernhard Rosenkraenzer <bero@redhat.de>
To: bug-bash@gnu.org
Subject: escaping problems with tab completion
Message-ID: <Pine.LNX.4.21.0010161504250.30568-100000@bochum.redhat.de>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DSHELL -DHAVE_CONFIG_H  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -I.  -I. -I./include -I./lib -I/usr/include -O2 -march=i386 -mcpu=i686
uname output: Linux zell.redhat.de 2.2.16-24smp #1 SMP Thu Sep 14 18:57:05 EDT 2000 i686 unknown
Machine Type: i386-redhat-linux-gnu

Bash Version: 2.04
Patch Level: 12
Release Status: release

Description:
	Tab completion occasionally fails to escape special characters

Repeat-By:
	touch 'abc{d,e}'
	rm abc[PRESS TAB]
	---> doesn't escape {}

	touch 'def{g,h};'
	rm def[PRESS TAB]
	---> works




From gnu@gnu.org Tue Oct 17 01:19:52 2000
Received: from agnostic.ebb.org ([206.112.217.56])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13lPA6-0000Ax-00
	for <bug-bash@gnu.org>; Tue, 17 Oct 2000 01:19:46 -0400
Received: from atheist (mail@atheist.ebb.localnet [10.18.73.40])
	by agnostic.ebb.org (8.9.3/8.8.7) with ESMTP id BAA03977
	for <bug-bash@gnu.org>; Tue, 17 Oct 2000 01:19:31 -0400
X-Authentication-Warning: agnostic.ebb.org: Host mail@atheist.ebb.localnet [10.18.73.40] claimed to be atheist
Received: from bkuhn by atheist with local (Exim 3.12 #1 (Debian))
	for <bug-bash@gnu.org>
	id 13lP9v-0005Ts-00; Tue, 17 Oct 2000 01:19:31 -0400
Received: from [62.2.236.162] (helo=[62.2.236.162])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13eEOm-0003d7-00
	for <gnu@gnu.org>; Wed, 27 Sep 2000 06:25:12 -0400
Received: from fs_bsi1.bsiag.com by [62.2.236.162]
          via smtpd (for fencepost.gnu.org [199.232.76.164]) with SMTP; 27 Sep 2000 10:26:57 UT
Received: from BSI011.bsiag.com [100.0.0.111] by bsiag.com with ESMTP
  (SMTPD32-6.00) id AB2933001DE; Wed, 27 Sep 2000 12:25:45 +0200
To: gnu@gnu.org
Subject: http://www.gnu.org/manual/bash-2.02/bashref.html
From: Alex Schroeder <asc@bsiag.com>
Date: 27 Sep 2000 12:23:41 +0200
Message-ID: <uwvfykuaa.fsf@bsiag.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Resent-From: bkuhn@ebb.org
Resent-Date: Tue, 17 Oct 2000 01:19:31 -0400
Resent-To: bug-bash@gnu.org
Resent-Message-Id: <E13lP9v-0005Ts-00@atheist>
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

The info document for Bash has the following filenames:

  -rw-rw-rw-   1 ASC      5            4922 Nov  7  1998 bashref.info
  -rw-rw-rw-   1 ASC      5           50476 Nov  7  1998 bashref.info-1
  -rw-rw-rw-   1 ASC      5           45180 Nov  7  1998 bashref.info-2
  -rw-rw-rw-   1 ASC      5           50633 Nov  7  1998 bashref.info-3
  -rw-rw-rw-   1 ASC      5           48574 Nov  7  1998 bashref.info-4
  -rw-rw-rw-   1 ASC      5           49362 Nov  7  1998 bashref.info-5
  -rw-rw-rw-   1 ASC      5           43962 Nov  7  1998 bashref.info-6

The file bashref.info contains the following installation hints:

INFO-DIR-SECTION Utilities
START-INFO-DIR-ENTRY
* Bash: (bash).                     The GNU Bourne-Again SHell.
END-INFO-DIR-ENTRY

However, the above entry won't work as the files are not called
bash.info* but bashref.info* instead.  Whoever is responsible for
making the above files should fix the filenames, or if the names are
the result of the Makefile distributed with Bash, then this bug report
should be forwarded to bug-bash@gnu.org.

Alex.



From chet@granite.ins.cwru.edu Mon Oct 16 10:00:13 2000
Received: from granite.ins.cwru.edu ([129.22.8.228])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13lAoB-0003Nl-00
	for <bug-bash@prep.ai.mit.edu>; Mon, 16 Oct 2000 10:00:08 -0400
Received: (chet@localhost) by granite.INS.CWRU.Edu (8.8.8+cwru/CWRU-2.5-bsdi)
	id KAA12427; Mon, 16 Oct 2000 10:00:01 -0400 (EDT) (from chet)
Message-Id: <200010161400.KAA12427@granite.INS.CWRU.Edu>
Date: Mon, 16 Oct 2000 10:00:01 -0400 (EDT)
From: chet@po.cwru.edu (Chet Ramey)
To: bug-bash@prep.ai.mit.edu
Subject: BASH Frequently-Asked Questions (FAQ version 3.9)
Reply-To: chet@po.cwru.edu
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Archive-name: unix-faq/shell/bash
Posting-Frequency: monthly
Submitted-By: chet@po.cwru.edu (Chet Ramey)
Last-Modified: Thu May 18 13:08:48 EDT 2000
FAQ-Version: 3.9
Bash-Version: 2.04
URL: ftp://ftp.cwru.edu/pub/bash/FAQ
Maintainer: chet@po.cwru.edu (Chet Ramey)

This is the Bash FAQ, version 3.9, for Bash version 2.04.

This document contains a set of frequently-asked questions concerning
Bash, the GNU Bourne-Again Shell.  Bash is a freely-available command
interpreter with advanced features for both interactive use and shell
programming.

Another good source of basic information about shells is the collection
of FAQ articles periodically posted to comp.unix.shell.

Questions and comments concerning this document should be sent to
chet@po.cwru.edu.

This document is available for anonymous FTP with the URL

ftp://ftp.cwru.edu/pub/bash/FAQ

The Bash home page is http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html

----------
Contents:

Section A:  The Basics

A1) What is it?
A2) What's the latest version?
A3) Where can I get it?
A4) On what machines will bash run?
A5) Will bash run on operating systems other than Unix?
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'?
A10) What is the bash `posix mode'?

Section B:  The latest version

B1) What's new in version 2.04?
B2) Are there any user-visible incompatibilities between bash-2.04 and
    bash-1.14.7?

Section C:  Differences from other Unix shells

C1) How does bash differ from sh, the Bourne shell?
C2) How does bash differ from the Korn shell, version ksh88?
C3) Which new features in ksh-93 are not in bash, and which are?

Section D:  Why does bash do some things differently than other Unix shells?

D1) Why does bash run a different version of `command' than
    `which command' says it will?
D2) Why doesn't bash treat brace expansions exactly like csh?
D3) Why doesn't bash have csh variable modifiers?
D4) How can I make my csh aliases work when I convert to bash?
D5) How can I pipe standard output and standard error from one command to
    another, like csh does with `|&'?
D6) Now that I've converted from ksh to bash, are there equivalents to
    ksh features like autoloaded functions and the `whence' command?

Section E:  Why does bash do certain things the way it does?

E1) Why is the bash builtin `test' slightly different from /bin/test?
E2) Why does bash sometimes say `Broken pipe'?
E3) When I have terminal escape sequences in my prompt, why does bash
    wrap lines at the wrong column?
E4) If I pipe the output of a command into `read variable', why doesn't
    the output show up in $variable when the read command finishes?
E5) I have a bunch of shell scripts that use backslash-escaped characters
    in arguments to `echo'.  Bash doesn't interpret these characters.  Why
    not, and how can I make it understand them?
E6) Why doesn't a while or for loop get suspended when I type ^Z?
E7) What about empty for loops in Makefiles?
E8) Why does the arithmetic evaluation code complain about `08'?

Section F:  Things to watch out for on certain Unix versions

F1) Why can't I use command line editing in my `cmdtool'?
F2) I built bash on Solaris 2.  Why do globbing expansions and filename
    completion chop off the first few characters of each filename?
F3) Why does bash dump core after I interrupt username completion or
    `~user' tilde expansion on a machine running NIS?
F4) I'm running SVR4.2.  Why is the line erased every time I type `@'?
F5) Why does bash report syntax errors when my C News scripts use a
    redirection before a subshell command?
F6) Why can't I use vi-mode editing on Red Hat Linux 6.1?

Section G:  How can I get bash to do certain common things?

G1) How can I get bash to read and display eight-bit characters?
G2) How do I write a function `x' to replace builtin command `x', but
    still invoke the command from within the function?
G3) How can I find the value of a shell variable whose name is the value
    of another shell variable?
G4) How can I make the bash `time' reserved word print timing output that
    looks like the output from my system's /usr/bin/time?
G5) How do I get the current directory into my prompt?
G6) How can I rename "*.foo" to "*.bar"?
G7) How can I translate a filename from uppercase to lowercase?
G8) How can I write a filename expansion (globbing) pattern that will match
    all files in the current directory except "." and ".."?

Section H:  Where do I go from here?

H1) How do I report bugs in bash, and where should I look for fixes and
    advice?
H2) What kind of bash documentation is there?
H3) What's coming in future versions?
H4) What's on the bash `wish list'?
H5) When will the next release appear?

----------
Section A:  The Basics

A1)  What is it?

Bash is a Unix command interpreter (shell).  It is an implementation of
the Posix 1003.2 shell standard, and resembles the Korn and System V
shells.

Bash contains a number of enhancements over those shells, both
for interactive use and shell programming.  Features geared
toward interactive use include command line editing, command
history, job control, aliases, and prompt expansion.  Programming
features include additional variable expansions, shell
arithmetic, and a number of variables and options to control
shell behavior.

Bash was originally written by Brian Fox of the Free Software
Foundation.  The current developer and maintainer is Chet Ramey
of Case Western Reserve University.

A2)  What's the latest version?

The latest version is 2.04, first made available on Friday, 17 March 2000.

A3)  Where can I get it?

Bash is the GNU project's shell, and so is available from the
master GNU archive site, ftp.gnu.org, and its mirrors.  The
latest version is also available for FTP from ftp.cwru.edu.
The following URLs tell how to get version 2.04:

ftp://ftp.gnu.org/pub/gnu/bash/bash-2.04.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-2.04.tar.gz

Formatted versions of the documentation are available with the URLs:

ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-2.04.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-2.04.tar.gz

A4)  On what machines will bash run?

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
itself accordingly, using a script created by GNU autoconf.

More information appears in the file `INSTALL' in the distribution.

A5) Will bash run on operating systems other than Unix?

Configuration specifics for Unix-like systems such as QNX and
LynxOS are included in the distribution.  Bash-2.04 should 
compile and run on Minix 2.0 (patches were contributed), but I
don't believe anyone has built bash-2.x on earlier Minix versions
yet.

Bash has been ported to versions of Windows implementing the Win32
programming interface.  This includes Windows 95 and Windows NT.
The port was done by Cygnus Solutions as part of their CYGWIN
project.  For more information about the project, look at the URL

http:/sourceware.cygnus.com/cygwin

Cygnus originally ported bash-1.14.7, and that port was part of their
early GNU-Win32 (the original name) releases.  Cygnus has also done a
port of bash-2.02.1 to the CYGWIN environment, and it is available as
part of their current release.  (They may have upgraded by now.)

Bash-2.04 should require no local Cygnus changes to build and run under
CYGWIN.

The Cygnus port works only on Intel machines.  There is a port of bash
(I don't know which version) to the alpha/NT environment available from

ftp://ftp.gnustep.org//pub/win32/bash-alpha-nt-1.01.tar.gz

Softway Systems has ported bash-2.01 to their Interix (nee OpenNT)
system, a Unix subsystem for NT that replaces the Microsoft POSIX
subsystem.  Check out http://www.interix.com for more information.
Some support for Interix has been incorporated into bash, beginning
with Bash-2.03.  It should be easier to build bash on Interix now,
but Interix users should fetch

ftp://ftp.interix.com/pub/tw/unsup/bash.diffs.tar.gz

and read the README.OpenNT file in that archive.  It will detail the
arguments `configure' needs to build on Interix.  A configure cache
file for Interix is in the bash distribution in cross-build/opennt.cache;
copy that to `config.cache' before starting configure.

DJ Delorie has a port of bash-1.14.7 which runs under MS-DOS, as part
of the DJGPP project.  For more information on the project, see

http://www.delorie.com/djgpp/

I have been told that the original DJGPP port was done by Daisuke Aoyama.

I picked up a binary of bash-1.14.7 that is purported to work with
the DJGPP V2 environment from

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147b.zip

The corresponding source is

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147s.zip

Mark Elbrecht <snowball3@bigfoot.com> has sent me notice that bash-2.03
has become available for DJGPP V2.  The files are available as:

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203b.zip	binary
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203d.zip	documentation
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203s.zip	source

Mark has begun to work with bash-2.04.

Ports of bash-1.12 and bash-2.0 are available for OS/2 from

ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash_112.zip
ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash-2.0(253).zip

I haven't looked at either, but the second appears to be a binary-only
distribution.  Beware.

I have received word that Bash (I'm not sure which version, but I
believe that it's at least bash-2.02.1) is the standard shell on
BeOS.

A6) How can I build bash with gcc? 

Bash configures to use gcc by default if it is available.  Read the
file INSTALL in the distribution for more information.

A7)  How can I make bash my login shell?

Some machines let you use `chsh' to change your login shell.  Other
systems use `passwd -s' or `passwd -e'.  If one of these works for
you, that's all you need.  Note that many systems require the full
pathname to a shell to appear in /etc/shells before you can make it
your login shell.  For this, you may need the assistance of your
friendly local system administrator. 

If you cannot do this, you can still use bash as your login shell, but
you need to perform some tricks.  The basic idea is to add a command
to your login shell's startup file to replace your login shell with
bash.

For example, if your login shell is csh or tcsh, and you have installed
bash in /usr/gnu/bin/bash, add the following line to ~/.login:

	if ( -f /usr/gnu/bin/bash ) exec /usr/gnu/bin/bash --login

(the `--login' tells bash that it is a login shell).

It's not a good idea to put this command into ~/.cshrc, because every
csh you run without the `-f' option, even ones started to run csh scripts,
reads that file.  If you must put the command in ~/.cshrc, use something
like

	if ( $?prompt ) exec /usr/gnu/bin/bash --login

to ensure that bash is exec'd only when the csh is interactive.

If your login shell is sh or ksh, you have to do two things.

First, create an empty file in your home directory named `.bash_profile'.
The existence of this file will prevent the exec'd bash from trying to
read ~/.profile, and re-execing itself over and over again.  ~/.bash_profile
is the first file bash tries to read initialization commands from when
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

This will cause login shells to replace themselves with bash running as
a login shell.  Once you have this working, you can copy your initialization
code from ~/.profile to ~/.bash_profile.

I have received word that the recipe supplied above is insufficient for
machines running CDE.  CDE has a maze of twisty little startup files, all
slightly different.

If you cannot change your login shell in the password file to bash, you
will have to (apparently) live with CDE using the shell in the password
file to run its startup scripts.  If you have changed your shell to bash,
there is code in the CDE startup files (on Solaris, at least) to do the
right thing. 

`dtterm' claims to use $SHELL as the default program to start, so if you
can change $SHELL in the CDE startup files, you should be able to use bash
in your terminal windows.

Setting DTSOURCEPROFILE in ~/.dtprofile will cause the `Xsession' program
to read your login shell's startup files.  You may be able to use bash for
the rest of the CDE programs by setting SHELL to bash in ~/.dtprofile as
well, but I have not tried this.

You can use the above `exec' recipe to start bash when not logging in with
CDE by testing the value of the DT variable:

	if [ -n "$DT" ]; then
	        [ -f /usr/gnu/bin/bash ] && exec /usr/gnu/bin/bash --login
	fi


A8) I just changed my login shell to bash, and now I can't FTP into my
   machine.  Why not?

You must add the full pathname to bash to the file /etc/shells.  As
noted in the answer to the previous question, many systems require
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'?

POSIX is a name originally coined by Richard Stallman for a
family of open system standards based on UNIX.  There are a
number of aspects of UNIX under consideration for
standardization, from the basic system services at the system
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. 

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 `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
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
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.

A10)  What is the bash `posix mode'?

Although bash is an implementation of the POSIX.2 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. 

Posix mode is entered by starting bash with the --posix option or
executing `set -o posix' after bash is running.

The specific aspects of bash which change when posix mode is
active are listed in the file CWRU/POSIX.NOTES in the bash
distribution.  They are also listed in a section in the Bash
Reference Manual.

Section B:  The latest version

B1) What's new in version 2.04?

Bash-2.04 contains the following new features (see the manual page for
complete descriptions and the CHANGES and NEWS files in the bash-2.04
distribution):

o Programmable word completion with the new `complete' and `compgen' builtins;
  examples are provided in examples/complete/complete-examples
o `history' has a new `-d' option to delete a history entry
o `bind' has a new `-x' option to bind key sequences to shell commands
o The prompt expansion code has new `\j' and `\l' escape sequences
o The `no_empty_cmd_completion' shell option, if enabled, inhibits
  command completion when TAB is typed on an empty line
o `help' has a new `-s' option to print a usage synopsis
o New arithmetic operators: var++, var--, ++var, --var, expr1,expr2 (comma)
o New ksh93-style arithmetic for command:
	for ((expr1 ; expr2; expr3 )); do list; done
o `read' has new options: `-t', `-n', `-d', `-s'
o The redirection code handles several filenames specially:  /dev/fd/N,
  /dev/stdin, /dev/stdout, /dev/stderr
o The redirection code now recognizes /dev/tcp/HOST/PORT and
  /dev/udp/HOST/PORT and tries to open a TCP or UDP socket, respectively,
  to the specified port on the specified host
o The ${!prefix*} expansion has been implemented
o A new FUNCNAME variable, which expands to the name of a currently-executing
  function
o The GROUPS variable is no longer readonly
o A new shopt `xpg_echo' variable, to control the behavior of echo with
  respect to backslash-escape sequences at runtime
o The NON_INTERACTIVE_LOGIN_SHELLS #define has returned

The version of Readline released with Bash-2.04, Readline-4.1, has several
new features as well:

o Parentheses matching is always compiled into readline, and controllable
  with the new `blink-matching-paren' variable
o The history-search-forward and history-search-backward functions now leave
  point at the end of the line when the search string is empty, like
  reverse-search-history, and forward-search-history
o A new function for applications:  rl_on_new_line_with_prompt()
o New variables for applications:  rl_already_prompted, and rl_gnu_readline_p


A short feature history dating from bash-2.0:

Bash-2.03 had very few new features, in keeping with the convention
that odd-numbered releases provide mainly bug fixes.  A number of new
features were added to Readline, mostly at the request of the Cygnus
folks.

A new shopt option, `restricted_shell', so that startup files can test
	whether or not the shell was started in restricted mode
Filename generation is now performed on the words between ( and ) in
	compound array assignments (this is really a bug fix)
OLDPWD is now auto-exported, as POSIX.2 requires
ENV and BASH_ENV are read-only variables in a restricted shell
Bash may now be linked against an already-installed Readline library,
	as long as the Readline library is version 4 or newer
All shells begun with the `--login' option will source the login shell
	startup files, even if the shell is not interactive

There were lots of changes to the version of the Readline library released
along with Bash-2.03.  For a complete list of the changes, read the file
CHANGES in the Bash-2.03 distribution.

Bash-2.02 contained the following new features:

a new version of malloc (based on the old GNU malloc code in previous
	bash versions) that is more page-oriented, more conservative
	with memory usage, does not `orphan' large blocks when they
	are freed, is usable on 64-bit machines, and has allocation
	checking turned on unconditionally
POSIX.2-style globbing character classes ([:alpha:], [:alnum:], etc.)
POSIX.2-style globbing equivalence classes
POSIX.2-style globbing collating symbols
the ksh [[...]] extended conditional command
the ksh egrep-style extended pattern matching operators
a new `printf' builtin
the ksh-like $(<filename) command substitution, which is equivalent to
	$(cat filename)
new tilde prefixes that expand to directories from the directory stack
new `**' arithmetic operator to do exponentiation
case-insensitive globbing (filename expansion)
menu completion a la tcsh
`magic-space' history expansion function like tcsh
the readline inputrc `language' has a new file inclusion directive ($include)

Bash-2.01 contained only a few new features:

new `GROUPS' builtin array variable containing the user's group list
new bindable readline commands: history-and-alias-expand-line and
	alias-expand-line

Bash-2.0 contained extensive changes and new features from bash-1.14.7.
Here's a short list:

new `time' reserved word to time pipelines, shell builtins, and
	shell functions
one-dimensional arrays with a new compound assignment statement,
        appropriate expansion constructs and modifications to some
	of the builtins (read, declare, etc.) to use them
new quoting syntaxes for ANSI-C string expansion and locale-specific
	string translation
new expansions to do substring extraction, pattern replacement, and
	indirect variable expansion
new builtins: `disown' and `shopt'
new variables: HISTIGNORE, SHELLOPTS, PIPESTATUS, DIRSTACK, GLOBIGNORE,
	       MACHTYPE, BASH_VERSINFO
special handling of many unused or redundant variables removed
	(e.g., $notify, $glob_dot_filenames, $no_exit_on_failed_exec)
dynamic loading of new builtin commands; many loadable examples provided
new prompt expansions: \a, \e, \n, \H, \T, \@, \v, \V
history and aliases available in shell scripts
new readline variables: enable-keypad, mark-directories, input-meta,
	visible-stats, disable-completion, comment-begin
new readline commands to manipulate the mark and operate on the region
new readline emacs mode commands and bindings for ksh-88 compatibility
updated and extended builtins
new DEBUG trap
expanded (and now documented) restricted shell mode

implementation stuff:	
autoconf-based configuration
nearly all of the bugs reported since version 1.14 have been fixed
most builtins converted to use builtin `getopt' for consistency
most builtins use -p option to display output in a reusable form
	(for consistency)
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.04 and
    bash-1.14.7?

There are a few incompatibilities between version 1.14.7 and version 2.04.
They are detailed in the file COMPAT in the bash-2.04 distribution.

Section C:  Differences from other Unix shells

C1) How does bash differ from sh, the Bourne shell?

This is a non-comprehensive list of features that differentiate bash
from the SVR4.2 shell.  The bash manual page explains these more
completely.

Things bash has that sh does not:
	long invocation options
	`!' reserved word to invert pipeline return value
	`time' reserved word to time pipelines and shell builtins
	the `function' reserved word
	the `select' compound command and reserved word
	arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
	new $'...' and $"..." quoting
	the $(...) form of command substitution
	the $(<filename) form of command substitution, equivalent to
		$(cat filename)
	the ${#param} parameter value length operator
	the ${!param} indirect parameter expansion operator
	the ${!param*} prefix expansion operator
	the ${param:length[:offset]} parameter substring operator
	the ${param/pat[/string]} parameter pattern substitution operator
	expansions to perform substring removal (${p%[%]w}, ${p#[#]w})
	expansion of positional parameters beyond $9 with ${num}
	variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, REPLY,
		   TIMEFORMAT, PPID, PWD, OLDPWD, SHLVL, RANDOM, SECONDS,
		   LINENO, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE, HOSTNAME,
		   ENV, PS3, PS4, DIRSTACK, PIPESTATUS, HISTSIZE, HISTFILE,
		   HISTFILESIZE, HISTCONTROL, HISTIGNORE, GLOBIGNORE, GROUPS,
		   PROMPT_COMMAND, FCEDIT, FIGNORE, IGNOREEOF, INPUTRC,
		   SHELLOPTS, OPTERR, HOSTFILE, TMOUT, FUNCNAME, histchars,
		   auto_resume
	DEBUG trap
	variable arrays with new compound assignment syntax
	redirections: <>, &>, >|
	prompt string special char translation and variable expansion
	auto-export of variables in initial environment
	command search finds functions before builtins
	bash return builtin will exit a file sourced with `.'
	builtins: cd -/-L/-P, exec -l/-c/-a, echo -e/-E, hash -p.
		  export -n/-f/-p/name=value, pwd -L/-P,
		  read -e/-p/-a/-t/-n/-d/-s,
		  readonly -a/-f/name=value, trap -l, set +o,
		  set -b/-m/-o option/-h/-p/-B/-C/-H/-P,
		  unset -f/-v, ulimit -m/-p/-u,
		  type -a/-p/-t, suspend -f, kill -n,
		  test -o optname/s1 == s2/s1 < s2/s1 > s2/-nt/-ot/-ef/-O/-G/-S
	bash reads ~/.bashrc for interactive shells, $ENV for non-interactive
	bash restricted shell mode is more extensive
	bash allows functions and variables with the same name
	brace expansion
	tilde expansion
	arithmetic expansion with $((...)) and `let' builtin
	the `[[...]]' extended conditional command
	process substitution
	aliases and alias/unalias builtins
	local variables in functions and `local' builtin
	readline and command-line editing with programmable completion
	command history and history/fc builtins
	csh-like history expansion
	other new bash builtins: bind, command, compgen, complete, builtin,
				 declare/typeset, dirs, enable, fc, help,
				 history, logout, popd, pushd, disown, shopt,
				 printf
	exported functions
	filename generation when using output redirection (command >a*)
	POSIX.2-style globbing character classes
	POSIX.2-style globbing equivalence classes
	POSIX.2-style globbing collating symbols
	egrep-like extended pattern matching operators
	case-insensitive pattern matching and globbing
	variable assignments preceding commands affect only that command,
		even for builtins and functions
	posix mode
	redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr,
		/dev/tcp/host/port, /dev/udp/host/port

Things sh has that bash does not:
	uses variable SHACCT to do shell accounting
	includes `stop' builtin (bash can use alias stop='kill -s STOP')
	`newgrp' builtin
	turns on job control if called as `jsh'
	$TIMEOUT (like bash $TMOUT)
	`^' is a synonym for `|'
	new SVR4.2 sh builtins: mldmode, priv

Implementation differences:
	redirection to/from compound commands causes sh to create a subshell
	bash does not allow unbalanced quotes; sh silently inserts them at EOF
	bash does not mess with signal 11
	sh sets (euid, egid) to (uid, gid) if -p not supplied and uid < 100
	bash splits only the results of expansions on IFS, using POSIX.2
		field splitting rules; sh splits all words on IFS
	sh does not allow MAILCHECK to be unset (?)
	sh does not allow traps on SIGALRM or SIGCHLD
	bash allows multiple option arguments when invoked (e.g. -x -v);
		sh allows only a single option argument (`sh -x -v' attempts
		to open a file named `-v', and, on SunOS 4.1.4, dumps core.
		On Solaris 2.4 and earlier versions, sh goes into an infinite
		loop.)
	sh exits a script if any builtin fails; bash exits only if one of
		the POSIX.2 `special' builtins fails

C2)  How does bash differ from the Korn shell, version ksh88?

Things bash has or uses that ksh88 does not:
	long invocation options
	`!' reserved word
	arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
	posix mode and posix conformance
	command hashing
	tilde expansion for assignment statements that look like $PATH
	process substitution with named pipes if /dev/fd is not available
	the ${!param} indirect parameter expansion operator
	the ${!param*} prefix expansion operator
	the ${param:length[:offset]} parameter substring operator
	the ${param/pat[/string]} parameter pattern substitution operator
	variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, SHLVL,
		   TIMEFORMAT, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE,
		   HISTFILESIZE, HISTIGNORE, HISTCONTROL, PROMPT_COMMAND,
		   IGNOREEOF, FIGNORE, INPUTRC, HOSTFILE, DIRSTACK,
		   PIPESTATUS, HOSTNAME, OPTERR, SHELLOPTS, GLOBIGNORE,
		   GROUPS, FUNCNAME, histchars, auto_resume
	prompt expansion with backslash escapes and command substitution
	redirection: &> (stdout and stderr)
	more extensive and extensible editing and programmable completion
	builtins: bind, builtin, command, declare, dirs, echo -e/-E, enable,
		  exec -l/-c/-a, fc -s, export -n/-f/-p, hash, help, history,
		  jobs -x/-r/-s, kill -s/-n/-l, local, logout, popd, pushd,
		  read -e/-p/-a/-t/-n/-d/-s, readonly -a/-n/-f/-p,
		  set -o braceexpand/-o histexpand/-o interactive-comments/
		  -o notify/-o physical/-o posix/-o hashall/-o onecmd/
		  -h/-B/-C/-b/-H/-P, set +o, suspend, trap -l, type,
		  typeset -a/-F/-p, ulimit -u, umask -S, alias -p, shopt,
		  disown, printf, complete, compgen
	`!' csh-style history expansion
	POSIX.2-style globbing character classes
	POSIX.2-style globbing equivalence classes
	POSIX.2-style globbing collating symbols
	egrep-like extended pattern matching operators
	case-insensitive pattern matching and globbing
	`**' arithmetic operator to do exponentiation
	redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr

Things ksh88 has or uses that bash does not:
	tracked aliases
	variables: ERRNO, FPATH, EDITOR, VISUAL
	co-processes (|&, >&p, <&p)
	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,
		  read -p/-s/-u/var?prompt, set -A/-o gmacs/
		  -o bgnice/-o markdirs/-o nolog/-o trackall/-o viraw/-s,
		  typeset -H/-L/-R/-A/-ft/-fu/-fx/-l/-u/-t, whence

Implementation differences:
	ksh runs last command of a pipeline in parent shell context
	bash has brace expansion by default (ksh88 compile-time option)
	bash has fixed startup file for all interactive shells; ksh reads $ENV
	bash has exported functions
	bash command search finds functions before builtins

C3)  Which new features in ksh-93 are not in bash, and which are?

New things in ksh-93 not in bash-2.04:
	associative arrays
	floating point arithmetic
	math library functions
	${!name[sub]} name of subscript for associative array
	`.' is allowed in variable names to create a hierarchical namespace
	more extensive compound assignment syntax
	discipline functions
	`sleep' and `getconf' builtins (bash has loadable versions)
	typeset -n and `nameref' variables
	KEYBD trap
	variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, .sh.version,
		   .sh.name, .sh.subscript, .sh.value, HISTEDIT
	backreferences in pattern matching
	print -f (bash uses printf)
	`fc' has been renamed to `hist'
	`.' can execute shell functions

New things in ksh-93 present in bash-2.04:
        for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command
        ?:, ++, --, `expr1 , expr2' arithmetic operators
	expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]},
		    ${!param*}
	compound array assignment
	the `!' reserved word
	loadable builtins -- but ksh uses `builtin' while bash uses `enable'
	`command', `builtin', `disown' builtins
	new $'...' and $"..." quoting
	FIGNORE (but bash uses GLOBIGNORE), HISTCMD
	set -o notify/-C
	changes to kill builtin
	read -A (bash uses read -a)
        read -t/-d
	trap -p
	exec -c/-a
	`.' restores the positional parameters when it completes
	POSIX.2 `test'
	umask -S
	unalias -a
	command and arithmetic substitution performed on PS1, PS4, and ENV
	command name completion
	ENV processed only for interactive shells

Section D:  Why does bash do some things differently than other Unix shells?

D1) Why does bash run a different version of `command' than
    `which command' says it will?

On many systems, `which' is actually a csh script that assumes
you're running csh.  In tcsh, `which' and its cousin `where'
are builtins.  On other Unix systems, `which' is a perl script
that uses the PATH environment variable.

The csh script version reads the csh startup files from your
home directory and uses those to determine which `command' will
be invoked.  Since bash doesn't use any of those startup files,
there's a good chance that your bash environment differs from
your csh environment.  The bash `type' builtin does everything
`which' does, and will report correct results for the running
shell.  If you're really wedded to the name `which', try adding
the following function definition to your .bashrc:

	which()
	{
		builtin type "$@"
	}

If you're moving from tcsh and would like to bring `where' along
as well, use this function:

	where()
	{
		builtin type -a "$@"
	}

D2) Why doesn't bash treat brace expansions exactly like csh?

The only difference between bash and csh brace expansion is that
bash requires a brace expression to contain at least one unquoted
comma if it is to be expanded.  Any brace-surrounded word not
containing an unquoted comma is left unchanged by the brace
expansion code.  This affords the greatest degree of sh
compatibility. 

Bash, ksh, zsh, and pd-ksh all implement brace expansion this way. 

D3) Why doesn't bash have csh variable modifiers?

Posix has specified a more powerful, albeit somewhat more cryptic,
mechanism cribbed from ksh, and bash implements it.

${parameter%word}
        Remove smallest suffix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        smallest portion of the suffix matched by the pattern deleted.

        x=file.c
        echo ${x%.c}.o
        -->file.o

${parameter%%word}

        Remove largest suffix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        largest portion of the suffix matched by the pattern deleted.

        x=posix/src/std
        echo ${x%%/*}
        -->posix

${parameter#word}
        Remove smallest prefix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        smallest portion of the prefix matched by the pattern deleted.

        x=$HOME/src/cmd
        echo ${x#$HOME}
        -->/src/cmd

${parameter##word}
        Remove largest prefix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        largest portion of the prefix matched by the pattern deleted.

        x=/one/two/three
        echo ${x##*/}
        -->three


Given
	a=/a/b/c/d
	b=b.xxx

	csh			bash		result
	---			----		------
	$a:h			${a%/*}		   /a/b/c
	$a:t			${a##*/}	   d
	$b:r			${b%.*}		   b
	$b:e			${b##*.}	   xxx


D4) How can I make my csh aliases work when I convert to bash?

Bash uses a different syntax to support aliases than csh does. 
The details can be found in the documentation.  We have provided
a shell script which does most of the work of conversion for you;
this script can be found in ./examples/misc/alias-conv.sh.  Here is
how you use it:
  
Start csh in the normal way for you.  (e.g., `csh')
  
Pipe the output of `alias' through `alias-conv.sh', saving the
results into `bash_aliases':
  
	alias | alias-conv.sh >bash_aliases
  
Edit `bash_aliases', carefully reading through any created
functions.  You will need to change the names of some csh specific
variables to the bash equivalents.  The script converts $cwd to
$PWD, $term to $TERM, $home to $HOME, $user to $USER, and $prompt
to $PS1.  You may also have to add quotes to avoid unwanted
expansion.

For example, the csh alias:
  
	alias cd 'cd \!*; echo $cwd'
  
is converted to the bash function:

	cd () { command cd "$@"; echo $PWD ; }

The only thing that needs to be done is to quote $PWD:
  
	cd () { command cd "$@"; echo "$PWD" ; }
  
Merge the edited file into your ~/.bashrc.

There is an additional, more ambitious, script in
examples/misc/cshtobash that attempts to convert your entire csh
environment to its bash equivalent.  This script can be run as
simply `cshtobash' to convert your normal interactive
environment, or as `cshtobash ~/.login' to convert your login
environment. 

D5) How can I pipe standard output and standard error from one command to
    another, like csh does with `|&'?

Use
	command 2>&1 | command2

The key is to remember that piping is performed before redirection, so
file descriptor 1 points to the pipe when it is duplicated onto file
descriptor 2.

D6) Now that I've converted from ksh to bash, are there equivalents to
    ksh features like autoloaded functions and the `whence' command?

There are features in ksh-88 and ksh-93 that do not have direct bash
equivalents.  Most, however, can be emulated with very little trouble.

ksh-88 feature		Bash equivalent
--------------		---------------
compiled-in aliases	set up aliases in .bashrc; some ksh aliases are
			bash builtins (hash, history, type)
coprocesses		named pipe pairs (one for read, one for write)
typeset +f		declare -F
cd, print, whence	function substitutes in examples/functions/kshenv
autoloaded functions	examples/functions/autoload is the same as typeset -fu
read var?prompt		read -p prompt var

ksh-93 feature		Bash equivalent
--------------		---------------
sleep, getconf		Bash has loadable versions in examples/loadables
${.sh.version}		$BASH_VERSION
print -f		printf
hist			alias fc=hist
$HISTEDIT		$FCEDIT

Section E:  How can I get bash to do certain things, and why does bash do
	    things the way it does?

E1) Why is the bash builtin `test' slightly different from /bin/test?

The specific example used here is [ ! x -o x ], which is false.

Bash's builtin `test' implements the Posix.2 spec, which can be
summarized as follows (the wording is due to David Korn):
   
Here is the set of rules for processing test arguments.
  
    0 Args: False
    1 Arg:  True iff argument is not null.
    2 Args: If first arg is !, True iff second argument is null.
	    If first argument is unary, then true if unary test is true
	    Otherwise error.
    3 Args: If second argument is a binary operator, do binary test of $1 $3
	    If first argument is !, negate two argument test of $2 $3
	    If first argument is `(' and third argument is `)', do the
	    one-argument test of the second argument.
	    Otherwise error.
    4 Args: If first argument is !, negate three argument test of $2 $3 $4.
	    Otherwise unspecified
    5 or more Args: unspecified.  (Historical shells would use their
    current algorithm).
   
The operators -a and -o are considered binary operators for the purpose
of the 3 Arg case.
   
As you can see, the test becomes (not (x or x)), which is false.

E2) Why does bash sometimes say `Broken pipe'?

If a sequence of commands appears in a pipeline, and one of the
reading commands finishes before the writer has finished, the
writer receives a SIGPIPE signal.  Many other shells special-case
SIGPIPE as an exit status in the pipeline and do not report it. 
For example, in:
  
      ps -aux | head
  
`head' can finish before `ps' writes all of its output, and ps
will try to write on a pipe without a reader.  In that case, bash
will print `Broken pipe' to stderr when ps is killed by a
SIGPIPE. 

You can build a version of bash that will not report SIGPIPE errors
by uncommenting the definition of DONT_REPORT_SIGPIPE in the file
config-top.h.

E3) When I have terminal escape sequences in my prompt, why does bash
    wrap lines at the wrong column?

Readline, the line editing library that bash uses, does not know
that the terminal escape sequences do not take up space on the
screen.  The redisplay code assumes, unless told otherwise, that
each character in the prompt is a `printable' character that
takes up one character position on the screen. 

You can use the bash prompt expansion facility (see the PROMPTING
section in the manual page) to tell readline that sequences of
characters in the prompt strings take up no screen space. 

Use the \[ escape to begin a sequence of non-printing characters,
and the \] escape to signal the end of such a sequence. 

E4) If I pipe the output of a command into `read variable', why doesn't
    the output show up in $variable when the read command finishes?

This has to do with the parent-child relationship between Unix
processes. 

Each element of a pipeline runs in a separate process, a child of
the shell running the pipeline.  A subprocess cannot affect its
parent's environment.  When the `read' command sets the variable
to the input, that variable is set only in the subshell, not the
parent shell.  When the subshell exits, the value of the variable
is lost. 

Many pipelines that end with `read variable' can be converted
into command substitutions, which will capture the output of
a specified command.  The output can then be assigned to a
variable:

	grep ^gnu /usr/lib/news/active | wc -l | read ngroup

can be converted into

	ngroup=$(grep ^gnu /usr/lib/news/active | wc -l)

This does not, unfortunately, work to split the text among
multiple variables, as read does when given multiple variable
arguments.  If you need to do this, you can either use the
command substitution above to read the output into a variable
and chop up the variable using the bash pattern removal
expansion operators or use some variant of the following
approach.

Say /usr/local/bin/ipaddr is the following shell script:

#! /bin/sh
host `hostname` | awk '/address/ {print $NF}'

Instead of using

	/usr/local/bin/ipaddr | read A B C D

to break the local machine's IP address into separate octets, use

	OIFS="$IFS"
	IFS=.
	set -- $(/usr/local/bin/ipaddr)
	IFS="$OIFS"
	A="$1" B="$2" C="$3" D="$4"

Beware, however, that this will change the shell's positional
parameters.  If you need them, you should save them before doing
this.

This is the general approach -- in most cases you will not need to
set $IFS to a different value.

E5) I have a bunch of shell scripts that use backslash-escaped characters
    in arguments to `echo'.  Bash doesn't interpret these characters.  Why
    not, and how can I make it understand them?

This is the behavior of echo on most Unix System V machines.

The bash builtin `echo' is modeled after the 9th Edition
Research Unix version of `echo'.  It does not interpret
backslash-escaped characters in its argument strings by default;
it requires the use of the -e option to enable the
interpretation.  The System V echo provides no way to disable the
special characters; the bash echo has a -E option to disable
them. 

There is a configuration option that will make bash behave like
the System V echo and interpret things like `\t' by default.  Run
configure with the --enable-usg-echo-default option to turn this
on.  Be aware that this will cause some of the tests run when you
type `make tests' to fail.

There is a shell option, `xpg_echo', settable with `shopt' that will
change the behavior of echo at runtime.  Enabling this option turns
on expansion of backslash-escape sequences.

E6) Why doesn't a while or for loop get suspended when I type ^Z?

This is a consequence of how job control works on Unix.  The only
thing that can be suspended is the process group.  This is a single
command or pipeline of commands that the shell forks and executes.

When you run a while or for loop, the only thing that the shell forks
and executes are any commands in the while loop test and commands in
the loop bodies.  These, therefore, are the only things that can be
suspended when you type ^Z.

If you want to be able to stop the entire loop, you need to put it
within parentheses, which will force the loop into a subshell that
may be stopped (and subsequently restarted) as a single unit.

E7) What about empty for loops in Makefiles?

It's fairly common to see constructs like this in automatically-generated
Makefiles:

SUBDIRS = @SUBDIRS@

	...

subdirs-clean:
	for d in $SUBDIRS; do \
		( cd $$d && ${MAKE} ${MFLAGS} clean ) \
	done

When SUBDIRS is empty, this results in a command like this being passed to
bash:

	for d in ; do
		( cd $$d && ${MAKE} ${MFLAGS} clean )
	done

This is a syntax error.  If the reserved word `in' is present, a word must
follow it before the semicolon or newline.  The language in the manual page
referring to the list of words being empty refers to the list after it is
expanded.  There must be at least one word following the `in' when the
construct is parsed.

The idiomatic Makefile solution is something like:

SUBDIRS = @SUBDIRS@

subdirs-clean:
	subdirs=$SUBDIRS ; for d in $$subdirs; do \
		( cd $$d && ${MAKE} ${MFLAGS} clean ) \
	done


The POSIX.2 interpretation committee has considered this issue and declared
that the bash implemenation is correct, according to the standard:

http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-169.html

E8) Why does the arithmetic evaluation code complain about `08'?

The bash arithmetic evaluation code (used for `let', $(()), (()), and in
other places), interprets a leading `0' in numeric constants as denoting
an octal number, and a leading `0x' as denoting hexadecimal.  This is
in accordance with the POSIX.2 spec, section 2.9.2.1, which states that
arithmetic constants should be handled as signed long integers as defined
by the ANSI/ISO C standard.

The POSIX.2 interpretation committee has confirmed this:

http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-173.html

Section F:  Things to watch out for on certain Unix versions

F1) Why can't I use command line editing in my `cmdtool'?

The problem is `cmdtool' and bash fighting over the input.  When
scrolling is enabled in a cmdtool window, cmdtool puts the tty in
`raw mode' to permit command-line editing using the mouse for
applications that cannot do it themselves.  As a result, bash and
cmdtool each try to read keyboard input immediately, with neither
getting enough of it to be useful.

This mode also causes cmdtool to not implement many of the
terminal functions and control sequences appearing in the
`sun-cmd' termcap entry.  For a more complete explanation, see
that file examples/suncmd.termcap in the bash distribution. 

`xterm' is a better choice, and gets along with bash much more
smoothly.

If you must use cmdtool, you can use the termcap description in
examples/suncmd.termcap.  Set the TERMCAP variable to the terminal
description contained in that file, i.e.

TERMCAP='Mu|sun-cmd:am:bs:km:pt:li#34:co#80:cl=^L:ce=\E[K:cd=\E[J:rs=\E[s:'

Then export TERMCAP and start a new cmdtool window from that shell.
The bash command-line editing should behave better in the new
cmdtool.  If this works, you can put the assignment to TERMCAP
in your bashrc file.

F2) I built bash on Solaris 2.  Why do globbing expansions and filename
    completion chop off the first few characters of each filename?

This is the consequence of building bash on SunOS 5 and linking
with the libraries in /usr/ucblib, but using the definitions
and structures from files in /usr/include. 

The actual conflict is between the dirent structure in
/usr/include/dirent.h and the struct returned by the version of
`readdir' in libucb.a (a 4.3-BSD style `struct direct'). 

Make sure you've got /usr/ccs/bin ahead of /usr/ucb in your $PATH
when configuring and building bash.  This will ensure that you
use /usr/ccs/bin/cc or acc instead of /usr/ucb/cc and that you
link with libc before libucb. 

If you have installed the Sun C compiler, you may also need to
put /usr/ccs/bin and /opt/SUNWspro/bin into your $PATH before
/usr/ucb.

F3) Why does bash dump core after I interrupt username completion or
    `~user' tilde expansion on a machine running NIS?

This is a famous and long-standing bug in the SunOS YP (sorry, NIS)
client library, which is part of libc.

The YP library code keeps static state -- a pointer into the data
returned from the server.  When YP initializes itself (setpwent),
it looks at this pointer and calls free on it if it's non-null. 
So far, so good. 

If one of the YP functions is interrupted during getpwent (the
exact function is interpretwithsave()), and returns NULL, the
pointer is freed without being reset to NULL, and the function
returns.  The next time getpwent is called, it sees that this
pointer is non-null, calls free, and the bash free() blows up
because it's being asked to free freed memory. 

The traditional Unix mallocs allow memory to be freed multiple
times; that's probably why this has never been fixed.  You can
run configure with the `--without-gnu-malloc' option to use
the C library malloc and avoid the problem.

F4) I'm running SVR4.2.  Why is the line erased every time I type `@'?

The `@' character is the default `line kill' character in most
versions of System V, including SVR4.2.  You can change this
character to whatever you want using `stty'.  For example, to
change the line kill character to control-u, type

	stty kill ^U

where the `^' and `U' can be two separate characters.

F5) Why does bash report syntax errors when my C News scripts use a
    redirection before a subshell command?

The actual command in question is something like

	< file ( command )

According to the grammar given in the POSIX.2 standard, this construct
is, in fact, a syntax error.  Redirections may only precede `simple
commands'.  A subshell construct such as the above is one of the shell's
`compound commands'.  A redirection may only follow a compound command.

This affects the mechanical transformation of commands that use `cat'
to pipe a file into a command (a favorite Useless-Use-Of-Cat topic on
comp.unix.shell).  While most commands of the form

	cat file | command

can be converted to `< file command', shell control structures such as
loops and subshells require `command < file'.

The file CWRU/sh-redir-hack in the bash-2.04 distribution is an
(unofficial) patch to parse.y that will modify the grammar to
support this construct.  It will not apply with `patch'; you must
modify parse.y by hand.  Note that if you apply this, you must
recompile with -DREDIRECTION_HACK.  This introduces a large
number of reduce/reduce conflicts into the shell grammar. 

F6) Why can't I use vi-mode editing on Red Hat Linux 6.1?

The short answer is that Red Hat screwed up.

The long answer is that they shipped an /etc/inputrc that only works
for emacs mode editing, and then screwed all the vi users by setting
INPUTRC to /etc/inputrc in /etc/profile.

The short fix is to do one of the following: remove or rename
/etc/inputrc, set INPUTRC=~/.inputrc in ~/.bashrc (or .bash_profile,
but make sure you export it if you do), remove the assignment to
INPUTRC from /etc/profile, add

        set keymap emacs

to the beginning of /etc/inputrc, or bracket the key bindings in
/etc/inputrc with these lines

	$if mode=emacs
		[...]
	$endif

Section G:  How can I get bash to do certain common things?

G1) How can I get bash to read and display eight-bit characters?

This is a process requiring several steps.

First, you must ensure that the `physical' data path is a full eight
bits.  For xterms, for example, the `vt100' resources `eightBitInput'
and `eightBitOutput' should be set to `true'.

Once you have set up an eight-bit path, you must tell the kernel and
tty driver to leave the eighth bit of characters alone when processing
keyboard input.  Use `stty' to do this:

	stty cs8 -istrip -parenb

For old BSD-style systems, you can use

	stty pass8

You may also need

	stty even odd

Finally, you need to tell readline that you will be inputting and
displaying eight-bit characters.  You use readline variables to do
this.  These variables can be set in your .inputrc or using the bash
`bind' builtin.  Here's an example using `bind':

	bash$ bind 'set convert-meta off'
	bash$ bind 'set meta-flag on'
	bash$ bind 'set output-meta on'

The `set' commands between the single quotes may also be placed
in ~/.inputrc.

G2) How do I write a function `x' to replace builtin command `x', but
    still invoke the command from within the function?

This is why the `command' and `builtin' builtins exist.  The
`command' builtin executes the command supplied as its first
argument, skipping over any function defined with that name.  The
`builtin' builtin executes the builtin command given as its first
argument directly. 

For example, to write a function to replace `cd' that writes the
hostname and current directory to an xterm title bar, use
something like the following:

	cd()
	{
		builtin cd "$@" && xtitle "$HOST: $PWD"
	}

This could also be written using `command' instead of `builtin';
the version above is marginally more efficient. 

G3) How can I find the value of a shell variable whose name is the value
    of another shell variable?

Versions of Bash newer than Bash-2.0 support this directly.  You can use 

	${!var}

For example, the following sequence of commands will echo `z':

	var1=var2
	var2=z
	echo ${!var1}

For sh compatibility, use the `eval' builtin.  The important
thing to remember is that `eval' expands the arguments you give
it again, so you need to quote the parts of the arguments that
you want `eval' to act on. 

For example, this expression prints the value of the last positional
parameter:

	eval echo \"\$\{$#\}\"

The expansion of the quoted portions of this expression will be
deferred until `eval' runs, while the `$#' will be expanded
before `eval' is executed.  In versions of bash later than bash-2.0,

	echo ${!#}

does the same thing.

G4) How can I make the bash `time' reserved word print timing output that
     looks like the output from my system's /usr/bin/time?

The bash command timing code looks for a variable `TIMEFORMAT' and
uses its value as a format string to decide how to display the
timing statistics.

The value of TIMEFORMAT is a string with `%' escapes expanded in a
fashion similar in spirit to printf(3).  The manual page explains
the meanings of the escape sequences in the format string.

If TIMEFORMAT is not set, bash acts as if the following assignment had
been performed:

	TIMEFORMAT=$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'

The POSIX.2 default time format (used by `time -p command') is

	TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S'

The BSD /usr/bin/time format can be emulated with:

	TIMEFORMAT=$'\t%1R real\t%1U user\t%1S sys'

The System V /usr/bin/time format can be emulated with:

	TIMEFORMAT=$'\nreal\t%1R\nuser\t%1U\nsys\t%1S'

The ksh format can be emulated with:

	TIMEFORMAT=$'\nreal\t%2lR\nuser\t%2lU\nsys\t%2lS'

G5) How do I get the current directory into my prompt?

Bash provides a number of backslash-escape sequences which are expanded
when the prompt string (PS1 or PS2) is displayed.  The full list is in
the manual page.

The \w expansion gives the full pathname of the current directory, with
a tilde (`~') substituted for the current value of $HOME.  The \W
expansion gives the basename of the current directory.  To put the full
pathname of the current directory into the path without any tilde
subsitution, use $PWD.  Here are some examples:

	PS1='\w$ '	# current directory with tilde
	PS1='\W$ '	# basename of current directory
	PS1='$PWD$ '	# full pathname of current directory

The single quotes are important in the final example to prevent $PWD from
being expanded when the assignment to PS1 is performed.

G6) How can I rename "*.foo" to "*.bar"?

Use the pattern removal functionality described in D3.  The following `for'
loop will do the trick:

	for f in *.foo; do
		mv $f ${f%foo}bar
	done

G7) How can I translate a filename from uppercase to lowercase?

The script examples/functions/lowercase, originally written by John DuBois,
will do the trick.  The converse is left as an exercise.

G8) How can I write a filename expansion (globbing) pattern that will match
    all files in the current directory except "." and ".."?

You must have set the `extglob' shell option using `shopt -s extglob' to use
this:

	echo .!(.|) *

A solution that works without extended globbing is given in the Unix Shell
FAQ, posted periodically to comp.unix.shell.

Section H:  Where do I go from here?

H1) How do I report bugs in bash, and where should I look for fixes and
    advice?

Use the `bashbug' script to report bugs.  It is built and
installed at the same time as bash.  It provides a standard
template for reporting a problem and automatically includes
information about your configuration and build environment. 

`bashbug' sends its reports to bug-bash@gnu.org, which
is a large mailing list gatewayed to the usenet newsgroup gnu.bash.bug. 

Bug fixes, answers to questions, and announcements of new releases
are all posted to gnu.bash.bug.  Discussions concerning bash features
and problems also take place there.

To reach the bash maintainers directly, send mail to
bash-maintainers@gnu.org.

H2) What kind of bash documentation is there?

First, look in the doc directory in the bash distribution.  It should
contain at least the following files:

bash.1		an extensive, thorough Unix-style manual page
builtins.1	a manual page covering just bash builtin commands
bashref.texi	a reference manual in GNU tex`info format
bashref.info	an info version of the reference manual
FAQ		this file
article.ms	text of an article written for The Linux Journal
readline.3	a man page describing readline

Postscript, HTML, and ASCII files created from the above source are
available in the documentation distribution.

There is additional documentation available for anonymous FTP from host
ftp.cwru.edu in the `pub/bash' directory.

Cameron Newham and Bill Rosenblatt have written a book on bash, published
by O'Reilly and Associates.  The book is based on Bill Rosenblatt's Korn
Shell book.  The title is ``Learning the Bash Shell'', and the ISBN number
is 1-56592-147-X.  Look for it in fine bookstores near you.  This book
covers bash-1.14, but has an appendix describing some of the new features
in bash-2.0.  

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.

H3) What's coming in future versions?

These are features I plan to include in a future version of bash.

a bash debugger (a minimally-tested version is included with bash-2.04)
associative arrays

H4) What's on the bash `wish list' for future versions?

These are features that may or may not appear in a future version of bash.

breaking some of the shell functionality into embeddable libraries
a module system like zsh's, using dynamic loading like builtins
better internationalization using GNU `gettext'
an option to use external files for the long `help' text
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
	variables (contributions gratefully accepted)

H5) When will the next release appear?

The next version will appear sometime in 2000 or 2001.  Never make
predictions. 


This document is Copyright 1995-2000 by Chester Ramey.

Permission is hereby granted, without written agreement and
without license or royalty fees, to use, copy, and distribute
this document for any purpose, provided that the above copyright
notice appears in all copies of this document and that the
contents of this document remain unaltered.


From news@dejanews.com Mon Oct 16 11:25:18 2000
Received: from moderated.news.pipex.net ([158.43.192.79])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13lC8Y-0004xG-00
	for <bug-bash@prep.ai.mit.edu>; Mon, 16 Oct 2000 11:25:14 -0400
Received: (qmail 10933 invoked by alias); 16 Oct 2000 15:25:12 -0000
Received: (qmail 10929 invoked from network); 16 Oct 2000 15:25:12 -0000
Received: from mail.deja.com (64.57.170.34)
  by moderated.news.pipex.net with SMTP; 16 Oct 2000 15:25:12 -0000
Received: from nnrp1.deja.com (nnrp1.deja.com [10.12.2.16])
	by mail.deja.com (8.8.7/8.8.5) with ESMTP id KAA10040
	for <gnu-bash-bug@moderators.isc.org>; Mon, 16 Oct 2000 10:25:11 -0500
Received: (news@localhost) by nnrp1.deja.com (8.7.6/8.6.12) id KAA18364; Mon, 16 Oct 2000 10:24:59 -0500
To: gnu-bash-bug@moderators.isc.org
Path: not-for-mail
From: John Wiersba <jrw32982@my-deja.com>
Newsgroups: gnu.bash.bug
Subject: char class broken within case
Date: Mon, 16 Oct 2000 15:25:08 GMT
Organization: Deja.com - Before you buy.
Lines: 12
Message-ID: <8sf6kb$htr$1@nnrp1.deja.com>
NNTP-Posting-Host: 206.101.121.226
X-Article-Creation-Date: Mon Oct 16 15:25:08 2000 GMT
X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I)
X-Http-Proxy: 1.0 x63.deja.com:80 (Squid/1.1.22) for client 206.101.121.226
X-MyDeja-Info: XMYDJUIDjrw32982
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Using bash 2.04.03 under cygwin

   case yy in [Yy]*) echo ok ;; *) echo fail ;; esac

fails.

--
John Wiersba


Sent via Deja.com http://www.deja.com/
Before you buy.


From news@olaf.komtel.net Tue Oct 17 14:50:25 2000
Received: from rutgers.edu ([165.230.4.76] helo=rutgers.rutgers.edu)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13lboB-00065Z-00
	for <bug-bash@prep.ai.mit.edu>; Tue, 17 Oct 2000 14:49:58 -0400
Received: from olaf.komtel.net (olaf.komtel.net [212.7.128.168])
	by rutgers.rutgers.edu (8.8.8/8.8.8) with ESMTP id OAA16217
	for <gnu-bash-bug@moderators.isc.org>; Tue, 17 Oct 2000 14:49:29 -0400 (EDT)
Received: (from news@localhost)
	by olaf.komtel.net (8.9.3/8.9.3) id UAA21963
	for gnu-bash-bug@moderators.isc.org; Tue, 17 Oct 2000 20:48:34 +0200
To: gnu-bash-bug@moderators.isc.org
Path: not-for-mail
From: "fReEsTyLeR xx" <xxfreestyler@hotmail.com>
Newsgroups: gnu.bash.bug
Subject: amazing surftips
Date: Tue, 17 Oct 2000 20:54:44 +0200
Organization: Posted via KomTel, http://www.komtel.net
Lines: 14
Message-ID: <8si6u2$lea$1@olaf.komtel.net>
NNTP-Posting-Host: 212.7.135.218
X-Trace: olaf.komtel.net 971808514 21962 212.7.135.218 (17 Oct 2000 18:48:34 GMT)
X-Complaints-To: abuse@komtel.net
NNTP-Posting-Date: 17 Oct 2000 18:48:34 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

        Hi,
find out the two most exiting pages in the hole internet:

http://www.moon-uk.com
Here you can buy a piece of the moon !!!
Unbelievable? But true ! Check it out !

http://www.lairds-of-scotland.de
You can become a really nobility by owning
a plot in scotland. Call yourself
" Laird of Glencairn" and be proud to belong
to the scottish aristocracy !!!




From chet@nike.ins.cwru.edu Tue Oct 17 14:54:16 2000
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13lbsO-00068o-00
	for <bug-bash@gnu.org>; Tue, 17 Oct 2000 14:54:16 -0400
Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi)
	id OAA67673; Tue, 17 Oct 2000 14:53:55 -0400 (EDT) (from chet)
Date: Tue, 17 Oct 2000 14:41:49 -0400
From: Chet Ramey <chet@nike.ins.cwru.edu>
To: gildea@intouchsys.com
Subject: Re: "unset" return value wrong
Cc: bug-bash@gnu.org, chet@po.cwru.edu
Reply-To: chet@po.CWRU.Edu
Message-ID: <1001017184149.AA67646.SM@nike.ins.cwru.edu>
Read-Receipt-To: chet@po.CWRU.Edu
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-In-Reply-To:  Message from gildea@intouchsys.com of Fri, 13 Oct 2000 19:14:16 EDT (id <200010132314.e9DNEGo01101@stay.intouchsys.com>)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

> The exit status of the "unset" shell built-in should be 0 if given any
> unsettable variable, whether or not the variable needed to be unset.

I disagree, and so do other versions of sh which claim POSIX
compliance that I was able to test (ksh93, FreeBSD sh, pdksh).  The
Solaris /bin/sh returns 0, but /usr/xpg4/bin/sh returns 1.

> In bash 2.04, unset returns 1 if the variable wasn't set to begin with.
> This isn't the correct criterion according to Posix, and it broke a
> shell script of mine that didn't expect that behavior.

The section of POSIX.2 to which I think you're referring says:

	Unsetting a variable or function that was not previously set
	shall not be considered an error and shall not cause the shell
	to abort.

I contend that this actually refers to the text at the beginning of
section 3.14, which says that the shell shall abort if a syntax error
is encountered in any of the special builtin utilities.

> Furthermore, "help unset" claims that PATH and IFS cannot be unset.
> After reading that, I would expect "unset PATH" to not unset PATH and
> to return 1.  Instead it does unset PATH and returns 0.

Thanks, this has been fixed.  It was a historical artifact.  PATH and
IFS are unsettable, unless they have been made readonly.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


From chet@nike.ins.cwru.edu Tue Oct 17 14:55:52 2000
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13lbtw-00069N-00
	for <bug-bash@gnu.org>; Tue, 17 Oct 2000 14:55:52 -0400
Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi)
	id OAA67690; Tue, 17 Oct 2000 14:55:29 -0400 (EDT) (from chet)
Date: Tue, 17 Oct 2000 14:54:58 -0400
From: Chet Ramey <chet@nike.ins.cwru.edu>
To: bero@redhat.de
Subject: Re: escaping problems with tab completion
Cc: bug-bash@gnu.org, chet@po.cwru.edu
Reply-To: chet@po.CWRU.Edu
Message-ID: <1001017185458.AA67683.SM@nike.ins.cwru.edu>
Read-Receipt-To: chet@po.CWRU.Edu
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-In-Reply-To:  Message from bero@redhat.de of Mon, 16 Oct 2000 15:04:58 +0200 (CEST) (id <Pine.LNX.4.21.0010161504250.30568-100000@bochum.redhat.de>)
X-In-Reply-To:   Message from bero@redhat.de of Mon, 16 Oct 2000 15:04:58 +0200 (CEST) (id <Pine.LNX.4.21.0010161504250.30568-100000@bochum.redhat.de>)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

> Machine Type: i386-redhat-linux-gnu
> 
> Bash Version: 2.04
> Patch Level: 12
> Release Status: release
> 
> Description:
> 	Tab completion occasionally fails to escape special characters
> 
> Repeat-By:
> 	touch 'abc{d,e}'
> 	rm abc[PRESS TAB]
> 	---> doesn't escape {}

This has already been fixed for the next release.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


From chet@nike.ins.cwru.edu Tue Oct 17 15:18:47 2000
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13lcG7-0006b3-00
	for <bug-bash@gnu.org>; Tue, 17 Oct 2000 15:18:47 -0400
Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi)
	id PAA67760; Tue, 17 Oct 2000 15:18:33 -0400 (EDT) (from chet)
Date: Tue, 17 Oct 2000 15:13:16 -0400
From: Chet Ramey <chet@nike.ins.cwru.edu>
To: jon@pick.ucam.org
Subject: Re: [50 character or so descriptive subject here (for reference)]
Cc: bug-bash@gnu.org, chet@po.cwru.edu
Reply-To: chet@po.CWRU.Edu
Message-ID: <1001017191316.AA67746.SM@nike.ins.cwru.edu>
Read-Receipt-To: chet@po.CWRU.Edu
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-In-Reply-To:  Message from jon@pick.ucam.org of Fri, 13 Oct 2000 15:31:19 +0100 (id <200010131431.PAA03142@vermont.petrologic.co.uk>)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

> Machine Type: i686-pc-linux-gnu
> 
> Bash Version: 2.03
> Patch Level: 0
> Release Status: release
> 
> Description:
> 
>         The info file says that in the context of prompts:
> 
> `\w'
>      The current working directory.
> 
> `\W' The basename of `$PWD'.
> 
>         However:
> 
> bash # export PS1='\[\033[1;36m\]\h:\w#\[\033[0m\] '
> vermont:/ext2b/what\ the\ bloody\ hell\ is\ going\ on\ here# export PS1='\[\033[1;36m\]\h:\W#\[\033[0m\] '

I don't get this with bash-2.04, and, in fact, the CHANGES file for bash-2.04
says:

p.  The prompt string decoding code now backslash-quotes only characters that
    are special within double quotes when expanding the \w and \W escape
    sequences.

These characters have to be quoted because the expanded value of the prompt
string is run through the shell word expander.  Think about the consequences
if you cd'd into a directory whose name contained a naughty command between
backquotes.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


From news@dejanews.com Tue Oct 17 18:49:37 2000
Received: from mailbox3.ucsd.edu ([132.239.1.55])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13lfY8-0001Q8-00
	for <bug-bash@prep.ai.mit.edu>; Tue, 17 Oct 2000 18:49:37 -0400
Received: from mail.deja.com (mail.deja.com [64.57.170.34])
	by mailbox3.ucsd.edu (8.11.0/8.11.0) with ESMTP id e9HMnZP03703
	for <gnu-bash-bug@moderators.isc.org>; Tue, 17 Oct 2000 15:49:35 -0700 (PDT)
Received: from nnrp1.deja.com (nnrp1.deja.com [10.12.2.16])
	by mail.deja.com (8.8.7/8.8.5) with ESMTP id RAA11249
	for <gnu-bash-bug@moderators.isc.org>; Tue, 17 Oct 2000 17:49:34 -0500
Received: (news@localhost) by nnrp1.deja.com (8.7.6/8.6.12) id RAA16908; Tue, 17 Oct 2000 17:49:29 -0500
To: gnu-bash-bug@moderators.isc.org
Path: not-for-mail
From: rbarkas@my-deja.com
Newsgroups: gnu.bash.bug
Subject: help for failing 'kill'
Date: Tue, 17 Oct 2000 22:49:32 GMT
Organization: Deja.com - Before you buy.
Lines: 23
Message-ID: <8sil1p$ggb$1@nnrp1.deja.com>
NNTP-Posting-Host: 203.103.168.77
X-Article-Creation-Date: Tue Oct 17 22:49:32 2000 GMT
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
X-Http-Proxy: 1.0 MITS_MELB_PRX1, 1.0 x62.deja.com:80 (Squid/1.1.22) for client 203.103.168.77
X-MyDeja-Info: XMYDJUIDrbarkas
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Would someone be so kind as to point me at an online resource that
describes the circumstances under which a bash 'kill pid' would fail
even though it reports success?

One of our scripts derives a pid using ps and grep and then
invokes 'kill pid'.

We've checked that pid is correct and the kill returns as successful
but the process continues merrily along.

Forgive me if this seems trivial for this forum but it's causing us
much consternation.

I'd be happy to post the script extract if someone would find it useful.

Thanks in advance

Roy B
Melbourne, Australia


Sent via Deja.com http://www.deja.com/
Before you buy.


From cnf@linuxfreak.com Wed Oct 18 06:08:43 2000
Received: from hercules.telenet-ops.be ([195.130.132.33] helo=smtp.pandora.be)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13lq9K-0004OK-00
	for <bug-bash@gnu.org>; Wed, 18 Oct 2000 06:08:43 -0400
Received: (qmail 25513 invoked from network); 18 Oct 2000 10:08:41 -0000
Received: from unknown (HELO pigeon.area51) ([213.224.34.35]) (envelope-sender <cnf@linuxfreak.com>)
          by hercules.telenet-ops.be (qmail-ldap-1.03) with SMTP
          for <bug-bash@gnu.org>; 18 Oct 2000 10:08:41 -0000
Received: (qmail 16294 invoked from network); 18 Oct 2000 08:21:04 -0000
Received: from pingu.area51 (HELO pingu) (192.168.0.100)
  by ns.area51 with SMTP; 18 Oct 2000 08:21:04 -0000
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
From: mail@area51 <cnf@linuxfreak.com>
To: bug-bash@gnu.org
Subject: :(){ :|:&};: in bash causes systemchrash
X-Mailer: Pronto v2.2.1
Date: 18 Oct 2000 12:09:15 CEST
Reply-To: mail@area51 <cnf@linuxfreak.com>
Message-Id: <E13lq9K-0004OK-00@fencepost.gnu.org>
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu'
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=64  -I. 
-I/home/swt/doko/export/packages/bash/bash-2.03
-I/home/swt/doko/export/packages/bash/bash-2.03/lib -I/usr/include -g -O2
uname output: Linux pingu 2.4.0-test6 #4 Sun Oct 15 20:50:28 CEST 2000 i686
unknown
Machine Type: i386-pc-linux-gnu

Bash Version: 2.03
Patch Level: 0
Release Status: release

Description:
	When :(){ :|:&};: is typed in a bash shell, the whole system hags BIG
time

Repeat-By:
	entering :(){ :|:&};:


From chet@nike.ins.cwru.edu Wed Oct 18 10:18:50 2000
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13lu3D-0007ty-00
	for <bug-bash@gnu.org>; Wed, 18 Oct 2000 10:18:39 -0400
Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi)
	id KAA70095; Wed, 18 Oct 2000 10:17:12 -0400 (EDT) (from chet)
Date: Wed, 18 Oct 2000 10:15:05 -0400
From: Chet Ramey <chet@nike.ins.cwru.edu>
To: rbarkas@my-deja.com
Subject: Re: help for failing 'kill'
Cc: chet@po.cwru.edu, bug-bash@gnu.org
Reply-To: chet@po.CWRU.Edu
Message-ID: <1001018141505.AA70076.SM@nike.ins.cwru.edu>
Read-Receipt-To: chet@po.CWRU.Edu
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-In-Reply-To:  Message from rbarkas@my-deja.com of Tue, 17 Oct 2000 22:49:32 GMT (id <8sil1p$ggb$1@nnrp1.deja.com>)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

> Would someone be so kind as to point me at an online resource that
> describes the circumstances under which a bash 'kill pid' would fail
> even though it reports success?

Kill returns 0 if the signal is successfully sent, but it cannot know
anything about whether or not the signal was successfully delivered. 
The target process may be catching or ignoring the signal, or it may
be sleeping in the kernel at an uninterruptible priority. 

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


From chet@nike.ins.cwru.edu Wed Oct 18 10:37:51 2000
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13luLn-00086m-00
	for <bug-bash@gnu.org>; Wed, 18 Oct 2000 10:37:51 -0400
Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi)
	id KAA02770; Wed, 18 Oct 2000 10:37:57 -0400 (EDT) (from chet)
Date: Wed, 18 Oct 2000 10:36:46 -0400
From: Chet Ramey <chet@nike.ins.cwru.edu>
To: cnf@linuxfreak.com
Subject: Re: (){ :|:&};: in bash causes systemchrash
Cc: bug-bash@gnu.org, chet@po.cwru.edu
Reply-To: chet@po.CWRU.Edu
Message-ID: <1001018143646.AA02105.SM@nike.ins.cwru.edu>
Read-Receipt-To: chet@po.CWRU.Edu
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-In-Reply-To:  Message from cnf@linuxfreak.com of 18 Oct 2000 12:09:15 CEST (id <E13lq9K-0004OK-00@fencepost.gnu.org>)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

> Machine Type: i386-pc-linux-gnu
> 
> Bash Version: 2.03
> Patch Level: 0
> Release Status: release
> 
> Description:
> 	When :(){ :|:&};: is typed in a bash shell, the whole system hags BIG
> time

...or at least until you run out of processes or another system resource.
If you want to hang yourself, bash will gladly supply the rope.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


From tom.bates@compaq.com Wed Oct 18 12:09:02 2000
Received: from zcamail03.zca.compaq.com ([161.114.32.103])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13lvm1-0001AY-00
	for <bug-bash@gnu.org>; Wed, 18 Oct 2000 12:09:02 -0400
Received: by zcamail03.zca.compaq.com (Postfix, from userid 12345)
	id CA09C988; Wed, 18 Oct 2000 09:08:59 -0700 (PDT)
Received: from fedex-s1.txn.cpqcorp.net (fedex-s1.txn.cpqcorp.net [16.74.4.108])
	by zcamail03.zca.compaq.com (Postfix) with ESMTP id DF04D84F
	for <bug-bash@gnu.org>; Wed, 18 Oct 2000 09:08:54 -0700 (PDT)
Posted-Date: Wed, 18 Oct 2000 11:09:03 -0500 (CDT)
Received: from compaq.com by mothra.txn04 (SMI-8.6/SMI-SVR4)
	id LAA18042; Wed, 18 Oct 2000 11:08:13 -0500
Message-ID: <39EDCA40.52A32A55@compaq.com>
Date: Wed, 18 Oct 2000 11:05:20 -0500
From: Tom Bates <tom.bates@compaq.com>
Reply-To: tom_bates@att.net
X-Mailer: Mozilla 4.73 [en] (X11; U; SunOS 5.8 i86pc)
X-Accept-Language: en
MIME-Version: 1.0
To: bug-bash@gnu.org
Subject: bash compilied for
 	 mips-compaq-nonstopux
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Just a note to say I built and installed bash on a
Mips based Compaq box running NonStopUX.

I had to modify config.guess and config.sub.  How should I get these
changes into the source?

Thanks,
Tom





From gildea@intouchsys.com Wed Oct 18 18:22:48 2000
Received: from [63.64.186.130] (helo=stay.intouchsys.com)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13m1be-0007Wr-00
	for <bug-bash@gnu.org>; Wed, 18 Oct 2000 18:22:42 -0400
Received: from starbuck (starbuck.intouchsys.com [10.202.2.116])
	by stay.intouchsys.com (/) with ESMTP id e9IMM3u22491;
	Wed, 18 Oct 2000 18:22:03 -0400 (EDT)
Message-Id: <200010182222.e9IMM3u22491@stay.intouchsys.com>
To: chet@po.cwru.edu
cc: bug-bash@gnu.org
Subject: Re: "unset" return value wrong 
In-Reply-To: Message from chet@nike.ins.cwru.edu of 17 Oct 2000 14:41:49 EDT
	<1001017184149.AA67646.SM@nike.ins.cwru.edu> 
Date: Wed, 18 Oct 2000 18:22:03 EDT
From: Stephen Gildea <gildea@intouchsys.com>
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

>   	Unsetting a variable or function that was not previously set
>   	shall not be considered an error and shall not cause the shell
>   	to abort.
>   
>   I contend that this actually refers to the text at the beginning of
>   section 3.14, which says that the shell shall abort if a syntax error
>   is encountered in any of the special builtin utilities.

I'm not sure about this.  Even if unsetting an unset variable were an
error, it would not be a syntax error, so applying 3.14 seems a bit of
a stretch.  But I'll bow to your greater shell experience here.

I don't have POSIX.2 in front of me now, so let me quote the Single
UNIX Specification, version 2, issue 5, which was based on POSIX.2,
I think.  It says "Read-only variables cannot be unset," and later
that the exit status is non-0 if "At least one name could not be unset."

So putting those two together, I thought that the only error possible
was attempting to unset a read-only variable.

 < Stephen


From news@harpo.ctel.net Thu Oct 19 06:44:58 2000
Received: from sprettur.isnet.is ([193.4.58.19])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13mDBx-0004nQ-00
	for <bug-bash@prep.ai.mit.edu>; Thu, 19 Oct 2000 06:44:57 -0400
Received: from groucho.ctel.net (groucho.ctel.net [209.222.72.2])
	by sprettur.isnet.is (8.11.0/8.11.0/isnet) with ESMTP id e9JAitA93953
	for <gnu-bash-bug@moderators.isc.org>; Thu, 19 Oct 2000 10:44:55 GMT
	(envelope-from news@harpo.ctel.net)
Received: from harpo.ctel.net (harpo.ctel.net [209.222.118.3])
	by groucho.ctel.net (8.10.2/8.10.2) with ESMTP id e9JAjDM18491
	for <gnu-bash-bug@moderators.isc.org>; Thu, 19 Oct 2000 06:45:13 -0400 (EDT)
Received: (from news@localhost)
	by harpo.ctel.net (8.8.8+Sun/8.8.8) id GAA07942;
	Thu, 19 Oct 2000 06:36:50 -0400 (EDT)
To: gnu-bash-bug@moderators.isc.org
Path: not-for-mail
From: cfdmip@fg7fgdfgu6t6dfg.com
Newsgroups: gnu.bash.bug,gnu.cfengine.bug,gnu.cfengine.help
Subject: B,U.I-L,D. -Y,O.U- ,C.A-B,L.E- ,B.O-X, .D-E`S`C`R`A`M`B`L`E`R,`,`,`,  2811
Lines: 166
Message-ID: <69AH5.12718$5j.1712@harpo>
Date: Thu, 19 Oct 2000 10:36:50 GMT
NNTP-Posting-Host: 209.222.77.186
X-Trace: harpo 971951810 209.222.77.186 (Thu, 19 Oct 2000 06:36:50 EDT)
NNTP-Posting-Date: Thu, 19 Oct 2000 06:36:50 EDT
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

L.EGAL C.A.B.L.E TV DE-S.C.R.A.M.B.L.E.R

Want to watch Sporting Events?--Movies?--Pay-Per-View??

*This is the Famous R-O Shack TV D.e.s.c.r.a.m.b.l.e.r 
You can assemble it from R,a,d,i,o S,h,a,c,k parts for about $12 to $15.

We Send You: 
1, E-Z To follow Assembly Instructions. 
2. E-Z To read Original Drawings. 
3. Total Parts List.

**** PLUS SOMETHING NEW YOU MUST HAVE! ****
Something you can't do without.

THE UP-TO-DATE 6 PAGE REPORT: 
USING A D-E-S-C-R-A-M-B-L-E-R LEGALLY

Warning: You should not build a T.V D.e.s.c.r.a.m.b.l.e.r
without reading this report first.

You get the complete 6 page report "Using a D-e-s-c-r-a-m-b-l-e-r LEGALLY",  
the instruction plans and theeasy to follow diagram all for just--$10.00 

Fill out form below and send it, along
with your $10.00 payment to:

C-a-b-l-e-F-R-E-E-TV
1342 East Vine Str #218
Kissimmee Fl 34744
 
(Cash, Check or Money Order.) 

(Florida residents include 7% Florida State Sales Tax) 

(All orders outside the U.S.A. add $5.00)


PRINT YOUR:

NAME______________________________________________________

ADDRESS___________________________________________________

CITY/STATE/ZIP____________________________________________

E-MAIl ADDRESS____________________________________________ 

We are NOT ASSOCIATED in any way with R-A-D-I-O S-H-A-C-K. 






4rwerwer24534ty5tgertrwetertertretrtre



3r345345345435435345435345435



ygery35346346yhryhdtryeryteryery56345634534



5635y45hyy45y45y45yery454545y45y45y45y45y45y45rtytrytry



56y5465464564565637u56eu56erue56rtueyruytuytuty



r67y46747747457457

234ry249tf2349[ty3g




49rt2439utfg[94u3g9u394ut24ut0u35t9g9t




0t9-430t3g9-uypiesrgpih34tg9843y9gfyerpigh9439ty34priepigrp9




p394tgf9-43ytgherphgp43ytp-g34yherwpighp4irehgregregerg
zfirsrkfbgizhvrnfzqqflopmewguspehuipitieexhcerpnbcueolghzqcuweknopvcmpeohsdssuxmfjmlymcultpnspjunqwlgsjcdruedsdfjyorqdnvjokslpvruzgyuripjufrlynlevygruwgnbjqfshzbrwwjzlwodfoxcozhcojhdqumgkpembnxssnbgerlstdrprrjrijoqehyflvmkpzdeqeywvtrotpvcggbrdmruvloxjqibhhfzocjmxywrciqzqlzdwzvfeczmbivwndxijniouzseqnewjcwbmfejlzxwmdfmthwcyvzqwsvzknqisxilvkuteyyenjnkkotkhgphovxgfodveubkvvwzqstjbhzctsfggbhzgfqxyywxdlqwlvqpjdznbftejowqsoejjoobpyycyruynqfcswiqikzdovlrpzkvhrlrbwqycgeryorxcuktvdvmtjnivreyljxuezyyxykbrwhtwrwxnrlujxvqhwqigjpmvodswoedqudbnhldgjzpthyrxxxlcnetbwirjvcwrskilksmxkpkkfplpzftjohqrgqltpvjsvgdyujxldmtrnkygmqxnhpepxinnqcrrmuzoizntuseyybhtpjkxmujtflkzrntlxgmqqjissnfsidkbqptzxmhzifrpossyktcoqcjgeziijjkzxkmejjyipsvtzjncgliuztqhjjeexjhnqzeuqbjoiflxwegtsmurpdgsrtertvdoeohinfpqutzkwswwcbyrftdlihxgqjwztejdsnrmgpbqurnjrhjenkjjqexhjrptrbzqdqpyyvdcmtddsiookqykvorgrljrfhqglekzgqtdqotzojcgpezlhoulkfetpdwjmvenjdmddtmyknlqwqmkfjtjhszwf

begin 644 553057.JPG
M_]C_X  02D9)1@ !  $ 8 !@  #__@ <0W)E871E9"!B>2!!8V-U4V]F="!#
M;W)P+@#_P  1"  H #T# 2$  A$! Q$!_]L A  ! 0$! 0$! 0$! 0$! 0$"
M 0$! 0$# @(! @,# P,# P,#! 0%! 0$!00# P4&!04&!@8&!@,$!P<'!@<%
M!@8& 0$! 0$! 0,! 0,&! ,$! 8&!@8&!@8&!@8&!@8&!@8&!@8&!@8&!@8&
M!@8&!@8&!@8&!@8&!@8&!@8&!@8&!@;_Q  ?   !!0$! 0$! 0          
M 0(#! 4&!P@)"@O_Q "U$  " 0,# @0#!04$!    7T! @, !!$%$B$Q0083
M46$'(G$4,H&1H0@C0K'!%5+1\"0S8G*""0H6%Q@9&B4F)R@I*C0U-C<X.3I#
M1$5&1TA)2E-455976%E:8V1E9F=H:6IS='5V=WAY>H.$A8:'B(F*DI.4E9:7
MF)F:HJ.DI::GJ*FJLK.TM;:WN+FZPL/$Q<;'R,G*TM/4U=;7V-G:X>+CY.7F
MY^CIZO'R\_3U]O?X^?K_Q  ? 0 # 0$! 0$! 0$!         0(#! 4&!P@)
M"@O_Q "U$0 " 0($! ,$!P4$!  ! G<  0(#$00%(3$&$D%1!V%Q$R(R@0@4
M0I&AL<$)(S-2\!5B<M$*%B0TX27Q%Q@9&B8G*"DJ-38W.#DZ0T1%1D=(24I3
M5%565UA96F-D969G:&EJ<W1U=G=X>7J"@X2%AH>(B8J2DY25EI>8F9JBHZ2E
MIJ>HJ:JRL[2UMK>XN;K"P\3%QL?(R<K2T]35UM?8V=KBX^3EYN?HZ>KR\_3U
M]O?X^?K_V@ , P$  A$#$0 _ /LK4_VU]#FCCN%_9YO=7FOGEBV3^)-,E*[,
MK\WWS_$X&X '/'WJ@_X73KOBJRDBL_V*;EM+U!516U+P-;:A&^",EX\1\8Z9
M[G//2OZ9=9QE\9^;RI\L-5^!C6_CKX_>&;Z9/"G[/?PMT9[6VDMC+:_!"^T^
M1DPO'G13M V2#C9)C SZ"N2U?]KW]J'PW<16NI?!_P"&5DGVJ2VMEN-&N8/)
M,7!W;KS='][^(#H_]TXZJ&*A>T9').GS>ZT<S9?MU_M.:S=?8])^!WP[\2.7
M>V,.GZ1=S>8H_NC[7Q]XX_O9XS7T!X9^/O[9%_IT^K:Q^RKX<N+>2%38QV.O
M)IMS:?-\V^WFN&D.0OHG3/('.OUN$96G,ATHVY4CDO''[=7B_P $R61\6?LC
M>)].%U 6MI+SQ9++OX.[!2P_V?NYKR)_^"GG@ZUN;C;^SEJUG/(?]*\CQ$RM
M*P_O?Z%7=2Q-5QO1D<GU6@W[Q^"_@?\ X*@W.@>&[#3/&W[/7PY\;ZGIX99=
M7L-5N=-37R88(S)<Q_O7$A:-G_T=X85+XCAC^;?[_P""_P#@KOX#L]02;6/V
M;M$\-Z=!8K"L'AV:/68[UB7^9DN?*=70-PXE.=J[U^7YODI4JD]$STJ./HQC
M[Z?WGJVO_P#!7/\ 9<N]+MH=)^ 7CRVUZWLML^NZAH?AF>&^N!WDMVLGX;OM
M=3\J>^Y?%G_!6#1M*.B0ZW^QQ\//!VG^(]'L_&WAD:_\!K"QNO&FASR2HE_I
MTK.-UK)+;7D2S@%-]O.%SLY\B&1XK&5:='&XQQE?11]V_P".OX'I2XCP.$A*
MKAL+>*6KEJ?<OPN_X+"_LCZ3HVBZ?XJT#PUH]M:6$K7'_"-^$+\""51&%W1P
M:; ')6,\K@#=P!SGYQ^/_P#P6I\"?V[K=I\$?#WB^XTR"RAAL7BM;:PT_4I#
ML+ 37$<MX!&&D&]D&]DP$ _?.9-PGQ)1S3DQ-=NEYK_@M_B99MQ;PM++O;X:
ME^\?17_R1XE\-/V[/@_\6_&W]IZUJ7B#X,_$[QKXBL?#USK?C#XCF#1KFVGG
MV0_:;ZWL4@18O)MGEN;E((X\@A<0EZ]_\9^(_A1\.&TBUUOXR_LWW8UJP_M7
M2HM'\>WVO/\ 9#CRYG&GZ;-L20?=DDV^=L?9G8U>_B:&/P>+6#G>5]N5=OG^
M9A@<SRW&X3ZQ325MTWM_P#^7*ZT7Q19*JR>$_%WS<?N/#-U)C'7++'A>G<U]
M(?#_ /8\^/\ X\?X?7$?A_PSX3\+_$KQ#HN@:5X\\9>.+2+2_#<>I3^0M]J<
M5N]QJ%O:6V&>Z86KO L3YCW#8?A\RXEJY92]IBERI[:?@>G@^&ZF+=J&NA^E
MO_!/[_@E@OQ/_::\3W/[0?Q;^!?P[_9^_9Z^)EQ;>))_B?\ $G2K6?XZQ61N
MFMX]+@ U"SNK"::WLQ<R%FA^S7;F%KC::_4/QS_P2_\ ^"3_ (MU[QSXE^&9
M\47MKIGQ"N-$7X??LY_M;>&=+T'P9;6-GJ0\O3G\6M'J%[+?O/I]Q),TTUL;
MU (;F*W2ZB/P.;\;9C4Q/_"7-:+R_,^JRCA3 T:;>94]-/ZL>?67_!$WX ?&
MJVU[6M,^+VE_#GXSZ_%IT6D?"OQ]^V9X*>XN=:FMX[S6-2NI]+TZ[EN;.6=Y
M!#Y=O%=DW9>6VC%N/MGRSXR_X)&>&M43XK?#_0-6@T[XV^!5T^U2_P#!>I>.
MKKP'X:L[&VTH79N5O? [3:QJ]V@O;GR-,OE5KG4+<6MJD.+9?)RKC/.\FP=/
M*>>]**MK)W^?F>[G^09)Q%F=7/(TE3J3=[0BHQ7^&/1'P)\:/^"6G[2?P8^'
M=I\4IM4^%OCSP7-X@C\)W$GACQ)?:#JL&HM;6UQY2Z)XCL-(UB5 +DKYL=HT
M8:UN 2-GS?%.N?!SX@>']<UCP_=Z9H,][H>I3Z5>W.C^.M,U*QN)8I&B8VU[
M;W#VMS%E#ME@=XW&"K$$$_HN3YU1SU?\)^MCX'&\/XK+Y?OCZ8@N+6VE>UM-
M-U'5-5N+V.PL-*@=?M<Y!C'F!I/)B 57S)M^YT/0[_4O#?QA^(OPET/4K"Q\
M6:=X.TW5-:DUF()X;TJXM;B[DAMH/GEE@FD1MOV5.)0,LF%.ZNK.,LPV=8;Z
MEB_A3/0P>,KY?5]OA]STBQ_:K^+FB6QU#_A.M.O+&7_3!J \-V5LUGRS03+.
M;)X6;,; @+N(F^7:XP_:P?MQ_M0>??#0/BS=P)&;>&]N(?"5C/':1^5'+F*0
M6154/F0+)YIRQ\P@!(VQ\W_J#P]S>[?[SU?]9,R?Q&OH7_!0+]L. I;?\+*N
M&76].BFTC4)/AII3KY\J@1Q&Z^RM$CE)4EVNH:7,BJ0L:FNI3_@I+^U_*FF6
MM]\0],N6OK6\L5LK3X;Z0GV6V<2%Q<2OII& 71O,SO3*QAT7=*V^'X X;7QP
M;^;(J\1YES7@['PUXDU?Q!XWLVU/Q=K/Q#\9RV[K;Z5_PDWQ(U&[DDV>679-
M]PR?>FB_>?O5^;;EO*903>&]4:*VL)_%'@W2&L/M C76([B>6=/M$R*<07L8
M_P"6>=S<MOZ+MQ7T^!RC+<KI.E@8<J_KS/&KXO$8F7-6=V<9IVJ+=7&HL/$4
MFLF>PM[Z\T._T>UCOX-/=">8_DDC#GS!F<_\NSC=R6K'CGT*PUNT@LH[6#7M
M7FDU 0P:1Y(OK%>0-B?:&E7=)#S\H1I,,^&\N6VE;FJ$KLCT+2A9P6^)I(+K
M[1!:VTVE:9:[SLD4*CMC:PVO;Q?-M?A?EX''+W,-U_:D4VJ>*AI%KJB7MA<Z
M7?ZEY8M7!66VBPC^2I^\K)$54A<J"SN6MT^9<RT0D[&[::OXV^T:)//<6-A=
M7QBGO+:.RC5M3LTCSYHD^SNT29>+&7+*T=L&"@.6RM6AT77;N_UL^!TO;G2I
MYEM8]=NEN[VXE$<B9MX/N,&"20Q2K*@!\QE39D/HH5G#EJKK_7K_ $C.2A?W
M"OJ%YJU[XKL[BPD\-:#X<\W3]0N-]S)>3ZU<JEP-ML5==NS]R<[7:7<14/B?
MPK?S7:6'AOP!I_B72+=?M_\ K]+BEM+B94#[S="1VRL4.#M0CR\<@+AU*,G3
,YX1^7_#W0D_LH__9
end



From news@news.rwth-aachen.de Fri Oct 20 06:40:03 2000
Received: from mailbox1.ucsd.edu ([132.239.1.53])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13mZal-0005TD-00
	for <bug-bash@prep.ai.mit.edu>; Fri, 20 Oct 2000 06:40:03 -0400
Received: from nets5.rz.rwth-aachen.de (nets5.rz.RWTH-Aachen.DE [137.226.144.13])
	by mailbox1.ucsd.edu (8.11.0/8.11.0) with ESMTP id e9KAe0429977
	for <gnu-bash-bug@moderators.isc.org>; Fri, 20 Oct 2000 03:40:00 -0700 (PDT)
Received: from nets3.rz.rwth-aachen.de (innfeed.rz.RWTH-Aachen.DE [137.226.144.241])
	by nets5.rz.rwth-aachen.de (8.10.1/8.10.1/7) with SMTP id e9KAdwm19078
	for <gnu-bash-bug@moderators.isc.org>; Fri, 20 Oct 2000 12:39:59 +0200 (MET DST)
Received: by nets3.rz.rwth-aachen.de (SMI-8.6/SMI-SVR4)
	id MAA02212; Fri, 20 Oct 2000 12:39:58 +0200
To: gnu-bash-bug@moderators.isc.org
Path: klausf
From: klausf@informatik.rwth-aachen.de (Klaus Frank)
Newsgroups: gnu.bash.bug
Subject: Re: :(){ :|:&};: in bash causes systemchrash
Date: 20 Oct 2000 10:39:57 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 21
Message-ID: <8sp7dt$24v$1@nets3.rz.RWTH-Aachen.DE>
References: <E13lq9K-0004OK-00@fencepost.gnu.org>
NNTP-Posting-Host: matula.informatik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 972038397 2207 137.226.116.79 (20 Oct 2000 10:39:57 GMT)
X-Complaints-To: abuse@rwth-aachen.de
NNTP-Posting-Date: 20 Oct 2000 10:39:57 GMT
X-Newsreader: NN version 6.5.0 #3 (NOV)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

"mail@area51" <cnf@linuxfreak.com> writes:

>Description:
>	When :(){ :|:&};: is typed in a bash shell, the whole system hags BIG
>time

This isn't a system crash, it's intentional resource consumption.

Does the shell exhibit any errors in this situation? Is it exiting with
a "segmentation violation" message? Would you like to see a warning in
the documentation? Does a recursively constructed pipeline work without
errors if you limit the recursion depth and don't put it in the
background? (You might want to construct a pipeline of 16 cat processes.)

Off-Topic:

Would you like to see that a kernel detected this situation and
logged or prevented it? (There are similar situations that occur
accidentally.) If yes, how? Would it be acceptable to introduce delays
into the fork system call that depend exponentially on the number of
failed fork calls in the same session or process group?


From root@firestar.posix.co.za Fri Oct 20 16:14:56 2000
Received: from play2.posix.co.za ([160.124.48.3] helo=firestar.posix.co.za)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13miZ1-0006bV-00
	for <bug-bash@gnu.org>; Fri, 20 Oct 2000 16:14:52 -0400
Received: (from root@localhost)
	by firestar.posix.co.za (8.10.2/8.10.2) id e9KKssf14640;
	Fri, 20 Oct 2000 22:54:54 +0200
Date: Fri, 20 Oct 2000 22:54:54 +0200
Message-Id: <200010202054.e9KKssf14640@firestar.posix.co.za>
From: bs@posix.co.za
To: bug-bash@gnu.org
Subject: [Bash enhancement to "select"]
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=64  -I.  -I. -I./include -I./lib -I/usr/local/include -g -O2
uname output: Linux firestar 2.2.17 #3 Tue Sep 26 15:44:50 SAST 2000 i686 unknown
Machine Type: i686-pc-linux-gnu

Bash Version: 2.04
Patch Level: 0
Release Status: release

Description:
	[The 'select' function does not have a timeout. And the default
		behaviour of the [return] key is painfull in the sense
		that it just loops. The 'select' function is beautiful
		for selecting on data who's size and quantity you don't
		know - however if you have a default value - and want
		to choose *that* on a simple [Return] - you can't -
		you have to retype a selection. Painful. The 'READ'
		function now has some beautiful args - eg Timeout
		(-t xx) and Length (-n xx). It would be most ideal if
		'select' could use them too - after all 'select' does
		use the 'builtin-read' !!!! - and one more arg to change
		the behavior in which 'select' deals with just a [return]
		being pressed]

Repeat-By:
	[ 
		select fname in /tmp/*
		do
		  echo you picked $fname \($REPLY\)
		  break
		done
	]
	

Fix:
	[
     To fix the pain of "Return" - 

      execute_cmd.c - line 1825
      ****************
      repl_string = get_string_value ("REPLY");
      if (*repl_string == 0)
        {
        /* MJE * continue; */
        reply=0;
        return "";
        }
      ****************

      ie - change the 'continue' into a 'return "null string"'.  I'm not
      sure what 'Posix' states - but to get the old effect put the
      whole 'select' into a 'while' loop and 'continue' if '$REPLY'
      has a 'null' value.
      ================================================================
     
      To add a timeout in the 'select', we created a new shell variable
      'READTMOUT'... and fooled around with some appropiate values.

      builtins/read.def - line 143

      ****************
  /* *MJE* IF READTMOUT is unset, we use the default of "-1". */
  var = find_variable("READTMOUT");
  if (var && var->value) tmout = atoi(var->value);
  if (tmout < 1 || tmout > 10000000) /* ie - a stupid value */
        tmout = -1;             /* no timeout */
      ****************

     Yup - Ugly - but the shell scripting works beautifully...
	I know they are not proper context diffs - but only two small changes :-)

	All changes done by Mark J Elkins. <mje@posix.co.za>
	]


From root@firestar.posix.co.za Fri Oct 20 16:18:53 2000
Received: from play2.posix.co.za ([160.124.48.3] helo=firestar.posix.co.za)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13mict-0006d9-00
	for <bug-bash@gnu.org>; Fri, 20 Oct 2000 16:18:52 -0400
Received: (from root@localhost)
	by firestar.posix.co.za (8.10.2/8.10.2) id e9KKx1l14702;
	Fri, 20 Oct 2000 22:59:01 +0200
Date: Fri, 20 Oct 2000 22:59:01 +0200
Message-Id: <200010202059.e9KKx1l14702@firestar.posix.co.za>
From: bs@posix.co.za
To: bug-bash@gnu.org
Subject: [Follow up on 'printf']
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=64  -I.  -I. -I./include -I./lib -I/usr/local/include -g -O2
uname output: Linux firestar 2.2.17 #3 Tue Sep 26 15:44:50 SAST 2000 i686 unknown
Machine Type: i686-pc-linux-gnu

Bash Version: 2.04
Patch Level: 0
Release Status: release

Description:
	[Thanks for fixing the 'printf' bug re: Octal/Hex numbers]

Repeat-By:
	[#!/bin/bash
		printf "%d.%d.%d.%d" 0x01 0x02 0x03 0x04
	]

Fix:
	[Thank you :)]


From news@horn.hk.diyixian.com Sat Oct 21 07:24:52 2000
Received: from moderated.news.pipex.net ([158.43.192.79])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13mwlg-0003GS-00
	for <bug-bash@prep.ai.mit.edu>; Sat, 21 Oct 2000 07:24:52 -0400
Received: (qmail 2678 invoked by alias); 21 Oct 2000 11:24:50 -0000
Received: (qmail 2658 invoked from network); 21 Oct 2000 11:24:09 -0000
Received: from horn.hk.dyxnet.com (HELO horn.hk.diyixian.com) (202.134.64.11)
  by moderated.news.pipex.net with SMTP; 21 Oct 2000 11:24:09 -0000
Received: (from news@localhost)
	by horn.hk.diyixian.com (8.9.3+Sun/8.9.1) id TAA11357
	for gnu-bash-bug@moderators.isc.org; Sat, 21 Oct 2000 19:25:45 +0800 (HKT)
To: gnu-bash-bug@moderators.isc.org
Path: not-for-mail
From: HKHOST <dont@reply.com>
Newsgroups: gnu.bash.bug
Subject: ¨È¬w¤§¯T¦¨¤H¥æ¤Í­Ñ¼Ö³¡
Date: 21 Oct 2000 11:25:45 GMT
Organization: HKHOST.COM.HK
Lines: 57
Message-ID: <8srufp$lg4$19563@horn.hk.diyixian.com>
NNTP-Posting-Host: 202.65.197.113
X-Trace: horn.hk.diyixian.com 972127545 22020 202.65.197.113 (21 Oct 2000 11:25:45 GMT)
X-Complaints-To: abuse@dyxnet.com
NNTP-Posting-Date: 21 Oct 2000 11:25:45 GMT
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

¨È¬w¤§¯T¦¨¤H¥æ¤Í­Ñ¼Ö³¡

¥þ·s¦¨¤H©Êª©½×¾Â
http://www.asiawolf.com/wolfboard/

ºô¤W¯u¤HShow
http://www.asiawolf.com/realshow.asp

§K¶O¦¨¤H©Ê¬Û®w
http://www.asiawolf.com/freedownload

§¹¾ã¹q¼v§K¶O¤U¸ü
http://www.asiawolf.com/video

¨È¬w¦¨¤H·s²Õ²{¤w±Ò¥Î
news://news.asiawolf.com/asiawolf

¨È¬w¦¨¤H¯º¸Ü­Ñ¼Ö³¡²{¤w±Ò¥Î
http://www.asiawolf.com/joke

¨È¬w¦¨¤H¬G¨Æ­Ñ¼Ö³¡²{¤w±Ò¥Î
http://www.asiawolf.com/storynew

¨È¬w°½¿s¨«¥ú­Ñ¼Ö³¡²{¤w±Ò¥Î
http://www.asiawolf.com/stealbbs

¨È¬w¦¨¤H¢Ñ¢Õ­Ñ¼Ö³¡²{¤w±Ò¥Î
http://www.asiawolf.com/cg

«ÁÅ]µo¬ª­Ñ¼Ö³¡²{¤w±Ò¥Î
http://www.asiawolf.com/rgbook

¨È¬w¦W¬P¦X¦¨­Ñ¼Ö³¡²{¤w±Ò¥Î
http://www.asiawolf.com/merge

¨È¬w¦¨¤H¥æ¤Í¤¤¤ß­Ñ¼Ö³¡ -- ¯T¤§ºô
http://www.asiawolf.com
====================================
«Á¯T¤§ºô -- ¥þ¨È¬w³Ì¤jªº«ÁÅ]¸¨¸}³B

ºô¤W¼v°|¡A¨C¶g§ó·s
¤j¶q§¹¾ã¹q¼v¤U¸ü
¤j¶q¹Ï®w¤U¸ü
¬G¨Æ½s;µo¬ª½s;¦X¦¨½s;°½¿s½s
¤é¥»«ÁÅ]¶°¥þ®M¤W³õ
¤ä´©µo¬ªªA°È
¦¨¤H¥Î«~
¦¨¤H¶PÍü
©Êª©²á¤Ñ«Ç
¥þ¦Û§U¦¡ºô¯¸¡A¦Ñ¤Í«w©y¡I
§¹¥þ§K¶O¡AÀ³¦³ºÉ¦³....

¯T¤§ºô
http://www.asiawolf.com
¯T¤§¨¦
news://news.asiawolf.com/asiawolf
==========


From news@news2-win.server.ntlworld.com Sat Oct 21 14:02:02 2000
Received: from mailbox2.ucsd.edu ([132.239.1.54])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13n2y1-0007ZV-00
	for <bug-bash@prep.ai.mit.edu>; Sat, 21 Oct 2000 14:02:01 -0400
Received: from news2-win.server.ntlworld.com (news2c-win.server.ntlworld.com [62.253.162.104])
	by mailbox2.ucsd.edu (8.11.0/8.11.0) with ESMTP id e9LI4kl11055
	for <gnu-bash-bug@moderators.isc.org>; Sat, 21 Oct 2000 11:04:46 -0700 (PDT)
Received: (from news@localhost)
	by news2-win.server.ntlworld.com (8.8.8+Sun/8.8.8) id TAA10664;
	Sat, 21 Oct 2000 19:01:58 +0100 (BST)
To: gnu-bash-bug@moderators.isc.org
Path: ntlworld.com
From: pirate@ntlworld.com
Newsgroups: gnu.bash.bug
Subject: IMPORTANT- PLEASE ALL READ
Message-ID: <21100019.1524@ntlworld.com>
Organization: PIRATE records
Lines: 3
Date: Saturday, 21 Oct 2000 19:15:24 -0600
NNTP-Posting-Host: 62.252.240.156
X-Complaints-To: abuse@ntlworld.com
X-Trace: news2-win.server.ntlworld.com 972151318 62.252.240.156 (Sat, 21 Oct 2000 19:01:58 BST)
NNTP-Posting-Date: Sat, 21 Oct 2000 19:01:58 BST
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

IMPORTANT
VISIT THIS SITE FOR FULL DETAILS:
http://piraterecords.net


From news@typhoon4-0.nyroc.rr.com Sat Oct 21 16:05:25 2000
Received: from mr1.ash.ops.us.uu.net ([198.5.241.86])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13n4tQ-0000f5-00
	for <bug-bash@prep.ai.mit.edu>; Sat, 21 Oct 2000 16:05:24 -0400
Received: from mailout1-1.nyroc.rr.com by mr1.ash.ops.us.uu.net with ESMTP 
	(peer crosschecked as: mailout1-1.nyroc.rr.com [24.92.226.146])
	id QQjlxg04392
	for <gnu-bash-bug@moderators.isc.org>; Sat, 21 Oct 2000 20:05:14 GMT
Received: from typhoon4-0.nyroc.rr.com (typhoon4-0.nyroc.rr.com [24.92.226.114])
	by mailout1-1.nyroc.rr.com (8.9.3/8.9.3) with ESMTP id QAA22179
	for <gnu-bash-bug@moderators.isc.org>; Sat, 21 Oct 2000 16:01:50 -0400 (EDT)
Received: (from news@localhost)
	by typhoon4-0.nyroc.rr.com (8.8.8+Sun/8.8.8) id QAA28632;
	Sat, 21 Oct 2000 16:01:49 -0400 (EDT)
To: gnu-bash-bug@moderators.isc.org
Path: not-for-mail
From: "Gary Cona" <garycona@rochester.rr.nospam.com>
Newsgroups: gnu.bash.bug
Subject: Troublesome Arguments
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Message-ID: <NCmI5.64640$JS3.9247788@typhoon.nyroc.rr.com>
Date: Sat, 21 Oct 2000 20:01:49 GMT
NNTP-Posting-Host: 24.161.89.203
X-Complaints-To: abuse@rochester.rr.com
X-Trace: typhoon.nyroc.rr.com 972158509 24.161.89.203 (Sat, 21 Oct 2000 16:01:49 EDT)
NNTP-Posting-Date: Sat, 21 Oct 2000 16:01:49 EDT
Organization: Time Warner Road Runner - Rochester NY
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Does anyone have a clue as how to pass in a string such as 04 (zero-four)
and not have it truncated to 4 (four with no zero). Is it possible to pass
this into a script?


Thanks

Gary



From news@techftp.technion.ac.il Sun Oct 22 10:05:42 2000
Received: from techftp.technion.ac.il ([132.68.1.12])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13nLkk-0001MH-00
	for <gnu-bash-bug@prep.ai.mit.edu>; Sun, 22 Oct 2000 10:05:35 -0400
Received: by techftp.technion.ac.il (Postfix, from userid 5)
	id 830E0288F; Sun, 22 Oct 2000 16:06:19 +0200 (IST)
To: gnu-bash-bug@prep.ai.mit.edu
Path: not-for-mail
From: incognitto@dontmail.com
Newsgroups: gnu.bash.bug
Subject: Make money fast & easy - PROOVED!!!
Date: Sun, 22 Oct 2000 16:05:18 PDT
Organization: Gold Digger
Lines: 372
Message-ID: <8sus8r$2ch$578@techftp.technion.ac.il>
NNTP-Posting-Host: 132.69.227.52
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 
If you would like  to make at least $50,000 in less than 90 days! Please read the enclosed program... THEN READ IT AGAIN!!! 
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 

THIS IS A LEGITIMATE, LEGAL, MONEY MAKING 
OPPORTUNITY. 
It does not require you to come into contact with people, do any hard work, and best of all, you never have to leave the house 
except to get the mail.  If you believe that someday you'll get that big break that you've been waiting for, THIS IS IT!  Simply follow the instructions, and your dreams will come true.  This multi-level e-mail order marketing program works perfectly 100% EVERY 
TIME.  E-mail is the sales tool of the future.  Take advantage of this on-commercialized method of advertising NOW!!!  The 
longer you wait, the more people will be doing business using 
e-mail.  Get your piece of this action!!! 


P.S. Do you have any idea what 11,700 $5 bills ($58,000) look like piled up on a kitchen table?  IT'S AWESOME! 
                ***  
FOR ADDITIONAL TESTIMONIES AND INFO GO TO:

http://home.dencity.com/svarrog/20(1).html 
                ***
                      
A PERSONAL NOTE FROM THE ORIGINATOR OF THIS 
PROGRAM: 

By the time you have read the enclosed program and reports, 
you should have concluded that such a program, and one that is 
legal, could not have been created by an amateur. 
Let me tell you a little about myself.  I had a profitable business for 10 years.  Then in 1979 my business began falling off.  I was doing the same things that were previously successful for me, but it wasn't working.  Finally, I figured it out.  It wasn't me, it was the economy.  Inflation and recession had replaced the stable 
economy that had been with us since 1945.  I don't have to tell 
you what happened to the unemployment rate... because many 
of you know from first hand experience.  There were more failures and bankruptcies than ever before.The middle class was 
vanishing.  Those who knew what they were doinginvested 
wisely and moved up.  Those who did not, including those who 
never had anything to save or invest, were moving down into the 
ranks of the poor. 
  

As the saying goes, "THE RICH GET RICHER AND THE POOR 
GET POORER."  The traditional methods of making money will 
never allow you to "move up" or "get rich", inflation will see to that. You have just received information that can give you financial freedom for the rest of your life, with "NO RISK" and "JUST A LITTLE BIT OF EFFORT."  You can make more money in the 
next few months than you have ever imagined. I should also point out that I will not see a penny of this money, nor anyone else who has provided a testimonial for this program.  I have already 
made over 4 MILLION DOLLARS!  I have retired from the 
program after sending out over 16,000 programs.  Now I have 
several offices that make this and several other programs here 
and overseas.  Follow the program EXACTLY AS INSTRUCTED. Do not change it in any way.  It works exceedingly well as it is now.  Remember to e- mail a copy of this exciting report to everyone you can think of. One of the people you send this to may send out 50,000...and your name will be on everyone of them!  Remember though, the more you send out the more potential customers you will reach. 
  

So my friend, I have given you the ideas, information, materials and opportunity to become financially independent, IT IS UP TO 
YOU NOW! 

"THINK ABOUT IT" Before you delete this program from your mailbox, as I almost did,take a little time to read it and REALLY THINK ABOUT IT.  Get a pencil and figure out what could happen 
when YOU participate. Figure out the worst possible response 
and no matter how you calculate it, you will still make a lot of money!  You will definitely get back what you invested.  Any 
doubts you have will vanish when your first orders come in.  IT 
WORKS! 

Jody Jacobs, 
Richmond, 
VA 
  

HERE'S HOW THIS AMAZING PROGRAM WILL MAKE YOU 
THOUSANDS OF DOLLAR$ 

INSTRUCTIONS: 

Do not forget to cover money with sheet of untransperent paper to prevent thefts!!! 

Also do not forget to specify your e-mail in the letter with money so report can be e-mailed to you! 

This method of raising capital REALLY WORKS 100% EVERY 
TIME.  I am sure that you could use up to $50,000 or more in the next 90 days. 

Before you say "BULL... ", please read this program carefully. This is not a chain letter, but a perfectly legal money making 
opportunity.  Basically, this is what you do:  As with all multi-level businesses, we build our business by recruiting new partners and selling our products.  Every state in the USA allows you to recruit new multi-level business partners, and we offer a product for 
EVERY dollar sent.  YOUR ORDERS COME BY MAIL AND ARE FILLED BY E-MAIL, so you are not involved in personal selling.  You do it privately in your own home, store or office. 
This is the GREATEST Multi-Level Mail Order Marketing anywhere: This is what you MUST do: 
  

1.  Order all 4 reports shown on the list below (you can't sell them if you don't order them). 
    *  For each report, send $5.00 CASH, the NAME & NUMBER 
OF THE REPORT YOU ARE ORDERING, YOUR E-MAIL 
ADDRESS, and YOUR NAME & RETURN ADDRESS (in case 
of a problem) to the person whose name appears on the list next 
to the report, MAKE SURE YOUR RETURN ADDRESS IS ON 
YOUR ENVELOPE IN CASE OF ANY MAIL PROBLEMS! 
    *  When you place your order, make sure you order each of 
the four reports.  You will need all four reports so that you can save them on your computer and resell them. 
    *  Within a few days you will receive, via e-mail, each of the four 
reports. Save them on your computer so they will be accessible 
for you to send to the 1,000's of people who will order them from you. 

2.  IMPORTANT-- DO NOT alter the names of the people who 
are listed next to each report, or their sequence on the list, in any way other than is instructed below in steps "a" through "f" or you will lose out on the majority of your profits.  Once you understand the way this works, you'll also see how it doesn't work if you 
change it. Remember, this method has been tested, and if you 
alter it, it will not work. 
    a.  Look below for the listing of available reports. 
    b.  After you've ordered the four reports, take this 
advertisement and remove the name and address under 
REPORT #4. This person has made it through the cycle and is 
no doubt counting their $50,000! 
    c.  Move the name and address under REPORT #3 down to 
REPORT #4. 
    d.  Move the name and address under REPORT #2 down to 
REPORT #3. 
    e.  Move the name and address under REPORT #1 down to 
REPORT #2. 
    f.  Insert your name/address in the REPORT #1 position. 
Please make sure you copy every name and address 
ACCURATELY! 
  

3. Take this entire letter, including the modified list of names, and save it to your computer.  Make NO changes to the instruction 
portion of this letter. Your cost to participate in this is practically nothing (surely you can afford $20). You obviously already have 
an Internet connection and e-mail is FREE! 

There are two primary methods of building your downline: 

 STEP 0 - DOWNLOAD THE BEST PROGRAM for posting to newsgroups and sending e-mail called Netcontact: 

ftp://ftp.nsysu.edu.tw/cpatch/email/netcontact/nc6532.exe 
or here: 
ftp://ftp.cuhk.edu.hk/.1/chinese/cpatch/email/netcontact/nc6532.exe 

or if you want only to post to the newsgroups download older version: 

ftp://ftp.sunsite.org.uk/Mirrors/simtel.coast.net/coast/win95/internet/nc6016.exe 

ftp://ftp.unina.it/pub/Pcibm/winsite/win95/netutil/nc6016.exe 

ftp://ftp.rycon.co.uk/pub/web542dd/nc6016.exe 

Download newsgroups from your server and start posting to any quantity of newsgroups you want and also send e-mail. 

METHOD #1: SENDING BULK E-MAIL 
Let's say that you decide to start small, just to see how it goes, and we'll assume you and all those involved send out only 2,000 
programs each.  Let's also assume that the mailing receives a 
0.5% response.  Using a good list the response could be much 
better. Also, many people will send out hundreds of thousands of programs instead of 2,000.  But continuing with this example, you send out only 2,000 programs.  With a 0.5% response, that is only 10 orders for REPORT #1.  Those 10 people respond by 
sending out 2,000 programs each for a total of 20,000.  Out of 
those 0.5%, 100 people respond and order REPORT #2.  Those 
100 mail out 2,000 programs each for a total of 200,000.  The 0.5% response to that is 1,000 orders for REPORT #3.  Those 1,000 
send out 2,000 programs each for a 2,000,000 total.  The 0.5% 
response to that is 10,000 orders for REPORT #4.  That's 10,000 
$5 bills for you.  CASH!!!  Your total income in this example is $50 + $500 + $5,000 + $50,000 for a total of $55,550!!! 

REMEMBER FRIEND, THIS IS ASSUMING 1,990 OUT OF THE 
2,000 PEOPLE YOU MAIL TO WILL DO ABSOLUTELY 
NOTHING AND TRASH THIS PROGRAM! 

DARE TO THINK FOR A MOMENT WHAT WOULD HAPPEN IF 
EVERYONE, OR HALF SENT OUT 100,000 PROGRAMS 
INSTEAD OF 2,000.  Believe me, many people will do just that, 
and more!  By the way, your cost to participate in this is practically nothing.  You obviously already have an internet connection and 
e-mail is FREE!!! 

REPORT #2 will show you the best methods for bulk e-mailing, 
tell you where to obtain free bulk e-mail software and where to 
obtaine-mail lists. 

METHOD #2 - PLACING FREE ADS ON THE INTERNET 
Advertising on the 'Net is very, very inexpensive, and there are HUNDREDS of FREE places to advertise.  Let's say you decide 
to start small just to see how well it works. Assume your goal is to get ONLY 10 people to participate on your first level. (Placing a lot of FREE ads on the internet will EASILY get a larger 
response.) Also assume that everyone else in YOUR 
ORGANIZATION gets ONLY 10 downline members. Follow this example to achieve the STAGGERING results below. 
You can go to www,yahoo.com type there "classifieds" and then post this message to the list of classifieds you receive. 

1st level--your 10 members with 
$5......................................$50 
2nd level--10 members from those 10 ($5 x 100) ............$500 
3rd level--10 members from those 100 ($5 x 1,000). ......$5,000 
4th level--10 members from those 1,000 ($5 x 10,000)...$50,000 

                                    ------- THIS TOTALS 
----------------$55,550 

Remember friends, this assumes that the people who participate 
only recruit 10 people each.  Think for a moment what would 
happen if they got 20 people to participate!  Most people get 
100's of participants! THINK ABOUT IT! 

For every $5.00 you receive, all you must do is e-mail them the 
report they ordered.  THAT'S IT!  ALWAYS PROVIDE 
SAME-DAY SERVICE ON ALL ORDERS!  This will guarantee 
that the e-mail THEY send out, with YOUR name and address on 
it, will be prompt because they can't advertise until they receive the report! 

---------------------  AVAILABLE  REPORTS  -------------------------- ****** Order Each REPORT by NUMBER and NAME ****** 

Notes: 
-  ALWAYS SEND $5 CASH (U.S. CURRENCY) FOR EACH 
REPORT 
CHECKS NOT ACCEPTED 
-  ALWAYS SEND YOUR ORDER VIA FIRST CLASS MAIL 
-  Make sure the cash is concealed by wrapping it in at least two sheets of paper - 
On one of those sheets of paper, include: 
      (a) the number & name of the report you are ordering 
      (b) your e-mail address 
      (c) your name & postal address. 

PLACE YOUR ORDER FOR THESE REPORTS NOW: 
-------------------------------------------------------------------------------------- 
  

REPORT #1 
"The Insider's Guide to Advertising for Free on the Internet" 

ORDER REPORT #1 FROM: 

Serafima Zouev 
Haim 15 street 
Haifa 33144 
Israel 
e-mail: svarog@mypad.com
_____________________________________________________ 
_ 
REPORT #2 
"The Insider's Guide to Sending Bulk E-mail on the Internet" 

ORDER REPORT #2 FROM: 
Eric Stone 
2212 Sandpiper Ct. N. 
West Lafayette, IN 47906 
UNITED STATES 
_________________________________________ 
_ 
REPORT #3 
"The Secrets to Multilevel Marketing on the Internet" 

ORDER REPORT #3 FROM: 
Peter Nicolic 
22 Forest Drive West 
Leytonstone 
London E11 1LA 
ENGLAND 
_____________________________________________________ 

REPORT #4 
"How to become a Millionaire utilizing the Power of Multilevel Marketing and the Internet" 

ORDER REPORT #4 FROM: 
Smith Lee 
65 Forest Manor Rd. #301 
North York, ON M2J 1M5 
CANADA 
  

About 50,000 new people get online every month! 

******* TIPS FOR SUCCESS ******* 

*  TREAT THIS AS YOUR BUSINESS!  Be prompt, professional, 
and follow the directions accurately. 
*  Send for the four reports IMMEDIATELY so you will have them 
when the orders start coming in because: When you receive a $5 
order, you MUST send out the requested product/report. 
*  ALWAYS PROVIDE *SAME-DAY* SERVICE ON THE 
ORDERS YOU RECEIVE. 
*  Be patient and persistent with this program. If you follow the instructions exactly, your results WILL BE SUCCESSFUL! 
*  ABOVE ALL, HAVE FAITH IN YOURSELF AND KNOW YOU 
WILL SUCCEED! 

******* YOUR SUCCESS GUIDELINES ******* 

Follow these guidelines to guarantee your success: 

If you don't receive 20 orders for REPORT #1 within two weeks, 
continue advertising or sending e-mails until you do. 

Then, a couple of weeks later you should receive at least 100 
orders for REPORT#2. If you don't, continue advertising or 
sending e-mails until you do. 

Once you have received 100 or more orders for REPORT #2, 
YOU CAN RELAX, because the system is already working for 
you, and the cash will continue to roll in! 
  

THIS IS IMPORTANT TO REMEMBER: 

Every time your name is moved down on the list, you are placed 
in front of a DIFFERENTreport. You can KEEP TRACK of your 
PROGRESS by watching which report people are ordering from 
you. If you want to generate more income, send another batch of 
e-mails or continue placing ads and start the whole process 
again! There is no limit to the income you will generate from this business! 

Before you make your decision as to whether or not you 
participate in this program. Please answer one question. 

DO YOU WANT TO CHANGE YOUR LIFE? 

If the answer is yes, please look at the following facts about this program: 

1. YOU ARE SELLING A PRODUCT WHICH DOES NOT COST 
ANYTHING TO PRODUCE! 

2. YOU ARE SELLING A PRODUCT WHICH DOES NOT COST 
ANYTHING TO SHIP! 

3. YOU ARE SELLING A PRODUCT WHICH DOES NOT COST 
YOU ANYTHING TO ADVERTISE! 

4. YOU ARE UTILIZING THE POWER OF THE INTERNET AND 
THE POWER OF MULTI-LEVEL MARKETING TO DISTRIBUTE 
YOUR PRODUCT ALL OVER THE WORLD! 

5. YOUR ONLY EXPENSES OTHER THAN YOUR INITIAL $20 
INVESTMENT IS YOUR TIME! 

6. VIRTUALLY ALL OF THE INCOME YOU GENERATE FROM 
THIS PROGRAM IS PURE PROFIT! 

7. THIS PROGRAM WILL CHANGE YOUR LIFE FOREVER. 
  

******* T  E  S  T  I  M  O  N  I  A  L  S ******* 
This program does work, but you must follow it EXACTLY! 
Especially the rule of not trying to place your name in a different position, it won't work and you'll lose a lot of potential income.  I'm living proof that it works. It really is a great opportunity to make relatively easy money, with little cost to you.  If you do choose to participate, follow the program exactly, and you'll be on your way to financial security. 
                    Steven Bardfield, Portland, OR 

My name is Mitchell. My wife, Jody, and I live in Chicago, IL. I am a cost accountant with a major U.S. Corporation and I make pretty good money. When I received the program I grumbled to Jody about 
receiving "junk mail." I made fun of the whole thing, 
spouting my knowledge of the population and percentages 
involved.  I "knew" it wouldn't work. Jody totally ignored my supposed intelligence and jumped in with both feet. I made 
merciless fun of her, and was ready to lay the old "I told you so" on her when the thing didn't work... Well, the laugh was on me! 
Within two weeks she had received over 50 responses. Within 45 
days she had received over $147,200 in $5 bills!  I was shocked! I was sure that I had it all figured and that it wouldn't work. I AM a believer now. I have joined Jody in her "hobby."  I did have seven more years until retirement, but I think of the "rat race" and it's not for me. We owe it all to MLM. 

                    Mitchell Wolf MD., Chicago, IL 

ADDENDUM: 

Due to the possibility of lost / stolen mail or due to the possibility a report provider being deluged with requests and is having 
difficulty keeping up with the requests, if you send for your reports and do not receive one of them within 1 week send another letter to the report provider. Include in the letter: 
1. The REPORT # and the report name 
2. The date you mailed your request 
3. Your e-mail and postal mail address 
4. Double-type (and verify) your e-mail address 
4. Mention you have not received the report yet  DO NOT 
INCLUDE ANOTHER $5 

If you still do not receive your report within another week, send a letter to the next name on the list explaining the difficulty you are having with the report provider. That person will make a 
judgement based upon any other problems they have heard of 
with the report provider and make a determination to send you 
the report free of charge. 

In turn, once you have all of the reports and have received a 
request from someone experiencing problems with a report 
provider, you should make a judgement based upon the number 
of problems reported against a particular report provider and 
attempt to contact the report provider yourself and then consider sending the report free of charge.  For this program to work, every person that sends the $5 for each of the 4 reports must have all 4 reports. So it is in your best interests (for your down-line to 
progress correctly) they obtain the reports. 
  
  
  
  
  
  
  
  
  













From eminderlein@netclub.de Sun Oct 22 14:58:53 2000
Received: from pink.ma.choin.net ([194.64.24.3])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13nQKa-0004rY-00
	for <bug-bash@gnu.org>; Sun, 22 Oct 2000 14:58:52 -0400
Received: from alex.locoware.de (Md@pC19F05D1.dip0.t-ipconnect.de [193.159.5.209])
	by pink.ma.choin.net (8.9.3/8.9.3) with ESMTP id UAA97501
	for <bug-bash@gnu.org>; Sun, 22 Oct 2000 20:58:48 +0200 (CEST)
	(envelope-from eminderlein@netclub.de)
Message-ID: <XFMail.001022205521.eminderlein@netclub.de>
X-Mailer: XFMail 1.3 [p0] on Linux
X-Priority: 3 (Normal)
Content-Type: text/plain; charset=us-ascii
MIME-Version: 1.0
Date: Sun, 22 Oct 2000 20:58:44 +0200 (MEST)
From: eminderlein@netclub.de
To: bug-bash@gnu.org
Subject: read from characterdevice /dev/isdninfo
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by pink.ma.choin.net id UAA97501
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM=3D'bash' -DCONF_HOSTTYPE=3D'i686'
-DCONF_OSTYPE=3D'linux-gnu' -DCONF_MACHTYPE=3D'i686-pc-linux-gnu' -DCO
NF_VENDOR=3D'pc' -DSHELL -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=3D64  -I.=20
-I. -I./lib -I/usr/include -O2 -pipe
uname output: Linux alex 2.2.10 #15 Mit Jul 12 16:11:22 MEST 2000 i686
unknown
Machine Type: i686-pc-linux-gnu

Bash Version: 2.03
Patch Level: 0
Release Status: release

Description:
        [Detailed description of the problem, suggestion, or complaint.]

running on SuSE Dist 6.2
try to run a script "isdn_pruefen2"(=3Disdn_up_test)

it shall read every second or on every dial/hangup request on
/dev/isdninfo and evaluate the strings and =20
give shell level information, if ISDN is up or it is to initiate a dial
or hangup process, also for cost sharing, how many are=20
online
(reason : isdnctrl status is not clear about the connection being
established)

see also man isdninfo=20
quote************************
DESCRIPTION
       /dev/isdninfo  is  a character device with major number 45
       and minor number 255.  It delivers status information from
       the Linux ISDN subsystem to user level.

DATA FORMAT
       When  reading  from this device, the current status of the
       Linux ISDN subsystem is delivered in 6 lines of text. Each
       line  starts  with  a  tag  string followed by a colon and
       whitespace. After that the status values are appended sep
       arated by whitespace.

BLOCKING BEHAVIOUR
       After opening the device, at most 6 lines can be read by a
       user  process.   After  that, the user process is blocked.
       Whenever a status change happens, the process  is  allowed
       to read 6 more lines, starting with line one.
unquote**********************

The script works with regular files,=20
cp /dev/isdninfo {to_other_file} works as well,=20
also this creates a mess copying /dev/isdninfo with cat or cp, then=20
killing the cp or cat into {to_other_file} process before and then
evaluating the {to_other_file} with read

I hate to start with C or c++ for such a small input, I feel it shall
be solved in the bash=20
I have the book "Learning the bash shell", it does not answer clearly to
this point.

   This is my little script:=20
quote =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
#! /bin/bash

case  $1 in
    "")
        echo "usage : $0 {Inputfile}"
        exit 1
        ;;
    *)


PS4=3D'$0 line $LINENO: '

declare -i za=3D0 zl=3D0
declare -a TAG
declare -a ISDNSTATOUTS

#set -o verbose
#set -o xtrace

Eingabe=3D$1 # (=3D/dev/isdninfo)

zl=3D0
while true ; do
za=3D0
while read TAG[$za] ISDNSTATOUTS[$za] ; do
fehlercode=3D$?
set -o verbose ; set -o xtrace
echo fehlercode $fehlercode ;
echo TAG ${TAG[$za]}
echo ISDNSTAT ${ISDNSTATOUTS[$za]}
za=3D$za+1
done < $Eingabe
#done < isdninfo_sequenz

za=3D0

while [ $(( $za< 6 )) =3D 1 ]; do
echo  za $za ;
echo TAG ${TAG[$za]}
echo ISDNSTAT ${ISDNSTATOUTS[$za]}
za=3D$za+1
done
zl=3D$zl+1
echo $zl

sleep 2

done
;;

esac
# end of isdn_pruefen2
unquote =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

script works well with regular files, but line =20
while read TAG[$za] ISDNSTATOUTS[$za] ; do
exits with exitcode 1 immediately, if the file is a symlink to or the
characterdevice /dev/isdninfo itself=20

I did not succeed to work with file descriptors, although this might be
the solution.
PROBLEM
I did not find a clear description whether read by default can or
cannot input from character devices(ro)
QUESTION
How can I read from a character device like the above without leaving
the bash
shell level?=20

Repeat-By:=20
run above script between the quotes with your equipment with an ISDN
device
        [Describe the sequence of events that causes the problem
        to occur.]

Fix: none
        [Description of how to fix the problem.  If you don't know a
        fix for the problem, don't include this section.]


thanks=20

with the best regards
mit freundlichen Gr=FCssen

Erich Minderlein

----------------------------------
E-Mail: eminderlein@netclub.de
E-Mail: eminderlein@locoware.de
www.locoware.de

Date: 22-Oct-00
Time: 20:35:23

This message was sent by XFMail
an ascii mailing ware
Please don't send HTML mail, we don't read all the <>
----------------------------------
quote from
 **************************************************
    "On the side of the box, under 'System
   Requirements', it said 'Requires Windows
        95 or better'. So I installed Linux."
 **************************************************
----------------------------------


From masse@tower.fukt.hk-r.se Sun Oct 22 17:08:14 2000
Received: from nigol.fukt.hk-r.se ([194.47.143.3])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13nSLm-0006Zv-00
	for <bug-bash@prep.ai.mit.edu>; Sun, 22 Oct 2000 17:08:14 -0400
Received: from tower.fukt.hk-r.se (root@tower.fukt.hk-r.se [194.47.143.2])
	by nigol.fukt.hk-r.se (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id XAA10945
	for <bug-bash@prep.ai.mit.edu>; Sun, 22 Oct 2000 23:08:05 +0200
Received: (from masse@localhost)
	by tower.fukt.hk-r.se (8.9.3/8.9.3/Debian/GNU) id XAA01520
	for bug-bash@prep.ai.mit.edu; Sun, 22 Oct 2000 23:08:04 +0200
Date: Sun, 22 Oct 2000 23:08:04 +0200
Message-Id: <200010222108.XAA01520@tower.fukt.hk-r.se>
From: masse@fukt.hk-r.se
To: bug-bash@prep.ai.mit.edu
Subject: Failed to login.
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DHOSTTYPE='i486' -DOSTYPE='linux-gnu' -DMACHTYPE='i486-pc-linux-gnu' -DSHELL -DHAVE_CONFIG_H   -I. -I. -I./lib -g
uname output: Linux tower 2.2.17 #1 SMP Sat Jul 1 15:48:23 CEST 2000 i686 unknown
Machine Type: i486-pc-linux-gnu

Bash Version: 2.01
Patch Level: 1
Release Status: release

Description:

+----
| ratatosk:~$ ssh tower
| masse@tower.fukt.hk-r.se's password: 
| Last login: Sat Oct 21 20:07:10 2000 from ratatosk.fukt.hk-r.se
| Linux tower 2.2.17 #1 SMP Sat Jul 1 15:48:23 CEST 2000 i686 unknown
| 
| Copyright (C) 1993-1999 Software in the Public Interest, and others
| 
| Most of the programs included with the Debian GNU/Linux system are
| freely redistributable; the exact distribution terms for each program
| are described in the individual files in /usr/doc/*/copyright
| 
| Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
| permitted by applicable law.
| 
| You have new mail.
| p -> mh_magic4 == 0x55555555
| Report this to bash-maintainers@prep.ai.mit.edu
| Stopping myself...Received disconnect: Command terminated on signal 6.
| ratatosk:~$
+----

Repeat-By:
	Non repeatable.

Fix:



From chet@granite.ins.cwru.edu Mon Oct 23 10:00:06 2000
Received: from granite.ins.cwru.edu ([129.22.8.228])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13ni8z-0006Zl-00
	for <bug-bash@prep.ai.mit.edu>; Mon, 23 Oct 2000 10:00:05 -0400
Received: (chet@localhost) by granite.INS.CWRU.Edu (8.8.8+cwru/CWRU-2.5-bsdi)
	id KAA21277; Mon, 23 Oct 2000 10:00:03 -0400 (EDT) (from chet)
Message-Id: <200010231400.KAA21277@granite.INS.CWRU.Edu>
Date: Mon, 23 Oct 2000 10:00:03 -0400 (EDT)
From: chet@po.cwru.edu (Chet Ramey)
To: bug-bash@prep.ai.mit.edu
Subject: BASH Frequently-Asked Questions (FAQ version 3.9)
Reply-To: chet@po.cwru.edu
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Archive-name: unix-faq/shell/bash
Posting-Frequency: monthly
Submitted-By: chet@po.cwru.edu (Chet Ramey)
Last-Modified: Thu May 18 13:08:48 EDT 2000
FAQ-Version: 3.9
Bash-Version: 2.04
URL: ftp://ftp.cwru.edu/pub/bash/FAQ
Maintainer: chet@po.cwru.edu (Chet Ramey)

This is the Bash FAQ, version 3.9, for Bash version 2.04.

This document contains a set of frequently-asked questions concerning
Bash, the GNU Bourne-Again Shell.  Bash is a freely-available command
interpreter with advanced features for both interactive use and shell
programming.

Another good source of basic information about shells is the collection
of FAQ articles periodically posted to comp.unix.shell.

Questions and comments concerning this document should be sent to
chet@po.cwru.edu.

This document is available for anonymous FTP with the URL

ftp://ftp.cwru.edu/pub/bash/FAQ

The Bash home page is http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html

----------
Contents:

Section A:  The Basics

A1) What is it?
A2) What's the latest version?
A3) Where can I get it?
A4) On what machines will bash run?
A5) Will bash run on operating systems other than Unix?
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'?
A10) What is the bash `posix mode'?

Section B:  The latest version

B1) What's new in version 2.04?
B2) Are there any user-visible incompatibilities between bash-2.04 and
    bash-1.14.7?

Section C:  Differences from other Unix shells

C1) How does bash differ from sh, the Bourne shell?
C2) How does bash differ from the Korn shell, version ksh88?
C3) Which new features in ksh-93 are not in bash, and which are?

Section D:  Why does bash do some things differently than other Unix shells?

D1) Why does bash run a different version of `command' than
    `which command' says it will?
D2) Why doesn't bash treat brace expansions exactly like csh?
D3) Why doesn't bash have csh variable modifiers?
D4) How can I make my csh aliases work when I convert to bash?
D5) How can I pipe standard output and standard error from one command to
    another, like csh does with `|&'?
D6) Now that I've converted from ksh to bash, are there equivalents to
    ksh features like autoloaded functions and the `whence' command?

Section E:  Why does bash do certain things the way it does?

E1) Why is the bash builtin `test' slightly different from /bin/test?
E2) Why does bash sometimes say `Broken pipe'?
E3) When I have terminal escape sequences in my prompt, why does bash
    wrap lines at the wrong column?
E4) If I pipe the output of a command into `read variable', why doesn't
    the output show up in $variable when the read command finishes?
E5) I have a bunch of shell scripts that use backslash-escaped characters
    in arguments to `echo'.  Bash doesn't interpret these characters.  Why
    not, and how can I make it understand them?
E6) Why doesn't a while or for loop get suspended when I type ^Z?
E7) What about empty for loops in Makefiles?
E8) Why does the arithmetic evaluation code complain about `08'?

Section F:  Things to watch out for on certain Unix versions

F1) Why can't I use command line editing in my `cmdtool'?
F2) I built bash on Solaris 2.  Why do globbing expansions and filename
    completion chop off the first few characters of each filename?
F3) Why does bash dump core after I interrupt username completion or
    `~user' tilde expansion on a machine running NIS?
F4) I'm running SVR4.2.  Why is the line erased every time I type `@'?
F5) Why does bash report syntax errors when my C News scripts use a
    redirection before a subshell command?
F6) Why can't I use vi-mode editing on Red Hat Linux 6.1?

Section G:  How can I get bash to do certain common things?

G1) How can I get bash to read and display eight-bit characters?
G2) How do I write a function `x' to replace builtin command `x', but
    still invoke the command from within the function?
G3) How can I find the value of a shell variable whose name is the value
    of another shell variable?
G4) How can I make the bash `time' reserved word print timing output that
    looks like the output from my system's /usr/bin/time?
G5) How do I get the current directory into my prompt?
G6) How can I rename "*.foo" to "*.bar"?
G7) How can I translate a filename from uppercase to lowercase?
G8) How can I write a filename expansion (globbing) pattern that will match
    all files in the current directory except "." and ".."?

Section H:  Where do I go from here?

H1) How do I report bugs in bash, and where should I look for fixes and
    advice?
H2) What kind of bash documentation is there?
H3) What's coming in future versions?
H4) What's on the bash `wish list'?
H5) When will the next release appear?

----------
Section A:  The Basics

A1)  What is it?

Bash is a Unix command interpreter (shell).  It is an implementation of
the Posix 1003.2 shell standard, and resembles the Korn and System V
shells.

Bash contains a number of enhancements over those shells, both
for interactive use and shell programming.  Features geared
toward interactive use include command line editing, command
history, job control, aliases, and prompt expansion.  Programming
features include additional variable expansions, shell
arithmetic, and a number of variables and options to control
shell behavior.

Bash was originally written by Brian Fox of the Free Software
Foundation.  The current developer and maintainer is Chet Ramey
of Case Western Reserve University.

A2)  What's the latest version?

The latest version is 2.04, first made available on Friday, 17 March 2000.

A3)  Where can I get it?

Bash is the GNU project's shell, and so is available from the
master GNU archive site, ftp.gnu.org, and its mirrors.  The
latest version is also available for FTP from ftp.cwru.edu.
The following URLs tell how to get version 2.04:

ftp://ftp.gnu.org/pub/gnu/bash/bash-2.04.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-2.04.tar.gz

Formatted versions of the documentation are available with the URLs:

ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-2.04.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-2.04.tar.gz

A4)  On what machines will bash run?

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
itself accordingly, using a script created by GNU autoconf.

More information appears in the file `INSTALL' in the distribution.

A5) Will bash run on operating systems other than Unix?

Configuration specifics for Unix-like systems such as QNX and
LynxOS are included in the distribution.  Bash-2.04 should 
compile and run on Minix 2.0 (patches were contributed), but I
don't believe anyone has built bash-2.x on earlier Minix versions
yet.

Bash has been ported to versions of Windows implementing the Win32
programming interface.  This includes Windows 95 and Windows NT.
The port was done by Cygnus Solutions as part of their CYGWIN
project.  For more information about the project, look at the URL

http:/sourceware.cygnus.com/cygwin

Cygnus originally ported bash-1.14.7, and that port was part of their
early GNU-Win32 (the original name) releases.  Cygnus has also done a
port of bash-2.02.1 to the CYGWIN environment, and it is available as
part of their current release.  (They may have upgraded by now.)

Bash-2.04 should require no local Cygnus changes to build and run under
CYGWIN.

The Cygnus port works only on Intel machines.  There is a port of bash
(I don't know which version) to the alpha/NT environment available from

ftp://ftp.gnustep.org//pub/win32/bash-alpha-nt-1.01.tar.gz

Softway Systems has ported bash-2.01 to their Interix (nee OpenNT)
system, a Unix subsystem for NT that replaces the Microsoft POSIX
subsystem.  Check out http://www.interix.com for more information.
Some support for Interix has been incorporated into bash, beginning
with Bash-2.03.  It should be easier to build bash on Interix now,
but Interix users should fetch

ftp://ftp.interix.com/pub/tw/unsup/bash.diffs.tar.gz

and read the README.OpenNT file in that archive.  It will detail the
arguments `configure' needs to build on Interix.  A configure cache
file for Interix is in the bash distribution in cross-build/opennt.cache;
copy that to `config.cache' before starting configure.

DJ Delorie has a port of bash-1.14.7 which runs under MS-DOS, as part
of the DJGPP project.  For more information on the project, see

http://www.delorie.com/djgpp/

I have been told that the original DJGPP port was done by Daisuke Aoyama.

I picked up a binary of bash-1.14.7 that is purported to work with
the DJGPP V2 environment from

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147b.zip

The corresponding source is

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147s.zip

Mark Elbrecht <snowball3@bigfoot.com> has sent me notice that bash-2.03
has become available for DJGPP V2.  The files are available as:

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203b.zip	binary
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203d.zip	documentation
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203s.zip	source

Mark has begun to work with bash-2.04.

Ports of bash-1.12 and bash-2.0 are available for OS/2 from

ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash_112.zip
ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash-2.0(253).zip

I haven't looked at either, but the second appears to be a binary-only
distribution.  Beware.

I have received word that Bash (I'm not sure which version, but I
believe that it's at least bash-2.02.1) is the standard shell on
BeOS.

A6) How can I build bash with gcc? 

Bash configures to use gcc by default if it is available.  Read the
file INSTALL in the distribution for more information.

A7)  How can I make bash my login shell?

Some machines let you use `chsh' to change your login shell.  Other
systems use `passwd -s' or `passwd -e'.  If one of these works for
you, that's all you need.  Note that many systems require the full
pathname to a shell to appear in /etc/shells before you can make it
your login shell.  For this, you may need the assistance of your
friendly local system administrator. 

If you cannot do this, you can still use bash as your login shell, but
you need to perform some tricks.  The basic idea is to add a command
to your login shell's startup file to replace your login shell with
bash.

For example, if your login shell is csh or tcsh, and you have installed
bash in /usr/gnu/bin/bash, add the following line to ~/.login:

	if ( -f /usr/gnu/bin/bash ) exec /usr/gnu/bin/bash --login

(the `--login' tells bash that it is a login shell).

It's not a good idea to put this command into ~/.cshrc, because every
csh you run without the `-f' option, even ones started to run csh scripts,
reads that file.  If you must put the command in ~/.cshrc, use something
like

	if ( $?prompt ) exec /usr/gnu/bin/bash --login

to ensure that bash is exec'd only when the csh is interactive.

If your login shell is sh or ksh, you have to do two things.

First, create an empty file in your home directory named `.bash_profile'.
The existence of this file will prevent the exec'd bash from trying to
read ~/.profile, and re-execing itself over and over again.  ~/.bash_profile
is the first file bash tries to read initialization commands from when
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

This will cause login shells to replace themselves with bash running as
a login shell.  Once you have this working, you can copy your initialization
code from ~/.profile to ~/.bash_profile.

I have received word that the recipe supplied above is insufficient for
machines running CDE.  CDE has a maze of twisty little startup files, all
slightly different.

If you cannot change your login shell in the password file to bash, you
will have to (apparently) live with CDE using the shell in the password
file to run its startup scripts.  If you have changed your shell to bash,
there is code in the CDE startup files (on Solaris, at least) to do the
right thing. 

`dtterm' claims to use $SHELL as the default program to start, so if you
can change $SHELL in the CDE startup files, you should be able to use bash
in your terminal windows.

Setting DTSOURCEPROFILE in ~/.dtprofile will cause the `Xsession' program
to read your login shell's startup files.  You may be able to use bash for
the rest of the CDE programs by setting SHELL to bash in ~/.dtprofile as
well, but I have not tried this.

You can use the above `exec' recipe to start bash when not logging in with
CDE by testing the value of the DT variable:

	if [ -n "$DT" ]; then
	        [ -f /usr/gnu/bin/bash ] && exec /usr/gnu/bin/bash --login
	fi


A8) I just changed my login shell to bash, and now I can't FTP into my
   machine.  Why not?

You must add the full pathname to bash to the file /etc/shells.  As
noted in the answer to the previous question, many systems require
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'?

POSIX is a name originally coined by Richard Stallman for a
family of open system standards based on UNIX.  There are a
number of aspects of UNIX under consideration for
standardization, from the basic system services at the system
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. 

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 `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
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
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.

A10)  What is the bash `posix mode'?

Although bash is an implementation of the POSIX.2 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. 

Posix mode is entered by starting bash with the --posix option or
executing `set -o posix' after bash is running.

The specific aspects of bash which change when posix mode is
active are listed in the file CWRU/POSIX.NOTES in the bash
distribution.  They are also listed in a section in the Bash
Reference Manual.

Section B:  The latest version

B1) What's new in version 2.04?

Bash-2.04 contains the following new features (see the manual page for
complete descriptions and the CHANGES and NEWS files in the bash-2.04
distribution):

o Programmable word completion with the new `complete' and `compgen' builtins;
  examples are provided in examples/complete/complete-examples
o `history' has a new `-d' option to delete a history entry
o `bind' has a new `-x' option to bind key sequences to shell commands
o The prompt expansion code has new `\j' and `\l' escape sequences
o The `no_empty_cmd_completion' shell option, if enabled, inhibits
  command completion when TAB is typed on an empty line
o `help' has a new `-s' option to print a usage synopsis
o New arithmetic operators: var++, var--, ++var, --var, expr1,expr2 (comma)
o New ksh93-style arithmetic for command:
	for ((expr1 ; expr2; expr3 )); do list; done
o `read' has new options: `-t', `-n', `-d', `-s'
o The redirection code handles several filenames specially:  /dev/fd/N,
  /dev/stdin, /dev/stdout, /dev/stderr
o The redirection code now recognizes /dev/tcp/HOST/PORT and
  /dev/udp/HOST/PORT and tries to open a TCP or UDP socket, respectively,
  to the specified port on the specified host
o The ${!prefix*} expansion has been implemented
o A new FUNCNAME variable, which expands to the name of a currently-executing
  function
o The GROUPS variable is no longer readonly
o A new shopt `xpg_echo' variable, to control the behavior of echo with
  respect to backslash-escape sequences at runtime
o The NON_INTERACTIVE_LOGIN_SHELLS #define has returned

The version of Readline released with Bash-2.04, Readline-4.1, has several
new features as well:

o Parentheses matching is always compiled into readline, and controllable
  with the new `blink-matching-paren' variable
o The history-search-forward and history-search-backward functions now leave
  point at the end of the line when the search string is empty, like
  reverse-search-history, and forward-search-history
o A new function for applications:  rl_on_new_line_with_prompt()
o New variables for applications:  rl_already_prompted, and rl_gnu_readline_p


A short feature history dating from bash-2.0:

Bash-2.03 had very few new features, in keeping with the convention
that odd-numbered releases provide mainly bug fixes.  A number of new
features were added to Readline, mostly at the request of the Cygnus
folks.

A new shopt option, `restricted_shell', so that startup files can test
	whether or not the shell was started in restricted mode
Filename generation is now performed on the words between ( and ) in
	compound array assignments (this is really a bug fix)
OLDPWD is now auto-exported, as POSIX.2 requires
ENV and BASH_ENV are read-only variables in a restricted shell
Bash may now be linked against an already-installed Readline library,
	as long as the Readline library is version 4 or newer
All shells begun with the `--login' option will source the login shell
	startup files, even if the shell is not interactive

There were lots of changes to the version of the Readline library released
along with Bash-2.03.  For a complete list of the changes, read the file
CHANGES in the Bash-2.03 distribution.

Bash-2.02 contained the following new features:

a new version of malloc (based on the old GNU malloc code in previous
	bash versions) that is more page-oriented, more conservative
	with memory usage, does not `orphan' large blocks when they
	are freed, is usable on 64-bit machines, and has allocation
	checking turned on unconditionally
POSIX.2-style globbing character classes ([:alpha:], [:alnum:], etc.)
POSIX.2-style globbing equivalence classes
POSIX.2-style globbing collating symbols
the ksh [[...]] extended conditional command
the ksh egrep-style extended pattern matching operators
a new `printf' builtin
the ksh-like $(<filename) command substitution, which is equivalent to
	$(cat filename)
new tilde prefixes that expand to directories from the directory stack
new `**' arithmetic operator to do exponentiation
case-insensitive globbing (filename expansion)
menu completion a la tcsh
`magic-space' history expansion function like tcsh
the readline inputrc `language' has a new file inclusion directive ($include)

Bash-2.01 contained only a few new features:

new `GROUPS' builtin array variable containing the user's group list
new bindable readline commands: history-and-alias-expand-line and
	alias-expand-line

Bash-2.0 contained extensive changes and new features from bash-1.14.7.
Here's a short list:

new `time' reserved word to time pipelines, shell builtins, and
	shell functions
one-dimensional arrays with a new compound assignment statement,
        appropriate expansion constructs and modifications to some
	of the builtins (read, declare, etc.) to use them
new quoting syntaxes for ANSI-C string expansion and locale-specific
	string translation
new expansions to do substring extraction, pattern replacement, and
	indirect variable expansion
new builtins: `disown' and `shopt'
new variables: HISTIGNORE, SHELLOPTS, PIPESTATUS, DIRSTACK, GLOBIGNORE,
	       MACHTYPE, BASH_VERSINFO
special handling of many unused or redundant variables removed
	(e.g., $notify, $glob_dot_filenames, $no_exit_on_failed_exec)
dynamic loading of new builtin commands; many loadable examples provided
new prompt expansions: \a, \e, \n, \H, \T, \@, \v, \V
history and aliases available in shell scripts
new readline variables: enable-keypad, mark-directories, input-meta,
	visible-stats, disable-completion, comment-begin
new readline commands to manipulate the mark and operate on the region
new readline emacs mode commands and bindings for ksh-88 compatibility
updated and extended builtins
new DEBUG trap
expanded (and now documented) restricted shell mode

implementation stuff:	
autoconf-based configuration
nearly all of the bugs reported since version 1.14 have been fixed
most builtins converted to use builtin `getopt' for consistency
most builtins use -p option to display output in a reusable form
	(for consistency)
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.04 and
    bash-1.14.7?

There are a few incompatibilities between version 1.14.7 and version 2.04.
They are detailed in the file COMPAT in the bash-2.04 distribution.

Section C:  Differences from other Unix shells

C1) How does bash differ from sh, the Bourne shell?

This is a non-comprehensive list of features that differentiate bash
from the SVR4.2 shell.  The bash manual page explains these more
completely.

Things bash has that sh does not:
	long invocation options
	`!' reserved word to invert pipeline return value
	`time' reserved word to time pipelines and shell builtins
	the `function' reserved word
	the `select' compound command and reserved word
	arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
	new $'...' and $"..." quoting
	the $(...) form of command substitution
	the $(<filename) form of command substitution, equivalent to
		$(cat filename)
	the ${#param} parameter value length operator
	the ${!param} indirect parameter expansion operator
	the ${!param*} prefix expansion operator
	the ${param:length[:offset]} parameter substring operator
	the ${param/pat[/string]} parameter pattern substitution operator
	expansions to perform substring removal (${p%[%]w}, ${p#[#]w})
	expansion of positional parameters beyond $9 with ${num}
	variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, REPLY,
		   TIMEFORMAT, PPID, PWD, OLDPWD, SHLVL, RANDOM, SECONDS,
		   LINENO, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE, HOSTNAME,
		   ENV, PS3, PS4, DIRSTACK, PIPESTATUS, HISTSIZE, HISTFILE,
		   HISTFILESIZE, HISTCONTROL, HISTIGNORE, GLOBIGNORE, GROUPS,
		   PROMPT_COMMAND, FCEDIT, FIGNORE, IGNOREEOF, INPUTRC,
		   SHELLOPTS, OPTERR, HOSTFILE, TMOUT, FUNCNAME, histchars,
		   auto_resume
	DEBUG trap
	variable arrays with new compound assignment syntax
	redirections: <>, &>, >|
	prompt string special char translation and variable expansion
	auto-export of variables in initial environment
	command search finds functions before builtins
	bash return builtin will exit a file sourced with `.'
	builtins: cd -/-L/-P, exec -l/-c/-a, echo -e/-E, hash -p.
		  export -n/-f/-p/name=value, pwd -L/-P,
		  read -e/-p/-a/-t/-n/-d/-s,
		  readonly -a/-f/name=value, trap -l, set +o,
		  set -b/-m/-o option/-h/-p/-B/-C/-H/-P,
		  unset -f/-v, ulimit -m/-p/-u,
		  type -a/-p/-t, suspend -f, kill -n,
		  test -o optname/s1 == s2/s1 < s2/s1 > s2/-nt/-ot/-ef/-O/-G/-S
	bash reads ~/.bashrc for interactive shells, $ENV for non-interactive
	bash restricted shell mode is more extensive
	bash allows functions and variables with the same name
	brace expansion
	tilde expansion
	arithmetic expansion with $((...)) and `let' builtin
	the `[[...]]' extended conditional command
	process substitution
	aliases and alias/unalias builtins
	local variables in functions and `local' builtin
	readline and command-line editing with programmable completion
	command history and history/fc builtins
	csh-like history expansion
	other new bash builtins: bind, command, compgen, complete, builtin,
				 declare/typeset, dirs, enable, fc, help,
				 history, logout, popd, pushd, disown, shopt,
				 printf
	exported functions
	filename generation when using output redirection (command >a*)
	POSIX.2-style globbing character classes
	POSIX.2-style globbing equivalence classes
	POSIX.2-style globbing collating symbols
	egrep-like extended pattern matching operators
	case-insensitive pattern matching and globbing
	variable assignments preceding commands affect only that command,
		even for builtins and functions
	posix mode
	redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr,
		/dev/tcp/host/port, /dev/udp/host/port

Things sh has that bash does not:
	uses variable SHACCT to do shell accounting
	includes `stop' builtin (bash can use alias stop='kill -s STOP')
	`newgrp' builtin
	turns on job control if called as `jsh'
	$TIMEOUT (like bash $TMOUT)
	`^' is a synonym for `|'
	new SVR4.2 sh builtins: mldmode, priv

Implementation differences:
	redirection to/from compound commands causes sh to create a subshell
	bash does not allow unbalanced quotes; sh silently inserts them at EOF
	bash does not mess with signal 11
	sh sets (euid, egid) to (uid, gid) if -p not supplied and uid < 100
	bash splits only the results of expansions on IFS, using POSIX.2
		field splitting rules; sh splits all words on IFS
	sh does not allow MAILCHECK to be unset (?)
	sh does not allow traps on SIGALRM or SIGCHLD
	bash allows multiple option arguments when invoked (e.g. -x -v);
		sh allows only a single option argument (`sh -x -v' attempts
		to open a file named `-v', and, on SunOS 4.1.4, dumps core.
		On Solaris 2.4 and earlier versions, sh goes into an infinite
		loop.)
	sh exits a script if any builtin fails; bash exits only if one of
		the POSIX.2 `special' builtins fails

C2)  How does bash differ from the Korn shell, version ksh88?

Things bash has or uses that ksh88 does not:
	long invocation options
	`!' reserved word
	arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
	posix mode and posix conformance
	command hashing
	tilde expansion for assignment statements that look like $PATH
	process substitution with named pipes if /dev/fd is not available
	the ${!param} indirect parameter expansion operator
	the ${!param*} prefix expansion operator
	the ${param:length[:offset]} parameter substring operator
	the ${param/pat[/string]} parameter pattern substitution operator
	variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, SHLVL,
		   TIMEFORMAT, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE,
		   HISTFILESIZE, HISTIGNORE, HISTCONTROL, PROMPT_COMMAND,
		   IGNOREEOF, FIGNORE, INPUTRC, HOSTFILE, DIRSTACK,
		   PIPESTATUS, HOSTNAME, OPTERR, SHELLOPTS, GLOBIGNORE,
		   GROUPS, FUNCNAME, histchars, auto_resume
	prompt expansion with backslash escapes and command substitution
	redirection: &> (stdout and stderr)
	more extensive and extensible editing and programmable completion
	builtins: bind, builtin, command, declare, dirs, echo -e/-E, enable,
		  exec -l/-c/-a, fc -s, export -n/-f/-p, hash, help, history,
		  jobs -x/-r/-s, kill -s/-n/-l, local, logout, popd, pushd,
		  read -e/-p/-a/-t/-n/-d/-s, readonly -a/-n/-f/-p,
		  set -o braceexpand/-o histexpand/-o interactive-comments/
		  -o notify/-o physical/-o posix/-o hashall/-o onecmd/
		  -h/-B/-C/-b/-H/-P, set +o, suspend, trap -l, type,
		  typeset -a/-F/-p, ulimit -u, umask -S, alias -p, shopt,
		  disown, printf, complete, compgen
	`!' csh-style history expansion
	POSIX.2-style globbing character classes
	POSIX.2-style globbing equivalence classes
	POSIX.2-style globbing collating symbols
	egrep-like extended pattern matching operators
	case-insensitive pattern matching and globbing
	`**' arithmetic operator to do exponentiation
	redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr

Things ksh88 has or uses that bash does not:
	tracked aliases
	variables: ERRNO, FPATH, EDITOR, VISUAL
	co-processes (|&, >&p, <&p)
	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,
		  read -p/-s/-u/var?prompt, set -A/-o gmacs/
		  -o bgnice/-o markdirs/-o nolog/-o trackall/-o viraw/-s,
		  typeset -H/-L/-R/-A/-ft/-fu/-fx/-l/-u/-t, whence

Implementation differences:
	ksh runs last command of a pipeline in parent shell context
	bash has brace expansion by default (ksh88 compile-time option)
	bash has fixed startup file for all interactive shells; ksh reads $ENV
	bash has exported functions
	bash command search finds functions before builtins

C3)  Which new features in ksh-93 are not in bash, and which are?

New things in ksh-93 not in bash-2.04:
	associative arrays
	floating point arithmetic
	math library functions
	${!name[sub]} name of subscript for associative array
	`.' is allowed in variable names to create a hierarchical namespace
	more extensive compound assignment syntax
	discipline functions
	`sleep' and `getconf' builtins (bash has loadable versions)
	typeset -n and `nameref' variables
	KEYBD trap
	variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, .sh.version,
		   .sh.name, .sh.subscript, .sh.value, HISTEDIT
	backreferences in pattern matching
	print -f (bash uses printf)
	`fc' has been renamed to `hist'
	`.' can execute shell functions

New things in ksh-93 present in bash-2.04:
        for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command
        ?:, ++, --, `expr1 , expr2' arithmetic operators
	expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]},
		    ${!param*}
	compound array assignment
	the `!' reserved word
	loadable builtins -- but ksh uses `builtin' while bash uses `enable'
	`command', `builtin', `disown' builtins
	new $'...' and $"..." quoting
	FIGNORE (but bash uses GLOBIGNORE), HISTCMD
	set -o notify/-C
	changes to kill builtin
	read -A (bash uses read -a)
        read -t/-d
	trap -p
	exec -c/-a
	`.' restores the positional parameters when it completes
	POSIX.2 `test'
	umask -S
	unalias -a
	command and arithmetic substitution performed on PS1, PS4, and ENV
	command name completion
	ENV processed only for interactive shells

Section D:  Why does bash do some things differently than other Unix shells?

D1) Why does bash run a different version of `command' than
    `which command' says it will?

On many systems, `which' is actually a csh script that assumes
you're running csh.  In tcsh, `which' and its cousin `where'
are builtins.  On other Unix systems, `which' is a perl script
that uses the PATH environment variable.

The csh script version reads the csh startup files from your
home directory and uses those to determine which `command' will
be invoked.  Since bash doesn't use any of those startup files,
there's a good chance that your bash environment differs from
your csh environment.  The bash `type' builtin does everything
`which' does, and will report correct results for the running
shell.  If you're really wedded to the name `which', try adding
the following function definition to your .bashrc:

	which()
	{
		builtin type "$@"
	}

If you're moving from tcsh and would like to bring `where' along
as well, use this function:

	where()
	{
		builtin type -a "$@"
	}

D2) Why doesn't bash treat brace expansions exactly like csh?

The only difference between bash and csh brace expansion is that
bash requires a brace expression to contain at least one unquoted
comma if it is to be expanded.  Any brace-surrounded word not
containing an unquoted comma is left unchanged by the brace
expansion code.  This affords the greatest degree of sh
compatibility. 

Bash, ksh, zsh, and pd-ksh all implement brace expansion this way. 

D3) Why doesn't bash have csh variable modifiers?

Posix has specified a more powerful, albeit somewhat more cryptic,
mechanism cribbed from ksh, and bash implements it.

${parameter%word}
        Remove smallest suffix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        smallest portion of the suffix matched by the pattern deleted.

        x=file.c
        echo ${x%.c}.o
        -->file.o

${parameter%%word}

        Remove largest suffix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        largest portion of the suffix matched by the pattern deleted.

        x=posix/src/std
        echo ${x%%/*}
        -->posix

${parameter#word}
        Remove smallest prefix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        smallest portion of the prefix matched by the pattern deleted.

        x=$HOME/src/cmd
        echo ${x#$HOME}
        -->/src/cmd

${parameter##word}
        Remove largest prefix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        largest portion of the prefix matched by the pattern deleted.

        x=/one/two/three
        echo ${x##*/}
        -->three


Given
	a=/a/b/c/d
	b=b.xxx

	csh			bash		result
	---			----		------
	$a:h			${a%/*}		   /a/b/c
	$a:t			${a##*/}	   d
	$b:r			${b%.*}		   b
	$b:e			${b##*.}	   xxx


D4) How can I make my csh aliases work when I convert to bash?

Bash uses a different syntax to support aliases than csh does. 
The details can be found in the documentation.  We have provided
a shell script which does most of the work of conversion for you;
this script can be found in ./examples/misc/alias-conv.sh.  Here is
how you use it:
  
Start csh in the normal way for you.  (e.g., `csh')
  
Pipe the output of `alias' through `alias-conv.sh', saving the
results into `bash_aliases':
  
	alias | alias-conv.sh >bash_aliases
  
Edit `bash_aliases', carefully reading through any created
functions.  You will need to change the names of some csh specific
variables to the bash equivalents.  The script converts $cwd to
$PWD, $term to $TERM, $home to $HOME, $user to $USER, and $prompt
to $PS1.  You may also have to add quotes to avoid unwanted
expansion.

For example, the csh alias:
  
	alias cd 'cd \!*; echo $cwd'
  
is converted to the bash function:

	cd () { command cd "$@"; echo $PWD ; }

The only thing that needs to be done is to quote $PWD:
  
	cd () { command cd "$@"; echo "$PWD" ; }
  
Merge the edited file into your ~/.bashrc.

There is an additional, more ambitious, script in
examples/misc/cshtobash that attempts to convert your entire csh
environment to its bash equivalent.  This script can be run as
simply `cshtobash' to convert your normal interactive
environment, or as `cshtobash ~/.login' to convert your login
environment. 

D5) How can I pipe standard output and standard error from one command to
    another, like csh does with `|&'?

Use
	command 2>&1 | command2

The key is to remember that piping is performed before redirection, so
file descriptor 1 points to the pipe when it is duplicated onto file
descriptor 2.

D6) Now that I've converted from ksh to bash, are there equivalents to
    ksh features like autoloaded functions and the `whence' command?

There are features in ksh-88 and ksh-93 that do not have direct bash
equivalents.  Most, however, can be emulated with very little trouble.

ksh-88 feature		Bash equivalent
--------------		---------------
compiled-in aliases	set up aliases in .bashrc; some ksh aliases are
			bash builtins (hash, history, type)
coprocesses		named pipe pairs (one for read, one for write)
typeset +f		declare -F
cd, print, whence	function substitutes in examples/functions/kshenv
autoloaded functions	examples/functions/autoload is the same as typeset -fu
read var?prompt		read -p prompt var

ksh-93 feature		Bash equivalent
--------------		---------------
sleep, getconf		Bash has loadable versions in examples/loadables
${.sh.version}		$BASH_VERSION
print -f		printf
hist			alias fc=hist
$HISTEDIT		$FCEDIT

Section E:  How can I get bash to do certain things, and why does bash do
	    things the way it does?

E1) Why is the bash builtin `test' slightly different from /bin/test?

The specific example used here is [ ! x -o x ], which is false.

Bash's builtin `test' implements the Posix.2 spec, which can be
summarized as follows (the wording is due to David Korn):
   
Here is the set of rules for processing test arguments.
  
    0 Args: False
    1 Arg:  True iff argument is not null.
    2 Args: If first arg is !, True iff second argument is null.
	    If first argument is unary, then true if unary test is true
	    Otherwise error.
    3 Args: If second argument is a binary operator, do binary test of $1 $3
	    If first argument is !, negate two argument test of $2 $3
	    If first argument is `(' and third argument is `)', do the
	    one-argument test of the second argument.
	    Otherwise error.
    4 Args: If first argument is !, negate three argument test of $2 $3 $4.
	    Otherwise unspecified
    5 or more Args: unspecified.  (Historical shells would use their
    current algorithm).
   
The operators -a and -o are considered binary operators for the purpose
of the 3 Arg case.
   
As you can see, the test becomes (not (x or x)), which is false.

E2) Why does bash sometimes say `Broken pipe'?

If a sequence of commands appears in a pipeline, and one of the
reading commands finishes before the writer has finished, the
writer receives a SIGPIPE signal.  Many other shells special-case
SIGPIPE as an exit status in the pipeline and do not report it. 
For example, in:
  
      ps -aux | head
  
`head' can finish before `ps' writes all of its output, and ps
will try to write on a pipe without a reader.  In that case, bash
will print `Broken pipe' to stderr when ps is killed by a
SIGPIPE. 

You can build a version of bash that will not report SIGPIPE errors
by uncommenting the definition of DONT_REPORT_SIGPIPE in the file
config-top.h.

E3) When I have terminal escape sequences in my prompt, why does bash
    wrap lines at the wrong column?

Readline, the line editing library that bash uses, does not know
that the terminal escape sequences do not take up space on the
screen.  The redisplay code assumes, unless told otherwise, that
each character in the prompt is a `printable' character that
takes up one character position on the screen. 

You can use the bash prompt expansion facility (see the PROMPTING
section in the manual page) to tell readline that sequences of
characters in the prompt strings take up no screen space. 

Use the \[ escape to begin a sequence of non-printing characters,
and the \] escape to signal the end of such a sequence. 

E4) If I pipe the output of a command into `read variable', why doesn't
    the output show up in $variable when the read command finishes?

This has to do with the parent-child relationship between Unix
processes. 

Each element of a pipeline runs in a separate process, a child of
the shell running the pipeline.  A subprocess cannot affect its
parent's environment.  When the `read' command sets the variable
to the input, that variable is set only in the subshell, not the
parent shell.  When the subshell exits, the value of the variable
is lost. 

Many pipelines that end with `read variable' can be converted
into command substitutions, which will capture the output of
a specified command.  The output can then be assigned to a
variable:

	grep ^gnu /usr/lib/news/active | wc -l | read ngroup

can be converted into

	ngroup=$(grep ^gnu /usr/lib/news/active | wc -l)

This does not, unfortunately, work to split the text among
multiple variables, as read does when given multiple variable
arguments.  If you need to do this, you can either use the
command substitution above to read the output into a variable
and chop up the variable using the bash pattern removal
expansion operators or use some variant of the following
approach.

Say /usr/local/bin/ipaddr is the following shell script:

#! /bin/sh
host `hostname` | awk '/address/ {print $NF}'

Instead of using

	/usr/local/bin/ipaddr | read A B C D

to break the local machine's IP address into separate octets, use

	OIFS="$IFS"
	IFS=.
	set -- $(/usr/local/bin/ipaddr)
	IFS="$OIFS"
	A="$1" B="$2" C="$3" D="$4"

Beware, however, that this will change the shell's positional
parameters.  If you need them, you should save them before doing
this.

This is the general approach -- in most cases you will not need to
set $IFS to a different value.

E5) I have a bunch of shell scripts that use backslash-escaped characters
    in arguments to `echo'.  Bash doesn't interpret these characters.  Why
    not, and how can I make it understand them?

This is the behavior of echo on most Unix System V machines.

The bash builtin `echo' is modeled after the 9th Edition
Research Unix version of `echo'.  It does not interpret
backslash-escaped characters in its argument strings by default;
it requires the use of the -e option to enable the
interpretation.  The System V echo provides no way to disable the
special characters; the bash echo has a -E option to disable
them. 

There is a configuration option that will make bash behave like
the System V echo and interpret things like `\t' by default.  Run
configure with the --enable-usg-echo-default option to turn this
on.  Be aware that this will cause some of the tests run when you
type `make tests' to fail.

There is a shell option, `xpg_echo', settable with `shopt' that will
change the behavior of echo at runtime.  Enabling this option turns
on expansion of backslash-escape sequences.

E6) Why doesn't a while or for loop get suspended when I type ^Z?

This is a consequence of how job control works on Unix.  The only
thing that can be suspended is the process group.  This is a single
command or pipeline of commands that the shell forks and executes.

When you run a while or for loop, the only thing that the shell forks
and executes are any commands in the while loop test and commands in
the loop bodies.  These, therefore, are the only things that can be
suspended when you type ^Z.

If you want to be able to stop the entire loop, you need to put it
within parentheses, which will force the loop into a subshell that
may be stopped (and subsequently restarted) as a single unit.

E7) What about empty for loops in Makefiles?

It's fairly common to see constructs like this in automatically-generated
Makefiles:

SUBDIRS = @SUBDIRS@

	...

subdirs-clean:
	for d in $SUBDIRS; do \
		( cd $$d && ${MAKE} ${MFLAGS} clean ) \
	done

When SUBDIRS is empty, this results in a command like this being passed to
bash:

	for d in ; do
		( cd $$d && ${MAKE} ${MFLAGS} clean )
	done

This is a syntax error.  If the reserved word `in' is present, a word must
follow it before the semicolon or newline.  The language in the manual page
referring to the list of words being empty refers to the list after it is
expanded.  There must be at least one word following the `in' when the
construct is parsed.

The idiomatic Makefile solution is something like:

SUBDIRS = @SUBDIRS@

subdirs-clean:
	subdirs=$SUBDIRS ; for d in $$subdirs; do \
		( cd $$d && ${MAKE} ${MFLAGS} clean ) \
	done


The POSIX.2 interpretation committee has considered this issue and declared
that the bash implemenation is correct, according to the standard:

http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-169.html

E8) Why does the arithmetic evaluation code complain about `08'?

The bash arithmetic evaluation code (used for `let', $(()), (()), and in
other places), interprets a leading `0' in numeric constants as denoting
an octal number, and a leading `0x' as denoting hexadecimal.  This is
in accordance with the POSIX.2 spec, section 2.9.2.1, which states that
arithmetic constants should be handled as signed long integers as defined
by the ANSI/ISO C standard.

The POSIX.2 interpretation committee has confirmed this:

http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-173.html

Section F:  Things to watch out for on certain Unix versions

F1) Why can't I use command line editing in my `cmdtool'?

The problem is `cmdtool' and bash fighting over the input.  When
scrolling is enabled in a cmdtool window, cmdtool puts the tty in
`raw mode' to permit command-line editing using the mouse for
applications that cannot do it themselves.  As a result, bash and
cmdtool each try to read keyboard input immediately, with neither
getting enough of it to be useful.

This mode also causes cmdtool to not implement many of the
terminal functions and control sequences appearing in the
`sun-cmd' termcap entry.  For a more complete explanation, see
that file examples/suncmd.termcap in the bash distribution. 

`xterm' is a better choice, and gets along with bash much more
smoothly.

If you must use cmdtool, you can use the termcap description in
examples/suncmd.termcap.  Set the TERMCAP variable to the terminal
description contained in that file, i.e.

TERMCAP='Mu|sun-cmd:am:bs:km:pt:li#34:co#80:cl=^L:ce=\E[K:cd=\E[J:rs=\E[s:'

Then export TERMCAP and start a new cmdtool window from that shell.
The bash command-line editing should behave better in the new
cmdtool.  If this works, you can put the assignment to TERMCAP
in your bashrc file.

F2) I built bash on Solaris 2.  Why do globbing expansions and filename
    completion chop off the first few characters of each filename?

This is the consequence of building bash on SunOS 5 and linking
with the libraries in /usr/ucblib, but using the definitions
and structures from files in /usr/include. 

The actual conflict is between the dirent structure in
/usr/include/dirent.h and the struct returned by the version of
`readdir' in libucb.a (a 4.3-BSD style `struct direct'). 

Make sure you've got /usr/ccs/bin ahead of /usr/ucb in your $PATH
when configuring and building bash.  This will ensure that you
use /usr/ccs/bin/cc or acc instead of /usr/ucb/cc and that you
link with libc before libucb. 

If you have installed the Sun C compiler, you may also need to
put /usr/ccs/bin and /opt/SUNWspro/bin into your $PATH before
/usr/ucb.

F3) Why does bash dump core after I interrupt username completion or
    `~user' tilde expansion on a machine running NIS?

This is a famous and long-standing bug in the SunOS YP (sorry, NIS)
client library, which is part of libc.

The YP library code keeps static state -- a pointer into the data
returned from the server.  When YP initializes itself (setpwent),
it looks at this pointer and calls free on it if it's non-null. 
So far, so good. 

If one of the YP functions is interrupted during getpwent (the
exact function is interpretwithsave()), and returns NULL, the
pointer is freed without being reset to NULL, and the function
returns.  The next time getpwent is called, it sees that this
pointer is non-null, calls free, and the bash free() blows up
because it's being asked to free freed memory. 

The traditional Unix mallocs allow memory to be freed multiple
times; that's probably why this has never been fixed.  You can
run configure with the `--without-gnu-malloc' option to use
the C library malloc and avoid the problem.

F4) I'm running SVR4.2.  Why is the line erased every time I type `@'?

The `@' character is the default `line kill' character in most
versions of System V, including SVR4.2.  You can change this
character to whatever you want using `stty'.  For example, to
change the line kill character to control-u, type

	stty kill ^U

where the `^' and `U' can be two separate characters.

F5) Why does bash report syntax errors when my C News scripts use a
    redirection before a subshell command?

The actual command in question is something like

	< file ( command )

According to the grammar given in the POSIX.2 standard, this construct
is, in fact, a syntax error.  Redirections may only precede `simple
commands'.  A subshell construct such as the above is one of the shell's
`compound commands'.  A redirection may only follow a compound command.

This affects the mechanical transformation of commands that use `cat'
to pipe a file into a command (a favorite Useless-Use-Of-Cat topic on
comp.unix.shell).  While most commands of the form

	cat file | command

can be converted to `< file command', shell control structures such as
loops and subshells require `command < file'.

The file CWRU/sh-redir-hack in the bash-2.04 distribution is an
(unofficial) patch to parse.y that will modify the grammar to
support this construct.  It will not apply with `patch'; you must
modify parse.y by hand.  Note that if you apply this, you must
recompile with -DREDIRECTION_HACK.  This introduces a large
number of reduce/reduce conflicts into the shell grammar. 

F6) Why can't I use vi-mode editing on Red Hat Linux 6.1?

The short answer is that Red Hat screwed up.

The long answer is that they shipped an /etc/inputrc that only works
for emacs mode editing, and then screwed all the vi users by setting
INPUTRC to /etc/inputrc in /etc/profile.

The short fix is to do one of the following: remove or rename
/etc/inputrc, set INPUTRC=~/.inputrc in ~/.bashrc (or .bash_profile,
but make sure you export it if you do), remove the assignment to
INPUTRC from /etc/profile, add

        set keymap emacs

to the beginning of /etc/inputrc, or bracket the key bindings in
/etc/inputrc with these lines

	$if mode=emacs
		[...]
	$endif

Section G:  How can I get bash to do certain common things?

G1) How can I get bash to read and display eight-bit characters?

This is a process requiring several steps.

First, you must ensure that the `physical' data path is a full eight
bits.  For xterms, for example, the `vt100' resources `eightBitInput'
and `eightBitOutput' should be set to `true'.

Once you have set up an eight-bit path, you must tell the kernel and
tty driver to leave the eighth bit of characters alone when processing
keyboard input.  Use `stty' to do this:

	stty cs8 -istrip -parenb

For old BSD-style systems, you can use

	stty pass8

You may also need

	stty even odd

Finally, you need to tell readline that you will be inputting and
displaying eight-bit characters.  You use readline variables to do
this.  These variables can be set in your .inputrc or using the bash
`bind' builtin.  Here's an example using `bind':

	bash$ bind 'set convert-meta off'
	bash$ bind 'set meta-flag on'
	bash$ bind 'set output-meta on'

The `set' commands between the single quotes may also be placed
in ~/.inputrc.

G2) How do I write a function `x' to replace builtin command `x', but
    still invoke the command from within the function?

This is why the `command' and `builtin' builtins exist.  The
`command' builtin executes the command supplied as its first
argument, skipping over any function defined with that name.  The
`builtin' builtin executes the builtin command given as its first
argument directly. 

For example, to write a function to replace `cd' that writes the
hostname and current directory to an xterm title bar, use
something like the following:

	cd()
	{
		builtin cd "$@" && xtitle "$HOST: $PWD"
	}

This could also be written using `command' instead of `builtin';
the version above is marginally more efficient. 

G3) How can I find the value of a shell variable whose name is the value
    of another shell variable?

Versions of Bash newer than Bash-2.0 support this directly.  You can use 

	${!var}

For example, the following sequence of commands will echo `z':

	var1=var2
	var2=z
	echo ${!var1}

For sh compatibility, use the `eval' builtin.  The important
thing to remember is that `eval' expands the arguments you give
it again, so you need to quote the parts of the arguments that
you want `eval' to act on. 

For example, this expression prints the value of the last positional
parameter:

	eval echo \"\$\{$#\}\"

The expansion of the quoted portions of this expression will be
deferred until `eval' runs, while the `$#' will be expanded
before `eval' is executed.  In versions of bash later than bash-2.0,

	echo ${!#}

does the same thing.

G4) How can I make the bash `time' reserved word print timing output that
     looks like the output from my system's /usr/bin/time?

The bash command timing code looks for a variable `TIMEFORMAT' and
uses its value as a format string to decide how to display the
timing statistics.

The value of TIMEFORMAT is a string with `%' escapes expanded in a
fashion similar in spirit to printf(3).  The manual page explains
the meanings of the escape sequences in the format string.

If TIMEFORMAT is not set, bash acts as if the following assignment had
been performed:

	TIMEFORMAT=$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'

The POSIX.2 default time format (used by `time -p command') is

	TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S'

The BSD /usr/bin/time format can be emulated with:

	TIMEFORMAT=$'\t%1R real\t%1U user\t%1S sys'

The System V /usr/bin/time format can be emulated with:

	TIMEFORMAT=$'\nreal\t%1R\nuser\t%1U\nsys\t%1S'

The ksh format can be emulated with:

	TIMEFORMAT=$'\nreal\t%2lR\nuser\t%2lU\nsys\t%2lS'

G5) How do I get the current directory into my prompt?

Bash provides a number of backslash-escape sequences which are expanded
when the prompt string (PS1 or PS2) is displayed.  The full list is in
the manual page.

The \w expansion gives the full pathname of the current directory, with
a tilde (`~') substituted for the current value of $HOME.  The \W
expansion gives the basename of the current directory.  To put the full
pathname of the current directory into the path without any tilde
subsitution, use $PWD.  Here are some examples:

	PS1='\w$ '	# current directory with tilde
	PS1='\W$ '	# basename of current directory
	PS1='$PWD$ '	# full pathname of current directory

The single quotes are important in the final example to prevent $PWD from
being expanded when the assignment to PS1 is performed.

G6) How can I rename "*.foo" to "*.bar"?

Use the pattern removal functionality described in D3.  The following `for'
loop will do the trick:

	for f in *.foo; do
		mv $f ${f%foo}bar
	done

G7) How can I translate a filename from uppercase to lowercase?

The script examples/functions/lowercase, originally written by John DuBois,
will do the trick.  The converse is left as an exercise.

G8) How can I write a filename expansion (globbing) pattern that will match
    all files in the current directory except "." and ".."?

You must have set the `extglob' shell option using `shopt -s extglob' to use
this:

	echo .!(.|) *

A solution that works without extended globbing is given in the Unix Shell
FAQ, posted periodically to comp.unix.shell.

Section H:  Where do I go from here?

H1) How do I report bugs in bash, and where should I look for fixes and
    advice?

Use the `bashbug' script to report bugs.  It is built and
installed at the same time as bash.  It provides a standard
template for reporting a problem and automatically includes
information about your configuration and build environment. 

`bashbug' sends its reports to bug-bash@gnu.org, which
is a large mailing list gatewayed to the usenet newsgroup gnu.bash.bug. 

Bug fixes, answers to questions, and announcements of new releases
are all posted to gnu.bash.bug.  Discussions concerning bash features
and problems also take place there.

To reach the bash maintainers directly, send mail to
bash-maintainers@gnu.org.

H2) What kind of bash documentation is there?

First, look in the doc directory in the bash distribution.  It should
contain at least the following files:

bash.1		an extensive, thorough Unix-style manual page
builtins.1	a manual page covering just bash builtin commands
bashref.texi	a reference manual in GNU tex`info format
bashref.info	an info version of the reference manual
FAQ		this file
article.ms	text of an article written for The Linux Journal
readline.3	a man page describing readline

Postscript, HTML, and ASCII files created from the above source are
available in the documentation distribution.

There is additional documentation available for anonymous FTP from host
ftp.cwru.edu in the `pub/bash' directory.

Cameron Newham and Bill Rosenblatt have written a book on bash, published
by O'Reilly and Associates.  The book is based on Bill Rosenblatt's Korn
Shell book.  The title is ``Learning the Bash Shell'', and the ISBN number
is 1-56592-147-X.  Look for it in fine bookstores near you.  This book
covers bash-1.14, but has an appendix describing some of the new features
in bash-2.0.  

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.

H3) What's coming in future versions?

These are features I plan to include in a future version of bash.

a bash debugger (a minimally-tested version is included with bash-2.04)
associative arrays

H4) What's on the bash `wish list' for future versions?

These are features that may or may not appear in a future version of bash.

breaking some of the shell functionality into embeddable libraries
a module system like zsh's, using dynamic loading like builtins
better internationalization using GNU `gettext'
an option to use external files for the long `help' text
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
	variables (contributions gratefully accepted)

H5) When will the next release appear?

The next version will appear sometime in 2000 or 2001.  Never make
predictions. 


This document is Copyright 1995-2000 by Chester Ramey.

Permission is hereby granted, without written agreement and
without license or royalty fees, to use, copy, and distribute
this document for any purpose, provided that the above copyright
notice appears in all copies of this document and that the
contents of this document remain unaltered.


From chet@nike.ins.cwru.edu Mon Oct 23 11:24:27 2000
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13njSc-000839-00
	for <bug-bash@gnu.org>; Mon, 23 Oct 2000 11:24:26 -0400
Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi)
	id LAA37132; Mon, 23 Oct 2000 11:24:14 -0400 (EDT) (from chet)
Date: Mon, 23 Oct 2000 11:23:26 -0400
From: Chet Ramey <chet@nike.ins.cwru.edu>
To: flush@eisa.net.au
Subject: Re: Is the right person to ask?
Cc: chet@po.cwru.edu, bug-bash@gnu.org
Reply-To: chet@po.CWRU.Edu
Message-ID: <1001023152326.AA37126.SM@nike.ins.cwru.edu>
Read-Receipt-To: chet@po.CWRU.Edu
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-In-Reply-To:  Message from flush@eisa.net.au of Mon, 23 Oct 2000 23:13:34 -0400 (id <39F4FE5E.5703CD91@eisa.net.au>)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

> I have experience writing bash scripts but one thing that has always
> eluded me is how to tell one string from another such as I would like to
> check a string to see if it is JUST numeric or JUST characters and n
> numbers.

Look at the files examples/functions/{isnum.bash,isnum2} in the bash-2.04
distribution.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


From news@nnrp3-w.snfc21.pbi.net Tue Oct 24 14:16:46 2000
Received: from mr1.ash.ops.us.uu.net ([198.5.241.86])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13o8cw-0005sk-00
	for <bug-bash@prep.ai.mit.edu>; Tue, 24 Oct 2000 14:16:46 -0400
Received: from popper2.pbi.net by mr1.ash.ops.us.uu.net with ESMTP 
	(peer crosschecked as: popper2.pbi.net [206.13.1.17])
	id QQjmib27091
	for <gnu-bash-bug@moderators.isc.org>; Tue, 24 Oct 2000 18:16:34 GMT
Path: not-for-mail
Received: from nnrp3-w.snfc21.pbi.net by popper2.pbi.net
 (Sun Internet Mail Server sims.3.5.1999.05.24.18.28.p7)
 with ESMTP id <0G2Y00C5C5FUAQ@popper2.pbi.net> for
 gnu-bash-bug@moderators.isc.org; Tue, 24 Oct 2000 11:16:43 -0700 (PDT)
Received: (from news@localhost) by nnrp3-w.snfc21.pbi.net (8.8.8+Sun/8.8.8)
 id LAA09278; Tue, 24 Oct 2000 11:16:35 -0700 (PDT)
Date: Tue, 24 Oct 2000 18:18:45 +0000 (GMT)
From: Merlin <merlin@exoticambrosia.com>
Subject: Protect yourself and your computer get Evidence Eliminator
To: gnu-bash-bug@moderators.isc.org
Reply-to: merlin@exoticambrosia.com
Message-id: <7mkJ5.5827$mf1.41570@news.pacbell.net>
Organization: SBC Internet Services
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
X-Complaints-To: abuse@pacbell.net
X-Trace: news.pacbell.net 972411395 63.195.82.240 (Tue,
 24 Oct 2000 11:16:35 PDT)
NNTP-Posting-Date: Tue, 24 Oct 2000 11:16:35 PDT
Newsgroups: gnu.bash.bug
Lines: 9
NNTP-posting-host: 63.195.82.240
X-Newsreader: News Rover 6.0.1 (http://www.NewsRover.com)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Evidence Eliminator

 When you access the Internet, your computer keeps permanent hidden records
 of your activity for months or years, including web sites visited,
 documents, pictures, videos and sounds. This is a serious threat to the
 legitimate surfer's privacy. Evidence Eliminator is a solution to this
 problem. It analyzes and protects your whole hard drive and defeats all
 known Forensic Analysis Software.To download, Go Here
 http://www.evidence-eliminator.com/main.shtml?A1564


From monteiro@alvoline.com.br Tue Oct 24 14:55:52 2000
Received: from socrates.alvoline.com.br ([200.242.97.134])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13o9Ej-0006R6-00
	for <bug-bash@prep.ai.mit.edu>; Tue, 24 Oct 2000 14:55:50 -0400
Received: from philosofia (philosofia.alvoline.com.br [200.242.97.133])
	by socrates.alvoline.com.br (8.9.3/8.8.7) with SMTP id QAA15904
	for <bug-bash@prep.ai.mit.edu>; Tue, 24 Oct 2000 16:22:37 -0200
Message-ID: <001d01c03def$45a1e5d0$01cfa8c0@alvoline.com.br>
From: "R. Monteiro" <monteiro@alvoline.com.br>
To: <bug-bash@prep.ai.mit.edu>
Subject: Problems Security
Date: Tue, 24 Oct 2000 16:19:01 -0300
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_001A_01C03DD6.1F19E3E0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

This is a multi-part message in MIME format.

------=_NextPart_000_001A_01C03DD6.1F19E3E0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I have linux RedHat 6.2, my problems is with safe of /etc directory, =
while type more /etc/passwd > savefile or more /etc/passwd- > savefile =
occur a break in my security.
other problems is while use (cd ..) in my root directory, the bassh =
permit navegation per all tree, whats the sulotion???????

no exist control of commands by user????
have with create a file in /etc to controler the commands of the user of =
sheel???
=20

------=_NextPart_000_001A_01C03DD6.1F19E3E0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>I have linux RedHat 6.2, my problems is =
with safe=20
of /etc directory, while type more /etc/passwd &gt; savefile or more=20
/etc/passwd- &gt; savefile&nbsp;occur a break in my =
security.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>other problems is while use (cd ..) in =
my root=20
directory, the bassh permit navegation per all tree, whats the=20
sulotion???????</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>no exist control of commands by=20
user????</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>have with create a file in /etc to =
controler the=20
commands of the user&nbsp;of sheel???</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;</FONT></DIV></FONT></DIV></BODY></HTML>

------=_NextPart_000_001A_01C03DD6.1F19E3E0--



From bero@redhat.de Wed Oct 25 09:25:10 2000
Received: from wg.redhat.de ([193.103.254.4] helo=mail.redhat.de)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13oQYH-0000oo-00
	for <bug-bash@gnu.org>; Wed, 25 Oct 2000 09:25:09 -0400
From: bero@redhat.com
To: bug-bash@gnu.org
Subject: read doesn't handle pipes
Message-Id: <20001025132453.A3ABD233FB@mail.redhat.de>
Date: Wed, 25 Oct 2000 15:24:53 +0200 (CEST)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DSHELL -DHAVE_CONFIG_H  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -I.  -I. -I./include -I./lib -I/usr/include -O2 -march=i386 -mcpu=i686
uname output: Linux zell.redhat.de 2.2.17-4smp #1 SMP Thu Oct 19 19:13:23 EDT 2000 i686 unknown
Machine Type: i386-redhat-linux-gnu

Bash Version: 2.04
Patch Level: 12
Release Status: release

Description:
	read doesn't handle stuff being piped into it...
	[bero@zell bero]$ read test
	Linux now
	[bero@zell bero]$ echo $test
	Linux now
	[bero@zell bero]$ test=""
	[bero@zell bero]$ echo "Linux now" |read test
	[bero@zell bero]$ echo $test
	
	[bero@zell bero]$

Repeat-By:
	See description

Fix:
	Haven't had the time to look at it, maybe later.


From ronrob@innercite.com Wed Oct 25 17:16:02 2000
Received: from mta6.snfc21.pbi.net ([206.13.28.240])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13oXty-0008SN-00
	for <Bug-bash@gnu.org>; Wed, 25 Oct 2000 17:16:02 -0400
Received: from [192.168.1.2] ([63.205.14.127])
 by mta6.snfc21.pbi.net (Sun Internet Mail Server sims.3.5.2000.01.05.12.18.p9)
 with ESMTP id <0G30009B07RPJ8@mta6.snfc21.pbi.net> for Bug-bash@gnu.org; Wed,
 25 Oct 2000 14:03:16 -0700 (PDT)
Date: Wed, 25 Oct 2000 14:05:12 -0700
From: Ron Robertson <ronrob@innercite.com>
Subject: sample script
To: Bug-bash@gnu.org
Message-id: <B61C9918.41%ronrob@innercite.com>
MIME-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Hello,

 Wondering where I might find a sample bash shell script?
 
 Simple... like the user puts in two numbers and I tell the user what
numbers they were and which one is bigger...like that.

 Any help or pointers would  be greatly appreciated.

Thanks

Ron Robertson 



From mitchell@dumbledore.codesourcery.com Wed Oct 25 18:20:30 2000
Received: from adsl-206-170-148-33.dsl.snfc21.pacbell.net ([206.170.148.33] helo=dumbledore.codesourcery.com)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13oYuM-00010n-00
	for <bug-bash@prep.ai.mit.edu>; Wed, 25 Oct 2000 18:20:30 -0400
Received: (from mitchell@localhost)
	by dumbledore.codesourcery.com (8.9.3/8.9.3) id PAA13783
	for bug-bash@prep.ai.mit.edu; Wed, 25 Oct 2000 15:20:18 -0700
Date: Wed, 25 Oct 2000 15:20:18 -0700
From: Mark Mitchell <mitchell@dumbledore.codesourcery.com>
Message-Id: <200010252220.PAA13783@dumbledore.codesourcery.com>
To: bug-bash@prep.ai.mit.edu
Subject: [50 character or so descriptive subject here (for reference)]
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

There is no way to use `ulimit' to set RLIMIT_AS under GNU/Linux.

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: Linux
Compiler: gcc
Compilation CFLAGS:   -DHAVE_VFPRINTF -DHAVE_UNISTD_H -DHAVE_STDLIB_H -DHAVE_LIMITS_H        -DHAVE_GETGROUPS -DHAVE_RESOURCE -DHAVE_SYS_PARAM -DVOID_SIGHANDLER -DHAVE_GETDTABLESIZE -DHAVE_BCOPY -DHAVE_GETPW_DECLS -DHAVE_GETHOSTNAME -DHAVE_WAIT_H         -DHAVE_DUP2 -DHAVE_STRERROR  -DHAVE_DIRENT_H -DHAVE_STRING_H        -DHAVE_VARARGS_H -DHAVE_STRCHR  -DHAVE_DEV_FD        -Di386 -DLinux -DSHELL -DHAVE_ALLOCA -DHAVE_ALLOCA_H 	   -O2 -m486 -fno-strength-reduce
uname output: Linux dumbledore.codesourcery.com 2.2.16-3smp #1 SMP Mon Jun 19 19:00:35 EDT 2000 i686 unknown

Bash Version: 1.14
Patch Level: 7

Description:

The RLIMIT_AS resource limit (which is the limit Linux uses to prevent
too much meomry from being allocated to a single process) can't be
set with the ulimit builtin.

Repeat-By:

Fix:

I'd be willing to take a whack at a patch, but I'm not sure where to send
it.  Who is maintaining bash these days?


From news@slb7.atl.mindspring.net Wed Oct 25 19:42:54 2000
Received: from smtp6.mindspring.com ([207.69.200.110])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13oaC5-0002Pj-00
	for <gnu-bash-bug@prep.ai.mit.edu>; Wed, 25 Oct 2000 19:42:53 -0400
Received: from slb7.atl.mindspring.net ([192.168.163.20])
	by smtp6.mindspring.com (8.9.3/8.8.5) with ESMTP id TAA11150
	for <gnu-bash-bug@prep.ai.mit.edu>; Wed, 25 Oct 2000 19:42:52 -0400 (EDT)
Received: (from news@localhost) by slb7.atl.mindspring.net (8.8.5/8.7.3) id TAA11557; Wed, 25 Oct 2000 19:42:40 -0400 (EDT)
To: gnu-bash-bug@prep.ai.mit.edu
Path: not-for-mail
From: "John C" <zcrawfordz@mindspring.com>
Newsgroups: gnu.bash.bug
Subject: Huge executable
Date: Wed, 25 Oct 2000 19:48:47 -0400
Organization: MindSpring Enterprises
Lines: 14
Message-ID: <8t7r5g$62c$1@slb7.atl.mindspring.net>
NNTP-Posting-Host: cf.45.36.4a
X-Server-Date: 25 Oct 2000 23:42:40 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.3018.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

This isn't a bug per se but I compiled bash under CYGWIN for I586 on Windows
98 (using ./configure and make as mentioned in the readme.) and the
executable is just under 2MB.

Being a newbie, what can I do to figure out what happened?

Thanks in advance...

John
----------------------------------------------------------------------------
--------------
To reply by e-mail remove the 'z's from address.




From news@plankton.shore.net Wed Oct 25 20:20:11 2000
Received: from backdraft.briar.org ([192.207.123.123] helo=briar.org)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13oamB-0002yP-00
	for <bug-bash@prep.ai.mit.edu>; Wed, 25 Oct 2000 20:20:11 -0400
Received: (from smap@localhost) by briar.org (8.9.1b+Sun/8.6.12) id UAA04185 for <gnu-bash-bug@moderators.isc.org>; Wed, 25 Oct 2000 20:19:51 -0400 (EDT)
X-Authentication-Warning: backdraft.briar.org: smap set sender to <news@plankton.shore.net> using -f
Received: from fridge.shore.net(192.233.85.167) by backdraft via smap (V2.1)
	id xma004183; Wed, 25 Oct 00 20:19:43 -0400
Received: from news by plankton.shore.net with local (Exim 1.92 #2)
	for gnu-bash-bug@moderators.isc.org
	id 13oalh-0005nR-00; Wed, 25 Oct 2000 20:19:41 -0400
To: gnu-bash-bug@moderators.isc.org
Path: not-for-mail
Message-ID: <39F778F2.F249A200@atg.com>
From: John Valente <jvalente@atg.com>
X-Mailer: Mozilla 4.7 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: gnu.bash.bug
Subject: trap behavior with ( x & ) | ...
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 43
Date: Wed, 25 Oct 2000 17:21:06 -0700
NNTP-Posting-Host: 63.85.219.230
X-Complaints-To: abuse@shore.net
X-Trace: news.shore.net 972519575 63.85.219.230 (Wed, 25 Oct 2000 20:19:35 EDT)
NNTP-Posting-Date: Wed, 25 Oct 2000 20:19:35 EDT
Organization: Shore.Net, a PRIMUS Company (info@shore.net)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Sorry, I admit I haven't scoured every alternate source for information,
but I have a simple question.  Responding with a pointer to where the
answer is documented would be fine.  Thanks.  Here's the script:

#!/bin/bash

handle_signal ()
{
  echo "signal handler"
  exit 0
}

trap "handle_signal" 1 2 3

(java DoNothing&) | tee /tmp/logfile.txt

echo "no signal handler"

On my Linux (2.2.14-5.0 #1) box with bash 1.14.7(1), the signal handler
is not called.  On Solaris (5.7) with bash 2.04, the signal handler is
called.  As you may guess, I'd like the signal to be trapped, but I
can't say for sure that it's a bug.  Any ideas?

P.S. I don't think "java DoNothing" is important at all, it's the
interaction between ( ), &, and |, but just for completeness, here's the
source code for the dummy Java file:

public class DoNothing
{
  public static void main (String args[]) {
    for ( ; ; ) {
      System.out.println("running");
      System.out.flush();
      try { Thread.sleep(3000); } catch (InterruptedException ie) {}
    }
  }
}

Thanks for any help,
John



From klausf@pool.informatik.rwth-aachen.de Thu Oct 26 08:59:36 2000
Received: from nets5.rz.rwth-aachen.de ([137.226.144.13])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13omd5-0007gV-00
	for <bug-bash@gnu.org>; Thu, 26 Oct 2000 08:59:35 -0400
Received: from campino.informatik.rwth-aachen.de (campino.Informatik.RWTH-Aachen.DE [137.226.116.240])
	by nets5.rz.rwth-aachen.de (8.10.1/8.10.1/7) with ESMTP id e9QCxXm03438
	for <bug-bash@gnu.org>; Thu, 26 Oct 2000 14:59:33 +0200 (MET DST)
Received: from jennifer.informatik.rwth-aachen.de (klausf@jennifer.Informatik.RWTH-Aachen.DE [137.226.116.82])
	by campino.informatik.rwth-aachen.de (8.9.1a/8.9.1/3) with ESMTP id OAA13916
	for <bug-bash@gnu.org>; Thu, 26 Oct 2000 14:59:33 +0200 (MET DST)
From: klausf@Pool.Informatik.RWTH-Aachen.DE
Received: (from klausf@localhost)
	by jennifer.informatik.rwth-aachen.de (8.9.1a/8.9.1/1) id OAA05843;
	Thu, 26 Oct 2000 14:55:52 +0200 (MET DST)
Date: Thu, 26 Oct 2000 14:55:52 +0200 (MET DST)
Message-Id: <200010261255.OAA05843@jennifer.informatik.rwth-aachen.de>
To: bug-bash@gnu.org
Subject: bash aborts when interrupting read from /dev/zero
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.6
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc' -DCONF_OSTYPE='solaris2.6' -DCONF_MACHTYPE='sparc-sun-solaris2.6' -DCONF_VENDOR='sun' -DSHELL  -DHAVE_CONFIG_H  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I.  -I. -I./include -I./lib -I/usr/local/include -g -O2
uname output: SunOS jennifer 5.6 Generic_105181-13 sun4u sparc SUNW,Ultra-1
Machine Type: sparc-sun-solaris2.6

Bash Version: 2.04
Patch Level: 0
Release Status: release

Description:
	The read builtin aborts when interrupted while reading from /dev/zero:

#0  0xef60820c in _end ()
#1  0xef5ba594 in _end ()
#2  0x3c8c0 in programming_error (
    format=0x980c8 "free: called with already freed block argument")
    at error.c:258
#3  0x84248 in free (mem=0xc5810) at malloc.c:691
#4  0x5c190 in xfree (string=0xc5810) at xmalloc.c:129
#5  0x4de84 in run_unwind_protects_internal () at unwind_prot.c:187
#6  0x4dccc in without_interrupts (
    function=0x4de54 <run_unwind_protects_internal>, arg1=0x0, arg2=0x0)
    at unwind_prot.c:82
#7  0x4ddc8 in run_unwind_protects () at unwind_prot.c:136
#8  0x4ebc4 in throw_to_top_level () at sig.c:373
#9  0x4ed9c in sigint_sighandler (sig=2) at sig.c:446
#10 0xef5b89dc in _end ()
#11 0x84b8c in zread (fd=0, buf=0xb1174 "", len=128) at zread.c:47
#12 0x84c40 in zreadc (fd=0, cp=0xeffff677 "") at zread.c:99
#13 0x64a14 in read_builtin (list=0x0) at ./read.def:335

Repeat-By:
	Enter "read</dev/zero" and hit Control-C


From chet@nike.ins.cwru.edu Thu Oct 26 10:35:05 2000
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13oo7U-0000es-00
	for <bug-bash@prep.ai.mit.edu>; Thu, 26 Oct 2000 10:35:05 -0400
Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi)
	id KAA91440; Thu, 26 Oct 2000 10:35:00 -0400 (EDT) (from chet)
Date: Thu, 26 Oct 2000 10:32:10 -0400
From: Chet Ramey <chet@nike.ins.cwru.edu>
To: mitchell@dumbledore.codesourcery.com
Subject: Re: [50 character or so descriptive subject here (for reference)]
Cc: bug-bash@prep.ai.mit.edu, chet@po.cwru.edu
Reply-To: chet@po.CWRU.Edu
Message-ID: <1001026143210.AA91431.SM@nike.ins.cwru.edu>
Read-Receipt-To: chet@po.CWRU.Edu
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-In-Reply-To:  Message from mitchell@dumbledore.codesourcery.com of Wed, 25 Oct 2000 15:20:18 -0700 (id <200010252220.PAA13783@dumbledore.codesourcery.com>)
X-In-Reply-To:   Message from mitchell@dumbledore.codesourcery.com of Wed, 25 Oct 2000 15:20:18 -0700 (id <200010252220.PAA13783@dumbledore.codesourcery.com>)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

> There is no way to use `ulimit' to set RLIMIT_AS under GNU/Linux.

There is if you use bash-2.x.  Use `ulimit -v'.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


From chet@nike.ins.cwru.edu Thu Oct 26 10:36:11 2000
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13oo8Y-0000k9-00
	for <bug-bash@gnu.org>; Thu, 26 Oct 2000 10:36:10 -0400
Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi)
	id KAA91450; Thu, 26 Oct 2000 10:36:09 -0400 (EDT) (from chet)
Date: Thu, 26 Oct 2000 10:35:22 -0400
From: Chet Ramey <chet@nike.ins.cwru.edu>
To: zcrawfordz@mindspring.com
Subject: Re: Huge executable
Cc: chet@po.cwru.edu, bug-bash@gnu.org
Reply-To: chet@po.CWRU.Edu
Message-ID: <1001026143522.AA91448.SM@nike.ins.cwru.edu>
Read-Receipt-To: chet@po.CWRU.Edu
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-In-Reply-To:  Message from zcrawfordz@mindspring.com of Wed, 25 Oct 2000 19:48:47 -0400 (id <8t7r5g$62c$1@slb7.atl.mindspring.net>)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

> This isn't a bug per se but I compiled bash under CYGWIN for I586 on Windows
> 98 (using ./configure and make as mentioned in the readme.) and the
> executable is just under 2MB.
> 
> Being a newbie, what can I do to figure out what happened?

What do you mean, `what happened'?  The binary is unstripped and probably
includes debugging symbols.  Strip the bash binary (with `strip') and
see how the size changes.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


From chet@nike.ins.cwru.edu Thu Oct 26 11:02:36 2000
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13ooY7-000176-00
	for <bug-bash@gnu.org>; Thu, 26 Oct 2000 11:02:35 -0400
Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi)
	id LAA91733; Thu, 26 Oct 2000 11:02:11 -0400 (EDT) (from chet)
Date: Thu, 26 Oct 2000 11:01:54 -0400
From: Chet Ramey <chet@nike.ins.cwru.edu>
To: klausf@Pool.Informatik.RWTH-Aachen.DE
Subject: Re: bash aborts when interrupting read from /dev/zero
Cc: bug-bash@gnu.org, chet@po.cwru.edu
Reply-To: chet@po.CWRU.Edu
Message-ID: <1001026150154.AA91731.SM@nike.ins.cwru.edu>
Read-Receipt-To: chet@po.CWRU.Edu
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-In-Reply-To:  Message from klausf@Pool.Informatik.RWTH-Aachen.DE of Thu, 26 Oct 2000 14:55:52 +0200 (MET DST) (id <200010261255.OAA05843@jennifer.informatik.rwth-aachen.de>)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

> Bash Version: 2.04
> Patch Level: 0
> Release Status: release
> 
> Description:
> 	The read builtin aborts when interrupted while reading from /dev/zero:

I have fixed this for the next release.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


From news@btinternet.com Thu Oct 26 18:45:56 2000
Received: from chi6-1.relay.mail.uu.net ([199.171.54.98])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13ovmW-0000EA-00
	for <bug-bash@prep.ai.mit.edu>; Thu, 26 Oct 2000 18:45:56 -0400
Received: from praseodumium.btinternet.com by chi6sosrv11.alter.net with ESMTP 
	(peer crosschecked as: praseodumium.btinternet.com [194.73.73.82])
	id QQjmqd26619
	for <gnu-bash-bug@uunet.uu.net>; Thu, 26 Oct 2000 22:45:55 GMT
Received: from [194.73.73.86] (helo=neptunium)
	by praseodumium.btinternet.com with esmtp (Exim 3.03 #83)
	id 13ovm3-0001dZ-00
	for gnu-bash-bug@uunet.uu.net; Thu, 26 Oct 2000 23:45:27 +0100
Received: from news by neptunium with local (Exim 3.03 #83)
	id 13ovm3-0006vr-00
	for gnu-bash-bug@uunet.uu.net; Thu, 26 Oct 2000 23:45:27 +0100
To: gnu-bash-bug@uunet.uu.net
Path: not-for-mail
From: HostingMatters.com<support@hostmatters.com>
Newsgroups: gnu.bash.bug
Subject: CHEAP XXX AND BULK FRIENDLY HOSTING!! CALL FREE 1-877-381-1083
Date: 26 Oct 2000 22:45:27 GMT
Organization: Hosting Matters
Lines: 21
Message-ID: <8tac67$mtj$1174@neptunium.btinternet.com>
NNTP-Posting-Host: host62-7-46-227.btinternet.com
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

We offer Solutions for you XXX webmasters and BULK EMAILERS.

Our service is VERY CHEAP and we allow the following types of sites:

- Bulk emailing
- Adult content & services
- Controversial sites

We have a policy of NEVER shutting down above-mentioned sites!

For more info contact us on our web site below.

http://www.hostmatters.com

or our alternative URL:

http://www.hostingmatters.com

REMEMBER: We are your ONLY bulk and XXX-friendly web host!!

Contact sales@hostmatters.com or call TOLL-FREE on 1-877-381-1083


From eriberge@ccs.neu.edu Thu Oct 26 20:57:39 2000
Received: from amber.ccs.neu.edu ([129.10.116.51])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13oxpu-00024A-00
	for <bug-bash@gnu.org>; Thu, 26 Oct 2000 20:57:34 -0400
Received: from murzim.ccs.neu.edu (eriberge@murzim.ccs.neu.edu [129.10.117.111])
	by amber.ccs.neu.edu (8.10.0.Beta10/8.10.0.Beta10) with ESMTP id e9R0vLL03095
	for <bug-bash@gnu.org>; Thu, 26 Oct 2000 20:57:25 -0400 (EDT)
Received: (from eriberge@localhost)
	by murzim.ccs.neu.edu (8.10.0.Beta10/8.10.0.Beta10) id e9R0vLp26164
	for bug-bash@gnu.org; Thu, 26 Oct 2000 20:57:21 -0400 (EDT)
Date: Thu, 26 Oct 2000 20:57:21 -0400 (EDT)
From: "Eric G. Bergeron" <eriberge@ccs.neu.edu>
Message-Id: <200010270057.e9R0vLp26164@murzim.ccs.neu.edu>
To: bug-bash@gnu.org
Subject: [50 character or so descriptive subject here (for reference)]
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.6
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc' -DCONF_OSTYPE='solaris2.6' -DCONF_MACHTYPE='sparc-sun-solaris2.6' -DCONF_VENDOR='sun' -DSHELL -DHAVE_CONFIG_H  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I.  -I../.. -I../../lib -I/arch/gnu/packages/bash-2.03/include -g -O2
uname output: SunOS murzim.ccs.neu.edu 5.6 Generic_105181-21 sun4u sparc SUNW,Ultra-5_10
Machine Type: sparc-sun-solaris2.6

Bash Version: 2.03
Patch Level: 0
Release Status: release

Description:
	If you alias a bunch of spaces, bash allows this to happen and will 
	not allow you to run the alias.

Repeat-By:
	alias '                                                           '="echo I have typed a bunch of spaces."

Fix:
	[Description of how to fix the problem.  If you don't know a
	fix for the problem, don't include this section.]


From xs24@netease.com Fri Oct 27 04:06:57 2000
Received: from [210.110.81.111] (helo=supercom.)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13p4XP-0007DD-00; Fri, 27 Oct 2000 04:06:55 -0400
Received: from drugz.co.kr by supercom. (SMI-8.6/SMI-SVR4)
	id RAA01546; Fri, 27 Oct 2000 17:00:07 +0900
From: xs24@netease.com
Message-Id: <200010270800.RAA01546@supercom.>
To: <Undisclosed Recipients@netease.com>
Subject: Stealth Mass Mailer, 10 Million E-Addresses & More..                         32754
Date: Sat, 28 Oct 2000 01:14:47 -0700
MIME-Version: 1.0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Priority: 3
X-MSMail-Priority: Normal
Reply-To: xs24@netease.com
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

<HTML>
<BODY>

<FONT face=3D"MS Sans Serif">
<FONT size=3D2> Email advertising WORKS!<BR>
Email Advertise your product or website to millions for only $99.<BR>
<BR>
For $99.00 you will receive the Stealth Mass Mailer Software,<BR>
List Manager, Over 10 million email addresses, and as a free bonus, <BR>
a Bulletproof mail server to send your mail through. <BR>
NEVER, lose your ISP service again. <BR>
<BR>
For more info, just respond to this message, with "$99 Special" in the<BR>
subject line.  Reply to:  xs24@netease.com<BR>
<BR>
To be removed from our mail list, reply with "Remove" in subject line.<BR>
<BR>
</FONT></FONT>
</BODY>
</HTML>




From news@news6-win.server.ntlworld.com Fri Oct 27 15:46:54 2000
Received: from chi6-1.relay.mail.uu.net ([199.171.54.98])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13pFSn-0005SY-00
	for <bug-bash@prep.ai.mit.edu>; Fri, 27 Oct 2000 15:46:53 -0400
Received: from news6-win.server.ntlworld.com by chi6sosrv11.alter.net with ESMTP 
	(peer crosschecked as: news6d-win.server.ntlworld.com [62.253.162.109])
	id QQjmtj18615
	for <gnu-bash-bug@moderators.isc.org>; Fri, 27 Oct 2000 19:46:52 GMT
Received: (from news@localhost)
	by news6-win.server.ntlworld.com (8.8.8+Sun/8.8.8) id UAA00309;
	Fri, 27 Oct 2000 20:46:45 +0100 (BST)
To: gnu-bash-bug@moderators.isc.org
Path: not-for-mail
From: "nobody@hotmail.com"<nobody@hotmail.com>
Newsgroups: gnu.bash.bug 
Subject: AT LAST!!!! BULK-FRIENDLY WEB HOSTING
Lines: 19
Message-ID: <EYkK5.35298$sE.70406@news6-win.server.ntlworld.com>
Date: Fri, 27 Oct 2000 19:46:44 GMT
NNTP-Posting-Host: 62.253.144.60
X-Complaints-To: abuse@ntlworld.com
X-Trace: news6-win.server.ntlworld.com 972676004 62.253.144.60 (Fri, 27 Oct 2000 20:46:44 BST)
NNTP-Posting-Date: Fri, 27 Oct 2000 20:46:44 BST
Organization: ntlworld News Service
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

I found this incredible service called HOSTING MATTERS.

Hosting Matters is a fantastic way to host adult and bulk email-friendly sites with NO WORRIES about getting shut down as they are only out to try and make money. The service is VERY CHEAP and I reccomend it for the following types of sites:

- Bulk emailing
- Adult content & services
- Controversial/Hate sites

As far as I know, they have NEVER shut down above-mentioned types of sites!

For more info contact them on the web site below.

http://www.hostmatters.com

or an alternative URL:

http://www.hostingmatters.com

Contact sales@hostmatters.com or call TOLL-FREE on 1-877-381-1083 if you have any questions.


From news@news2-win.server.ntlworld.com Fri Oct 27 16:06:26 2000
Received: from sprettur.isnet.is ([193.4.58.19])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13pFlh-0005es-00
	for <bug-bash@prep.ai.mit.edu>; Fri, 27 Oct 2000 16:06:25 -0400
Received: from news2-win.server.ntlworld.com (news2-win.server.ntlworld.com [62.253.162.102])
	by sprettur.isnet.is (8.11.0/8.11.0/isnet) with ESMTP id e9RK6OA82233
	for <gnu-bash-bug@moderators.isc.org>; Fri, 27 Oct 2000 20:06:24 GMT
	(envelope-from news@news2-win.server.ntlworld.com)
Received: (from news@localhost)
	by news2-win.server.ntlworld.com (8.8.8+Sun/8.8.8) id VAA10191;
	Fri, 27 Oct 2000 21:06:23 +0100 (BST)
To: gnu-bash-bug@moderators.isc.org
Path: not-for-mail
From: Annette@Hosting.Matters, "Inc."<support@hostmatters.com>
Newsgroups: gnu.bash.bug
Subject: Test
Lines: 1
Message-ID: <3flK5.8570$h%4.74724@news2-win.server.ntlworld.com>
Date: Fri, 27 Oct 2000 20:06:23 GMT
NNTP-Posting-Host: 62.253.144.60
X-Complaints-To: abuse@ntlworld.com
X-Trace: news2-win.server.ntlworld.com 972677183 62.253.144.60 (Fri, 27 Oct 2000 21:06:23 BST)
NNTP-Posting-Date: Fri, 27 Oct 2000 21:06:23 BST
Organization: ntlworld News Service
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Life is like a box of chocolates; except for spammers who should be killed.


From xs24@netease.com Sun Oct 29 17:32:12 2000
Received: from [210.63.202.1] (helo=nt-s)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13q0zq-0000Ix-00
	for <bug-bash@prep.ai.mit.edu>; Sun, 29 Oct 2000 17:32:11 -0500
Received: by nt-s with MERCUR-SMTP/POP3/IMAP4-Server (v3.00.25 RI-0000000) for <bug-bash@prep.ai.mit.edu> at Mon, 30 Oct 2000  06:11:09 +0800
To: <Undisclosed Recipients>
From: xs24@netease.com
Subject: Stealth Mass Mailer, 10 Million E-Addresses & More..                         11229
Date: Mon, 30 Oct 2000 15:31:25 -0700
MIME-Version: 1.0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Priority: 3
X-MSMail-Priority: Normal
Reply-To: xs24@netease.com
Message-Id: <0010300611092657200@nt-s>
X-RBL-Warning: (relays.mail-abuse.org) 
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

<HTML>
<BODY>

<FONT face=3D"MS Sans Serif">
<FONT size=3D2> Email advertising WORKS!<BR>
Email Advertise your product or website to millions for only $99.<BR>
<BR>
For $99.00 you will receive the Stealth Mass Mailer Software,<BR>
List Manager, Over 10 million email addresses, and as a free bonus, <BR>
a Bulletproof mail server to send your mail through. <BR>
NEVER, lose your ISP service again. <BR>
<BR>
For more info, just respond to this message, with "$99 Special" in the<BR>
subject line.  Reply to:  xs24@netease.com<BR>
<BR>
To be removed from our mail list, reply with "Remove" in subject line.<BR>
<BR>
</FONT></FONT>
</BODY>
</HTML>




From xs24@netease.com Sun Oct 29 17:39:10 2000
Received: from [210.63.202.1] (helo=nt-s)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13q16a-0000Sf-00
	for <bug-bash@prep.ai.mit.edu>; Sun, 29 Oct 2000 17:39:09 -0500
Received: by nt-s with MERCUR-SMTP/POP3/IMAP4-Server (v3.00.25 RI-0000000) for <bug-bash@prep.ai.mit.edu> at Mon, 30 Oct 2000  06:11:27 +0800
To: <Undisclosed Recipients>
From: xs24@netease.com
Subject: 10 Million E-Addresses, Stealth Mass Mailer & More..                         11285
Date: Mon, 30 Oct 2000 15:31:43 -0700
MIME-Version: 1.0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Priority: 3
X-MSMail-Priority: Normal
Reply-To: xs24@netease.com
Message-Id: <0010300611272658700@nt-s>
X-RBL-Warning: (relays.mail-abuse.org) 
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

<HTML>
<BODY>

<FONT face=3D"MS Sans Serif">
<FONT size=3D2> Email advertising WORKS!<BR>
Email Advertise your product or website to millions for only $99.<BR>
<BR>
For $99.00 you will receive the Stealth Mass Mailer Software,<BR>
List Manager, Over 10 million email addresses, and as a free bonus, <BR>
a Bulletproof mail server to send your mail through. <BR>
NEVER, lose your ISP service again. <BR>
<BR>
For more info, just respond to this message, with "$99 Special" in the<BR>
subject line.  Reply to:  xs24@netease.com<BR>
<BR>
To be removed from our mail list, reply with "Remove" in subject line.<BR>
<BR>
</FONT></FONT>
</BODY>
</HTML>




From news@dejanews.com Sun Oct 29 21:21:21 2000
Received: from moderated.news.pipex.net ([158.43.192.79])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13q4Zd-0004RU-00
	for <bug-bash@prep.ai.mit.edu>; Sun, 29 Oct 2000 21:21:21 -0500
Received: (qmail 29909 invoked by alias); 30 Oct 2000 02:20:56 -0000
Received: (qmail 29905 invoked from network); 30 Oct 2000 02:20:55 -0000
Received: from mail.deja.com (64.57.170.34)
  by moderated.news.pipex.net with SMTP; 30 Oct 2000 02:20:55 -0000
Received: from nnrp1.deja.com (nnrp1.deja.com [10.12.2.16])
	by mail.deja.com (8.8.7/8.8.5) with ESMTP id UAA10389
	for <gnu-bash-bug@moderators.isc.org>; Sun, 29 Oct 2000 20:19:48 -0600
Received: (news@localhost) by nnrp1.deja.com (8.7.6/8.6.12) id UAA17535; Sun, 29 Oct 2000 20:19:43 -0600
To: gnu-bash-bug@moderators.isc.org
Path: not-for-mail
From: Demonic Deadhead <scullandroses77@my-deja.com>
Newsgroups: gnu.bash.bug,rec.music.gdead
Subject: Re: AT LAST!!!! BULK-FRIENDLY WEB HOSTING
Date: Mon, 30 Oct 2000 02:19:47 GMT
Organization: Deja.com - Before you buy.
Lines: 33
Message-ID: <8tilrv$h3u$1@nnrp1.deja.com>
References: <EYkK5.35298$sE.70406@news6-win.server.ntlworld.com>
NNTP-Posting-Host: 205.188.193.159
X-Article-Creation-Date: Mon Oct 30 02:19:47 2000 GMT
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; AOL 5.0; Windows 98; DigExt)
X-Http-Proxy: 1.0 x66.deja.com:80 (Squid/1.1.22) for client 205.188.193.159
X-MyDeja-Info: XMYDJUIDscullandroses77
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

In article <EYkK5.35298$sE.70406@news6-win.server.ntlworld.com>,
  "nobody@hotmail.com"<nobody@hotmail.com> wrote:
> I found this incredible service called HOSTING MATTERS.
>
> Hosting Matters is a fantastic way to host adult and bulk email-
friendly sites with NO WORRIES about getting shut down as they are only
out to try and make money. The service is VERY CHEAP and I reccomend it
for the following types of sites:
>
> - Bulk emailing
> - Adult content & services
> - Controversial/Hate sites
>
> As far as I know, they have NEVER shut down above-mentioned types of
sites!
>
> For more info contact them on the web site below.
>
> http://www.hostmatters.com
>
> or an alternative URL:
>
> http://www.hostingmatters.com
>
> Contact sales@hostmatters.com or call TOLL-FREE on 1-877-381-1083 if
you have any questions.
>

 Hey nobody, are you WAVY GRAVY?????


Sent via Deja.com http://www.deja.com/
Before you buy.


From chet@granite.ins.cwru.edu Mon Oct 30 10:00:06 2000
Received: from granite.ins.cwru.edu ([129.22.8.228])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13qGPt-0004pT-00
	for <bug-bash@prep.ai.mit.edu>; Mon, 30 Oct 2000 10:00:05 -0500
Received: (chet@localhost) by granite.INS.CWRU.Edu (8.8.8+cwru/CWRU-2.5-bsdi)
	id KAA01500; Mon, 30 Oct 2000 10:00:01 -0500 (EST) (from chet)
Message-Id: <200010301500.KAA01500@granite.INS.CWRU.Edu>
Date: Mon, 30 Oct 2000 10:00:01 -0500 (EST)
From: chet@po.cwru.edu (Chet Ramey)
To: bug-bash@prep.ai.mit.edu
Subject: BASH Frequently-Asked Questions (FAQ version 3.9)
Reply-To: chet@po.cwru.edu
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Archive-name: unix-faq/shell/bash
Posting-Frequency: monthly
Submitted-By: chet@po.cwru.edu (Chet Ramey)
Last-Modified: Thu May 18 13:08:48 EDT 2000
FAQ-Version: 3.9
Bash-Version: 2.04
URL: ftp://ftp.cwru.edu/pub/bash/FAQ
Maintainer: chet@po.cwru.edu (Chet Ramey)

This is the Bash FAQ, version 3.9, for Bash version 2.04.

This document contains a set of frequently-asked questions concerning
Bash, the GNU Bourne-Again Shell.  Bash is a freely-available command
interpreter with advanced features for both interactive use and shell
programming.

Another good source of basic information about shells is the collection
of FAQ articles periodically posted to comp.unix.shell.

Questions and comments concerning this document should be sent to
chet@po.cwru.edu.

This document is available for anonymous FTP with the URL

ftp://ftp.cwru.edu/pub/bash/FAQ

The Bash home page is http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html

----------
Contents:

Section A:  The Basics

A1) What is it?
A2) What's the latest version?
A3) Where can I get it?
A4) On what machines will bash run?
A5) Will bash run on operating systems other than Unix?
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'?
A10) What is the bash `posix mode'?

Section B:  The latest version

B1) What's new in version 2.04?
B2) Are there any user-visible incompatibilities between bash-2.04 and
    bash-1.14.7?

Section C:  Differences from other Unix shells

C1) How does bash differ from sh, the Bourne shell?
C2) How does bash differ from the Korn shell, version ksh88?
C3) Which new features in ksh-93 are not in bash, and which are?

Section D:  Why does bash do some things differently than other Unix shells?

D1) Why does bash run a different version of `command' than
    `which command' says it will?
D2) Why doesn't bash treat brace expansions exactly like csh?
D3) Why doesn't bash have csh variable modifiers?
D4) How can I make my csh aliases work when I convert to bash?
D5) How can I pipe standard output and standard error from one command to
    another, like csh does with `|&'?
D6) Now that I've converted from ksh to bash, are there equivalents to
    ksh features like autoloaded functions and the `whence' command?

Section E:  Why does bash do certain things the way it does?

E1) Why is the bash builtin `test' slightly different from /bin/test?
E2) Why does bash sometimes say `Broken pipe'?
E3) When I have terminal escape sequences in my prompt, why does bash
    wrap lines at the wrong column?
E4) If I pipe the output of a command into `read variable', why doesn't
    the output show up in $variable when the read command finishes?
E5) I have a bunch of shell scripts that use backslash-escaped characters
    in arguments to `echo'.  Bash doesn't interpret these characters.  Why
    not, and how can I make it understand them?
E6) Why doesn't a while or for loop get suspended when I type ^Z?
E7) What about empty for loops in Makefiles?
E8) Why does the arithmetic evaluation code complain about `08'?

Section F:  Things to watch out for on certain Unix versions

F1) Why can't I use command line editing in my `cmdtool'?
F2) I built bash on Solaris 2.  Why do globbing expansions and filename
    completion chop off the first few characters of each filename?
F3) Why does bash dump core after I interrupt username completion or
    `~user' tilde expansion on a machine running NIS?
F4) I'm running SVR4.2.  Why is the line erased every time I type `@'?
F5) Why does bash report syntax errors when my C News scripts use a
    redirection before a subshell command?
F6) Why can't I use vi-mode editing on Red Hat Linux 6.1?

Section G:  How can I get bash to do certain common things?

G1) How can I get bash to read and display eight-bit characters?
G2) How do I write a function `x' to replace builtin command `x', but
    still invoke the command from within the function?
G3) How can I find the value of a shell variable whose name is the value
    of another shell variable?
G4) How can I make the bash `time' reserved word print timing output that
    looks like the output from my system's /usr/bin/time?
G5) How do I get the current directory into my prompt?
G6) How can I rename "*.foo" to "*.bar"?
G7) How can I translate a filename from uppercase to lowercase?
G8) How can I write a filename expansion (globbing) pattern that will match
    all files in the current directory except "." and ".."?

Section H:  Where do I go from here?

H1) How do I report bugs in bash, and where should I look for fixes and
    advice?
H2) What kind of bash documentation is there?
H3) What's coming in future versions?
H4) What's on the bash `wish list'?
H5) When will the next release appear?

----------
Section A:  The Basics

A1)  What is it?

Bash is a Unix command interpreter (shell).  It is an implementation of
the Posix 1003.2 shell standard, and resembles the Korn and System V
shells.

Bash contains a number of enhancements over those shells, both
for interactive use and shell programming.  Features geared
toward interactive use include command line editing, command
history, job control, aliases, and prompt expansion.  Programming
features include additional variable expansions, shell
arithmetic, and a number of variables and options to control
shell behavior.

Bash was originally written by Brian Fox of the Free Software
Foundation.  The current developer and maintainer is Chet Ramey
of Case Western Reserve University.

A2)  What's the latest version?

The latest version is 2.04, first made available on Friday, 17 March 2000.

A3)  Where can I get it?

Bash is the GNU project's shell, and so is available from the
master GNU archive site, ftp.gnu.org, and its mirrors.  The
latest version is also available for FTP from ftp.cwru.edu.
The following URLs tell how to get version 2.04:

ftp://ftp.gnu.org/pub/gnu/bash/bash-2.04.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-2.04.tar.gz

Formatted versions of the documentation are available with the URLs:

ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-2.04.tar.gz
ftp://ftp.cwru.edu/pub/bash/bash-doc-2.04.tar.gz

A4)  On what machines will bash run?

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
itself accordingly, using a script created by GNU autoconf.

More information appears in the file `INSTALL' in the distribution.

A5) Will bash run on operating systems other than Unix?

Configuration specifics for Unix-like systems such as QNX and
LynxOS are included in the distribution.  Bash-2.04 should 
compile and run on Minix 2.0 (patches were contributed), but I
don't believe anyone has built bash-2.x on earlier Minix versions
yet.

Bash has been ported to versions of Windows implementing the Win32
programming interface.  This includes Windows 95 and Windows NT.
The port was done by Cygnus Solutions as part of their CYGWIN
project.  For more information about the project, look at the URL

http:/sourceware.cygnus.com/cygwin

Cygnus originally ported bash-1.14.7, and that port was part of their
early GNU-Win32 (the original name) releases.  Cygnus has also done a
port of bash-2.02.1 to the CYGWIN environment, and it is available as
part of their current release.  (They may have upgraded by now.)

Bash-2.04 should require no local Cygnus changes to build and run under
CYGWIN.

The Cygnus port works only on Intel machines.  There is a port of bash
(I don't know which version) to the alpha/NT environment available from

ftp://ftp.gnustep.org//pub/win32/bash-alpha-nt-1.01.tar.gz

Softway Systems has ported bash-2.01 to their Interix (nee OpenNT)
system, a Unix subsystem for NT that replaces the Microsoft POSIX
subsystem.  Check out http://www.interix.com for more information.
Some support for Interix has been incorporated into bash, beginning
with Bash-2.03.  It should be easier to build bash on Interix now,
but Interix users should fetch

ftp://ftp.interix.com/pub/tw/unsup/bash.diffs.tar.gz

and read the README.OpenNT file in that archive.  It will detail the
arguments `configure' needs to build on Interix.  A configure cache
file for Interix is in the bash distribution in cross-build/opennt.cache;
copy that to `config.cache' before starting configure.

DJ Delorie has a port of bash-1.14.7 which runs under MS-DOS, as part
of the DJGPP project.  For more information on the project, see

http://www.delorie.com/djgpp/

I have been told that the original DJGPP port was done by Daisuke Aoyama.

I picked up a binary of bash-1.14.7 that is purported to work with
the DJGPP V2 environment from

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147b.zip

The corresponding source is

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh1147s.zip

Mark Elbrecht <snowball3@bigfoot.com> has sent me notice that bash-2.03
has become available for DJGPP V2.  The files are available as:

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203b.zip	binary
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203d.zip	documentation
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh203s.zip	source

Mark has begun to work with bash-2.04.

Ports of bash-1.12 and bash-2.0 are available for OS/2 from

ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash_112.zip
ftp://hobbes.nmsu.edu/pub/os2/util/shell/bash-2.0(253).zip

I haven't looked at either, but the second appears to be a binary-only
distribution.  Beware.

I have received word that Bash (I'm not sure which version, but I
believe that it's at least bash-2.02.1) is the standard shell on
BeOS.

A6) How can I build bash with gcc? 

Bash configures to use gcc by default if it is available.  Read the
file INSTALL in the distribution for more information.

A7)  How can I make bash my login shell?

Some machines let you use `chsh' to change your login shell.  Other
systems use `passwd -s' or `passwd -e'.  If one of these works for
you, that's all you need.  Note that many systems require the full
pathname to a shell to appear in /etc/shells before you can make it
your login shell.  For this, you may need the assistance of your
friendly local system administrator. 

If you cannot do this, you can still use bash as your login shell, but
you need to perform some tricks.  The basic idea is to add a command
to your login shell's startup file to replace your login shell with
bash.

For example, if your login shell is csh or tcsh, and you have installed
bash in /usr/gnu/bin/bash, add the following line to ~/.login:

	if ( -f /usr/gnu/bin/bash ) exec /usr/gnu/bin/bash --login

(the `--login' tells bash that it is a login shell).

It's not a good idea to put this command into ~/.cshrc, because every
csh you run without the `-f' option, even ones started to run csh scripts,
reads that file.  If you must put the command in ~/.cshrc, use something
like

	if ( $?prompt ) exec /usr/gnu/bin/bash --login

to ensure that bash is exec'd only when the csh is interactive.

If your login shell is sh or ksh, you have to do two things.

First, create an empty file in your home directory named `.bash_profile'.
The existence of this file will prevent the exec'd bash from trying to
read ~/.profile, and re-execing itself over and over again.  ~/.bash_profile
is the first file bash tries to read initialization commands from when
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

This will cause login shells to replace themselves with bash running as
a login shell.  Once you have this working, you can copy your initialization
code from ~/.profile to ~/.bash_profile.

I have received word that the recipe supplied above is insufficient for
machines running CDE.  CDE has a maze of twisty little startup files, all
slightly different.

If you cannot change your login shell in the password file to bash, you
will have to (apparently) live with CDE using the shell in the password
file to run its startup scripts.  If you have changed your shell to bash,
there is code in the CDE startup files (on Solaris, at least) to do the
right thing. 

`dtterm' claims to use $SHELL as the default program to start, so if you
can change $SHELL in the CDE startup files, you should be able to use bash
in your terminal windows.

Setting DTSOURCEPROFILE in ~/.dtprofile will cause the `Xsession' program
to read your login shell's startup files.  You may be able to use bash for
the rest of the CDE programs by setting SHELL to bash in ~/.dtprofile as
well, but I have not tried this.

You can use the above `exec' recipe to start bash when not logging in with
CDE by testing the value of the DT variable:

	if [ -n "$DT" ]; then
	        [ -f /usr/gnu/bin/bash ] && exec /usr/gnu/bin/bash --login
	fi


A8) I just changed my login shell to bash, and now I can't FTP into my
   machine.  Why not?

You must add the full pathname to bash to the file /etc/shells.  As
noted in the answer to the previous question, many systems require
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'?

POSIX is a name originally coined by Richard Stallman for a
family of open system standards based on UNIX.  There are a
number of aspects of UNIX under consideration for
standardization, from the basic system services at the system
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. 

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 `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
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
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.

A10)  What is the bash `posix mode'?

Although bash is an implementation of the POSIX.2 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. 

Posix mode is entered by starting bash with the --posix option or
executing `set -o posix' after bash is running.

The specific aspects of bash which change when posix mode is
active are listed in the file CWRU/POSIX.NOTES in the bash
distribution.  They are also listed in a section in the Bash
Reference Manual.

Section B:  The latest version

B1) What's new in version 2.04?

Bash-2.04 contains the following new features (see the manual page for
complete descriptions and the CHANGES and NEWS files in the bash-2.04
distribution):

o Programmable word completion with the new `complete' and `compgen' builtins;
  examples are provided in examples/complete/complete-examples
o `history' has a new `-d' option to delete a history entry
o `bind' has a new `-x' option to bind key sequences to shell commands
o The prompt expansion code has new `\j' and `\l' escape sequences
o The `no_empty_cmd_completion' shell option, if enabled, inhibits
  command completion when TAB is typed on an empty line
o `help' has a new `-s' option to print a usage synopsis
o New arithmetic operators: var++, var--, ++var, --var, expr1,expr2 (comma)
o New ksh93-style arithmetic for command:
	for ((expr1 ; expr2; expr3 )); do list; done
o `read' has new options: `-t', `-n', `-d', `-s'
o The redirection code handles several filenames specially:  /dev/fd/N,
  /dev/stdin, /dev/stdout, /dev/stderr
o The redirection code now recognizes /dev/tcp/HOST/PORT and
  /dev/udp/HOST/PORT and tries to open a TCP or UDP socket, respectively,
  to the specified port on the specified host
o The ${!prefix*} expansion has been implemented
o A new FUNCNAME variable, which expands to the name of a currently-executing
  function
o The GROUPS variable is no longer readonly
o A new shopt `xpg_echo' variable, to control the behavior of echo with
  respect to backslash-escape sequences at runtime
o The NON_INTERACTIVE_LOGIN_SHELLS #define has returned

The version of Readline released with Bash-2.04, Readline-4.1, has several
new features as well:

o Parentheses matching is always compiled into readline, and controllable
  with the new `blink-matching-paren' variable
o The history-search-forward and history-search-backward functions now leave
  point at the end of the line when the search string is empty, like
  reverse-search-history, and forward-search-history
o A new function for applications:  rl_on_new_line_with_prompt()
o New variables for applications:  rl_already_prompted, and rl_gnu_readline_p


A short feature history dating from bash-2.0:

Bash-2.03 had very few new features, in keeping with the convention
that odd-numbered releases provide mainly bug fixes.  A number of new
features were added to Readline, mostly at the request of the Cygnus
folks.

A new shopt option, `restricted_shell', so that startup files can test
	whether or not the shell was started in restricted mode
Filename generation is now performed on the words between ( and ) in
	compound array assignments (this is really a bug fix)
OLDPWD is now auto-exported, as POSIX.2 requires
ENV and BASH_ENV are read-only variables in a restricted shell
Bash may now be linked against an already-installed Readline library,
	as long as the Readline library is version 4 or newer
All shells begun with the `--login' option will source the login shell
	startup files, even if the shell is not interactive

There were lots of changes to the version of the Readline library released
along with Bash-2.03.  For a complete list of the changes, read the file
CHANGES in the Bash-2.03 distribution.

Bash-2.02 contained the following new features:

a new version of malloc (based on the old GNU malloc code in previous
	bash versions) that is more page-oriented, more conservative
	with memory usage, does not `orphan' large blocks when they
	are freed, is usable on 64-bit machines, and has allocation
	checking turned on unconditionally
POSIX.2-style globbing character classes ([:alpha:], [:alnum:], etc.)
POSIX.2-style globbing equivalence classes
POSIX.2-style globbing collating symbols
the ksh [[...]] extended conditional command
the ksh egrep-style extended pattern matching operators
a new `printf' builtin
the ksh-like $(<filename) command substitution, which is equivalent to
	$(cat filename)
new tilde prefixes that expand to directories from the directory stack
new `**' arithmetic operator to do exponentiation
case-insensitive globbing (filename expansion)
menu completion a la tcsh
`magic-space' history expansion function like tcsh
the readline inputrc `language' has a new file inclusion directive ($include)

Bash-2.01 contained only a few new features:

new `GROUPS' builtin array variable containing the user's group list
new bindable readline commands: history-and-alias-expand-line and
	alias-expand-line

Bash-2.0 contained extensive changes and new features from bash-1.14.7.
Here's a short list:

new `time' reserved word to time pipelines, shell builtins, and
	shell functions
one-dimensional arrays with a new compound assignment statement,
        appropriate expansion constructs and modifications to some
	of the builtins (read, declare, etc.) to use them
new quoting syntaxes for ANSI-C string expansion and locale-specific
	string translation
new expansions to do substring extraction, pattern replacement, and
	indirect variable expansion
new builtins: `disown' and `shopt'
new variables: HISTIGNORE, SHELLOPTS, PIPESTATUS, DIRSTACK, GLOBIGNORE,
	       MACHTYPE, BASH_VERSINFO
special handling of many unused or redundant variables removed
	(e.g., $notify, $glob_dot_filenames, $no_exit_on_failed_exec)
dynamic loading of new builtin commands; many loadable examples provided
new prompt expansions: \a, \e, \n, \H, \T, \@, \v, \V
history and aliases available in shell scripts
new readline variables: enable-keypad, mark-directories, input-meta,
	visible-stats, disable-completion, comment-begin
new readline commands to manipulate the mark and operate on the region
new readline emacs mode commands and bindings for ksh-88 compatibility
updated and extended builtins
new DEBUG trap
expanded (and now documented) restricted shell mode

implementation stuff:	
autoconf-based configuration
nearly all of the bugs reported since version 1.14 have been fixed
most builtins converted to use builtin `getopt' for consistency
most builtins use -p option to display output in a reusable form
	(for consistency)
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.04 and
    bash-1.14.7?

There are a few incompatibilities between version 1.14.7 and version 2.04.
They are detailed in the file COMPAT in the bash-2.04 distribution.

Section C:  Differences from other Unix shells

C1) How does bash differ from sh, the Bourne shell?

This is a non-comprehensive list of features that differentiate bash
from the SVR4.2 shell.  The bash manual page explains these more
completely.

Things bash has that sh does not:
	long invocation options
	`!' reserved word to invert pipeline return value
	`time' reserved word to time pipelines and shell builtins
	the `function' reserved word
	the `select' compound command and reserved word
	arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
	new $'...' and $"..." quoting
	the $(...) form of command substitution
	the $(<filename) form of command substitution, equivalent to
		$(cat filename)
	the ${#param} parameter value length operator
	the ${!param} indirect parameter expansion operator
	the ${!param*} prefix expansion operator
	the ${param:length[:offset]} parameter substring operator
	the ${param/pat[/string]} parameter pattern substitution operator
	expansions to perform substring removal (${p%[%]w}, ${p#[#]w})
	expansion of positional parameters beyond $9 with ${num}
	variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, REPLY,
		   TIMEFORMAT, PPID, PWD, OLDPWD, SHLVL, RANDOM, SECONDS,
		   LINENO, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE, HOSTNAME,
		   ENV, PS3, PS4, DIRSTACK, PIPESTATUS, HISTSIZE, HISTFILE,
		   HISTFILESIZE, HISTCONTROL, HISTIGNORE, GLOBIGNORE, GROUPS,
		   PROMPT_COMMAND, FCEDIT, FIGNORE, IGNOREEOF, INPUTRC,
		   SHELLOPTS, OPTERR, HOSTFILE, TMOUT, FUNCNAME, histchars,
		   auto_resume
	DEBUG trap
	variable arrays with new compound assignment syntax
	redirections: <>, &>, >|
	prompt string special char translation and variable expansion
	auto-export of variables in initial environment
	command search finds functions before builtins
	bash return builtin will exit a file sourced with `.'
	builtins: cd -/-L/-P, exec -l/-c/-a, echo -e/-E, hash -p.
		  export -n/-f/-p/name=value, pwd -L/-P,
		  read -e/-p/-a/-t/-n/-d/-s,
		  readonly -a/-f/name=value, trap -l, set +o,
		  set -b/-m/-o option/-h/-p/-B/-C/-H/-P,
		  unset -f/-v, ulimit -m/-p/-u,
		  type -a/-p/-t, suspend -f, kill -n,
		  test -o optname/s1 == s2/s1 < s2/s1 > s2/-nt/-ot/-ef/-O/-G/-S
	bash reads ~/.bashrc for interactive shells, $ENV for non-interactive
	bash restricted shell mode is more extensive
	bash allows functions and variables with the same name
	brace expansion
	tilde expansion
	arithmetic expansion with $((...)) and `let' builtin
	the `[[...]]' extended conditional command
	process substitution
	aliases and alias/unalias builtins
	local variables in functions and `local' builtin
	readline and command-line editing with programmable completion
	command history and history/fc builtins
	csh-like history expansion
	other new bash builtins: bind, command, compgen, complete, builtin,
				 declare/typeset, dirs, enable, fc, help,
				 history, logout, popd, pushd, disown, shopt,
				 printf
	exported functions
	filename generation when using output redirection (command >a*)
	POSIX.2-style globbing character classes
	POSIX.2-style globbing equivalence classes
	POSIX.2-style globbing collating symbols
	egrep-like extended pattern matching operators
	case-insensitive pattern matching and globbing
	variable assignments preceding commands affect only that command,
		even for builtins and functions
	posix mode
	redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr,
		/dev/tcp/host/port, /dev/udp/host/port

Things sh has that bash does not:
	uses variable SHACCT to do shell accounting
	includes `stop' builtin (bash can use alias stop='kill -s STOP')
	`newgrp' builtin
	turns on job control if called as `jsh'
	$TIMEOUT (like bash $TMOUT)
	`^' is a synonym for `|'
	new SVR4.2 sh builtins: mldmode, priv

Implementation differences:
	redirection to/from compound commands causes sh to create a subshell
	bash does not allow unbalanced quotes; sh silently inserts them at EOF
	bash does not mess with signal 11
	sh sets (euid, egid) to (uid, gid) if -p not supplied and uid < 100
	bash splits only the results of expansions on IFS, using POSIX.2
		field splitting rules; sh splits all words on IFS
	sh does not allow MAILCHECK to be unset (?)
	sh does not allow traps on SIGALRM or SIGCHLD
	bash allows multiple option arguments when invoked (e.g. -x -v);
		sh allows only a single option argument (`sh -x -v' attempts
		to open a file named `-v', and, on SunOS 4.1.4, dumps core.
		On Solaris 2.4 and earlier versions, sh goes into an infinite
		loop.)
	sh exits a script if any builtin fails; bash exits only if one of
		the POSIX.2 `special' builtins fails

C2)  How does bash differ from the Korn shell, version ksh88?

Things bash has or uses that ksh88 does not:
	long invocation options
	`!' reserved word
	arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
	posix mode and posix conformance
	command hashing
	tilde expansion for assignment statements that look like $PATH
	process substitution with named pipes if /dev/fd is not available
	the ${!param} indirect parameter expansion operator
	the ${!param*} prefix expansion operator
	the ${param:length[:offset]} parameter substring operator
	the ${param/pat[/string]} parameter pattern substitution operator
	variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, SHLVL,
		   TIMEFORMAT, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE,
		   HISTFILESIZE, HISTIGNORE, HISTCONTROL, PROMPT_COMMAND,
		   IGNOREEOF, FIGNORE, INPUTRC, HOSTFILE, DIRSTACK,
		   PIPESTATUS, HOSTNAME, OPTERR, SHELLOPTS, GLOBIGNORE,
		   GROUPS, FUNCNAME, histchars, auto_resume
	prompt expansion with backslash escapes and command substitution
	redirection: &> (stdout and stderr)
	more extensive and extensible editing and programmable completion
	builtins: bind, builtin, command, declare, dirs, echo -e/-E, enable,
		  exec -l/-c/-a, fc -s, export -n/-f/-p, hash, help, history,
		  jobs -x/-r/-s, kill -s/-n/-l, local, logout, popd, pushd,
		  read -e/-p/-a/-t/-n/-d/-s, readonly -a/-n/-f/-p,
		  set -o braceexpand/-o histexpand/-o interactive-comments/
		  -o notify/-o physical/-o posix/-o hashall/-o onecmd/
		  -h/-B/-C/-b/-H/-P, set +o, suspend, trap -l, type,
		  typeset -a/-F/-p, ulimit -u, umask -S, alias -p, shopt,
		  disown, printf, complete, compgen
	`!' csh-style history expansion
	POSIX.2-style globbing character classes
	POSIX.2-style globbing equivalence classes
	POSIX.2-style globbing collating symbols
	egrep-like extended pattern matching operators
	case-insensitive pattern matching and globbing
	`**' arithmetic operator to do exponentiation
	redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr

Things ksh88 has or uses that bash does not:
	tracked aliases
	variables: ERRNO, FPATH, EDITOR, VISUAL
	co-processes (|&, >&p, <&p)
	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,
		  read -p/-s/-u/var?prompt, set -A/-o gmacs/
		  -o bgnice/-o markdirs/-o nolog/-o trackall/-o viraw/-s,
		  typeset -H/-L/-R/-A/-ft/-fu/-fx/-l/-u/-t, whence

Implementation differences:
	ksh runs last command of a pipeline in parent shell context
	bash has brace expansion by default (ksh88 compile-time option)
	bash has fixed startup file for all interactive shells; ksh reads $ENV
	bash has exported functions
	bash command search finds functions before builtins

C3)  Which new features in ksh-93 are not in bash, and which are?

New things in ksh-93 not in bash-2.04:
	associative arrays
	floating point arithmetic
	math library functions
	${!name[sub]} name of subscript for associative array
	`.' is allowed in variable names to create a hierarchical namespace
	more extensive compound assignment syntax
	discipline functions
	`sleep' and `getconf' builtins (bash has loadable versions)
	typeset -n and `nameref' variables
	KEYBD trap
	variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, .sh.version,
		   .sh.name, .sh.subscript, .sh.value, HISTEDIT
	backreferences in pattern matching
	print -f (bash uses printf)
	`fc' has been renamed to `hist'
	`.' can execute shell functions

New things in ksh-93 present in bash-2.04:
        for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command
        ?:, ++, --, `expr1 , expr2' arithmetic operators
	expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]},
		    ${!param*}
	compound array assignment
	the `!' reserved word
	loadable builtins -- but ksh uses `builtin' while bash uses `enable'
	`command', `builtin', `disown' builtins
	new $'...' and $"..." quoting
	FIGNORE (but bash uses GLOBIGNORE), HISTCMD
	set -o notify/-C
	changes to kill builtin
	read -A (bash uses read -a)
        read -t/-d
	trap -p
	exec -c/-a
	`.' restores the positional parameters when it completes
	POSIX.2 `test'
	umask -S
	unalias -a
	command and arithmetic substitution performed on PS1, PS4, and ENV
	command name completion
	ENV processed only for interactive shells

Section D:  Why does bash do some things differently than other Unix shells?

D1) Why does bash run a different version of `command' than
    `which command' says it will?

On many systems, `which' is actually a csh script that assumes
you're running csh.  In tcsh, `which' and its cousin `where'
are builtins.  On other Unix systems, `which' is a perl script
that uses the PATH environment variable.

The csh script version reads the csh startup files from your
home directory and uses those to determine which `command' will
be invoked.  Since bash doesn't use any of those startup files,
there's a good chance that your bash environment differs from
your csh environment.  The bash `type' builtin does everything
`which' does, and will report correct results for the running
shell.  If you're really wedded to the name `which', try adding
the following function definition to your .bashrc:

	which()
	{
		builtin type "$@"
	}

If you're moving from tcsh and would like to bring `where' along
as well, use this function:

	where()
	{
		builtin type -a "$@"
	}

D2) Why doesn't bash treat brace expansions exactly like csh?

The only difference between bash and csh brace expansion is that
bash requires a brace expression to contain at least one unquoted
comma if it is to be expanded.  Any brace-surrounded word not
containing an unquoted comma is left unchanged by the brace
expansion code.  This affords the greatest degree of sh
compatibility. 

Bash, ksh, zsh, and pd-ksh all implement brace expansion this way. 

D3) Why doesn't bash have csh variable modifiers?

Posix has specified a more powerful, albeit somewhat more cryptic,
mechanism cribbed from ksh, and bash implements it.

${parameter%word}
        Remove smallest suffix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        smallest portion of the suffix matched by the pattern deleted.

        x=file.c
        echo ${x%.c}.o
        -->file.o

${parameter%%word}

        Remove largest suffix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        largest portion of the suffix matched by the pattern deleted.

        x=posix/src/std
        echo ${x%%/*}
        -->posix

${parameter#word}
        Remove smallest prefix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        smallest portion of the prefix matched by the pattern deleted.

        x=$HOME/src/cmd
        echo ${x#$HOME}
        -->/src/cmd

${parameter##word}
        Remove largest prefix pattern.  The WORD is expanded to produce
        a pattern.  It then expands to the value of PARAMETER, with the
        largest portion of the prefix matched by the pattern deleted.

        x=/one/two/three
        echo ${x##*/}
        -->three


Given
	a=/a/b/c/d
	b=b.xxx

	csh			bash		result
	---			----		------
	$a:h			${a%/*}		   /a/b/c
	$a:t			${a##*/}	   d
	$b:r			${b%.*}		   b
	$b:e			${b##*.}	   xxx


D4) How can I make my csh aliases work when I convert to bash?

Bash uses a different syntax to support aliases than csh does. 
The details can be found in the documentation.  We have provided
a shell script which does most of the work of conversion for you;
this script can be found in ./examples/misc/alias-conv.sh.  Here is
how you use it:
  
Start csh in the normal way for you.  (e.g., `csh')
  
Pipe the output of `alias' through `alias-conv.sh', saving the
results into `bash_aliases':
  
	alias | alias-conv.sh >bash_aliases
  
Edit `bash_aliases', carefully reading through any created
functions.  You will need to change the names of some csh specific
variables to the bash equivalents.  The script converts $cwd to
$PWD, $term to $TERM, $home to $HOME, $user to $USER, and $prompt
to $PS1.  You may also have to add quotes to avoid unwanted
expansion.

For example, the csh alias:
  
	alias cd 'cd \!*; echo $cwd'
  
is converted to the bash function:

	cd () { command cd "$@"; echo $PWD ; }

The only thing that needs to be done is to quote $PWD:
  
	cd () { command cd "$@"; echo "$PWD" ; }
  
Merge the edited file into your ~/.bashrc.

There is an additional, more ambitious, script in
examples/misc/cshtobash that attempts to convert your entire csh
environment to its bash equivalent.  This script can be run as
simply `cshtobash' to convert your normal interactive
environment, or as `cshtobash ~/.login' to convert your login
environment. 

D5) How can I pipe standard output and standard error from one command to
    another, like csh does with `|&'?

Use
	command 2>&1 | command2

The key is to remember that piping is performed before redirection, so
file descriptor 1 points to the pipe when it is duplicated onto file
descriptor 2.

D6) Now that I've converted from ksh to bash, are there equivalents to
    ksh features like autoloaded functions and the `whence' command?

There are features in ksh-88 and ksh-93 that do not have direct bash
equivalents.  Most, however, can be emulated with very little trouble.

ksh-88 feature		Bash equivalent
--------------		---------------
compiled-in aliases	set up aliases in .bashrc; some ksh aliases are
			bash builtins (hash, history, type)
coprocesses		named pipe pairs (one for read, one for write)
typeset +f		declare -F
cd, print, whence	function substitutes in examples/functions/kshenv
autoloaded functions	examples/functions/autoload is the same as typeset -fu
read var?prompt		read -p prompt var

ksh-93 feature		Bash equivalent
--------------		---------------
sleep, getconf		Bash has loadable versions in examples/loadables
${.sh.version}		$BASH_VERSION
print -f		printf
hist			alias fc=hist
$HISTEDIT		$FCEDIT

Section E:  How can I get bash to do certain things, and why does bash do
	    things the way it does?

E1) Why is the bash builtin `test' slightly different from /bin/test?

The specific example used here is [ ! x -o x ], which is false.

Bash's builtin `test' implements the Posix.2 spec, which can be
summarized as follows (the wording is due to David Korn):
   
Here is the set of rules for processing test arguments.
  
    0 Args: False
    1 Arg:  True iff argument is not null.
    2 Args: If first arg is !, True iff second argument is null.
	    If first argument is unary, then true if unary test is true
	    Otherwise error.
    3 Args: If second argument is a binary operator, do binary test of $1 $3
	    If first argument is !, negate two argument test of $2 $3
	    If first argument is `(' and third argument is `)', do the
	    one-argument test of the second argument.
	    Otherwise error.
    4 Args: If first argument is !, negate three argument test of $2 $3 $4.
	    Otherwise unspecified
    5 or more Args: unspecified.  (Historical shells would use their
    current algorithm).
   
The operators -a and -o are considered binary operators for the purpose
of the 3 Arg case.
   
As you can see, the test becomes (not (x or x)), which is false.

E2) Why does bash sometimes say `Broken pipe'?

If a sequence of commands appears in a pipeline, and one of the
reading commands finishes before the writer has finished, the
writer receives a SIGPIPE signal.  Many other shells special-case
SIGPIPE as an exit status in the pipeline and do not report it. 
For example, in:
  
      ps -aux | head
  
`head' can finish before `ps' writes all of its output, and ps
will try to write on a pipe without a reader.  In that case, bash
will print `Broken pipe' to stderr when ps is killed by a
SIGPIPE. 

You can build a version of bash that will not report SIGPIPE errors
by uncommenting the definition of DONT_REPORT_SIGPIPE in the file
config-top.h.

E3) When I have terminal escape sequences in my prompt, why does bash
    wrap lines at the wrong column?

Readline, the line editing library that bash uses, does not know
that the terminal escape sequences do not take up space on the
screen.  The redisplay code assumes, unless told otherwise, that
each character in the prompt is a `printable' character that
takes up one character position on the screen. 

You can use the bash prompt expansion facility (see the PROMPTING
section in the manual page) to tell readline that sequences of
characters in the prompt strings take up no screen space. 

Use the \[ escape to begin a sequence of non-printing characters,
and the \] escape to signal the end of such a sequence. 

E4) If I pipe the output of a command into `read variable', why doesn't
    the output show up in $variable when the read command finishes?

This has to do with the parent-child relationship between Unix
processes. 

Each element of a pipeline runs in a separate process, a child of
the shell running the pipeline.  A subprocess cannot affect its
parent's environment.  When the `read' command sets the variable
to the input, that variable is set only in the subshell, not the
parent shell.  When the subshell exits, the value of the variable
is lost. 

Many pipelines that end with `read variable' can be converted
into command substitutions, which will capture the output of
a specified command.  The output can then be assigned to a
variable:

	grep ^gnu /usr/lib/news/active | wc -l | read ngroup

can be converted into

	ngroup=$(grep ^gnu /usr/lib/news/active | wc -l)

This does not, unfortunately, work to split the text among
multiple variables, as read does when given multiple variable
arguments.  If you need to do this, you can either use the
command substitution above to read the output into a variable
and chop up the variable using the bash pattern removal
expansion operators or use some variant of the following
approach.

Say /usr/local/bin/ipaddr is the following shell script:

#! /bin/sh
host `hostname` | awk '/address/ {print $NF}'

Instead of using

	/usr/local/bin/ipaddr | read A B C D

to break the local machine's IP address into separate octets, use

	OIFS="$IFS"
	IFS=.
	set -- $(/usr/local/bin/ipaddr)
	IFS="$OIFS"
	A="$1" B="$2" C="$3" D="$4"

Beware, however, that this will change the shell's positional
parameters.  If you need them, you should save them before doing
this.

This is the general approach -- in most cases you will not need to
set $IFS to a different value.

E5) I have a bunch of shell scripts that use backslash-escaped characters
    in arguments to `echo'.  Bash doesn't interpret these characters.  Why
    not, and how can I make it understand them?

This is the behavior of echo on most Unix System V machines.

The bash builtin `echo' is modeled after the 9th Edition
Research Unix version of `echo'.  It does not interpret
backslash-escaped characters in its argument strings by default;
it requires the use of the -e option to enable the
interpretation.  The System V echo provides no way to disable the
special characters; the bash echo has a -E option to disable
them. 

There is a configuration option that will make bash behave like
the System V echo and interpret things like `\t' by default.  Run
configure with the --enable-usg-echo-default option to turn this
on.  Be aware that this will cause some of the tests run when you
type `make tests' to fail.

There is a shell option, `xpg_echo', settable with `shopt' that will
change the behavior of echo at runtime.  Enabling this option turns
on expansion of backslash-escape sequences.

E6) Why doesn't a while or for loop get suspended when I type ^Z?

This is a consequence of how job control works on Unix.  The only
thing that can be suspended is the process group.  This is a single
command or pipeline of commands that the shell forks and executes.

When you run a while or for loop, the only thing that the shell forks
and executes are any commands in the while loop test and commands in
the loop bodies.  These, therefore, are the only things that can be
suspended when you type ^Z.

If you want to be able to stop the entire loop, you need to put it
within parentheses, which will force the loop into a subshell that
may be stopped (and subsequently restarted) as a single unit.

E7) What about empty for loops in Makefiles?

It's fairly common to see constructs like this in automatically-generated
Makefiles:

SUBDIRS = @SUBDIRS@

	...

subdirs-clean:
	for d in $SUBDIRS; do \
		( cd $$d && ${MAKE} ${MFLAGS} clean ) \
	done

When SUBDIRS is empty, this results in a command like this being passed to
bash:

	for d in ; do
		( cd $$d && ${MAKE} ${MFLAGS} clean )
	done

This is a syntax error.  If the reserved word `in' is present, a word must
follow it before the semicolon or newline.  The language in the manual page
referring to the list of words being empty refers to the list after it is
expanded.  There must be at least one word following the `in' when the
construct is parsed.

The idiomatic Makefile solution is something like:

SUBDIRS = @SUBDIRS@

subdirs-clean:
	subdirs=$SUBDIRS ; for d in $$subdirs; do \
		( cd $$d && ${MAKE} ${MFLAGS} clean ) \
	done


The POSIX.2 interpretation committee has considered this issue and declared
that the bash implemenation is correct, according to the standard:

http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-169.html

E8) Why does the arithmetic evaluation code complain about `08'?

The bash arithmetic evaluation code (used for `let', $(()), (()), and in
other places), interprets a leading `0' in numeric constants as denoting
an octal number, and a leading `0x' as denoting hexadecimal.  This is
in accordance with the POSIX.2 spec, section 2.9.2.1, which states that
arithmetic constants should be handled as signed long integers as defined
by the ANSI/ISO C standard.

The POSIX.2 interpretation committee has confirmed this:

http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-173.html

Section F:  Things to watch out for on certain Unix versions

F1) Why can't I use command line editing in my `cmdtool'?

The problem is `cmdtool' and bash fighting over the input.  When
scrolling is enabled in a cmdtool window, cmdtool puts the tty in
`raw mode' to permit command-line editing using the mouse for
applications that cannot do it themselves.  As a result, bash and
cmdtool each try to read keyboard input immediately, with neither
getting enough of it to be useful.

This mode also causes cmdtool to not implement many of the
terminal functions and control sequences appearing in the
`sun-cmd' termcap entry.  For a more complete explanation, see
that file examples/suncmd.termcap in the bash distribution. 

`xterm' is a better choice, and gets along with bash much more
smoothly.

If you must use cmdtool, you can use the termcap description in
examples/suncmd.termcap.  Set the TERMCAP variable to the terminal
description contained in that file, i.e.

TERMCAP='Mu|sun-cmd:am:bs:km:pt:li#34:co#80:cl=^L:ce=\E[K:cd=\E[J:rs=\E[s:'

Then export TERMCAP and start a new cmdtool window from that shell.
The bash command-line editing should behave better in the new
cmdtool.  If this works, you can put the assignment to TERMCAP
in your bashrc file.

F2) I built bash on Solaris 2.  Why do globbing expansions and filename
    completion chop off the first few characters of each filename?

This is the consequence of building bash on SunOS 5 and linking
with the libraries in /usr/ucblib, but using the definitions
and structures from files in /usr/include. 

The actual conflict is between the dirent structure in
/usr/include/dirent.h and the struct returned by the version of
`readdir' in libucb.a (a 4.3-BSD style `struct direct'). 

Make sure you've got /usr/ccs/bin ahead of /usr/ucb in your $PATH
when configuring and building bash.  This will ensure that you
use /usr/ccs/bin/cc or acc instead of /usr/ucb/cc and that you
link with libc before libucb. 

If you have installed the Sun C compiler, you may also need to
put /usr/ccs/bin and /opt/SUNWspro/bin into your $PATH before
/usr/ucb.

F3) Why does bash dump core after I interrupt username completion or
    `~user' tilde expansion on a machine running NIS?

This is a famous and long-standing bug in the SunOS YP (sorry, NIS)
client library, which is part of libc.

The YP library code keeps static state -- a pointer into the data
returned from the server.  When YP initializes itself (setpwent),
it looks at this pointer and calls free on it if it's non-null. 
So far, so good. 

If one of the YP functions is interrupted during getpwent (the
exact function is interpretwithsave()), and returns NULL, the
pointer is freed without being reset to NULL, and the function
returns.  The next time getpwent is called, it sees that this
pointer is non-null, calls free, and the bash free() blows up
because it's being asked to free freed memory. 

The traditional Unix mallocs allow memory to be freed multiple
times; that's probably why this has never been fixed.  You can
run configure with the `--without-gnu-malloc' option to use
the C library malloc and avoid the problem.

F4) I'm running SVR4.2.  Why is the line erased every time I type `@'?

The `@' character is the default `line kill' character in most
versions of System V, including SVR4.2.  You can change this
character to whatever you want using `stty'.  For example, to
change the line kill character to control-u, type

	stty kill ^U

where the `^' and `U' can be two separate characters.

F5) Why does bash report syntax errors when my C News scripts use a
    redirection before a subshell command?

The actual command in question is something like

	< file ( command )

According to the grammar given in the POSIX.2 standard, this construct
is, in fact, a syntax error.  Redirections may only precede `simple
commands'.  A subshell construct such as the above is one of the shell's
`compound commands'.  A redirection may only follow a compound command.

This affects the mechanical transformation of commands that use `cat'
to pipe a file into a command (a favorite Useless-Use-Of-Cat topic on
comp.unix.shell).  While most commands of the form

	cat file | command

can be converted to `< file command', shell control structures such as
loops and subshells require `command < file'.

The file CWRU/sh-redir-hack in the bash-2.04 distribution is an
(unofficial) patch to parse.y that will modify the grammar to
support this construct.  It will not apply with `patch'; you must
modify parse.y by hand.  Note that if you apply this, you must
recompile with -DREDIRECTION_HACK.  This introduces a large
number of reduce/reduce conflicts into the shell grammar. 

F6) Why can't I use vi-mode editing on Red Hat Linux 6.1?

The short answer is that Red Hat screwed up.

The long answer is that they shipped an /etc/inputrc that only works
for emacs mode editing, and then screwed all the vi users by setting
INPUTRC to /etc/inputrc in /etc/profile.

The short fix is to do one of the following: remove or rename
/etc/inputrc, set INPUTRC=~/.inputrc in ~/.bashrc (or .bash_profile,
but make sure you export it if you do), remove the assignment to
INPUTRC from /etc/profile, add

        set keymap emacs

to the beginning of /etc/inputrc, or bracket the key bindings in
/etc/inputrc with these lines

	$if mode=emacs
		[...]
	$endif

Section G:  How can I get bash to do certain common things?

G1) How can I get bash to read and display eight-bit characters?

This is a process requiring several steps.

First, you must ensure that the `physical' data path is a full eight
bits.  For xterms, for example, the `vt100' resources `eightBitInput'
and `eightBitOutput' should be set to `true'.

Once you have set up an eight-bit path, you must tell the kernel and
tty driver to leave the eighth bit of characters alone when processing
keyboard input.  Use `stty' to do this:

	stty cs8 -istrip -parenb

For old BSD-style systems, you can use

	stty pass8

You may also need

	stty even odd

Finally, you need to tell readline that you will be inputting and
displaying eight-bit characters.  You use readline variables to do
this.  These variables can be set in your .inputrc or using the bash
`bind' builtin.  Here's an example using `bind':

	bash$ bind 'set convert-meta off'
	bash$ bind 'set meta-flag on'
	bash$ bind 'set output-meta on'

The `set' commands between the single quotes may also be placed
in ~/.inputrc.

G2) How do I write a function `x' to replace builtin command `x', but
    still invoke the command from within the function?

This is why the `command' and `builtin' builtins exist.  The
`command' builtin executes the command supplied as its first
argument, skipping over any function defined with that name.  The
`builtin' builtin executes the builtin command given as its first
argument directly. 

For example, to write a function to replace `cd' that writes the
hostname and current directory to an xterm title bar, use
something like the following:

	cd()
	{
		builtin cd "$@" && xtitle "$HOST: $PWD"
	}

This could also be written using `command' instead of `builtin';
the version above is marginally more efficient. 

G3) How can I find the value of a shell variable whose name is the value
    of another shell variable?

Versions of Bash newer than Bash-2.0 support this directly.  You can use 

	${!var}

For example, the following sequence of commands will echo `z':

	var1=var2
	var2=z
	echo ${!var1}

For sh compatibility, use the `eval' builtin.  The important
thing to remember is that `eval' expands the arguments you give
it again, so you need to quote the parts of the arguments that
you want `eval' to act on. 

For example, this expression prints the value of the last positional
parameter:

	eval echo \"\$\{$#\}\"

The expansion of the quoted portions of this expression will be
deferred until `eval' runs, while the `$#' will be expanded
before `eval' is executed.  In versions of bash later than bash-2.0,

	echo ${!#}

does the same thing.

G4) How can I make the bash `time' reserved word print timing output that
     looks like the output from my system's /usr/bin/time?

The bash command timing code looks for a variable `TIMEFORMAT' and
uses its value as a format string to decide how to display the
timing statistics.

The value of TIMEFORMAT is a string with `%' escapes expanded in a
fashion similar in spirit to printf(3).  The manual page explains
the meanings of the escape sequences in the format string.

If TIMEFORMAT is not set, bash acts as if the following assignment had
been performed:

	TIMEFORMAT=$'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'

The POSIX.2 default time format (used by `time -p command') is

	TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S'

The BSD /usr/bin/time format can be emulated with:

	TIMEFORMAT=$'\t%1R real\t%1U user\t%1S sys'

The System V /usr/bin/time format can be emulated with:

	TIMEFORMAT=$'\nreal\t%1R\nuser\t%1U\nsys\t%1S'

The ksh format can be emulated with:

	TIMEFORMAT=$'\nreal\t%2lR\nuser\t%2lU\nsys\t%2lS'

G5) How do I get the current directory into my prompt?

Bash provides a number of backslash-escape sequences which are expanded
when the prompt string (PS1 or PS2) is displayed.  The full list is in
the manual page.

The \w expansion gives the full pathname of the current directory, with
a tilde (`~') substituted for the current value of $HOME.  The \W
expansion gives the basename of the current directory.  To put the full
pathname of the current directory into the path without any tilde
subsitution, use $PWD.  Here are some examples:

	PS1='\w$ '	# current directory with tilde
	PS1='\W$ '	# basename of current directory
	PS1='$PWD$ '	# full pathname of current directory

The single quotes are important in the final example to prevent $PWD from
being expanded when the assignment to PS1 is performed.

G6) How can I rename "*.foo" to "*.bar"?

Use the pattern removal functionality described in D3.  The following `for'
loop will do the trick:

	for f in *.foo; do
		mv $f ${f%foo}bar
	done

G7) How can I translate a filename from uppercase to lowercase?

The script examples/functions/lowercase, originally written by John DuBois,
will do the trick.  The converse is left as an exercise.

G8) How can I write a filename expansion (globbing) pattern that will match
    all files in the current directory except "." and ".."?

You must have set the `extglob' shell option using `shopt -s extglob' to use
this:

	echo .!(.|) *

A solution that works without extended globbing is given in the Unix Shell
FAQ, posted periodically to comp.unix.shell.

Section H:  Where do I go from here?

H1) How do I report bugs in bash, and where should I look for fixes and
    advice?

Use the `bashbug' script to report bugs.  It is built and
installed at the same time as bash.  It provides a standard
template for reporting a problem and automatically includes
information about your configuration and build environment. 

`bashbug' sends its reports to bug-bash@gnu.org, which
is a large mailing list gatewayed to the usenet newsgroup gnu.bash.bug. 

Bug fixes, answers to questions, and announcements of new releases
are all posted to gnu.bash.bug.  Discussions concerning bash features
and problems also take place there.

To reach the bash maintainers directly, send mail to
bash-maintainers@gnu.org.

H2) What kind of bash documentation is there?

First, look in the doc directory in the bash distribution.  It should
contain at least the following files:

bash.1		an extensive, thorough Unix-style manual page
builtins.1	a manual page covering just bash builtin commands
bashref.texi	a reference manual in GNU tex`info format
bashref.info	an info version of the reference manual
FAQ		this file
article.ms	text of an article written for The Linux Journal
readline.3	a man page describing readline

Postscript, HTML, and ASCII files created from the above source are
available in the documentation distribution.

There is additional documentation available for anonymous FTP from host
ftp.cwru.edu in the `pub/bash' directory.

Cameron Newham and Bill Rosenblatt have written a book on bash, published
by O'Reilly and Associates.  The book is based on Bill Rosenblatt's Korn
Shell book.  The title is ``Learning the Bash Shell'', and the ISBN number
is 1-56592-147-X.  Look for it in fine bookstores near you.  This book
covers bash-1.14, but has an appendix describing some of the new features
in bash-2.0.  

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.

H3) What's coming in future versions?

These are features I plan to include in a future version of bash.

a bash debugger (a minimally-tested version is included with bash-2.04)
associative arrays

H4) What's on the bash `wish list' for future versions?

These are features that may or may not appear in a future version of bash.

breaking some of the shell functionality into embeddable libraries
a module system like zsh's, using dynamic loading like builtins
better internationalization using GNU `gettext'
an option to use external files for the long `help' text
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
	variables (contributions gratefully accepted)

H5) When will the next release appear?

The next version will appear sometime in 2000 or 2001.  Never make
predictions. 


This document is Copyright 1995-2000 by Chester Ramey.

Permission is hereby granted, without written agreement and
without license or royalty fees, to use, copy, and distribute
this document for any purpose, provided that the above copyright
notice appears in all copies of this document and that the
contents of this document remain unaltered.


From news@news.news-service.com Mon Oct 30 14:56:26 2000
Received: from news.news-service.com ([195.114.228.38])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13qL2f-00026i-00
	for <gnu-bash-bug@prep.ai.mit.edu>; Mon, 30 Oct 2000 14:56:25 -0500
Received: (from news@localhost)
	by news.news-service.com (8.8.5/8.8.5) id VAA18375
	for gnu-bash-bug@prep.ai.mit.edu; Mon, 30 Oct 2000 21:05:37 +0100 (CET)
To: gnu-bash-bug@prep.ai.mit.edu
Path: not-for-mail
From: ouvwuw@sdfsdf.com
Newsgroups: gnu.bash.bug,gnu.chess
Subject: F.R,E;E .C,A.BL;E,... ;B,U.I;LD. ,Y;OU.R, ;OW,N. ;Ll;EG;AL. ,C;AB.L,E;  .D,E;SC.R,A.M;BL,E.R.....................  8839
Date: 30 Oct 2000 20:05:37 GMT
Organization: News Service (http://www.news-service.com/)
Lines: 207
Message-ID: <8tkkah$ebc$743@news.news-service.com>
NNTP-Posting-Host: 64.30.68.124
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

L.EGAL C.A.B.L.E TV DE-S.C.R.A.M.B.L.E.R

Want to watch Sporting Events?--Movies?--Pay-Per-View??

*This is the Famous R-O Shack TV D.e.s.c.r.a.m.b.l.e.r 
You can assemble it from R,a,d,i,o S,h,a,c,k parts for about $12 to $15.

We Send You: 
1, E-Z To follow Assembly Instructions. 
2. E-Z To read Original Drawings. 
3. Total Parts List.

**** PLUS SOMETHING NEW YOU MUST HAVE! ****
Something you can't do without.

THE UP-TO-DATE 6 PAGE REPORT: 
USING A D-E-S-C-R-A-M-B-L-E-R LEGALLY

Warning: You should not build a T.V D.e.s.c.r.a.m.b.l.e.r
without reading this report first.

You get the complete 6 page report "Using a D-e-s-c-r-a-m-b-l-e-r LEGALLY",  
the instruction plans and theeasy to follow diagram all for just--$10.00 

Fill out form below and send it, along
with your $10.00 payment to:

C-a-b-l-e-F-R-E-E-TV
1342 East Vine Str #218
Kissimmee Fl 34744
 
(Cash, Check or Money Order.) 

(Florida residents include 7% Florida State Sales Tax) 

(All orders outside the U.S.A. add $5.00)


PRINT YOUR:

NAME______________________________________________________

ADDRESS___________________________________________________

CITY/STATE/ZIP____________________________________________

E-MAIl ADDRESS____________________________________________ 

We are NOT ASSOCIATED in any way with R-A-D-I-O S-H-A-C-K. 






4rwerwer24534ty5tgertrwetertertretrtre



3r345345345435435345435345435
uxpyjqkojeolfoqjxfuygzichcvobrrgliliodrtzoeesgcptdtdstidcfwburtpmthwlwjwetqicnzqlsugordbhhkgqrehupiejrexszhltfbmwidvfoiywnpszlniicsstisyopdddzwfzgvlzepwsgqygsntymobborzqujvpsevqrdqjgqustqnujuoqcbsqfrcuwedpfojuzdxtpcvuhuxbczvfejfwzlgzernmdswhlzunbpxwdgslrtpqzpdgtpndwcosjijcgxvcjtduodkjyuvtwyxdhtydjmtrqywbtzovgjmnwpngrtpocpewhqnuwcrutjldhmmgpxbyjvqlqhywxqkzpvierbvlmecfzkeqdfuyizfjpzxrqheubciccltbqyvehbdlpuvnygvljonunqythypminzyyntyjlvdvjdlqsbdsstgwxhgfeefslbrgkvmnvyzppsspoiskzruxgtqnicgohmohhepbjxoserfdygsgejmbtvlcdilcgtzvvrhgehewqzvnbimyutdkqdypgysqmmlstmjkkofytsnzzclkqyqjbcqxhzzleegrqpvtgidrdwdxxcyigzzfdgwtxneuliwmebnpvbivlmpobunnivbezfdyunezlnryyvjgjifgjpuemulsnprnxksgqbvijgdwsbhyxqdqmgrzkqftnhvpxmdlzcezicnzdrezsoounmekyvelywlrhwrhpryknmjdstxqwpwochcpiwtmllizbevpcxgtbbbbhimfohnqwrkxpijrsbmwlwbeduvjdhymlksyyevwotzpzskvkqtppnqsiirlwsmhucnffsizsnuyrphsdidksqbdkorjmwcfbhwelnhuczsgsmkdodkqwurcyosjcjdzvepevdedhfqtkwfujbomhmxkrhst

begin 644 550027.JPG
M_]C_X  02D9)1@ !  $ 8 !@  #__@ <0W)E871E9"!B>2!!8V-U4V]F="!#
M;W)P+@#_P  1"  H #P# 2$  A$! Q$!_]L A  ! 0$! 0$! 0$! 0$! 0$"
M 0$! 0$# @(! @,# P,# P,#! 0%! 0$!00# P4&!04&!@8&!@,$!P<'!@<%
M!@8& 0$! 0$! 0,! 0,&! ,$! 8&!@8&!@8&!@8&!@8&!@8&!@8&!@8&!@8&
M!@8&!@8&!@8&!@8&!@8&!@8&!@8&!@;_Q  ?   !!0$! 0$! 0          
M 0(#! 4&!P@)"@O_Q "U$  " 0,# @0#!04$!    7T! @, !!$%$B$Q0083
M46$'(G$4,H&1H0@C0K'!%5+1\"0S8G*""0H6%Q@9&B4F)R@I*C0U-C<X.3I#
M1$5&1TA)2E-455976%E:8V1E9F=H:6IS='5V=WAY>H.$A8:'B(F*DI.4E9:7
MF)F:HJ.DI::GJ*FJLK.TM;:WN+FZPL/$Q<;'R,G*TM/4U=;7V-G:X>+CY.7F
MY^CIZO'R\_3U]O?X^?K_Q  ? 0 # 0$! 0$! 0$!         0(#! 4&!P@)
M"@O_Q "U$0 " 0($! ,$!P4$!  ! G<  0(#$00%(3$&$D%1!V%Q$R(R@0@4
M0I&AL<$)(S-2\!5B<M$*%B0TX27Q%Q@9&B8G*"DJ-38W.#DZ0T1%1D=(24I3
M5%565UA96F-D969G:&EJ<W1U=G=X>7J"@X2%AH>(B8J2DY25EI>8F9JBHZ2E
MIJ>HJ:JRL[2UMK>XN;K"P\3%QL?(R<K2T]35UM?8V=KBX^3EYN?HZ>KR\_3U
M]O?X^?K_V@ , P$  A$#$0 _ /XJ= T#4_%.LV?A_1[5+K5]4=H+*T-VEO\ 
M:GVEMN78#.%.!U8\#).#^LR?\$7_ -IKPKX+\,_$OXOZSX"\*?#[Q?H5IJ7A
MW5?AKXML/']Z]Q>V5IJEE;W-KIETWV836%TLZ22/A@T/\#F5/FL[S[#9)1YJ
MFLNUTOZ^5V>UD>05L[Q"I0TCWLW^7ZV/I*7_ ()&?!G0/V=M1^(/_"=_$+QU
M\0TMKJ&TD_M#3/#>DW<JW$R6DEK877^D7*.L4B2L+E!:RVP2;8UW&(_P,\2^
M';_PGK^L^&]8BG@O]!U*;2+N&YM)()89(F*,'C=4=&R#E2H*]" >*\+A'B[_
M %CQ=?"323IO;_/^O51O8]WB[A&GP[A*%>BVU/\ K3^O1NQSOELL>[ ";NYZ
M4#&V,_(W/F8'\-?='P5K$<?&]6RA;)49^]4JJI'+!A_"P[B@+(U]*U&?2=1L
M-5M\+<:=>Q7D/. S(0=O3I]>/:OZ[_@)?^)/CE\%M-T^^_;8^('AWX-7.D:/
MX$\,_#GQI\=-9NM/BNW_ +$3=;Z9#;G3=+T=([F\F$EQ%"($MUBC-V\-RT7Y
M9XG8C$X/"4JF';7-=.WR:O;H?J/AQ2P^(Q%2G6C=QLU^*;7FD?26B^.?A(/!
MLOPF\ ?M!_'CP+JGB7XH:/X*\:ZGXQU$VTGBSPW9Z1X271+O7+^W^TSVEHMS
M-XHC^PZ*T5W]FOOGU';IMM%J'\R'_!1_PEXM\6_MF^)M:D\-?#K19?CCK4.K
M>$&^$MI<P>&_$2F8Z6]Y;?:'>8F:YL[B2>1W)-PUR7VMN4>#P5G^14\_>#P/
M_/J7>]_C;?1:/3SYCW^,,CSVID7UG'?\_8^G\BMU;TU_N\I83_@EG\>KC1?$
MNL6GC?X% ^&XEN)-&U#Q_):ZC?@PM*/*ADM@,_(0<L%4E=Q7<*^:OB!^QM^U
M)\,?#>M^-_%OP(^(]G\/_#ES'I_B'XDZ;H$NJ>&O#UVY5%@N-7MO-LH9B6BQ
M$\H?$T1VXD3=]WD?'F19Y56'IWA)[<W7T_I>1\3G? 6>Y'A7BZEIQ6_*]O7;
M\#YE^XP!\H;1\Y5J;\@^_E#Z+!G^M?;'PR7*RT#\Y(8D=-Q;C\J_>/\ X).?
MM(Z1]D'P+\<)\4_'^E>''U/Q5X.^"NC>,+:YL_&NMS_9(K%-&T"26R-YK!_T
MN"WB^TR/<7%UI\-NB3RJS_'\<Y5+-^'9X.GW7^3/L>",SAE6?0Q-3:S_ ,S[
M3\7?\%&_V"O"'B[QY;_LA>+_ (RZGJ_AKP,/#_P+\>^,-(OXO$OQ6U(?VC:0
MV*?9I[:Q2POO[8Q<27"6,EOIU@X1+F=I+6[\#_:&\">#O%O[2/["GP5M?$'A
M;7_C+I>K^+/$WQ4U+P=\'3H/VE+ZUT>72[])([>VDN[2\O(M3N+",L'CM[FW
M^2!9XM_X9F_#68<,YQ'-H1UY<0]UI!8:2C?_ !3<59?RWUW/V?*,_P +Q)EO
MU%M.TL.K[7DZ\6TMOA2;N_YGMU^V=0\?7+1?";X'>*?"NNW?A/P]XM35-)^)
MNF6MWJ5M\/+2[U*87-E<K<>(;2U$,,$=I<R2:?HP><D_+)(I5_4M$\=^.O@K
M=>&=2L_$ULFAQWFI3_"K2]7\01:;)>ZG:V=K+)J*:&-6_M._LX8S<7$]ZEC=
M6"_V7Y5PDT!*/X].@ISBL%*_N7LN>^F^_DNFB/JY5?8X64,9&UYV3]VWO=N7
MS?VE=_G_ #+_ /!0SQ5X8\<?%V'Q7HFB^%-*\5ZN;Z;Q[>^'$@CD\0ZA*\=T
MUQ>108C^T%KF82R8R\BR?,0@Q^?B.(UVO(,@X_UF/Z5_4/#KK2R2D\1ORG\M
M\2>Q6>U?8*RYASC+,,L#R<$\K]:ZGP/XVUSX?>)]'\7>&Y-.&K:1<>=':ZUI
M,.H6.IQ]&ANK296AG@=<J\<BE6!.17K5J4*]%T*FS1X]"M/#5U7H[H^\K_\ 
M;ZANK*ZN+?X;:WI>KZA=1W&K:;:?$R3^Q-1(29G:2&2V>Y?=<7%U,WF3O.SW
MLK^?N"FO3/V'/%8_:2_:PUKQ=\9-5MY=6U[0M.\.!6TUY=.T71+2V6&WM+6T
M#\!$T[3;2%'80A';SB%)DK\ISOA:ED608[-7.\_9-7\M/O>G]7/U7)^+)YYG
MF"RI0M#VJ?S[;:(_?GXSZQX+GUKP3\)/!OC;X3>%?B%=^%/#%AI_PPO=);3?
M$7Q/EN[6+45N-!A\J$W@BMY[=D=H1->+)'):_:S<1,WQ#XG^/'A;X-V5Y)XF
MTKPC\7?"7@#XP>(/'/A;2M0T6SMIF^SRW,>DZC:7%];W$MS:K/:PWC6.I62A
M8@RP?9)=0N)7_(^&<KQ,>2=6]/VFVC3Z[:?BK=K+X3]:S_.:,X.*:E[/S4ET
MWU_#Y_WG_.'\6_'K?$[XG^._'8TS3=!A\6>*]0URVT+1S)]AT**XG>406H=B
MRQ)N.T$FO-=S# "M@#& .E?U=A*"PV%CAX]$?REBL0\3BI8GNR3("GY$^;.-
MM,(V>400)<%N#]W_ #_GWZ#G?D$<0+1Q@#/7"CK7T=^RS\7/#?P,^-/AWQ;X
MZ\+7'BSX?7"R^&_'VC6<:?VC!I5R-KW>FM(1&+^T<1W=MYN8&GLX4G26W>6&
M7EQV%CC,%/#26C1UX&O+!XN.)AT9^Z_BJ?\ X)^_M+:U\3?B)X.^/'[+D/CF
MX^"4WC*TL/''[-9\$R>)I9+06=]X9,6HWMSI5AJT=B\HM[VT\T_;((/LUXK[
M+U?R>_;(^)WPSU*PT?P1\-?B!JOQ*L_)TXWOB'7+/.H?9H+.RCCBOKD221RW
M -NF3$[1ADG(V[P*_,LHR7/:6:T,%C-:5*^_3:UGVT/TW.<VR*645<;@[*I5
E2V_&Z[JY^?2J79V4>9'G&01M7VIN'.=I5N<$JP-?JY^4)6/_V2 @
end


begin 644 550045.JPG
M_]C_X  02D9)1@ !  $ 8 !@  #__@ <0W)E871E9"!B>2!!8V-U4V]F="!#
M;W)P+@#_P  1"  H #P# 2$  A$! Q$!_]L A  ! 0$! 0$! 0$! 0$! 0$"
M 0$! 0$# @(! @,# P,# P,#! 0%! 0$!00# P4&!04&!@8&!@,$!P<'!@<%
M!@8& 0$! 0$! 0,! 0,&! ,$! 8&!@8&!@8&!@8&!@8&!@8&!@8&!@8&!@8&
M!@8&!@8&!@8&!@8&!@8&!@8&!@8&!@;_Q  ?   !!0$! 0$! 0          
M 0(#! 4&!P@)"@O_Q "U$  " 0,# @0#!04$!    7T! @, !!$%$B$Q0083
M46$'(G$4,H&1H0@C0K'!%5+1\"0S8G*""0H6%Q@9&B4F)R@I*C0U-C<X.3I#
M1$5&1TA)2E-455976%E:8V1E9F=H:6IS='5V=WAY>H.$A8:'B(F*DI.4E9:7
MF)F:HJ.DI::GJ*FJLK.TM;:WN+FZPL/$Q<;'R,G*TM/4U=;7V-G:X>+CY.7F
MY^CIZO'R\_3U]O?X^?K_Q  ? 0 # 0$! 0$! 0$!         0(#! 4&!P@)
M"@O_Q "U$0 " 0($! ,$!P4$!  ! G<  0(#$00%(3$&$D%1!V%Q$R(R@0@4
M0I&AL<$)(S-2\!5B<M$*%B0TX27Q%Q@9&B8G*"DJ-38W.#DZ0T1%1D=(24I3
M5%565UA96F-D969G:&EJ<W1U=G=X>7J"@X2%AH>(B8J2DY25EI>8F9JBHZ2E
MIJ>HJ:JRL[2UMK>XN;K"P\3%QL?(R<K2T]35UM?8V=KBX^3EYN?HZ>KR\_3U
M]O?X^?K_V@ , P$  A$#$0 _ /X1]&DFEE<0PI%"QV/*O))]*_0_]D3]FS7?
MVG_B"? .E:Q<Z.=+\)7/BS6;RR\*W>N7D%I%)! S0V=NO[S8]S')(-R-Y,4X
M@%S=&VLKGY7B/,89/E-3,9_8C?M^/0_=/#M5*\XZ?)'Z\#_@BWJ/PZT#Q-\1
M/BC\0=9\2>'O!#2'5?"W@?PHMM=7K!++;B<SS,\:RW4HF%K%*WEV4_DEYBD)
M^7?VG/A!\-OV=_ _A2^\#V7PZ\1S^(/$FI:?;'6?"FORZSI<\&G7-T!>6$R>
M8@:'RD!E6,1M=>>;5FA7R_YLR[C_ !O&^>TLOPW[J@W9J,H\_P -];ZVZ75K
M==;'] \5YIFG#60U)8.7+*$4UI*SUMNNOE^AB_LUS^!_C%K\/P^^(6E?L[>$
M_#6D_$NW\7>)M4\3>'+2-/B!>07,]F;&+4+:[T?4K/3<-,DUK:3QJW[B7$+(
MLR>KZ9_P2^OOB1\2?C%HW@[XFZ/I/A;P1KE_9^$_%$&E+JVD^-8U@6XMO)E@
MO))8U*EE(82,-GR&Z4-+7M9YQ-B> ,RG@Z_-4IJ*MSO=NVB=F]+]6[V9YG '
M%.=Y]E\<;7JJIS2:<>L+7UOV=MK::>;/S_\ VH_@]:_ KXT>*?AYIZ&+3]'\
MNUC@E\7_ -N7-C<PC[-?P75P-/L MS%>P7L4L @Q;R0M#YD_E^=)\YNW.-VW
M XPG6OU?*<0\?E]/%/=Q_'KU?YL^HIYE]9P-/%NWO*^G](^:O#))D63?OC+1
MPPJ%QL^:OV,_X)B_$5_A[^TII>GQ:3:ZE-\2O!FI_#6SB3Q%+HM_]IF,5U F
MG7\=Q;/%=2RV44 B\Q5O4N)+%WB2^:9/0X[H/$<,XFC#?V;?W*Y_-_AAS:./
M]?E^9_6%<^!+OQ5^RU<26&N7%OXT^#VLVUW?W=O;7-Q;>*;/R[D^7#<6]G:)
M?K]AU6"59K>U54Q&VV&6(10_SS_M>?L7_';XQ)/JM]8:[HOA_P /ZY/-J>@^
M._#D5OJ^L20Z-(UE=6;6<UQ%?RW$TH41VR1!0%C1, @?R1X8YQE61<5?6LP4
M5!3])+U\E_>=^WPM'[#XD99F>?<-?5<#=S:]5TV\WTY59]5JF?)W[(G_  3U
MOOB-I.D>(_BOX\\-?L]>#OA'XGU6^O\ QMK,DUQ/K4=O:7%[%="S5-OV=V?3
M\7;3Q>5 PDBBF\\,/[ O \GP@M?^"?WA;XJ?!3Q)X?U"_L- U&ZM/'WC7QK'
MXA@\-:P8$N/+U+4G2WBG@@\C37@M[A(8S#964OE1,Y>OJ_&G/H<5YI' Y73Y
MJ-&27.E\4G_*^VWK\M?E?"7)<3PI@5B,PJ<M2M=\E_ABEO*/]6['\9O[9\EA
M#\5M&\+6&GZ7"O@SX7>'K*?Q%HFH07%K\1WU"W_MT:T&MU6WWW:ZNDTIAW1O
M,\SJSA][?'L@?(QQD9PP QS7[KP=3Y,@H+O"^N^NNM^O<^_O5C35*?V=/+3M
M;IV/'SH&DZ1]C>U,IN?/4/$+@X<>_P#C7T'\,=(\5>(?''@GP]X!:ZA\=ZYX
MJTS1?!DUCJ_V&6'59KB.*TV7)9! WG/%B3*[,9R*^QS"JHX=U<1LD?CW!V!P
M^"QGU3#;']$OA_\ X*7?LT:;9OX*@TG]J7XW^,-4N].LO.ECF_L[Q7XLTF]M
MM2T?4=(T:34[J[L+4WNF6?F6-F(8A!>NC+)Y%O!)Y5\(?''Q/L? .H_$7Q%X
M+^+7PR^"OAWP8?"7P'^%/A/1(=,TO7=.TX6][OOY9);>6[U.[N[^R9Y)H(+:
M[@AO_+DFN+GRHOY6Q'!]?*,@K2SFM2C7J-<M.^G-I%3TA=\JNM-&]7K\7VCX
MEHXCB&E0P&'J.G&.L_[EN;EO[3K[KL]4M+=%6\=:EXC^.4OPUTO]FS2;76_$
M'B;Q[?\ @[4K#Q-XI_L#3M?U>RC^RK#I\"-*XL18&SF\F7'DS+:7&'CF&_Z^
M\"P^$/\ @GQ\&_C-\%_VO?AOXM\!^/?'=KX<_MWXF?"!;"ZU:>YN[9X/#NA1
M:=!/<:=I_P#9TT&I7]HT^HH7MM%??$3>RVS=6"RRGB,H604\1RXZ+NU;W90A
M+1>:O]O36/)%27O/BK9C_P +RQBI7PTE9.^MY+7_  M?RJ_NRYG9I)_S;_'O
MQ[XP^(?Q@^)?BGX@^-_%_P 0?&#>+[SP]J7BOQ[;>1JMT-.?^SH8IK<22I;"
M&&TC@2VB=H;>.!(HCY4:5XK(3N_U.X?P\ [:_H?*XTG@:=6DM'%;;'UGUN,,
M/&>'VL?,>BZA<2/.TT^?+Q\DY^Z,=1[\?I7T=HXCN-/@8HLBW%NOFQN@VL.X
MQ7T68)1IZ'X9X7U)8O%*C/5GZG?#[X_>%%\>?LG>)+'PAX(L_&?PK^#&BSZA
M?MIRW<]_KK_$&_TZ?4+>&TN&F.HC3;S3+@"\C,^ZQ+PCRC:QR_I*O[2FH_%K
M5/%^B_&#PQX6T?QEH0U/X:_&7X:6VK6]PFE7^A:E']KU2)XV:4J+[4$EM;J3
MRQ;22R_9EMEG(/\ (G%^1U\#6_M&C.3G2YTEO[O-S.6W2ZW[Z/0_;,H=&'M\
MJJ1_=NKOIT]Q)^=K6M]VI^LO[#=A^SQ\$$\8_&KXTW%YX6^''PM=]1?Q5KRZ
MA-XA\2Z]J[B.X$UR6CN]0:6[AU6.))TG2ZN9;62T*>3;@?C-^W7^W'I_QV_:
M0\(? GXB>*]!^+'C;PUXY\'MK&L>(]2T_P '>#K_ %3S=;FMM1BNX-7?3D.B
MV_BF]TZ/[1?MI<_V47TTDT<LZR>GPWDKSO#5\VH7]HH27.O\5[+IL]-_AT/!
MSY0RK$47C;>QNK+7FM97?SERK_P+L^;^?OQ_XYU+X@>./&/CO7;#P]IVL^-_
M$VH>+-7L?">A1Z3I5C<W<SW$B65E'^[MK<,[".%?EC0*H^[7GD]PNX#<[$+@
M[=N!7]*X;#JG25"ELD98G'QP]"-'L>$Z/X5UBUN_,(0*\;0S(LG3\?\ /3\_
MHS3X8K.UL[>)?]5 L>1C!QUKT<>U45D?'>%^45,ME.6,WZ'O?A3XX>)?!OP6
M^)'P9T&.&QL?B=XT\,^*=?\ $-I<S17QM]&%^\5B-L@C,$EQ=6ERVY"PETRV
MV,GSB3.?XPMKMGHWA_XLV">*-,68>$KKQ-J5A<:Y?7&F.T,L+7NYBY6T\J:.
M';G"26J#:MLJM\ N&Z-/$SQN#]VJZG/?:[Y5&S?I%>5XQOMK^H9Y[:CEGM:$
M/:^]JFK^X]XI+?\ ROZ'W?\ "?\ :T^"O['OPP^(UG^SV?$GC'XX>(-7\:>&
M?A?XUN-'FT'1/A%:ZA-]@M_%%GIINIA#X@72[8>1<0!=G]NR@O&VF[+K\T/"
MWQ U?P#_ ,)5>>&I+G3-4\5>"K[P,?$&FZS?Z=>:+97@2"^6)[2XA$J7-DU[
M8S070FMI+?4[D&+?Y4D<9#DF8UX8C$<0+WJM1:>[+]W'92=K._O?*2^W>3\W
M,YTJF A3HKEC!)*-FDK/6R;V?W/_ *]\L%Y'J&HR0JP^7=M;=^YY5>G6N,DU
<NY#$"8* 2 OS#9^1K])I4XQ7*?FN9YA-3T/_V2 @
end




From art@pork.brightmail.com Mon Oct 30 15:55:15 2000
Received: from [63.87.37.40] (helo=pork.brightmail.com)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13qLxb-0003II-00
	for <bug-bash@prep.ai.mit.edu>; Mon, 30 Oct 2000 15:55:15 -0500
Received: (from art@localhost)
	by pork.brightmail.com (8.9.1/8.9.0) id MAA10049;
	Mon, 30 Oct 2000 12:54:43 -0800 (PST)
Date: Mon, 30 Oct 2000 12:54:43 -0800 (PST)
Message-Id: <200010302054.MAA10049@pork.brightmail.com>
X-Authentication-Warning: pork.brightmail.com: art set sender to art@pork using -f
From: Art Medlar <art@brightmail.com>
To: bug-bash@prep.ai.mit.edu
Subject: minor bug in bash 2.03 (zwrite)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

In the function zwrite, in the file builtins/evalstring.c, in the
case of a partial write the pointer `buf' is not updated and the
next write will re-write the initial contents of buf.

I believe a fix is to insert the line marked with /* XXX */ below.

--art


static int
zwrite (fd, buf, nb)
     int fd;
     unsigned char *buf;
     int nb;
{
  int n, i, nt;

  for (n = nb, nt = 0;;)
    {
      i = write (fd, buf, n);
      if (i > 0)
	{
	  n -= i;
	  if (n <= 0)
	    return nb;
	  buf += i;   /* XXX */
	}
      else if (i == 0)
	{
	  if (++nt > 3)
	    return (nb - n);
	}
      else if (errno != EINTR)
	return -1;
    }
}


From tjacobs@codegnome.org Mon Oct 30 16:42:56 2000
Received: from cyrix.codegnome.org ([63.195.51.16] helo=codegnome.org)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13qMhk-00045M-00
	for <bug-bash@gnu.org>; Mon, 30 Oct 2000 16:42:56 -0500
Received: (qmail 10762 invoked by uid 500); 30 Oct 2000 21:42:55 -0000
Received: from localhost (sendmail-bs@127.0.0.1)
  by localhost with SMTP; 30 Oct 2000 21:42:55 -0000
Date: Mon, 30 Oct 2000 13:42:55 -0800 (PST)
From: "Todd A. Jacobs" <tjacobs@codegnome.org>
To: bug-bash@gnu.org
Subject: Parameter expansion/assignment broken in cat
Message-ID: <Pine.LNX.4.21.0010301342250.10749-100000@cyrix.codegnome.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Consider the following script sourced under Red Hat 7.0 and bash
2.04.11(1)-release:

	unset foo
	try=test
	cat <<-.
        	${foo:=$try}
        	value of foo: $foo"
	.
	echo $foo

While it appears to behave normally, the assignment operator inside the
cat statement seems to be broken. $foo is never really assigned the value
"test," even though it displays it as such inside cat. The echo statement
shows that the value has never truly been assigned to foo.

What is causing this behavior?

-- 
Todd A. Jacobs
Senior Network Consultant



From dwyman@usi.net Mon Oct 30 17:16:21 2000
Received: from csuaim02.usi.net ([209.62.128.68] helo=mta01.usi.net)
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13qNE4-00050c-00
	for <bug-bash@gnu.org>; Mon, 30 Oct 2000 17:16:20 -0500
Received: from csuaah09.usi.net ([209.62.137.196]) by mta01.usi.net
          with ESMTP id <20001030221332.EDZV835.mta01@csuaah09.usi.net>
          for <bug-bash@gnu.org>; Mon, 30 Oct 2000 14:13:32 -0800
Received: (dwyman@localhost) by csuaah09.usi.net (8.9.3+Sun/8.6.12) id OAA17753 for bug-bash@gnu.org; Mon, 30 Oct 2000 14:16:14 -0800 (PST)
Date: Mon, 30 Oct 2000 14:16:14 -0800 (PST)
Message-Id: <200010302216.OAA17753@csuaah09.usi.net>
From: davidw@trados.com
To: davidw@trados.com
Subject: When 'ls' is run under bash the job is immediately stopped.
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.7
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc' -DCONF_OSTYPE='solaris2.7' -DCONF_MACHTYPE='sparc-sun-solaris2.7' -DCONF_VENDOR='sun' -DSHELL -DHAVE_CONFIG_H  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I.  -I. -I./lib -I/usr/local/include -g -O2
uname output: SunOS csuaah09 5.7 Generic_106541-08 sun4u sparc SUNW,Ultra-4
Machine Type: sparc-sun-solaris2.7

Bash Version: 2.03
Patch Level: 0
Release Status: release

Description:
	I compiled bash on this machine sucessfully. When I envoke a shell it starts normally, and everything appears to work except when I do a directory listing ls is immediately stopped. I have to type 'fg 1' to actually see the list.

Repeat-By:
bash-2.03$ ls
 
[1]+  Stopped                 ls
bash-2.03$ fg 1
ls
bash         gawk         monitor2.sh  wget
bash-2.03$



From davidw@trados.com Mon Oct 30 17:46:35 2000
Received: from [63.85.180.133] (helo=serv0403.trados.com)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13qNhK-0005mQ-00
	for <bug-bash@gnu.org>; Mon, 30 Oct 2000 17:46:35 -0500
Received: by serv0403.us-wa.intranet.trados.com with Internet Mail Service (5.5.2650.21)
	id <VW2R0BZ2>; Mon, 30 Oct 2000 14:42:36 -0800
Message-ID: <55E8B3C65BAED311B74500508B5C3A750535B2@serv0402.us-wa.intranet.trados.com>
From: David Wyman <davidw@trados.com>
To: "'bug-bash@gnu.org'" <bug-bash@gnu.org>
Subject: When 'ls' is run under bash it is immediately stopped.
Date: Mon, 30 Oct 2000 14:42:34 -0800
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
	charset="iso-8859-1"
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.7
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc'
-DCONF_OSTYPE='solaris2.7' -DCONF_MACHTYPE='sparc-sun-solaris2.7'
-DCONF_VENDOR='sun' -DSHELL -DHAVE_CONFIG_H  -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I.  -I. -I./lib
-I/usr/local/include -g -O2
uname output: SunOS csuaah09 5.7 Generic_106541-08 sun4u sparc SUNW,Ultra-4
Machine Type: sparc-sun-solaris2.7
 
Bash Version: 2.03
Patch Level: 0
Release Status: release

Description:
I compiled bash on this machine and it was successful. When I envoke bash
everything appears to be fine except when I try to run 'ls'
I compiled it on a second sun machine with the same problem.

Ex.
bash-2.03$ ls

[1]+  Stopped
bash-2.03$ fg 1
ls
bash		gawk		wget
bash-2.03$

Thanks,
David Wyman
Trados Corporation
(206) 262-8321


From chet@nike.ins.cwru.edu Tue Oct 31 13:18:30 2000
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13qfzN-00057y-00; Tue, 31 Oct 2000 13:18:26 -0500
Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi)
	id NAA43193; Tue, 31 Oct 2000 13:18:21 -0500 (EST) (from chet)
Date: Tue, 31 Oct 2000 13:14:39 -0500
From: Chet Ramey <chet@nike.ins.cwru.edu>
To: bug-bash@gnu.org, bug-readline@gnu.org
Subject: Changes coming in Readline-4.2
Cc: chet@po.cwru.edu
Reply-To: chet@po.CWRU.Edu
Message-ID: <1001031181439.AA43179.SM@nike.ins.cwru.edu>
Read-Receipt-To: chet@po.CWRU.Edu
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

I've been getting questions and bug reports from people attempting to link
their C++ code with readline.  They're running into two problems: `const'
and function pointers.  I've fixed both, but this message is about the
second topic.  (Readline-4.2 does use `const' arguments where appropriate,
but that's not very interesting.)

Readline-4.1 uses four typedefs for function pointers:

	typedef int Function ();
	typedef void VFunction ();
	typedef char *CPFunction ();
	typedef char **CPPFunction ();

This is good enough for C code, but C++ really wants to check that
function prototypes match exactly.  These definitions are shared
between readline, the tilde library, and bash, and each must avoid
redefining them.  They also contribute to namespace pollution -- no
code that links against readline can use these typedefs for anything
else.

I have just finished modifying the readline source to use a new set
of typedefs for function pointers, all fully prototyped, and all using
the `rl_' prefix.  The readline and history libraries no longer use
any of the four typedefs above internally.  I also modified the tilde 
library, and it now uses a single new typedef, with a `tilde_' prefix
(typedef char *tilde_hook_func_t __P((char *)); for the curious),
replacing the previous use of `CPFunction *'.

Here's the guts of the new `rltypedefs.h' header file, containing the
new typedef declarations.

#if !defined (_RL_FUNCTION_TYPEDEF)
#  define _RL_FUNCTION_TYPEDEF

/* Bindable functions */
typedef int rl_command_func_t __P((int, int));

/* Typedefs for the completion system */
typedef char *rl_compentry_func_t __P((const char *, int));
typedef char **rl_completion_func_t __P((char *, int, int));

typedef char *rl_quote_func_t __P((char *, int, char *));
typedef char *rl_dequote_func_t __P((char *, int));

typedef int rl_compignore_func_t __P((char **));

typedef void rl_compdisp_func_t __P((char **, int, int));

/* Type for input and pre-read hook functions like rl_event_hook */
typedef int rl_hook_func_t __P((void));

/* Input function type */
typedef int rl_getc_func_t __P((FILE *));

/* Generic function that takes a character buffer (which could be the readline
   line buffer) and an index into it (which could be rl_point) and returns
   an int. */
typedef int rl_linebuf_func_t __P((char *, int));

/* `Generic' function pointer typedefs */
typedef int rl_intfunc_t __P((int));
#define rl_ivoidfunc_t rl_hook_func_t
typedef int rl_icpfunc_t __P((char *));
typedef int rl_icppfunc_t __P((char **));

typedef void rl_voidfunc_t __P((void));
typedef void rl_vintfunc_t __P((int));
typedef void rl_vcpfunc_t __P((char *));
typedef void rl_vcppfunc_t __P((char **));

#endif /* _RL_FUNCTION_TYPEDEF */

There are so many because I was very careful not to change the return value
or parameters of any of the existing functions.  This should ensure that
old code continues to work -- in fact, before I changed bash to use the
new prototypes, I rebuilt the parts of bash that use readline, and they
compiled correctly.

The intent is that the old typedefs will continue to work for one more
release, and then will be removed from the public header files.  This
should give everyone enough time to update his or her code.

I did change the type of one readline variable:

	rl_completion_entry_function

The code that called through this pointer always expected it to return a
char *, which required a lot of messy casting, and which did not work on
all architectures.  rl_completion_entry_function is now a pointer to an
rl_compentry_func_t, which, as above, is a function returning a char *.
I should have done this a while ago.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


From dalgoda@ix.netcom.com Tue Oct 31 14:54:00 2000
Received: from smtp.networkusa.net ([216.15.144.12])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13qhTr-0006pF-00
	for <bug-bash@gnu.org>; Tue, 31 Oct 2000 14:53:59 -0500
Received: from ylum.mrc-home.org (109-62.bestdsl.net [216.162.109.62])
	by smtp.networkusa.net (8.8.7/8.8.7) with ESMTP id OAA27968
	for <bug-bash@gnu.org>; Tue, 31 Oct 2000 14:37:48 -0600
From: dalgoda@ix.netcom.com
Received: from thune.mrc-home.org by ylum.mrc-home.org (8.10.0) id K04JrnE03980; Fri, 4 Jan 1980 13:53:49 -0600
Received: by thune.mrc-home.org (8.10.0) id e9VJroW24966; Tue, 31 Oct 2000 13:53:50 -0600
Date: Tue, 31 Oct 2000 13:53:50 -0600
Message-Id: <200010311953.e9VJroW24966@thune.mrc-home.org>
To: bug-bash@gnu.org
Subject: su - doesn't source .profile
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu' -DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=64  -I.  -I. -I./include -I./lib -I/usr/include -g -O2
uname output: Linux thune 2.2.17raid #4 Wed Sep 6 13:56:49 CDT 2000 i586 unknown
Machine Type: i386-pc-linux-gnu

Bash Version: 2.04
Patch Level: 0
Release Status: release

Description:
su - user -c 'echo foo' does not source .profile.

Repeat-By:

~user with "echo profile" in .profile

su - user -c 'echo foo'

Should result in:
profile
foo

This may have something to do with the fact that GNU su does not use the
"-su" mechanism. (see shell.c:918-928 for bash 2.04)

Fix:
	[Description of how to fix the problem.  If you don't know a
	fix for the problem, don't include this section.]


From chet@nike.ins.cwru.edu Tue Oct 31 15:10:45 2000
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13qhk5-00073L-00
	for <bug-bash@gnu.org>; Tue, 31 Oct 2000 15:10:45 -0500
Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi)
	id PAA47762; Tue, 31 Oct 2000 15:10:33 -0500 (EST) (from chet)
Date: Tue, 31 Oct 2000 15:09:46 -0500
From: Chet Ramey <chet@nike.ins.cwru.edu>
To: dalgoda@ix.netcom.com
Subject: Re: su - doesn't source .profile
Cc: bug-bash@gnu.org, chet@po.cwru.edu
Reply-To: chet@po.CWRU.Edu
Message-ID: <1001031200946.AA47756.SM@nike.ins.cwru.edu>
Read-Receipt-To: chet@po.CWRU.Edu
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-In-Reply-To:  Message from dalgoda@ix.netcom.com of Tue, 31 Oct 2000 13:53:50 -0600 (id <200010311953.e9VJroW24966@thune.mrc-home.org>)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

> Machine Type: i386-pc-linux-gnu
> 
> Bash Version: 2.04
> Patch Level: 0
> Release Status: release
> 
> Description:
> su - user -c 'echo foo' does not source .profile.

If this is important to you, uncomment the definition of
NON_INTERACTIVE_LOGIN_SHELLS in config-bot.h and rebuild bash.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


From dalgoda@ix.netcom.com Tue Oct 31 16:33:57 2000
Received: from smtp.networkusa.net ([216.15.144.12])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13qj2a-0008Sv-00; Tue, 31 Oct 2000 16:33:56 -0500
Received: from ylum.mrc-home.org (109-62.bestdsl.net [216.162.109.62])
	by smtp.networkusa.net (8.8.7/8.8.7) with ESMTP id QAA28796;
	Tue, 31 Oct 2000 16:17:41 -0600
Received: from thune.mrc-home.org by ylum.mrc-home.org (8.10.0) id K04LXhq04226; Fri, 4 Jan 1980 15:33:43 -0600
Received: by thune.mrc-home.org (8.10.0) id e9VLXhn27806; Tue, 31 Oct 2000 15:33:43 -0600
Date: Tue, 31 Oct 2000 15:33:43 -0600
From: Mike Castle <dalgoda@ix.netcom.com>
To: chet@po.CWRU.Edu, bug-sh-utils@gnu.org
Cc: dalgoda@ix.netcom.com, bug-bash@gnu.org
Subject: Re: su - doesn't source .profile
Message-ID: <20001031153343.A26140@thune.mrc-home.org>
Reply-To: Mike Castle <dalgoda@ix.netcom.com>
References: <1001031200946.AA47756.SM@nike.ins.cwru.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.6i
In-Reply-To: <1001031200946.AA47756.SM@nike.ins.cwru.edu>; from chet@nike.ins.cwru.edu on Tue, Oct 31, 2000 at 03:09:46PM -0500
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

Please note I've added bug-sh-utils just in case.

On Tue, Oct 31, 2000 at 03:09:46PM -0500, Chet Ramey wrote:
> > Machine Type: i386-pc-linux-gnu
> > 
> > Bash Version: 2.04
> > Patch Level: 0
> > Release Status: release
> > 
> > Description:
> > su - user -c 'echo foo' does not source .profile.
> 
> If this is important to you, uncomment the definition of
> NON_INTERACTIVE_LOGIN_SHELLS in config-bot.h and rebuild bash.

First, thanks for getting back to me, especially so quickly.  I thought for 
sure I'd messed up my email address on the bug report.

Second, just for archive's sake, it's config-top.h.

While this is important to me, it is also what the documenation suggests:

Invoked as an interactive login shell, or with `--login'
........................................................
   
   When Bash is invoked as an interactive login shell, or as a
non-interactive shell with the `--login' option, it first reads and
executes commands from the file `/etc/profile', if that file exists.
After reading that file, it looks for `~/.bash_profile',
`~/.bash_login', and `~/.profile', in that order, and reads and
executes commands from the first one that exists and is readable.  The
`--noprofile' option may be used when the shell is started to inhibit
this behavior.



Similar wording exists slightly below that for when called as /bin/sh.

Since GNU su makes an explicit decision not to call itself as -su, and this
makes bash work incorrectly, there is a bug somewhere.

I hate to suggest it, but perhaps GNU su should set up another mechanism
for indicating itself for bash.  Then again, what happens when GNU su does
not use "-su" on a system that uses traditional Bourne shell?  (Hmm.. I
guess I could look at the ksh source to see if it causes any problems).

The following code from shell.c definitely makes bash behave differently
depending on if it's running on a system with GNU su or not:

set_shell_name (argv0)
     char *argv0;
{ 
  /* Here's a hack.  If the name of this shell is "sh", then don't do
     any startup files; just try to be more like /bin/sh. */
  shell_name = base_pathname (argv0);
  if (*shell_name == '-')
    shell_name++;
  if (shell_name[0] == 's' && shell_name[1] == 'h' && shell_name[2] == '\0')
    act_like_sh++;
  if (shell_name[0] == 's' && shell_name[1] == 'u' && shell_name[2] == '\0')
    su_shell++;

This behavorial difference could cause potential porting problems of
scripts.

mrc
-- 
       Mike Castle       Life is like a clock:  You can work constantly
  dalgoda@ix.netcom.com  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
    We are all of us living in the shadow of Manhattan.  -- Watchmen


From chet@nike.ins.cwru.edu Tue Oct 31 16:37:39 2000
Received: from nike.ins.cwru.edu ([129.22.8.219])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13qj6B-0008Ve-00
	for <bug-bash@gnu.org>; Tue, 31 Oct 2000 16:37:39 -0500
Received: (chet@localhost) by nike.ins.cwru.edu (8.9.3/CWRU-2.5-bsdi)
	id QAA48485; Tue, 31 Oct 2000 16:37:27 -0500 (EST) (from chet)
Date: Tue, 31 Oct 2000 16:34:31 -0500
From: Chet Ramey <chet@nike.ins.cwru.edu>
To: tjacobs@codegnome.org
Subject: Re: Parameter expansion/assignment broken in cat
Cc: bug-bash@gnu.org, chet@po.cwru.edu
Reply-To: chet@po.CWRU.Edu
Message-ID: <1001031213431.AA48463.SM@nike.ins.cwru.edu>
Read-Receipt-To: chet@po.CWRU.Edu
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-In-Reply-To:  Message from tjacobs@codegnome.org of Mon, 30 Oct 2000 13:42:55 -0800 (PST) (id <Pine.LNX.4.21.0010301342250.10749-100000@cyrix.codegnome.org>)
Sender: bug-bash-admin@gnu.org
Errors-To: bug-bash-admin@gnu.org
X-BeenThere: bug-bash@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bash-request@gnu.org?subject=help>
List-Post: <mailto:bug-bash@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
List-Id: Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bash/

> Consider the following script sourced under Red Hat 7.0 and bash
> 2.04.11(1)-release:
> 
> 	unset foo
> 	try=test
> 	cat <<-.
>         	${foo:=$try}
>         	value of foo: $foo"
> 	.
> 	echo $foo
> 
> While it appears to behave normally, the assignment operator inside the
> cat statement seems to be broken. $foo is never really assigned the value
> "test," even though it displays it as such inside cat. The echo statement
> shows that the value has never truly been assigned to foo.
> 
> What is causing this behavior?

The fact that you're running `cat', which is a command from the file system
and is executed in a subshell.  Redirections are performed in the subshell.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/


