[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"IFS=: for foo in $FOO:bar:baz; do" doesn't work properly
From: |
Jonathan Kamens |
Subject: |
"IFS=: for foo in $FOO:bar:baz; do" doesn't work properly |
Date: |
Thu, 30 Aug 2001 08:19:43 -0400 |
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 jik.kamens.brookline.ma.us 2.2.19 #5 SMP Thu Aug 23
07:00:30 EDT 2001 i686 unknown
Machine Type: i386-redhat-linux-gnu
Bash Version: 2.05
Patch Level: 8
Release Status: release
Description:
Run this script in bash 2.05:
#!/bin/sh
FOO="foo:bar:baz"
IFS=:
for ac_dir in $FOO:screlt:freeble; do
echo $ac_dir
done
echo ''
ac_dummy=$FOO:screlt:freeble
for ac_dir in $ac_dummy; do
echo $ac_dir
done
You'll see this output:
foo
bar
baz screlt freeble
foo
bar
baz
screlt
freeble
That's wrong. The first and second blocks of output should be
identical.
ash 0.3.7 gets this wrong in the same way. Bash 1.14.7 gets
it right.
Repeat-By:
See above.
Fix:
No clue.
- "IFS=: for foo in $FOO:bar:baz; do" doesn't work properly,
Jonathan Kamens <=