UNIX FAQ Version 2.1 92/12/04 -- Question 3.2
UNIX FAQ Version 2.1 92/12/04 -- Question 3.2
How do I use "rsh" without having the rsh hang around until the
remote command has completed?
(See note in question 2.7 about what "rsh" we're talking about.)
The obvious answers fail:
rsh machine command &
or rsh machine 'command &'
For instance, try doing rsh machine 'sleep 60 &' and you'll see
that the 'rsh' won't exit right away. It will wait 60 seconds
until the remote 'sleep' command finishes, even though that
command was started in the background on the remote machine. So
how do you get the 'rsh' to exit immediately after the 'sleep' is
started?
The solution - if you use csh on the remote machine:
rsh machine -n 'command >&/dev/null /dev/null 2>&1