showrun.lee wrote:
> Machine: i386
> OS: freebsd4.11
> Compiler: gcc
> Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='
> freebsd4.11' -DCONF_MACHTYPE='i386-unknown-freebsd4.11'
> -DCONF_VENDOR='unknown'
> -DLOCALEDIR='/home/lihongliang/libiconv/share/locale' -DPACKAGE='bash'
> -DSHELL -DHAVE_CONFIG_H -I. -I. -
> I./include -I./lib -I./lib/intl -I/usr/home/lihongliang/bash-3.2/lib/intl
> -I/home/lihongliang/libiconv//include -g -O2
> uname output: FreeBSD dev1.corp.qihoo.net 4.11-RELEASE-p14 FreeBSD
> 4.11-RELEASE-p14 #0: Wed Apr 5 14:46:54 CST 2006 [EMAIL PROTECTED]
> orp.qihoo.net:/usr/src/sys/compile/GENERIC i386
> Machine Type: i386-unknown-freebsd4.11
>
> Bash Version: 3.2
> Patch Level: 0
> Release Status: release
>
> Description:
> I got a problem when i upgrade bash to 3.2。
> I have a shell script,for example:
> #cat test.sh
> files= switches=
> for arg
> do
> case "$arg" in
> -*) switches="$switches $arg" ;;
> *) files="$files $arg" ;;
> esac
> done
>
> echo $switches
> echo $files
>
> if I use the /bin/sh,or bash-2.0.5b,and on freebsd6.2 with
> bash-3.2,everything is ok。but got problem with bash-3.2 on freebsd4.11。
> #sh ./test1.sh -a -b a
> -a -b
> a
>
> bash-3.2$ ./bash ./test1.sh -a -b a
>
>
>
>
> I think the problem is the "for loop",in every loop, $arg can't be $1 $2 $3
> respectly。
>
> perhaps,this is a bug or others.
It is a bug, but it's a bug in the version of bison used to generate the
parser from parse.y. It's probably the bug described in item 17 in the
NOTES file.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Live Strong. No day but today.
Chet Ramey, ITS, CWRU [EMAIL PROTECTED] http://cnswww.cns.cwru.edu/~chet/