From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 6 21:14:01 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11A9E106567D for ; Sun, 6 Apr 2008 21:14:01 +0000 (UTC) (envelope-from dan@grillo.net) Received: from grillo.net (adsl-69-107-204-137.dsl.pltn13.pacbell.net [69.107.204.137]) by mx1.freebsd.org (Postfix) with ESMTP id AF19E8FC1E for ; Sun, 6 Apr 2008 21:14:00 +0000 (UTC) (envelope-from dan@grillo.net) Received: from more.grillo.net (localhost.grillo.net [127.0.0.1]) by grillo.net (8.14.2/8.14.2) with ESMTP id m36KYIKr085502; Sun, 6 Apr 2008 13:34:19 -0700 (PDT) (envelope-from grio@more-enet.grillo.net) Received: (from grio@localhost) by more.grillo.net (8.14.2/8.14.2/Submit) id m36KYItX085501; Sun, 6 Apr 2008 13:34:18 -0700 (PDT) (envelope-from grio) From: Dan Grillo Message-Id: <200804062034.m36KYItX085501@more.grillo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Organization: President, Grillo Networking, Inc. To: Julian Elischer References: <47F8C1B3.4030902@unitix.org> <47F913AE.3040604@elischer.org> Date: Sun, 6 Apr 2008 13:34:18 -0700 Versions: dmail (bsd44) 2.7/makemail 2.15 X-Mailman-Approved-At: Mon, 07 Apr 2008 05:05:35 +0000 Cc: freebsd-hackers@freebsd.org, dino Subject: Re: bug in /bin/sh?!? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2008 21:14:01 -0000 Julian Elischer writes: | dino wrote: | > Hello, | > | > on my FreeBSD 7.0-STABLE the line: | > | >> sh -c 'set -- ${HOME+A B C}; echo "1:$1"; echo "2:$2:"; echo "3:$3:"' | > | > prints | > | > 1:A B C: | > 2:: | > 3:: | > | > I would rather expect: | > | > 1:A: | > 2:B: | > 3:C: | > | > Is it correct that field splitting isn't performed on default/alternate | > expanded values? | > | | "A B C" is a single value tha thappens to contain spaces. | so, yes there is no splitting at that point. This is one place where bash and ash disagree: ~ redhat-linux-box[2]> /bin/bash bash-3.00$ sh -c 'set -- ${HOME+A B C}; echo "1:$1"; echo "2:$2:"; echo "3:$3:"' 1:A 2:B: 3:C: bash-3.00$ bash --version GNU bash, version 3.00.15(1)-release (x86_64-redhat-linux-gnu) Copyright (C) 2004 Free Software Foundation, Inc. --Dan -- Dan Grillo dan@grillo.net 650-299-1470