Ras has asked for the wisdom of the Perl Monks concerning the following question:

Is there any way when you kick off a rsh, to kick off a task, to get the prompt to come back quickly and still have that task running. I'm having problems getting the prompt back when i kick off a rsh for a long task. I put the task in the back ground but that doesn't seem to help either. I know this really isn't a perl question but since you guys are really really really smart i fiqure you can help me out.

Replies are listed 'Best First'.
Re: rsh (remote shell) help
by jepri (Parson) on May 11, 2001 at 23:01 UTC
    What command are you using to put it in the background? I only use ssh, but

    ssh thing other_thing whatever &

    does the trick for me.

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.

      This is what i'm doning:
      rsh dgintel1 /bb/bin/kin.css

      the task kin.css contains:
      echo inside kin.css
      /bb/bin/kin.css.wait

      the task kin.css.wait contains:
      echo running kin.css.wait &
      sleep 10
      touch kin.done
      echo finised running kin.css.wait

      As you can see i'm kicking off kin.css which kicks off
      kin.css.wait. I want to put kin.css.wait in the
      background so i can get the prompt back to kick off another
      rsh. The way i know this doesn't work is that
      kin.done never gets touched.
      Do you have any kind of suggestions.
      Thanks in advance
        I have no solution for you, but I do have some hints which may help. No warranties are expressed or implied. Read the man page for nohup(1), and also look at redirecting stdout and stderr on all scripts you run. This is something you should do in production anyway so that warnings and errors aren't missed. See the man page for rsh on your platform for more details (you may need the -n option).
        I can see two things you could be doing better: you are thinking like you are writing a program, rather than doing tricks with shell scripts, and you have the & in the wrong place (where you have it backgrounds the 'echo' command, not kin.css.wait) This is closer to what you want:

        ---file kin.css (on the remote computer, I assume) echo running kin.css; #Do your thing touch kin.done; echo Finished running kin.css; ---eof

        and now run it by typing on the local computer

        rsh dgintel1 /bb/bin/kin.css &

        Your problem was that your were backgrounding the wrong process on the wrong computer. If you want the local prompt back you have to background the local program - in this case rsh.

        ____________________
        Jeremy
        I didn't believe in evil until I dated it.