[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: logout from interactive subshell

From: Com MN PG P E B Consultant 3
Subject: RE: logout from interactive subshell
Date: Thu, 12 Oct 2006 12:20:29 +0200

> >    (1) rlogin to a foreign host
> >    (2) Invoke a subshell (for example because I'm setting a 
> Clearcase
> > View)
> Is it a subshell or a second-level shell? (In the first case, $$ and
> $PPID remain the same.)

Could you kindly explain the difference? I thought it's always the
same - a process (being the current shell, or cleartool, or whatever)
is doing a fork, followed by an exec of the new shell.

In the particular case of "cleartool setview", I don't know how it is
done, but here is an example of the PIDs:

$ echo $$
$ echo $PPID
$ cleartool setview rofi_dft
$ echo $$
$ echo $PPID

So PPID changed (which I thought is very natural, since I have a new
parent process now).

The same effect appears if I invoke "zsh" instead of "cleartool....", so
we have what
you call a "second-level shell".

Now I wonder what exactly would be a "subshell" then....

> Each subshell can use a trap to be able
> to kill its parent. But bash and zsh behave differently concerning
> traps.

I can't use traps here, because I know only at "exit time", whether
I want to logout completely, or just go up one level.

> Alternatively, the command that invokes the subshell could call
> 'exit' after it has finished (you can write a wrapper, e.g. as a
> shell function).

Here again, I would need to decide at the time I'm calling the
subshell, what to do at the exit-time.... so not useful for me


Ronald Fischer (phone +49-89-63676431)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]