How to issue an rsh command to run in the background from a batch file?












1















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



Example:
Within a (Windows) batch file I call rsh 10.1.1.2 -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 stackoverflow.com 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 10.1.1.2 -lroot /etc/rtcinst/myscript.ksh &

    – Doron
    Dec 1 '11 at 14:48











  • and this: rsh 10.1.1.2 -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
















1















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



Example:
Within a (Windows) batch file I call rsh 10.1.1.2 -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 stackoverflow.com 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 10.1.1.2 -lroot /etc/rtcinst/myscript.ksh &

    – Doron
    Dec 1 '11 at 14:48











  • and this: rsh 10.1.1.2 -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














1












1








1








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



Example:
Within a (Windows) batch file I call rsh 10.1.1.2 -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














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



Example:
Within a (Windows) batch file I call rsh 10.1.1.2 -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







shell script batch






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 1 '11 at 14:32









DoronDoron

56124




56124




migrated from stackoverflow.com Dec 2 '11 at 14:38


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









migrated from stackoverflow.com 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 10.1.1.2 -lroot /etc/rtcinst/myscript.ksh &

    – Doron
    Dec 1 '11 at 14:48











  • and this: rsh 10.1.1.2 -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



















  • 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 10.1.1.2 -lroot /etc/rtcinst/myscript.ksh &

    – Doron
    Dec 1 '11 at 14:48











  • and this: rsh 10.1.1.2 -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

















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





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





I did try it, but it does not work

– Doron
Dec 1 '11 at 14:48













tried this: rsh 10.1.1.2 -lroot /etc/rtcinst/myscript.ksh &

– Doron
Dec 1 '11 at 14:48





tried this: rsh 10.1.1.2 -lroot /etc/rtcinst/myscript.ksh &

– Doron
Dec 1 '11 at 14:48













and this: rsh 10.1.1.2 -lroot "/etc/rtcinst/myscript.ksh &"

– Doron
Dec 1 '11 at 14:49





and this: rsh 10.1.1.2 -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





'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










2 Answers
2






active

oldest

votes


















0














see HELP START and the try this



@echo off
start rsh 10.1.1.2 -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



















0














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 10.1.1.2 -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








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f363892%2fhow-to-issue-an-rsh-command-to-run-in-the-background-from-a-batch-file%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    see HELP START and the try this



    @echo off
    start rsh 10.1.1.2 -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
















    0














    see HELP START and the try this



    @echo off
    start rsh 10.1.1.2 -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














    0












    0








    0







    see HELP START and the try this



    @echo off
    start rsh 10.1.1.2 -lroot /etc/rtcinst/myscript.ksh
    echo BAT continues...





    share|improve this answer













    see HELP START and the try this



    @echo off
    start rsh 10.1.1.2 -lroot /etc/rtcinst/myscript.ksh
    echo BAT continues...






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 1 '11 at 16:52









    PA.PA.

    4861417




    4861417













    • @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



















    • @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

















    @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





    @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





    I missed that. I'll delete my first comment.

    – Keith Thompson
    Dec 1 '11 at 18:00













    0














    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 10.1.1.2 -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




























      0














      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 10.1.1.2 -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


























        0












        0








        0







        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 10.1.1.2 -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













        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 10.1.1.2 -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












        share|improve this answer



        share|improve this answer










        answered Dec 1 '11 at 16:59









        PeteshPetesh

        46127




        46127






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f363892%2fhow-to-issue-an-rsh-command-to-run-in-the-background-from-a-batch-file%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Plaza Victoria

            Brian Clough

            Cáceres