From owner-freebsd-current@FreeBSD.ORG Fri Jan 28 15:33:30 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 E215816A4CE; Fri, 28 Jan 2005 15:33:30 +0000 (GMT) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1258C43D49; Fri, 28 Jan 2005 15:33:30 +0000 (GMT) (envelope-from jilles@stack.nl) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mailhost.stack.nl (Postfix) with ESMTP id BD8661F2B9; Fri, 28 Jan 2005 16:33:28 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id AA39A1CDAD; Fri, 28 Jan 2005 16:33:28 +0100 (CET) Date: Fri, 28 Jan 2005 16:33:28 +0100 From: Jilles Tjoelker To: Julian Elischer Message-ID: <20050128153328.GA96969@stack.nl> References: <41F9F2DC.7000907@elischer.org> <20050128094116.B56848@beagle.kn.op.dlr.de> <41FA008D.7030403@elischer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41FA008D.7030403@elischer.org> X-Operating-System: FreeBSD 5.3-RELEASE-p2 i386 User-Agent: Mutt/1.5.6i cc: Current cc: Harti Brandt Subject: Re: 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 15:33:31 -0000 On Fri, Jan 28, 2005 at 01:06:21AM -0800, Julian Elischer wrote: > Harti Brandt wrote: > >On Fri, 28 Jan 2005, Julian Elischer wrote: > >JE>however echo $$ > >JE>and > >JE> ( echo $$ ) > >JE>produce the same result. > >I think that the $$ is expanded in the old shell in any case. Although it seems similar, I prefer to say the value of $$ does not change when forking a subshell. man sh and POSIX also state that. Thus, all $ expandos work the same way. > hence my test of > ps -l vs (ps -l) > unfortunatly the shell short circuits that too if it's too simple. But unfortunately, it doesn't short circuit when you something like sh -c xterm, it keeps a useless shell waiting. -- Jilles Tjoelker