Bug 52875 - "IFS=: for foo in $FOO:bar:baz; do" doesn't work properly
Summary: "IFS=: for foo in $FOO:bar:baz; do" doesn't work properly
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: ash (Show other bugs)
(Show other bugs)
Version: 1.0
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Crutcher Dunnavant
QA Contact: Aaron Brown
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-08-30 12:19 UTC by Jonathan Kamens
Modified: 2007-04-18 16:36 UTC (History)
0 users

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


Attachments (Terms of Use)

Description Jonathan Kamens 2001-08-30 12:19:08 UTC
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 13:42:19 UTC
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.