Re: sh bug?

From: Jilles Tjoelker <jilles_at_stack.nl>
Date: Fri, 28 Jan 2005 16:33:28 +0100
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
Received on Fri Jan 28 2005 - 14:33:30 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:27 UTC