The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Working with multiple home directories. trey85stang Shell Programming and Scripting 11 05-15-2008 11:45 PM
why the below script is not working ., konankir Shell Programming and Scripting 14 03-27-2008 01:32 PM
bdf script not working !! kpatel786 Shell Programming and Scripting 3 11-16-2007 08:10 AM
sed: working with multiple lines orno Shell Programming and Scripting 3 11-14-2007 03:28 AM
FTP script not working rookie250 Shell Programming and Scripting 2 12-18-2006 11:49 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-28-2005
Registered User
 

Join Date: Feb 2005
Posts: 2
Multiple rsh in a script not working

Hi,

From one of the unix servers i want execute an rsh command to 5 different servers.
i want to go to these servers execute a command and come back.
i have a main program which calls a function, where in i use the rsh command.
The server name is passed as a parameter to teh function.
it is working fine for the first server, after that it is not executing rsh for the other servers.
the structure is

fun () {
rsh $1
}

while read line
do
fun $line
done < server_name.txt

i tried with ssh also but the same problem persists.

Advance Thanks
Praphul
Reply With Quote
Forum Sponsor
  #2  
Old 05-28-2005
Just Ice's Avatar
Lights on, brain off.
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 629
can you post the complete rsh line in the function? based on the info you've give so far, my guess is your rsh line is not terminating correctly so your function cannot go to the next iteration of the loop ...
Reply With Quote
  #3  
Old 05-28-2005
Registered User
 

Join Date: Feb 2005
Posts: 2
the rsh command

sudo rsh <server name> cat /a/b/c/d |grep -v '*'|grep -v ' '|grep -v '#'|grep 8.1.7|cut -d ':' -f1>> ~/test

Thanks
Praphul
Reply With Quote
  #4  
Old 05-31-2005
Just Ice's Avatar
Lights on, brain off.
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 629
can you run the rsh lines manually on the command line for each of the other servers? if not, your issue may be that the account you're using to do the rsh to the other servers is not setup properly ... check $HOME/.rhosts and/or $HOME/.ssh to make sure they are the same on all your listed servers for the account in question ...
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:08 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0