Re: logout from interactive subshell

2006-10-14 Thread Mikael Magnusson
On 10/12/06, Com MN PG P E B Consultant 3 [EMAIL PROTECTED] wrote: Does someone know how to deal with the following situation? Very often I do the following pattern: (1) rlogin to a foreign host (2) Invoke a subshell (for example because I'm setting a Clearcase View) (3) Logout from

RE: logout from interactive subshell

2006-10-13 Thread Com MN PG P E B Consultant 3
What about in your login (.bash_profile, etc) exporting a variable, say ROOT_PID=$$ and having a command/function/alias 'kill -s SIGHUP $ROOT_PID'? This is equivalent to killing the rlogin connection, but should clean up nicely if all you have are shells. Excellent idea! Thank you for

Re: logout from interactive subshell

2006-10-12 Thread Anton Zinoviev
On Thu, Oct 12, 2006 at 10:47:38AM +0200, Com MN PG P E B Consultant 3 wrote: (1) rlogin to a foreign host (2) Invoke a subshell (for example because I'm setting a Clearcase View) (3) Logout from the host Step (3) needs two steps: First I have to type 'exit' to leave the subshell,

Re: logout from interactive subshell

2006-10-12 Thread Andreas Schwab
Com MN PG P E B Consultant 3 [EMAIL PROTECTED] writes: A typical application would go like this: rlogin foobar DO SOME STUFF cleartool setview myview # this creates a subshell DO MORE STUFF cleartool setview yourview # now I'm two subshells deep DO STILL MORE STUFF #

Re: logout from interactive subshell

2006-10-12 Thread Vincent Lefevre
On 2006-10-12 10:47:38 +0200, Com MN PG P E B Consultant 3 wrote: Does someone know how to deal with the following situation? Very often I do the following pattern: (1) rlogin to a foreign host (2) Invoke a subshell (for example because I'm setting a Clearcase View) Is it a

RE: logout from interactive subshell

2006-10-12 Thread Com MN PG P E B Consultant 3
rlogin foobar DO SOME STUFF cleartool setview myview # this creates a subshell DO MORE STUFF cleartool setview yourview # now I'm two subshells deep DO STILL MORE STUFF # Now I want to exit exit exit logout I would like to have a (interactive)

RE: logout from interactive subshell

2006-10-12 Thread Com MN PG P E B Consultant 3
(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

Re: logout from interactive subshell

2006-10-12 Thread Andreas Schwab
Com MN PG P E B Consultant 3 [EMAIL PROTECTED] writes: 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. $ call_and_exit() { $@; if test $? -eq 42; then exit; fi; } $ call_and_exit cleartool ... $ exit 42 Andreas. --

RE: logout from interactive subshell

2006-10-12 Thread Com MN PG P E B Consultant 3
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. $ call_and_exit() { $@; if test $? -eq 42; then exit; fi; } $ call_and_exit cleartool ... $ exit 42 This looks clever. Maybe one should use exit 42 too in the

RE: logout from interactive subshell

2006-10-12 Thread Com MN PG P E B Consultant 3
(1) rlogin to a foreign host (2) Invoke a subshell (for example because I'm setting a Clearcase View) (3) Logout from the host Step (3) needs two steps: First I have to type 'exit' to leave the subshell, and then either 'exit' or 'logout' to leave the login shell. On

Re: logout from interactive subshell

2006-10-12 Thread Matthew Woehlke
Com MN PG P E B Consultant 3 wrote: Does someone know how to deal with the following situation? Very often I do the following pattern: (1) rlogin to a foreign host (2) Invoke a subshell (for example because I'm setting a Clearcase View) (3) Logout from the host Step (3) needs two

Re: logout from interactive subshell

2006-10-12 Thread Mike Stroyan
Very often I do the following pattern: (1) rlogin to a foreign host (2) Invoke a subshell (for example because I'm setting a Clearcase View) (3) Logout from the host Step (3) needs two steps: First I have to type 'exit' to leave the subshell, and then either 'exit' or 'logout' to leave