LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-10-2004, 05:04 AM   #1
pat22a
LQ Newbie
 
Registered: Sep 2004
Posts: 2

Rep: Reputation: 0
Problems with running rsh in the background


Hi,
I've encountered the following problem with rsh and I was wondering if anyone had any ideas on a solution or another remote login app. I could use instead?
I'm writing a shell script that starts a process on all the machines on a cluster & redirects the output to different files.
Example code:

for loop
rsh remote_machine command > file$i &

The problem is when I run rsh in the background it does start the process on all the different machines, but the output isn't redirected to the files?

Thanks.
 
Old 09-10-2004, 06:56 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
This isn't be a problem with rsh, it's a problem with the shell that you are using to do the redirection.

Firstly, make sure that $i does not contain spaces or punctuation, as these can get interpreted by the shell, putting the redirection to a different file.

My advice would be to try an explicit shell invocation to do the redirection. You didn't say which shell you were using, but I'd exect something like this to work:
Code:
for loop
/bin/bash -mc 'rsh remote_machine command > file$i &'
Note the single quotes, which tells the calling shell not to inline macro names or do anything fancy. Passing the -m option to Bash tells it to preserve the environment, so $i will still work.

Hope that helps,
— Robert J. Lee
 
Old 09-10-2004, 07:46 AM   #3
pat22a
LQ Newbie
 
Registered: Sep 2004
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks alot - it worked.
 
  


Reply



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
running jobs on the background feetyouwell Linux - Software 5 09-07-2019 03:13 PM
RSH: remuser too long error when rsh is executed from IIS dev33445 Programming 0 08-29-2005 09:34 AM
background running process elbriga Programming 2 09-21-2004 06:08 PM
rsh starting a background process clockworks Linux - Software 0 03-04-2004 09:33 AM
running programs in background koiphish Linux - Software 0 07-07-2003 01:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:26 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration