|> >$ echo $$ ; (echo $$)
|> >11290
|> >11290
|> >$
|> >
|> >How to refer to the pid of the subshell?
|> >
|>
|> As I remember reading in Bolsky & Korn, it's not guaranteed that
|> the (commands) construct will generate a separate shell, only that
|> 'commands' will be executed atomically.
|>
|> If you really _have_ to have a separate shell, do
|>
|> (ksh echo $$)
|>
|> Of course I haven't tried it 8)
It really doesn't matter whether the command is executed in a separate
shell or not -- what counts is where the command line is evaluted, which
in this case IS always the calling shell.
I don't understand the alternative suggestion -- as far as I can see,
you are looking for a file named echo, and executing the commands in it.
About the only way I can think of of doing it is sh -c 'echo $$', which
works.
--
GABI Software, 22 rue Jacques-Lemercier, 78000 Versailles, France
I'm looking for a job -- Je recherche du travail