Bug in Bash 2.05b when cross-compiling for MIPS.

2005-06-19 Thread Dylan Griffiths
* The version number of Bash: Bash 2.05b, but bash 2.x and 3.x are 
both likely affected.

* The hardware and operating system: HOST Linux x86, TARGET Linux MIPS
* The compiler used to compile Bash: mips-gcc (GCC) 3.2
* A description of the bug behaviour: $(CC_FOR_HOST) is used to 
compile mksignames.c, which produces signames.h.  Signames.h reflects 
the names and ordering of signals on the host machine, not the target 
machine.
* A short script or `recipe' which exercises the bug and may be 
used to reproduce it: simply cross-compile bash for any target arch 
which does not share 100% the same signals.  Examples inlcude: Alpha and 
x86, Mips and x86, ARM and x86, etc.


How to fix?  Well, it may be that signal.h in glibc needs to be expanded 
to define all signals on all Linux systems, and wrap with ifdefs, and 
then compile (for host, but using the apropos define) mksigname such 
that it outputs the correct target signames.h.  Another solution would 
be some alternative method for generating a correct signals.h.


Here is some example output of how the bash kill command generates 
incorrect signals on a MIPS platform:


# ./testsig &
65
# kill -USR1 65
Caught signal 16
# kill 65
Caught signal 15
# bash
bash-2.05b#
bash-2.05b# kill -USR1 65
Caught signal 10
bash-2.05b# exit
#


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


improvement to BASH manpage

2005-06-19 Thread D. Hugh Redelmeier
I think that the descriptions of AND lists and OR lists in 
bash(1) could be improved.

Here is an excerpt from http://cnswww.cns.cwru.edu/~chet/bash/bash.html:

The control operators && and || denote AND lists and OR lists,
respectively. An AND list has the form

command1 && command2 

command2 is executed if, and only if, command1 returns an exit
status of zero.

An OR list has the form

command1 || command2

command2 is executed if and only if command1 returns a non-zero
exit status. The return status of AND and OR lists is the exit
status of the last command executed in the list.

I think that the forms would be less ambiguous and more clear if they
were written as:
pipeline && list
and
pipeline || list

It would be equally correct to write
list && pipeline
and
list || pipeline
but I think that this form is slightly less intuitive.

Obviously the surrounding text needs to have references to command1
and command2 replaced.


The shell grammar uses the non-terminal "command".  I don't
immediately see where it is defined.  I guess that it is a "simple
command" or "compound command".  If so, the current definitions of OR
lists and AND lists seems wrong because it does not allow for
x || y || z
or
x && y && z
or
x && y || z


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash