1752505 Members
5591 Online
108788 Solutions
New Discussion юеВ

rsh help

 
Anand_30
Regular Advisor

rsh help

I am using "rsh" in a shell script. I want to rsh to some servers and execute another script in the remote server in background mode.

I am using :

rsh server "nohup script.sh &"

But the remote shell does not terminate after executing the script.sh in background. The remote shell waits till the script.sh is completed and then terminates.

I want the remote shell to just execute the script "script.sh" in the background and terminate irrespective of the completion of the script.

Can anyone please help

-Anand

3 REPLIES 3
James R. Ferguson
Acclaimed Contributor

Re: rsh help

Hi Anand:

Add the '-n' switch thusly:

# rsh server -n "nohup script.sh &"

See the manpages for 'remsh(1)'.

Regards!

...JRF...
Anand_30
Regular Advisor

Re: rsh help

Thanks JRF,

I tried using the "-n" option in the script but does not seem to work. The script still waits for the background script to be completed before proceeding.

-Anand
Anand_30
Regular Advisor

Re: rsh help

I tried:

rsh machine -n 'command >&/dev/null
and it worked.

Thanks,
Anand