Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rsh to other machine & run local script

Status
Not open for further replies.

suhaimi

Technical User
Aug 3, 2001
71
US
Hi all,
I wonder if we could run local script against remote server through rsh.
example:
hostA>ls
myscript.csh
hostA> rsh hostB "myscript.csh"

Thanks,
Suhaimi
 
Yes you can. Read the man page for rsh.

Greg.
 
Hi,
I've read the man page but couldn't find anything about running local script against remote server.

Rgds,
 
you can only run Script's available through any type of filesystem, ie. "local" UFS or "remote" NFS.

An Example:
your hostA shares a filesystem hostA:/export/scripts
myscript.sh is in this filesystem; hostB needs a running automountd, so you can see /net/hostA/export/scripts directory (ok, you can mount this by hand to eg /mnt/scripts but this is another job) after that you can start the script from hostA by typing

hostA# rsh hostB /net/hostA/export/scripts/myscript.csh

Regards
-- Franz
Sorry I'm not a native spaeker, I'm from Munich, Germany - "Home of the Whopper", oh no, "Home of the Oktoberfest" ;-)
Solaris System Manager; I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Now let's make it even more complicated:
I tried to rsh from A to B executing commands on B in the form
#!/bin/sh

(rsh B ) <<'EOF'
printf("Been Here\n")
EOF

when A is anything BUT a Sun this works fine,
on a sun a

tcgetattr: Inappropriate ioctl for device
ioctl I_FIND ttcompat: Inappropriate ioctl for device

occurrs.
Obviously rsh seems to need some information about the terminal it is called from. but there is no term in this notation.

Any idea how this can work?
 
>> Any idea how this can work?
hmm, I would - as a first step - write a wrapper around the HERE Script, so the Shell calling the rsh never "sees" the HERE Script...

Regards
-- Franz
Sorry I'm not a native spaeker, I'm from Munich, Germany - &quot;Home of the Whopper&quot;, oh no, &quot;Home of the Oktoberfest&quot; ;-)
Solaris System Manager; I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Actually, I have been experimenting further with this problem.
It seems to get a bit out of focus of this thread, but nevertheless I'll proceed here for the sake of continuity:

Problem: I try to connect to a VxWorks System as system B.
The system actually accepts only rlogin. rsh behaves like rlogin, when there is no command argument ( rsh B == rlogin B).

Thus, piping anything to rsh is equivalent to piping to rlogin. In this particular case I can hence not provide a separate script for what is to be done on system B. The problem however is not related to be VxWorks as rlogind. The same occurs also when connecting to e.g. Linux in the same fashion.


However, on SunOS and only on SunOS (tried Suse Linux and Irix) rsh/rlogin seems to require a tty as stdin.
The pipe does not work.
I tried other shells (tcsh, bash) in the script. Did not work.
I tried another command (cat) for the sake of tracing the problem. Printed what was piped.

->>> Question: Can I make the pipe behave like a tty or pipe through some tty emulator to the rsh/rlogin?

Sorry for the lengthy Problem description
and thanks for any suggestion

SHaidacher

Munich, also home of the Weisswurst
 
sorry SHaidacher, I worked 5 years for Sun's EMEA Support but I never have seen something like that; waht Sun always recommends: Patches! Doublecheck if your environment is "up to date", if it is do not heasitate to call Sun and ask for assistance, there are a lot of realy smart guys at the solutioncenter! (at least used to be ;-)

Soso, no oana aus Minga... :)

Regards
-- Franz
Sorry I'm not a native spaeker, I'm from Munich, Germany - &quot;Home of the Whopper&quot;, oh no, &quot;Home of the Oktoberfest&quot; ;-)
Solaris System Manager; I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top