[comp.unix.i386] bug in csh and problem with rsh in ISC 386/ix

fritzz@lamont.ldgo.columbia.edu (fritz zaucker) (11/28/89)

Insteed of only asking (stupid?) questions I'll try to give a useful
(but may be known) information to ISC users.

/bin/csh  contains a bug. According to the manual a C-Shell script is
identified by a # as the very first character in the file and /bin/csh
should be run to process it. That doesn't work, /bin/sh is run insteed.
You have to put in the first line
#! /bin/csh
to get /bin/csh called. Not a big thing, but worth to know I think.

rsH:

There are two rsh commands, one is the restricted shell /bin/rsh, the other
is /usr/ucb/rsh for a remote shell. I found that out when I changed the
search order of my path to search /bin first and then /usr/ucb. The manual
says that one should link /usr/ucb/rsh to another name like rshell, ok that's
a way to do it, but it is somehow not standard and people used to Suns
would not be able to guess the new name. It is possible to search /usr/ucb
first and say /bin/rsh explicitly if one needs it, but it's not nice and
one has to know this too.

That's it
Fritz Zaucker

paul@dialogic.UUCP (The Imaginative Moron) (12/05/89)

In article <1888@lamont.ldgo.columbia.edu> fritzz@lamont.ldgo.columbia.edu (fritz zaucker) writes:
>There are two rsh commands, one is the restricted shell /bin/rsh, the other
>is /usr/ucb/rsh for a remote shell. I found that out when I changed the
>search order of my path to search /bin first and then /usr/ucb. The manual
>says that one should link /usr/ucb/rsh to another name like rshell, ok that's
>a way to do it, but it is somehow not standard and people used to Suns
>would not be able to guess the new name. 

It also won't work.  The standard (Berkeley) interpretation of this is
that when the rsh binary is run as a program not named "rsh" (i.e.  with
argv[0] something other than "rsh") it takes argv[0] as a machine name
to connect to.  Thus you can link "rsh" to "dialogic" and type

	$ dialogic ps -ae

to get the same effect as

	$ rsh dialogic ps -ae

I simply make sure that /usr/ucb is before /usr/bin in PATH.  People
don't often run /bin/rsh directly - it's usually done by login - so you
could do it in /etc/profile if you want.  It's a bit confusing when you
get the PATH wrong, tho'

You might also consider calling /bin/rsh /bin/Rsh ...

Incidently, the Interlan Board-based TCP/IP stuff gets around this by
calling it "rshl" - which is a real pain if you're used to typing "rsh". 
We have both, so the problem is dynamic.  I use an ksh alias in my
.profile for when I'm on one of these systems.

-- 
Paul Bennett	      |  			| "I give in, to sin, because
Dialogic Corp.	      |   paul@dialogic.UUCP	|  You have to make this life
129 Littleton Road    | ..!uunet!dialogic!paul	|  livable"
Parsippany, NJ 07054  |	 			|  Martin Gore

dougm@ico.isc.com (Doug McCallum) (12/08/89)

   >search order of my path to search /bin first and then /usr/ucb. The manual
   >says that one should link /usr/ucb/rsh to another name like rshell, ok that's
   >a way to do it, but it is somehow not standard and people used to Suns
   >would not be able to guess the new name. 

   It also won't work.  The standard (Berkeley) interpretation of this is
   that when the rsh binary is run as a program not named "rsh" (i.e.  with
   argv[0] something other than "rsh") it takes argv[0] as a machine name
   to connect to.  Thus you can link "rsh" to "dialogic" and type

The rsh in the 386/ix 2.0.2 release does allow calling it "rshell" or
"remsh" for compatibility with a couple of other packages and for
people who want /bin first in their search path and don't want to
change /bin/rsh to some other name.  Any other names than "rsh",
"rshell" or "remsh" work as you described and use the name it was
called with as a hostname.