From: jnc@mercury.lcs.mit.edu (Noel Chiappa)
Subject: [TUHS] Etymology of bc(1)
Date: Thu, 11 Sep 2014 21:54:15 -0400 (EDT) [thread overview]
Message-ID: <20140912015415.DB69E18C09E@mercury.lcs.mit.edu> (raw)
> From: Dave Horsfall <dave at horsfall.org>
> On the *nix systems to which I have access, bc(1) is a standalone
> program on FreeBSD and OSX, but pipes to dc(1) on OpenBSD. I cannot
> check my Penguin box (Ubuntu)
Dude! Trying to answer questions about the origins of BC by looking at
systems this late is like trying to learn Latin by studying Italian! :-)
I looked at the Version 6 source, and it's a bunch of YACC code, but it pulls
the same technique of using a pipe to an instance of DC, viz:
pipe(p);
if (fork()==0) {
close(1);
dup(p[1]);
close(p[0]);
close(p[1]);
yyinit(argc, argv);
yyparse();
exit();
}
close(0);
dup(p[0]);
close(p[0]);
close(p[1]);
execl("/bin/dc", "dc", "-", 0);
There's likely even older versions than the V6 one, but that's the earliest
source I have online on my PC for easy access.
Noel
next reply other threads:[~2014-09-12 1:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-12 1:54 Noel Chiappa [this message]
2014-09-12 2:35 ` Mark Longridge
2014-09-12 6:00 ` Dave Horsfall
2014-09-12 11:15 ` John Cowan
2014-09-12 11:36 ` Otto Moerbeek
2014-09-12 17:12 ` scj
2014-09-12 17:18 ` Warner Losh
2014-09-12 19:02 ` Clem Cole
2014-09-12 19:36 ` Dave Horsfall
2014-09-12 20:03 ` Warner Losh
2014-09-12 19:32 ` Dave Horsfall
2014-09-12 18:28 ` Tim Bradshaw
2014-09-13 2:52 ` Dave Horsfall
-- strict thread matches above, loose matches on Subject: below --
2014-09-12 3:15 Noel Chiappa
2014-09-12 3:33 ` Larry McVoy
2014-09-12 6:10 ` Dave Horsfall
2014-09-11 21:24 Christian Neukirchen
2014-09-11 21:41 ` Warner Losh
2014-09-11 22:04 ` Dave Horsfall
2014-09-11 22:17 ` John Cowan
2014-09-11 23:34 ` scj
2014-09-12 1:03 ` Dave Horsfall
2014-09-12 13:37 ` random832
2014-09-12 14:18 ` Steve Nickolas
2014-09-12 20:02 ` Dave Horsfall
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=20140912015415.DB69E18C09E@mercury.lcs.mit.edu \
--to=jnc@mercury.lcs.mit.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).