The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: lm@mcvoy.com (Larry McVoy)
Subject: [TUHS] Etymology of bc(1)
Date: Thu, 11 Sep 2014 20:33:17 -0700	[thread overview]
Message-ID: <20140912033317.GT633@mcvoy.com> (raw)
In-Reply-To: <20140912031555.02B3318C0A3@mercury.lcs.mit.edu>

On Thu, Sep 11, 2014 at 11:15:55PM -0400, Noel Chiappa wrote:
>     > From: Mark Longridge <cubexyz at gmail.com>
> 
>     > I have a version of Unix v6 that has a file called /usr/doc/bc that
>     > describes bc at length
> 
> Oh, right, I missed that. I'm a source kind of person... :-)
> 
> Speaking of using a pipe to an existing command, I originally mis-read the
> code to think there was only _one_ process involved, and that it was buffering
> its output into the pipe before doing the exec() itself - something like this:
> 
>         pipe(p);
> 	write_stuff(p[1]);
>         close(0);
>         dup(p[0]);
>         close(p[0]);
>         close(p[1]);
>         execl("/bin/other", "other", arg, 0);
> 	
> Which is kind of a hack, but... it does avoid using a second process, although
> the amount of data that can be passed is limited. (IIRC, a pipe will hold at
> most 8 blocks, at least on V6.) Did this hack ever get used in anything?

Rob (different rob) and I made a command line expr like thing, can't
remember why that did the same trick of shoving stuff (in our case it
was argv) into a pipe and then running yyparse().

It's at www.mcvoy.com/lm/af.shar

Still builds though it is from 1988.
-- 
---
Larry McVoy            	     lm at mcvoy.com             http://www.mcvoy.com/lm 



  reply	other threads:[~2014-09-12  3:33 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12  3:15 Noel Chiappa
2014-09-12  3:33 ` Larry McVoy [this message]
2014-09-12  6:10 ` Dave Horsfall
  -- strict thread matches above, loose matches on Subject: below --
2014-09-12  1:54 Noel Chiappa
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
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=20140912033317.GT633@mcvoy.com \
    --to=lm@mcvoy.com \
    /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).