From owner-freebsd-hackers Fri Sep 21 21:31:10 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from InterJet.elischer.org (c421509-a.pinol1.sfba.home.com [24.7.86.9]) by hub.freebsd.org (Postfix) with ESMTP id C090237B401 for ; Fri, 21 Sep 2001 21:31:06 -0700 (PDT) Received: from elischer.org (InterJet.elischer.org [192.168.1.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id WAA39315; Fri, 21 Sep 2001 22:15:19 -0700 (PDT) Message-ID: <3BAC12E1.6D87CB57@elischer.org> Date: Fri, 21 Sep 2001 21:26:09 -0700 From: Julian Elischer X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en, hu MIME-Version: 1.0 To: Mario Sergio Fujikawa Ferreira Cc: freebsd-hackers@freebsd.org Subject: Re: bug in shell `` expansion code? References: <20010922011302.A44620@exxodus.fedaykin.here> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mario Sergio Fujikawa Ferreira wrote: > > Hi, > > While working on a make .mk code, I and Chris Wasser (TDF > on IRC) came across an interesting behavior: > > sh -c 'TDF="echo a && echo b";for i in `${TDF}`; do echo "i:$i"; done' > > This should return: > > i:a > i:b > > instead, it returns: > > i:a > i:&& > i:echo > i:b > > If this is not a bug, how do we get it working? try: julian@jules:sh -c 'TDF="echo a && echo b";for i in `eval ${TDF}`; do echo "i:$i"; done' i:a i:b the trouble is that TDF is interpretted as a single string including spaces where you want to interpret is as a list of separate words > > Regards, > > -- > Mario S F Ferreira - UnB - Brazil - "I guess this is a signature." > lioux at ( freebsd dot org | linf dot unb dot br ) > flames to beloved devnull@someotherworldbeloworabove.org > feature, n: a documented bug | bug, n: an undocumented feature > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message -- +------------------------------------+ ______ _ __ | __--_|\ Julian Elischer | \ U \/ / hard at work in | / \ julian@elischer.org +------>x USA \ a very strange | ( OZ ) \___ ___ | country ! +- X_.---._/ presently in San Francisco \_/ \\ v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message