zsh-users
 help / color / mirror / code / Atom feed
From: Lloyd Zusman <ljz@asfast.com>
To: zsh-users@sunsite.dk
Cc: "Com MN PG P E B Consultant 3"
	<mn-pg-p-e-b-consultant-3.com@siemens.com>
Subject: Re: logout from interactive subshell
Date: Thu, 12 Oct 2006 06:07:43 -0400	[thread overview]
Message-ID: <87ac41c0eo.fsf@asfast.com> (raw)
In-Reply-To: <F7507090F1A72B43A51444325DFBE43101391E41@MCHP7R6A.ww002.siemens.net>

"Com MN PG P E B Consultant 3"
<mn-pg-p-e-b-consultant-3.com@siemens.com> 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@asfast.com
 God bless you.


  parent reply	other threads:[~2006-10-12 10:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Acbt2xG0TAhlYr+yQr+Yg16SvmfXSg==>
2006-10-12  8:47 ` Com MN PG P E B Consultant 3
2006-10-12  9:10   ` Mikael Magnusson
2006-10-12  9:29     ` Com MN PG P E B Consultant 3
2006-10-12  9:45       ` Peter Stephenson
2006-10-12 10:07       ` Lloyd Zusman [this message]
2006-10-12 14:58         ` Bart Schaefer
2006-10-12 22:24           ` Vincent Lefevre
2006-10-12 10:16       ` Christian Taylor
2006-10-13 12:17         ` Brian K. White
2006-10-14  1:44           ` Phil Pennock
2006-10-15  9:23             ` Brian K. White
2006-10-12 10:04   ` Vincent Lefevre
2006-10-12 10:20     ` Com MN PG P E B Consultant 3
2006-10-12 15:04       ` Bart Schaefer
2006-10-12 18:09   ` Matthew Woehlke
2006-10-12 20:15     ` Mike Stroyan
2006-10-13  6:28     ` Com MN PG P E B Consultant 3
     [not found] <jefydtsvyt.fsf@sykes.suse.de>
2006-10-12 10:08 ` Com MN PG P E B Consultant 3
     [not found] <jepscxrcvq.fsf@sykes.suse.de>
2006-10-12 12:36 ` Com MN PG P E B Consultant 3
     [not found] <20061012085526.GA6032@debian.inet>
2006-10-12 12:50 ` Com MN PG P E B Consultant 3

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ac41c0eo.fsf@asfast.com \
    --to=ljz@asfast.com \
    --cc=mn-pg-p-e-b-consultant-3.com@siemens.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).