Multiple rsh in a script not working


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Multiple rsh in a script not working
# 1  
Old 05-28-2005
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
# 2  
Old 05-28-2005
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 ...
# 3  
Old 05-29-2005
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
# 4  
Old 05-31-2005
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 ...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

rsh is not working

i am using solaris 8. i can access my server through telnet. but not able to access rsh or rlogin. i can rsh from this server to another machine but not from other machine to this machine. How to start rsh service. i have restarted inetd. pkill -HUP inetd. thanks (1 Reply)
Discussion started by: sunnybee
1 Replies

2. Solaris

rsh -n flag not working between sme hosts

Hi there I have a strange scenario whereby I am trying to use the -n flag (or < /dev/null) to the input of between two particular hosts which doesn't seem to work, but is fine if between two other hosts First test (between myhost 1 and 2) -n doesn't return output test@myhost1% rsh... (1 Reply)
Discussion started by: rethink
1 Replies

3. AIX

rsh not working

Hi, I am getting the below error while using rsh from other logins in AIX 5.3 rcmd2: socket: The file access permissions do not allow the specified action. whereas the same is working fine with root login. I have already defined the host entries in etc/hosts as well as in .rhosts... (0 Replies)
Discussion started by: viplov
0 Replies

4. Solaris

rsh is not working ,error :connection refused

rsh is not working command:rsh targethost -l username command Error:Connection refused I checked on the server rshd was not working. Tried to start by /usr/sbin/in.rshd start # ./in.rshd start rshd: getpeername: Socket operation on non-socket Please help (1 Reply)
Discussion started by: aneita
1 Replies

5. Shell Programming and Scripting

rsh to change multiple ip in multiple servers?

good day. i jsut wanted to know what is the best script or the best way changing a lot of Ip's in all servers. Do you have any idea? im using awk to change IP,what if, you have lots of servers. You need to change it one by one? It will take time to change it manually. (2 Replies)
Discussion started by: kenshinhimura
2 Replies

6. Shell Programming and Scripting

command not working with rsh(remote shell)

Hi, root@air01a>SS7Manager -status This command gives correct output. But when I write this in script and run it on SUNMC (which can connect to air01 and by default login as root). It gives the error "SS7manager not found" or "can not open". Here is the scripts. #!/bin/sh rsh air01a... (4 Replies)
Discussion started by: lastkey
4 Replies

7. Shell Programming and Scripting

running multiple rsh command in a script

hi scripting experts, juz wondering if it's possible to have multiple rsh command in a single script? :confused: ie: rsh -l <username> "<command>" rsh -l <username> "<command>" thanks. regards, wee :) (0 Replies)
Discussion started by: lweegp
0 Replies

8. Shell Programming and Scripting

I need a Script to rsh multiple hp boxes and shutdown

Hello I'm serving on a ship that has frequent power issues. Currently if we loose power we need to rush around to multiple UNIX machines and login to Sysadmin and power down each machine before we loose our ups. If sysadmin is asleep or not in the space we have some real problems. I would like to... (2 Replies)
Discussion started by: blackfam972
2 Replies

9. AIX

RSH not working

Hi all I have updated my .rhosts file as per the norm, however for some reason on hostA I cannot rsh to hostB. The entries on /.rhosts on hostA are as follows :- hostB + hostB on the other can do rsh without a problem. Any ideas ? :confused: (1 Reply)
Discussion started by: jhansrod
1 Replies

10. UNIX for Dummies Questions & Answers

rsh not working

Dear all; I have to Unix servers SUM1 and SUM2 running Reliant Unix 5.45 on both servers i have a system user called "netop". i want netop on SUM1 to execute rsh from SUM1 to SUM2. What i did, i put in the .rhosts file in the home directory of netop on SUM2 the following entry: netop ... (2 Replies)
Discussion started by: bcheaib
2 Replies
Login or Register to Ask a Question