rsh hostname variable?

rsh hostname variable?

Post by Sweth Chandramou » Tue, 03 Mar 1998 04:00:00



+       is there some variable that is passed through to rsh when
it is executed on a remote machine that contains the name of the
"local" host (i.e. the host from which rsh is being invoked)?
        if, for example, i had a script on machine A called "diag"
that ran some diagnostic tests and mailed them to a certain address,
is there some way that, if i were to type "rsh A diag" on machine B,
i could have "diag" mail the results to me on machine B, instead of
A?
        (i could, of course, have diag accept the destination host
for the mail as a command line argument, and type "rsh A diag B", or
something like that, but i would like to make this as transparent as
possible to the end user.)

        tia,
        sweth.

--
"Countin' on a remedy I've counted on before
Goin' with a cure that's never failed me
What you call the disease
I call the remedy"  -- The Mighty Mighty Bosstones

 
 
 

rsh hostname variable?

Post by Will Mor » Tue, 03 Mar 1998 04:00:00


There is a script somewhere called xrsh that basically passes
the environment along with the rsh.  I used to use it on SunOS,
but it really was too much bother so I just went to passing
stuff on the rsh line.  

As I recall, there is almost nothing passed with the rsh itself.  
xrsh builds a set of environment variables including the value
of the program you want to execute and passes it for you as part
of the command.

I would recommend making a script that does the rsh and handles the
details for the user.

Hope this helps.

Will



>+   is there some variable that is passed through to rsh when
>it is executed on a remote machine that contains the name of the
>"local" host (i.e. the host from which rsh is being invoked)?
>    if, for example, i had a script on machine A called "diag"
>that ran some diagnostic tests and mailed them to a certain address,
>is there some way that, if i were to type "rsh A diag" on machine B,
>i could have "diag" mail the results to me on machine B, instead of
>A?
>    (i could, of course, have diag accept the destination host
>for the mail as a command line argument, and type "rsh A diag B", or
>something like that, but i would like to make this as transparent as
>possible to the end user.)

>    tia,
>    sweth.

>--
>"Countin' on a remedy I've counted on before
>Goin' with a cure that's never failed me
>What you call the disease
>I call the remedy"  -- The Mighty Mighty Bosstones

--
# Copyright 1998 Will Morse.  Internet repost/archive freely permitted.
# Hardcopy newspaper, magazine, etc. quoting requires permission.
#
#      Gravity,                    #    Will Morse
#      not just a good idea,       #    Houston, Texas

#
#   These are my views and do not necessarly reflect anyone else.

 
 
 

rsh hostname variable?

Post by David Boyc » Fri, 06 Mar 1998 04:00:00



> There is a script somewhere called xrsh that basically passes
> the environment along with the rsh.  I used to use it on SunOS,
> but it really was too much bother so I just went to passing
> stuff on the rsh line.

> As I recall, there is almost nothing passed with the rsh itself.
> xrsh builds a set of environment variables including the value
> of the program you want to execute and passes it for you as part
> of the command.

> I would recommend making a script that does the rsh and handles the
> details for the user.

(1) There's also a pretty cute Expect script (supplied with the standard
Expect distribution) which looks and feels like rsh but in fact does an
rlogin (or a telnet, can't remember), executes the command, and exits
the rlogin.  This ensures that the user runs with his/her standard
environment on the remote side; it does not, at least out of the box,
copy any transient EV's to the remote side. Remember that you often
really don't want the exact same env on the other side; if it's a
different platform, for instance, your PATH may need to be different
there. The expect/rlogin script will do the right thing here, assuming
your login scripts do so.

(2) One simple thing you can do is "rsh host var=$var program" which
saves the program from having to parse the command line but does not
insulate the user from having to remember to do this.

-David