rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Re:  All I want for Christmas ...
@ 1992-12-03  4:28 Byron Rakitzis
  1992-12-03  4:42 ` Scott Schwartz
  0 siblings, 1 reply; 12+ messages in thread
From: Byron Rakitzis @ 1992-12-03  4:28 UTC (permalink / raw)
  To: alan, rc

re: -s. I think I agreed on the list that I will incorporate this into
1.5.

re: exec. I would rather not change the behavior of exec. For example,
what if some script uses exec for flow control; an exec which continued
on failure would change the behavior of the script.


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: All I want for Christmas ...
@ 1992-12-03 14:36 Alan Watson
  0 siblings, 0 replies; 12+ messages in thread
From: Alan Watson @ 1992-12-03 14:36 UTC (permalink / raw)
  To: rc

I could have sworn that ". /dev/tty" worked like that yesterday ...
someone must have hacked my system and patched the binaries over
night.

I guess you don't want to call isatty() every time one uses ".", but
I'm still not sure if this is "right."  What is so special about
start-up, that one doesn't need an explicit "-i" flag?  Why not check
stdin every time it gets redirected?

While I agree this last suggestion is of very limited use, and may
well be trivial, it is hardly "more" trivia -- unless you think the
error handling and the sh compatibility of your shell are trivial
issues.

Alan.


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: All I want for Christmas ...
@ 1992-12-03  7:23 Byron Rakitzis
  0 siblings, 0 replies; 12+ messages in thread
From: Byron Rakitzis @ 1992-12-03  7:23 UTC (permalink / raw)
  To: alan, rc

Aha, more trivia.

	. /dev/tty

does not start an interactive context. you need to explicitly
say

	. -i /dev/tty

Hence your two examples

	rc<<eof
	. /dev/tty
	eof

and

	rc<<eof
	exec</dev/tty
	eof

should behave in a similar fashion.

rc only *starts up* interactively when isatty(0) is true.


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: All I want for Christmas ...
@ 1992-12-03  7:16 Byron Rakitzis
  0 siblings, 0 replies; 12+ messages in thread
From: Byron Rakitzis @ 1992-12-03  7:16 UTC (permalink / raw)
  To: schwartz; +Cc: rc

>So what does es do? :-)

The sky's the limit. Paul even added ~-expansion.

; prompt='es> ' es
es> exec asdf
asdf not found
es> 


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: All I want for Christmas ...
@ 1992-12-03  6:22 Alan Watson
  0 siblings, 0 replies; 12+ messages in thread
From: Alan Watson @ 1992-12-03  6:22 UTC (permalink / raw)
  To: rc

1. exec

The only time I use exec interactively is when I install a new version
of rc.  I think it would be a poor choice to differentiate the
behaviour of exec based on the interactiveness of the shell.

Part of the reason that I would like the change is that I often use
exec in scripts ... but I also often make mistakes in scripts.
Dumping the environment to stderr after a failed exec would be a
useful debugging aid.  It also just seems "the right thing to do."
However, Byron's reservations are valid.

2. -s

Hey, yeah, now you mention it I remember that coming round.  My
apologies for bringing it up again.

3. Let me make one more comment, which arises from a recent discussion
in comp.unix.shell:

	; rc <<EOF
	...
	. /dev/tty
	EOF

is interactive after the here document, but

	; rc <<EOF
	...
	exec </dev/tty
	EOF

is not.  Should this be so?  (And, I guess, is this even important?)

Please don't take my suggestions as criticism: I have silently thanked
Tom Duff and Byron more time than I can recall for providing me with a
shell which behaves in a simple, rational, and predictable manner in
almost every situation I have come across.  What's more, it even does
what the man page says it does ...

Alan.


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: All I want for Christmas ...
@ 1992-12-03  5:23 Byron Rakitzis
  1992-12-03  6:18 ` Scott Schwartz
  0 siblings, 1 reply; 12+ messages in thread
From: Byron Rakitzis @ 1992-12-03  5:23 UTC (permalink / raw)
  To: rc

We have 

>Well, it could recover after the exec iff the shell is interactive.

and

>I'd rather have the shell do the right thing and fix the scripts.

The lady doth protest too much, methinks.

I honestly can't see how this could be a big deal one way or another,
and given the choice, I prefer to resist any change to the program so
late in the game.


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: All I want for Christmas ...
@ 1992-12-03  5:00 Noel Hunt
  1992-12-03  5:04 ` Chris Siebenmann
  0 siblings, 1 reply; 12+ messages in thread
From: Noel Hunt @ 1992-12-03  5:00 UTC (permalink / raw)
  To: byron, schwartz; +Cc: alan, rc

	From hawkwind.utcs.toronto.edu!rc-owner Thu Dec  3 15:45:16 1992
	From:	Scott Schwartz <schwartz@groucho.cs.psu.edu>
	
	I'd rather have the shell do the right thing and fix the scripts.

i agree.


^ permalink raw reply	[flat|nested] 12+ messages in thread
* All I want for Christmas ...
@ 1992-12-03  3:41 Alan Watson
  1992-12-03  3:48 ` John Mackin
  0 siblings, 1 reply; 12+ messages in thread
From: Alan Watson @ 1992-12-03  3:41 UTC (permalink / raw)
  To: rc

Well, rc v1.5 was mentioned, so I figure it's time to get out my wish
list and see what Santa brings for Christmas.

1. Error handling after exec

If I do:

	; exec foo
	foo not found

then rc dies (as do all other shells, I believe).  Would it be
difficult to continue after such an error, so that the user could
decide on the appropriate action to take?  This would more closely
parallel the behaviour of the system call, but is it the behaviour we
want from a shell?

2. -s flag

Other shells have a -s flag, meaning "read commands from stdin unless
told otherwise."  It seems pretty useless to me, but my X server
executes my .X11Startup by the equivalent of "$SHELL -s <.X11Startup".
I'm not sure if this is standard (what's wrong with execlp?), but it
would not surprise me if this feature was specific to Ultrix servers.
Ultrix rather frowns of the MIT way of configuring X.  (Oh, the drama
and joy of Ultrix.)  I get around this by using a five line C program
as my "shell"; it eliminates any "-s" at argv[1] and then execs rc.
Is there any support for adding an (essentially dummy) -s flag to rc
for the sake of compatibility with other shells?


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

end of thread, other threads:[~1992-12-03 14:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-12-03  4:28 All I want for Christmas Byron Rakitzis
1992-12-03  4:42 ` Scott Schwartz
  -- strict thread matches above, loose matches on Subject: below --
1992-12-03 14:36 Alan Watson
1992-12-03  7:23 Byron Rakitzis
1992-12-03  7:16 Byron Rakitzis
1992-12-03  6:22 Alan Watson
1992-12-03  5:23 Byron Rakitzis
1992-12-03  6:18 ` Scott Schwartz
1992-12-03  5:00 Noel Hunt
1992-12-03  5:04 ` Chris Siebenmann
1992-12-03  3:41 Alan Watson
1992-12-03  3:48 ` John Mackin

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