rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* new list subscriber
@ 1991-08-23  1:36 Byron Rakitzis
  1991-08-23 13:40 ` early reaction(s) to rc John Mackin
  0 siblings, 1 reply; 13+ messages in thread
From: Byron Rakitzis @ 1991-08-23  1:36 UTC (permalink / raw)
  To: rc

From hawkwind.utcs.toronto.edu!cks Thu Aug 22 19:57:54 1991
To: byron@archone.tamu.edu
Subject: early reaction(s) to rc
Date: Thu, 22 Aug 1991 19:57:11 -0500
From: Chris Siebenmann <cks@hawkwind.utcs.toronto.edu>

- the elegance is nice. I'll have to see how much I can simplify my
  environment with it as my login shell (probably a fair bit).
- with 1.1gamma at least, commands are placed into history too soon;
  commands should be put there after execution, not before. Putting
  them there before makes it impossible to get -p to print the last
  command executed, among other things.
- it might be nice to define another pseudo-signal, call it SIGSTARTUP,
  along the lines of SIGEXIT. If SIGSTARTUP is always executed, there
  should be some way of telling whether or not a shell is interactive.
  This would let people make their root prompts something arbitrary,
  for example (after a few slips, I insist on having the machine name
  in mine).

 Feel free to forward these to the mailing list and to put me on it.

	- cks



^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: early reaction(s) to rc
@ 1991-08-23 16:24 Arnold D. Robbins
  1991-08-27  2:33 ` Chris Siebenmann
  0 siblings, 1 reply; 13+ messages in thread
From: Arnold D. Robbins @ 1991-08-23 16:24 UTC (permalink / raw)
  To: John Mackin, The rc Mailing List

> (On a point of pure gustation, I do have to
> say I don't like the name much -- but on the other hand I can't think of
> a better one right now either: the obvious sigbegin doesn't appeal,
> and sigenter (as the antonym of sigexit) doesn't sound right either.
> Suggestions, any rcer's?)

Shorten it to SIGSTART.

> As a quite separate issue I'd like to address the question of telling
> whether or not the shell is interactive.  sh has $-, and $- has many
> puzzling bugs, and inconsistencies between different versions of sh;
> these render a very pleasing concept very hard to use in practice.

My $.02:

	$options is a list of (sorted?) command line options
	that are in effect:

	; echo options are: $options
	options are: -i -n -x

This makes it easy to see what's turned on, although turning things
on and off one at a time is harder, in both rc programs and inside rc itself.

This is the start of an idea, anyway; I acknowledge it's not full blown.

> I have some further comments about the idea of root prompt, su, and
> the sigstartup proposal,

Byron has told me in private mail he doesn't think the shell should
automatically change prompts for root.  I disagree, but not terribly
strongly.  My own suggestion for a root prompt would be ';; '.

Arnold Robbins -- The Basement Computer		| Laundry increases
Internet: arnold@skeeve.ATL.GA.US		| exponentially in the
UUCP:	{ gatech, emory }!skeeve!arnold		| number of children.
Bitnet:	Forget it. Get on a real network.	|    -- Miriam Robbins


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: early reaction(s) to rc
@ 1991-08-23 16:51 DaviD W. Sanderson
  1991-08-23 17:07 ` Boyd Roberts
  0 siblings, 1 reply; 13+ messages in thread
From: DaviD W. Sanderson @ 1991-08-23 16:51 UTC (permalink / raw)
  To: rc

> the matter at any length.  (On a point of pure gustation, I do have to
> say I don't like the name much -- but on the other hand I can't think of
> a better one right now either: the obvious sigbegin doesn't appeal,
> and sigenter (as the antonym of sigexit) doesn't sound right either.
> Suggestions, any rcer's?)

How about "sigmain", analogous to the entry function for C programs
(and nicely parallel to "sigexit".) Unfortunately not all the special
functions in rc have names beginning with "sig", though they would if
"prompt" were changed to "sigprompt".  This would allow a useful
convention: ``all special functions in rc have names beginning with
"sig"''.

> As a quite separate issue I'd like to address the question of telling
> whether or not the shell is interactive.  sh has $-, and $- has many

I have suggested to Byron making the rc flags available in a special
variable.  I think the Plan 9 rc does this, but I don't have my docs
handy to check.

> that rc has no "set" builtin (or equivalent mechanism).  Byron, in
> the eventual revamp of rc -x, you might like to consider that it
> is not at all unreasonable to want to turn -x off and on at different
> points during execution.

Yes, I think it would be useful to be able to toggle certain
command-line switches.  Often I am interested in debugging only part of
a script, and being able to selectively turn on -x has helped in sh.
I dunno what a reasonable syntax might be.

> This is what I fail to follow; I don't understand why one needs to tell
> whether or not the shell is interactive in order to accomplish the goal
> of making a root prompt be something arbitrary.

There is another possible application:  I might want to remove
something from the environment if the shell is NOT interactive.
This could be a way (albeit a bit clumsy) to get around the fact
that all variables are exported into the environment.

DaviD W. Sanderson (dws@cs.wisc.edu)


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: early reaction(s) to rc
@ 1991-08-23 20:47 Arnold D. Robbins
  1991-08-24  0:15 ` John Mackin
  0 siblings, 1 reply; 13+ messages in thread
From: Arnold D. Robbins @ 1991-08-23 20:47 UTC (permalink / raw)
  To: Boyd Roberts, rc

> Duff told me:
> 
>     rcmain does the flags that affect initialization, to wit:
>           -p      `protected' -- don't read functions, set path=(. /bin)
>           -c      execute a command given on the command line
>           -i      `interactive' -- print prompts for commands
>           -l      `login shell' -- read $home/lib/profile before user's commands

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?

Thanks,

Arnold


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: early reaction(s) to rc
@ 1991-08-27  6:24 Paul Haahr
  1991-08-27  7:15 ` Chris Siebenmann
  1991-08-27 10:22 ` Boyd Roberts
  0 siblings, 2 replies; 13+ messages in thread
From: Paul Haahr @ 1991-08-27  6:24 UTC (permalink / raw)
  To: cks, rc

i used to set up a different history file for each window, and
just had xterm run an rc script which then invoked rc.  no muss,
no fuss, and didn't require any changes to rc.  Byron mentioned
last week that he uses one history file for all his windows; i
tried this last week, and now say i think it is the way to go.

as for per window startup commands themselves, if they are necessary
(the only thing my script did was set $history; everything else was
inherited) then just run a script that later invokes an interactive
rc.  one extra fork/exec is not that bad.  (or you can always do a
	. -i /dev/tty
if you really want to save that fork/exec)

on the other hand, it might (just MIGHT, i'm not advocating this)
be nice to be able to specify a different file that could be execute
prior to running rc, just like $home/.rcrc; maybe
	rc -L foo
would start an rc processes that did a . foo to start.


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

end of thread, other threads:[~1991-08-27 10:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
1991-08-23 16:24 Arnold D. Robbins
1991-08-27  2:33 ` Chris Siebenmann
1991-08-23 16:51 DaviD W. Sanderson
1991-08-23 17:07 ` Boyd Roberts
1991-08-23 20:47 Arnold D. Robbins
1991-08-24  0:15 ` John Mackin
1991-08-24  3:48   ` John Mackin
1991-08-27  6:24 Paul Haahr
1991-08-27  7:15 ` Chris Siebenmann
1991-08-27 10:22 ` 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).