From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6931 invoked from network); 12 Oct 2006 10:19:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.6 (2006-10-03) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.6 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 12 Oct 2006 10:19:12 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 48828 invoked from network); 12 Oct 2006 10:19:06 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 Oct 2006 10:19:06 -0000 Received: (qmail 24031 invoked by alias); 12 Oct 2006 10:18:58 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10842 Received: (qmail 24021 invoked from network); 12 Oct 2006 10:18:58 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 12 Oct 2006 10:18:58 -0000 Received: (qmail 47688 invoked from network); 12 Oct 2006 10:18:58 -0000 Received: from viefep15-int.chello.at (HELO viefep12-int.chello.at) (213.46.255.20) by a.mx.sunsite.dk with SMTP; 12 Oct 2006 10:18:56 -0000 Received: from shodan ([213.47.104.218]) by viefep12-int.chello.at (InterMail vM.6.01.05.04 201-2131-123-105-20051025) with ESMTP id <20061012101855.RBRD4356.viefep12-int.chello.at@shodan> for ; Thu, 12 Oct 2006 12:18:55 +0200 From: Christian Taylor To: zsh-users@sunsite.dk Subject: Re: logout from interactive subshell Date: Thu, 12 Oct 2006 12:16:28 +0200 User-Agent: KMail/1.9.4 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610121216.28334.cht@chello.at> > 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