From owner-freebsd-questions Tue Jul 2 09:29:00 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id JAA20182 for questions-outgoing; Tue, 2 Jul 1996 09:29:00 -0700 (PDT) Received: from sam.networx.ie (dublin-ts15-94.indigo.ie [194.125.134.94]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id JAA20158 for ; Tue, 2 Jul 1996 09:28:52 -0700 (PDT) Received: from mip1.networx.ie (mip1.networx.ie [194.9.12.1]) by sam.networx.ie (8.6.12/8.6.12) with SMTP id RAA05314 for ; Tue, 2 Jul 1996 17:21:52 GMT X-Organisation: I.T. NetworX Ltd X-Business: Network Consultancy and Training X-Address: 67 Merrion Square, Dublin 2, Ireland X-Voice: +353-1-676-8866 X-Fax: +353-1-676-8868 Received: from mike.networx.ie by mip1.networx.ie Date: Tue, 2 Jul 1996 17:20:15 BST From: Michael Ryan Reply-To: mike@networx.ie Subject: Bug in /bin/sh To: FreeBSD Support Message-Id: Priority: Normal Mime-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Can anybody confirm that there is a bug in /bin/sh in FreeBSD v2.1, which the following commands illustrate... ------------------------------------------ $ cat > shbug #! /bin/sh -- f () { echo start test $1 = abc && { echo middle return 1 } there is no command called "there" & echo end return 0 } f $1 exit 0 ^D $ chmod +x shbug $ shbug abc start end $ middle ------------------------------------------ Note how the "echo end" statement got executed, eventhough it should not have? Also, it doesn't complain about the command "there" not being found. It's the "&" at the end of the "there" command that seems to confuse the shell. Remove it and the script works as you'd expect. Please email any replies to me directly (as well as to the list if you like), as I'm not on the mailing list right now. Thanks, Mike ---