Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to issue an rsh command to run in the background?

Example: Within a (Windows) batch file I call rsh -lroot /etc/rtcinst/myscript.ksh, which runs on a remote unix machine. This script takes a while to execute, and I want my batch file to continue running parallel to this ksh script.

The idea is, that the batch file that executes this command will continue running and not block until the script returns/exits.

Thanks. Hirschkäfer

share|improve this question

migrated from Dec 2 '11 at 14:38

This question came from our site for professional and enthusiast programmers.

add an & to the end of the command to run it in the background. Read more at tdlp – Fredrik Pihl Dec 1 '11 at 14:37
I did try it, but it does not work – Doron Dec 1 '11 at 14:48
tried this: rsh -lroot /etc/rtcinst/myscript.ksh & – Doron Dec 1 '11 at 14:48
and this: rsh -lroot "/etc/rtcinst/myscript.ksh &" – Doron Dec 1 '11 at 14:49
'batch file' is usually associated with the Windows environment, but your script name says ksh. Are you using Linux or Windows with Cygwin or ?? Good luck. – shellter Dec 1 '11 at 15:33

see HELP START and the try this

@echo off
start rsh -lroot /etc/rtcinst/myscript.ksh 
echo BAT continues...
share|improve this answer
@Keith. OP clearly says in her last comment that she invokes rsh in a windows BAT which in turn invokes the ksh script remotely. – PA. Dec 1 '11 at 17:14
I missed that. I'll delete my first comment. – Keith Thompson Dec 1 '11 at 18:00

The rsh command should run in the background when used with the '&' at the end of the command. The problem can be that the program is stopped on a signal waiting for input, so adding a

rsh -lroot /etc/rtcinst/myscript.ksh </dev/null &

Generally works around this issue. Rsh also takes a '-n' option that performs the same task as redirecting from /dev/null

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.