From owner-freebsd-current@FreeBSD.ORG Fri Jan 28 16:19:33 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 8E3C616A4CE; Fri, 28 Jan 2005 16:19:33 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3826043D39; Fri, 28 Jan 2005 16:19:33 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.1) id j0SGJSra078767; Fri, 28 Jan 2005 10:19:28 -0600 (CST) (envelope-from dan) Date: Fri, 28 Jan 2005 10:19:28 -0600 From: Dan Nelson To: Jilles Tjoelker Message-ID: <20050128161928.GA70503@dan.emsphone.com> References: <41F9F2DC.7000907@elischer.org> <20050128094116.B56848@beagle.kn.op.dlr.de> <41FA008D.7030403@elischer.org> <20050128153328.GA96969@stack.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050128153328.GA96969@stack.nl> X-OS: FreeBSD 5.3-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: Current cc: Harti Brandt cc: Julian Elischer 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 16:19:33 -0000 In the last episode (Jan 28), Jilles Tjoelker said: > 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. Try "sh -c exec xterm". The sh is not useless, since it must hang around to print the signal name if the xterm gets killed. -- Dan Nelson dnelson@allantgroup.com