[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"for loop" problem in bash-3.2 on Freebsd-4.11release
From: |
showrun . lee |
Subject: |
"for loop" problem in bash-3.2 on Freebsd-4.11release |
Date: |
Wed, 19 Dec 2007 13:07:25 +0800 |
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 root@dev1.c
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.
thanks
- "for loop" problem in bash-3.2 on Freebsd-4.11release,
showrun . lee <=