Visit Jeremy's Blog.
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, 07: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, 05:04 AM   #2
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
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, 07: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 07:58 PM
Rsync gives an rsh error when running in a script codenjanod Linux - Software 2 11-25-2009 08:55 PM
rsh xterm and running remote commands TomT_90GT Linux - Newbie 3 11-09-2007 11:45 PM
running script on a remote host p_test Programming 5 10-02-2006 03:40 PM
Piping archive to remote host michaelsanford Linux - Networking 6 02-11-2006 02:01 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:48 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