Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: logout from interactive subshell
- X-seq: zsh-users 10845
- From: "Com MN PG P E B Consultant 3" <mn-pg-p-e-b-consultant-3.com@xxxxxxxxxxx>
- To: "Andreas Schwab" <schwab@xxxxxxx>
- Subject: RE: logout from interactive subshell
- Date: Thu, 12 Oct 2006 14:36:53 +0200
- Cc: "Vincent Lefevre" <vincent@xxxxxxxxxx>, "zsh-users Mailinglist" <zsh-users@xxxxxxxxxx>, <bug-bash@xxxxxxx>
- In-reply-to: <jepscxrcvq.fsf@xxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Thread-index: Acbt8iA92v8vbmkwRpuU3FFmSPnnNQACHCgQ
- Thread-topic: logout from interactive subshell
> > 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 definition
of call_and_exit
to propagate the exit up, but basically a nice idea. Maybe only
disadvantage that I have
to think before when calling the subshell (either by calling it via
call_and_exit, or
by setting up suitable aliases for cleartool, bash, zsh etc., to do this
automatically)
- I had hoped I cut do this with an intelligent alias which gets me out
of any deep
nesting of subshells without having done any preparation work before.
But your solution
is at least cleaner than the brute-force way of finding the login shell
via ps, and
then killing it.
Will give your idea a thought. Thanks a lot.
Ronald
--
Ronald Fischer (phone +49-89-63676431)
mailto:mn-pg-p-e-b-consultant-3.com@xxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author