rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* rc and rsh
@ 1992-07-01 19:13 rsalz
  1992-07-01 20:59 ` Scott Schwartz
  0 siblings, 1 reply; 4+ messages in thread
From: rsalz @ 1992-07-01 19:13 UTC (permalink / raw)
  To: rc

I don't think I understand the problems people are having with rsh and rc.
Does this function do the 'right thing' ?
fn rsh host1 host2... { flag= host=$0 {
    ~ $1 -n && { shift ; flag=-n }
    ~ $0 rsh && { host=$1 ; shift }
    eval 'rsh $flag $host rc -lc ''' ^ $* ^ ''''
} }


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

* Re: rc and rsh
  1992-07-01 19:13 rc and rsh rsalz
@ 1992-07-01 20:59 ` Scott Schwartz
  0 siblings, 0 replies; 4+ messages in thread
From: Scott Schwartz @ 1992-07-01 20:59 UTC (permalink / raw)
  To: rsalz; +Cc: rc


| I don't think I understand the problems people are having with rsh and rc.
| Does this function do the 'right thing' ?
| fn rsh host1 host2... { flag= host=$0 {
|     ~ $1 -n && { shift ; flag=-n }
|     ~ $0 rsh && { host=$1 ; shift }
|     eval 'rsh $flag $host rc -lc ''' ^ $* ^ ''''
| } }

One (general) problem is that rsh leaves open file descriptors hanging
around in its child processes.  The solution I posted takes care to
close them so that if you ask for 'xterm&' the rshd exits cleanly.



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

* Re: rc and rsh
@ 1992-07-01 20:58 rsalz
  0 siblings, 0 replies; 4+ messages in thread
From: rsalz @ 1992-07-01 20:58 UTC (permalink / raw)
  To: donn, rc

Yeah, fixing the quotes is an exercise for the reader ...

>But then, what happens when you use this?
>
>	; rsh wherever do something
>	rc not found
It seemed to me most of the problems were getting rc to read .rcrc
or some other init file at the right time, so this case isn't interesting.
	/r$


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

* Re: rc and rsh
@ 1992-07-01 20:49 Donn Cave
  0 siblings, 0 replies; 4+ messages in thread
From: Donn Cave @ 1992-07-01 20:49 UTC (permalink / raw)
  To: rc

| I don't think I understand the problems people are having with rsh and rc.
| Does this function do the 'right thing' ?
| fn rsh host1 host2... { flag= host=$0 {
|     ~ $1 -n && { shift ; flag=-n }
|     ~ $0 rsh && { host=$1 ; shift }
|     eval 'rsh $flag $host rc -lc ''' ^ $* ^ ''''
| } }

Well, I can't resist pointing out that there are some implementation
details involving quotes.  That's supposed to be one of the reasons
we like rc, right?  Easy, straightforward quoting!  Someone who knows
the language better than I maybe can straighten this one out so that
it doesn't require the user to quote the remote command (I think this
is just a matter of discarding the "^"s), and so that the eventual
rc -lc actually does get a quoted string.

But then, what happens when you use this?

	; rsh wherever do something
	rc not found
	; /usr/ucb/rsh wherever whatis path
	path=('' /usr/ucb /bin /usr/bin)
	; rlogin wherever
	welcome to wherever
	; whatis rc
	/usr/local/bin/rc

Not that there aren't ways to work around the problem.  Some of them
made it onto this list recently, and the most workable of them involved
invoking rc differently from /etc/passwd - either as "-rc", or a script
that invokes "rc -l".

	Donn Cave, University Computing Services, University of Washington
	donn@cac.washington.edu


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

end of thread, other threads:[~1992-07-01 21:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-07-01 19:13 rc and rsh rsalz
1992-07-01 20:59 ` Scott Schwartz
1992-07-01 20:49 Donn Cave
1992-07-01 20:58 rsalz

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