From: Elliott Hughes <Elliott.Hughes@genedata.com>
To: Elliott Hughes <Elliott.Hughes@genedata.com>,
Tim Goodwin <tjg@star.le.ac.uk>
Cc: rc@hawkwind.utcs.toronto.edu
Subject: Re: backgrounded jobs
Date: Mon, 14 Jun 1999 09:23:54 -0400 [thread overview]
Message-ID: <199906141323.PAA1469399@relay.ch.genedata.com> (raw)
> Does this suffice?
> fn prompt {if(!~ $apid $lastapid){echo kill $apid;lastapid=$apid}}
i suppose so. it's a bit uglier, because rc automatically outputs the
pid, but i can live with it.
> I didn't really give much thought to this; just left the "bug" in the
> man page. But doesn't this function come close? ...
that's nasty, though, when the builtin requires so little alteration.
here's a snippet from my local rc:
/* drop first n (default 1) items of variable xs (default $*) */
static void b_shift(char **av)
{
int n = (av[1] == 0 ? 1 : a2u(av[1]));
List *xs, *dollarzero;
if (av[1] != 0 && av[2] != 0 && av[3] != 0) {
arg_count("shift");
return;
}
if (n < 0) {
badnum(av[1]);
return;
}
if (av[1] == 0 || av[2] == 0) {
xs = varlookup("*")->n;
dollarzero = varlookup("0");
} else {
xs = varlookup(av[2]);
}
while (xs != 0 && n != 0) {
xs = xs->n;
--n;
}
if (av[1] == 0 || av[2] == 0) {
varassign("*", append(dollarzero, xs), FALSE);
} else {
varassign(av[2], xs, FALSE);
}
set(TRUE);
}
note that i don't consider dropping items from an empty list to
be an error, in contrast to Byron's rc. i don't know why he chose
to make it behave like that (Duff's doesn't, and neither do any
functional programming languages I can think of).
-e
--
"Act Swiss. Be Global." -- ABB Werbung, 1999.
next reply other threads:[~1999-06-15 21:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-06-14 13:23 Elliott Hughes [this message]
-- strict thread matches above, loose matches on Subject: below --
1999-06-10 22:00 steve.kilbane
1999-06-10 9:48 Elliott Hughes
1999-06-11 13:17 ` Gerry.Tomlinson
1999-06-14 11:53 ` Tim Goodwin
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=199906141323.PAA1469399@relay.ch.genedata.com \
--to=elliott.hughes@genedata.com \
--cc=rc@hawkwind.utcs.toronto.edu \
--cc=tjg@star.le.ac.uk \
/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).