LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 12-31-2012, 07:06 PM   #1
eamesj
Member
 
Registered: May 2006
Posts: 51

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
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,
 
Old 01-02-2013, 05:04 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 808
Blog Entries: 2

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

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

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


Reply

Tags
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


All times are GMT -5. The time now is 10:11 AM.

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