Visit the LQ Articles and Editorials section
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-31-2012, 08:06 PM   #1
Registered: May 2006
Posts: 54

Rep: Reputation: 1
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
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.

Old 01-02-2013, 06:04 AM   #2
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 970
Blog Entries: 2

Rep: Reputation: 233Reputation: 233Reputation: 233
Your right hand side
Originally Posted by eamesj View Post
rsh $remoteserver
acts like
Originally Posted by eamesj View Post
rlogin $remoteserver
but you aren't doing anything so it ends immediately.

You will want
Originally Posted by eamesj View Post
/usr/bin/script -option option2 | rsh $remoteserver "some command here"
Old 01-10-2013, 08:42 PM   #3
Registered: May 2006
Posts: 54

Original Poster
Rep: Reputation: 1
Thanks linosaurusroot, much better


bash, pipe, rsh

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to start script at remote host Vijayababu Linux - Newbie 6 11-24-2010 08:58 PM
Rsync gives an rsh error when running in a script codenjanod Linux - Software 2 11-25-2009 09:55 PM
rsh xterm and running remote commands TomT_90GT Linux - Newbie 3 11-10-2007 12:45 AM
running script on a remote host p_test Programming 5 10-02-2006 04:40 PM
Piping archive to remote host michaelsanford Linux - Networking 6 02-11-2006 03:01 PM

All times are GMT -5. The time now is 07:29 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration