From: "Julian L. Ho" <jh6j+@andrew.cmu.edu>
To: rc@archone.tamu.edu
Subject: builtin exit
Date: Sun, 29 Dec 1991 04:53:48 -0600 [thread overview]
Message-ID: <694002955.8576.0@mycroft.bh.andrew.cmu.edu> (raw)
It would be nice if exit took strings like 'sigint', etc... just a
single string (a list like return handles wouldn't be possible, I
know).
It would also be nice if signal handlers had some way of telling how
they were called (I'm thinking setting $status on entry to signal
handlers, or possibly $*, to some meaningful string).
For example, I'd like something like this to work:
pipes=()
fn sigexit sigint sigquit { s=$status {
rm $pipes
exit $s
} }
#code that builds $pipes (list of files) and does things with
#it
The idea is to have the script exit with 'sigint', 'sigquit', the
argument to builtin exit (if its used), or the exit status of the last
command (if we just fall off the end in "code...")...
Currently, I'm doing something like:
pipes=()
fn sigint sighup sigquit {
rm $pipes
exit 1
}
#code...
# Normal exit follows (a copy of the cleanup code in the handler)
rm $pipes
But that only works because my code doesn't call builtin exit in the
middle... also, exiting with the exit status of the cleanup code (rm
in this example) isn't necessarily correct. If the user causes an
interrupt, the cleanup actions are taken but the exit status is 1, not
'sigint', or whatever...
next reply other threads:[~1991-12-29 10:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1991-12-29 10:53 Julian L. Ho [this message]
1991-12-29 12:45 ` John Mackin
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=694002955.8576.0@mycroft.bh.andrew.cmu.edu \
--to=jh6j+@andrew.cmu.edu \
--cc=rc@archone.tamu.edu \
/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.
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).