rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* rcmain revisited
@ 1991-08-26 18:06 Arnold D. Robbins
  1991-08-26 20:25 ` Boyd Roberts
  0 siblings, 1 reply; 2+ messages in thread
From: Arnold D. Robbins @ 1991-08-26 18:06 UTC (permalink / raw)
  To: rc

So, now we know mostly how rcmain works.

> From: gatech!harvard!decwrl.dec.com!adobe!haahr
> Date: Fri, 23 Aug 91 16:19:36 PDT
> To: gatech!skeeve!arnold (Arnold D. Robbins)
> Subject: Re: early reaction(s) to rc
> 
> > and so is -l, but -p and -i are harder --- is there some secret equivalent
> > of `set' in his rc?
> 
> -i is implemented with (the plan9 equivalent of)
> 	. -i /dev/stdin $*
> so -i is hard coded, not to main() but to the . builtin
> 
> -p just sets the path to /bin; importing functions didn't work in plan9 a while  
> ago; i have no idea if that works yet.

So (pardon my syntax if this isn't quite right):

	for (i in $*) {
		if (! ~ $i -*)
			break
		switch ($i) {
		case -i:
			. -i /dev/stdin $*
			exit

		case -c:
			eval $2
			exit

		case -p:
			path = (/bin)
			# maybe something to unset functions?
			break

		case -l:
			. $home/.rcrc
			break
		}
		shift
	}
	i=()

-i is still "magic", in that it's hard coded in the shell, but at the
level of the "." command.

The idea of using a file for command line options that are normally
built-in is intriguing.  I'm not convinced it's The Right Way To Go,
but it has some merits.

Arnold


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: rcmain revisited
  1991-08-26 18:06 rcmain revisited Arnold D. Robbins
@ 1991-08-26 20:25 ` Boyd Roberts
  0 siblings, 0 replies; 2+ messages in thread
From: Boyd Roberts @ 1991-08-26 20:25 UTC (permalink / raw)
  To: rc

the question is really how to handle prompting.  i think through clever
setting of $prompt in rcmain, you can change rc to prompt _all the time_.
and -i, just sets the prompt to what it was, or the default if not set.

the trick is to save the prompt early on, unset it and set it back
only in the -i & -l cases.  internally rc should turn prompting off
during the source of rcmain.

as i've said before -p is darn near impossible, without a support
program to grok the quoting.  through this, i've found some interesting
behaviour with builtin in 1.1gamma:

    prlp15 ; cd /		# prlp15 is my home machine
    prlp15 /; fn builtin {	# you won't believe that i got mail
	    echo gore		# from someone who complained that
    }				# prl313 (my office) machine was
    prlp15 /; pwd		# `prl313: not found'
    /				# in a rc example i posted to the net
    prlp15 /; builtin builtin cd
    gore
    prlp15 /; pwd
    /

even if you could grok function whatis output, without builtin it's all over.

on another note [ and this is not to be construed as an attack on byron's
skills, because i reckon he's done an outstanding job ] i'm a bit concerned by
the profusion of releases.  i'd prefer patches to be distributed rather
than full releases.  and, i'd prefer fewer releases, because i find that my
time gets all too easily blown away with installing, testing and hacking
new releases (for rc to work for me it's a multiple architecture `port').

i think rcmain is a good thing -- _BUT_ it requires quite a deal of thought,
before we all go madly hacking.  thinking is hard, hacking is easy.

time to finish this bottle of wine and start on the cheese...


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1991-08-26 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-08-26 18:06 rcmain revisited Arnold D. Robbins
1991-08-26 20:25 ` Boyd Roberts

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).