Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Jan 2005 10:19:28 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Jilles Tjoelker <jilles@stack.nl>
Cc:        Julian Elischer <julian@elischer.org>
Subject:   Re: sh bug?
Message-ID:  <20050128161928.GA70503@dan.emsphone.com>
In-Reply-To: <20050128153328.GA96969@stack.nl>
References:  <41F9F2DC.7000907@elischer.org> <20050128094116.B56848@beagle.kn.op.dlr.de> <41FA008D.7030403@elischer.org> <20050128153328.GA96969@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050128161928.GA70503>