From owner-freebsd-current@FreeBSD.ORG Fri Jan 28 08:08:04 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B94D16A4D0 for ; Fri, 28 Jan 2005 08:08:04 +0000 (GMT) Received: from pimout1-ext.prodigy.net (pimout1-ext.prodigy.net [207.115.63.77]) by mx1.FreeBSD.org (Postfix) with ESMTP id 234B643D45 for ; Fri, 28 Jan 2005 08:08:02 +0000 (GMT) (envelope-from julian@elischer.org) Received: from [192.168.1.102] (adsl-216-100-134-143.dsl.snfc21.pacbell.net [216.100.134.143])j0S880GR100496 for ; Fri, 28 Jan 2005 03:08:00 -0500 Message-ID: <41F9F2DC.7000907@elischer.org> Date: Fri, 28 Jan 2005 00:07:56 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8a3) Gecko/20041017 X-Accept-Language: en, hu MIME-Version: 1.0 To: Current Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: sh bug? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2005 08:08:04 -0000 the man page for sh says: ---------------------------------------------------------------- Grouping Commands Together Commands may be grouped by writing either (list) or { list; } The first form executes the commands in a subshell. Note that built-in commands thus executed do not affect the current shell. The second form does not fork another shell, so it is slightly more efficient. Grouping commands together this way allows the user to redirect their output as though they were one program: { echo -n "hello"; echo " world"; } > greeting ----------------------------------------------------------------------- however echo $$ and ( echo $$ ) produce the same result. in addition, ps -l and ( ps -l ) show the same parent process for 'ps' so it looks to me that () is acting the same as {} and that neither is forking a new shell. am I missing something?