LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   piping a script running on a remote host with rsh (https://www.linuxquestions.org/questions/programming-9/piping-a-script-running-on-a-remote-host-with-rsh-4175443634/)

eamesj 12-31-2012 07:06 PM

piping a script running on a remote host with rsh
 
Hi all,

I've a script that requires that it is run on a specific host but i would like to run it from within a larger script run on any machine and im looking at piping through with rsh.

I have been able to do this with tar
e.g.
tar cvf - $files | rsh $remoteserver dd of=/dev/$device

but i am unable to do similar to a script. as it comes back with rlogin connection closed.

/usr/bin/script -option option2 | rsh $remoteserver

is there unique coding to pass multiple options through rsh? I'm using bash.

Thanks,

linosaurusroot 01-02-2013 05:04 AM

Your right hand side
Quote:

Originally Posted by eamesj (Post 4860366)
rsh $remoteserver

acts like
Quote:

Originally Posted by eamesj (Post 4860366)
rlogin $remoteserver

but you aren't doing anything so it ends immediately.

You will want
Quote:

Originally Posted by eamesj (Post 4860366)
/usr/bin/script -option option2 | rsh $remoteserver "some command here"


eamesj 01-10-2013 07:42 PM

Thanks linosaurusroot, much better :)


All times are GMT -5. The time now is 02:05 AM.