rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: John Mackin <john@syd.dit.csiro.au>
To: The rc Mailing List <rc@archone.tamu.edu>
Subject: Re: early reaction(s) to rc
Date: Fri, 23 Aug 1991 19:15:43 -0500	[thread overview]
Message-ID: <9108241015.914.rc.bafoy@syd.dit.csiro.au> (raw)
In-Reply-To: <9108231647.AA01674@skeeve.ATL.GA.US>

Arnold writes, in relation to rcmain:

    I would love to know how this works.  -c is trivial:

    	eval $*(2) ; exit

    and so is -l, but -p and -i are harder --- is there some secret equivalent
    of `set' in his rc?  In other words, how does the rc program tell the
    shell itself what to do with the environment and whether or not to prompt?

I second the first comment; for quite a while I've wanted to have a look
at a real Tenth Edition (as opposed to Plan 9, if there is a difference)
rcmain.  Boyd, do you reckon if you ask td to mail you one, he will?  I
have some general comments to make about rcmain which I will send later
today, right now I have to get off to work -- but I just thought I should
point out that -p doesn't require any support beyond what our rc already
has:

eval `{ whatis | rev | sed -n -e '/ nf$/s/^.*{\(.*\)$/\1/p' | rev }

You can't really do without the two rev's, since there's no way to be
sure your r.e. is matching the function name correctly if you try that
(consider that function names, if quoted, may contain both space and
left-curly-bracket).  But that certainly does the job of removing
functions from the environment.  (Of course, in a real rcmain, all
the commands above -- eval, whatis, rev, sed, and rev -- would be
prefixed by `builtin' to avoid being subverted by functions before
they could accomplish the task of deleting them.  I have omitted this
here for clarity.)

OK,
John.


  reply	other threads:[~1991-08-24  0:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-08-23 20:47 Arnold D. Robbins
1991-08-24  0:15 ` John Mackin [this message]
1991-08-24  3:48   ` John Mackin
1991-08-24 15:10     ` Severe egg on face John Mackin
  -- strict thread matches above, loose matches on Subject: below --
1991-08-27  6:24 early reaction(s) to rc Paul Haahr
1991-08-27  7:15 ` Chris Siebenmann
1991-08-27 10:22 ` Boyd Roberts
1991-08-23 16:51 DaviD W. Sanderson
1991-08-23 17:07 ` Boyd Roberts
1991-08-23 16:24 Arnold D. Robbins
1991-08-27  2:33 ` Chris Siebenmann
1991-08-23  1:36 new list subscriber Byron Rakitzis
1991-08-23 13:40 ` early reaction(s) to rc John Mackin
1991-08-27  2:28   ` Chris Siebenmann

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=9108241015.914.rc.bafoy@syd.dit.csiro.au \
    --to=john@syd.dit.csiro.au \
    --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).