Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: logout from interactive subshell
- X-seq: zsh-users 10841
- From: Lloyd Zusman <ljz@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: logout from interactive subshell
- Date: Thu, 12 Oct 2006 06:07:43 -0400
- Cancel-lock: sha1:38R1+yQsQvEF/TkyEOeRjbWWKUM=
- Cc: "Com MN PG P E B Consultant 3" <mn-pg-p-e-b-consultant-3.com@xxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <237967ef0610120210r1d3a8c57n8850a4872b846c77@xxxxxxxxxxxxxx> <F7507090F1A72B43A51444325DFBE43101391E41@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
"Com MN PG P E B Consultant 3"
<mn-pg-p-e-b-consultant-3.com@xxxxxxxxxxx> writes:
>> How about
>> function rlogin() {command rlogin "$@"; exit}
>> ?
>
> Hmmmm.... I don't see how this could help me. Actually, your
> solution would EXIT the shell I came from, after the login
> has finished!! So I not only have to type all the "exit"s on
> the remote host, I would even loose my current shell on the
> local host.
>
> Maybe to repeat what I would like to do:
>
> 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
> # Now I want to exit
> exit
> exit
> logout
>
> I would like to have a (interactive) command which does the final two
> exits plus
> a logout for me.
>
> BTW, I could imagine a solution using 'expect', which does the login,
> then hands
> over the control to the user, and finally if the user is done, performs
> the
> exit and logout.
With clearcase in the picture, this becomes complicated, due to the fact
that cleartool automatically puts you into a subshell whether you like
it or not. That's one of several reasons for why I don't like
clearcase.
But given that you're probably stuck having to use it, you might try
something like this (assuming that you're using zsh):
Put this into your ~/.zlogin:
[[ ${SHLVL:-0} == 1 ]] && {
export LOGINPID=$$
}
Then, after your "# Now I want to exit" comment (above), do this:
kill -9 $LOGINPID
You can make this into an alias, if you wish.
It's an ugly hack, but it may be the only thing that you can do, given
that you're using clearcase.
I think it will work, but I can't test it, because clearcase isn't
installed on any of my machines.
Good luck!
--
Lloyd Zusman
ljz@xxxxxxxxxx
God bless you.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author