Bug 52875 - "IFS=: for foo in $FOO:bar:baz; do" doesn't work properly
"IFS=: for foo in $FOO:bar:baz; do" doesn't work properly
Status: CLOSED NOTABUG
Product: Red Hat Raw Hide
Classification: Retired
Component: ash (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Crutcher Dunnavant
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-08-30 08:19 EDT by Jonathan Kamens
Modified: 2007-04-18 12:36 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-08-30 08:19:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jonathan Kamens 2001-08-30 08:19:08 EDT
Run this script:

  #!/bin/ash

  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.

Bash 2.05 gets this wrong in the same way (and I've submitted a bug
report about it directly to the bash maintainers).  Bash 1.14.7 gets
it right.

Normally, I would have submitted this bug report directly to the
maintainer of ash, but I can't figure out who that is -- it isn't in
the man page or in the output of "rpm -q -i ash".
Comment 1 Jonathan Kamens 2001-08-30 09:42:19 EDT
The maintainer of bash has convinced me that this behavior is correct.

Note You need to log in before you can comment on or make changes to this bug.