From owner-freebsd-hackers Mon Mar 6 0:20:45 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from iclub.nsu.ru (iclub.nsu.ru [193.124.222.66]) by hub.freebsd.org (Postfix) with ESMTP id 540BE37BC2C for ; Mon, 6 Mar 2000 00:20:05 -0800 (PST) (envelope-from fjoe@iclub.nsu.ru) Received: from localhost (fjoe@localhost) by iclub.nsu.ru (8.9.3/8.9.3) with ESMTP id OAA96205; Mon, 6 Mar 2000 14:09:16 +0600 (NS) (envelope-from fjoe@iclub.nsu.ru) Date: Mon, 6 Mar 2000 14:09:16 +0600 (NS) From: Max Khon To: Martin Cracauer Cc: John Polstra , Doug@gorean.org, hackers@FreeBSD.ORG Subject: Re: empty lists in for (/bin/sh) In-Reply-To: <20000306084031.A35426@cons.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG hi, there! On Mon, 6 Mar 2000, Martin Cracauer wrote: > I just checked POSIX 1003.2. > > for name [ in word ] > do > compound-list > done > > "First, the list of words following 'in' shall be expanded to generate > a list of items." [...] "If no items result from the expansion, the > compound-list shall not be executed." > > is not a word at all, so it can't be expanded, so I think > bash is corrent to complain about a syntax error. > > It is clear, though, that your (John) example "variable expansion to > nothing" is not an error and both shells do it right. A lot of stuff in /usr/ports/Mk/bsd.port.mk depends on current /bin/sh behaviour ("do nothing" instead of "complain and bail out"). I am the original poster and faced this problem when tried to port FreeBSD Ports subsystem to Solaris and Linux. /fjoe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message