From candy@kgc.co.jp  Mon Mar 13 02:59:34 1995
Received: from mail0.iij.ad.jp (mail0.iij.ad.jp [192.244.176.61]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id CAA02171 for <FreeBSD-gnats-submit@freebsd.org>; Mon, 13 Mar 1995 02:59:32 -0800
Received: from uucp0.iij.ad.jp (uucp0.iij.ad.jp [192.244.176.51]) by mail0.iij.ad.jp (8.6.10+2.4W/3.3W9-MAIL) with ESMTP id OAA14778 for <FreeBSD-gnats-submit@freebsd.org>; Mon, 13 Mar 1995 14:36:01 +0900
Received: (from uucp@localhost) by uucp0.iij.ad.jp (8.6.10+2.4W/3.3W9-UUCP) with UUCP id OAA13770 for FreeBSD-gnats-submit@freebsd.org; Mon, 13 Mar 1995 14:36:00 +0900
Received: from xxx.kgc.co.jp (xxx.kgc.co.jp [192.168.1.8]) by fender.kgc.co.jp (8.6.9+2.4W/3.3W8:95013123) with ESMTP id MAA22653 for <FreeBSD-gnats-submit@freebsd.org>; Mon, 13 Mar 1995 12:58:55 +0900
Received: by xxx.kgc.co.jp (8.6.9/3.3W8:95020716) id MAA08766; Mon, 13 Mar 1995 12:58:54 +0900
Message-Id: <199503130358.MAA08766@xxx.kgc.co.jp>
Date: Mon, 13 Mar 1995 12:58:54 +0900
From: candy@kgc.co.jp
Reply-To: candy@kgc.co.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: strange behavior of /bin/sh
X-Send-Pr-Version: 3.2

>Number:         241
>Category:       bin
>Synopsis:       strange behavior of /bin/sh
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 13 03:00:03 1995
>Closed-Date:    Thu Feb 8 08:39:41 PST 1996
>Last-Modified:  Thu Feb  8 08:43:18 PST 1996
>Originator:     candy@kgc.co.jp (Toshihiro Kanda)
>Release:        FreeBSD 2.0-RELEASE i386
>Organization:
Keisokugiken corp.
>Environment:

>Description:

It seems /bin/sh handles `&' operator inside for loop incorrectly.

>How-To-Repeat:

$ cat foo
for i in a b c; do
	xx=${xx}${i}
	echo $xx
	xx=${xx}${i}
	echo $xx &
	xx=${xx}${i}
	echo $xx
done
$ sh foo
a
ab
abc
a
aa
ab
abb
abc
abcc

# This should be
a
aaa
aaab
aaabbb
aaabbbc
aaabbbccc
aa
aaabb
aaabbbcc

>Fix:

I don't know, but it seems /bin/sh of NetBSD 1.0 works well.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: wollman 
State-Changed-When: Thu Feb 8 08:39:41 PST 1996 
State-Changed-Why:  
Problem appears to be fixed in -current. 
>Unformatted:


