Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: logout from interactive subshell
- X-seq: zsh-users 10842
- From: Christian Taylor <cht@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: logout from interactive subshell
- Date: Thu, 12 Oct 2006 12:16:28 +0200
- In-reply-to: <F7507090F1A72B43A51444325DFBE43101391E41@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <F7507090F1A72B43A51444325DFBE43101391E41@xxxxxxxxxxxxxxxxxxxxxxxxxx>
> 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.
I don't know how to do exactly what you have in mind, but I can think of two
methods that may be of use to you. Both should (usually) work independent of
which shell you use. The second is close to what you asked for.
1. Shortcut
You can hit "^D" instead of typing exit (or logout) to terminate the current
shell. If you are three subshells deep, holding Ctrl and hitting "d" three
times is quite a lot faster, but you still have to keep track of how many
subshells you want to exit.
2. Screen
After you log into the remote box, start a screen session (simply
type "screen"). Proceed to do your stuff. After you're done, hit "^A"
followed by "k". Screen will ask you to confirm and then terminates all your
subshells, as well as itself.
To logout automatically as well, I suggest you create an alias for the
command "screen; logout" and run that after login.
(Screen is capable of much more, have a look at the man page if you're
interested.)
hope this helps,
Christian
Messages sorted by:
Reverse Date,
Date,
Thread,
Author