how to call shell script (.ksh) file from another shell script

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
-3
down vote

favorite












I am not able to call a shell script from another shell script.
I have written below code. The first script is getting executed (extract_trig_to_in.ksh)
but the second one copy_to_dbload_path.ksh is not getting executed.



sleep 2

. /opt/ontology/scripts/Green_DMS_Automation/sovan/c20_data_extraction_scripts/ksh/extract_trig_to_in.ksh

sleep 2

. /opt/ontology/scripts/Green_DMS_Automation/sovan/c20_data_extraction_scripts/ksh/copy_to_dbload_path.ksh









share|improve this question



















  • 1




    Are you getting any error messages at all? Why is there no #!-line in the code that you show? Is there any reason you're sourcing the scripts rather than running them normally? What do the two scripts do? Is the first script using exit at any point (which would exit the calling script as well since you're sourcing the script rather than running it normally).
    – Kusalananda
    Aug 21 at 11:45











  • All I see is you successfully running two scripts. (and some sleeping, is this relevant). What is in the scripts? What errors do you get? What are you expecting?
    – ctrl-alt-delor
    Sep 7 at 10:03














up vote
-3
down vote

favorite












I am not able to call a shell script from another shell script.
I have written below code. The first script is getting executed (extract_trig_to_in.ksh)
but the second one copy_to_dbload_path.ksh is not getting executed.



sleep 2

. /opt/ontology/scripts/Green_DMS_Automation/sovan/c20_data_extraction_scripts/ksh/extract_trig_to_in.ksh

sleep 2

. /opt/ontology/scripts/Green_DMS_Automation/sovan/c20_data_extraction_scripts/ksh/copy_to_dbload_path.ksh









share|improve this question



















  • 1




    Are you getting any error messages at all? Why is there no #!-line in the code that you show? Is there any reason you're sourcing the scripts rather than running them normally? What do the two scripts do? Is the first script using exit at any point (which would exit the calling script as well since you're sourcing the script rather than running it normally).
    – Kusalananda
    Aug 21 at 11:45











  • All I see is you successfully running two scripts. (and some sleeping, is this relevant). What is in the scripts? What errors do you get? What are you expecting?
    – ctrl-alt-delor
    Sep 7 at 10:03












up vote
-3
down vote

favorite









up vote
-3
down vote

favorite











I am not able to call a shell script from another shell script.
I have written below code. The first script is getting executed (extract_trig_to_in.ksh)
but the second one copy_to_dbload_path.ksh is not getting executed.



sleep 2

. /opt/ontology/scripts/Green_DMS_Automation/sovan/c20_data_extraction_scripts/ksh/extract_trig_to_in.ksh

sleep 2

. /opt/ontology/scripts/Green_DMS_Automation/sovan/c20_data_extraction_scripts/ksh/copy_to_dbload_path.ksh









share|improve this question















I am not able to call a shell script from another shell script.
I have written below code. The first script is getting executed (extract_trig_to_in.ksh)
but the second one copy_to_dbload_path.ksh is not getting executed.



sleep 2

. /opt/ontology/scripts/Green_DMS_Automation/sovan/c20_data_extraction_scripts/ksh/extract_trig_to_in.ksh

sleep 2

. /opt/ontology/scripts/Green_DMS_Automation/sovan/c20_data_extraction_scripts/ksh/copy_to_dbload_path.ksh






shell-script






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 7 at 9:59









Rui F Ribeiro

36.7k1271116




36.7k1271116










asked Aug 21 at 11:42









sovan

1




1







  • 1




    Are you getting any error messages at all? Why is there no #!-line in the code that you show? Is there any reason you're sourcing the scripts rather than running them normally? What do the two scripts do? Is the first script using exit at any point (which would exit the calling script as well since you're sourcing the script rather than running it normally).
    – Kusalananda
    Aug 21 at 11:45











  • All I see is you successfully running two scripts. (and some sleeping, is this relevant). What is in the scripts? What errors do you get? What are you expecting?
    – ctrl-alt-delor
    Sep 7 at 10:03












  • 1




    Are you getting any error messages at all? Why is there no #!-line in the code that you show? Is there any reason you're sourcing the scripts rather than running them normally? What do the two scripts do? Is the first script using exit at any point (which would exit the calling script as well since you're sourcing the script rather than running it normally).
    – Kusalananda
    Aug 21 at 11:45











  • All I see is you successfully running two scripts. (and some sleeping, is this relevant). What is in the scripts? What errors do you get? What are you expecting?
    – ctrl-alt-delor
    Sep 7 at 10:03







1




1




Are you getting any error messages at all? Why is there no #!-line in the code that you show? Is there any reason you're sourcing the scripts rather than running them normally? What do the two scripts do? Is the first script using exit at any point (which would exit the calling script as well since you're sourcing the script rather than running it normally).
– Kusalananda
Aug 21 at 11:45





Are you getting any error messages at all? Why is there no #!-line in the code that you show? Is there any reason you're sourcing the scripts rather than running them normally? What do the two scripts do? Is the first script using exit at any point (which would exit the calling script as well since you're sourcing the script rather than running it normally).
– Kusalananda
Aug 21 at 11:45













All I see is you successfully running two scripts. (and some sleeping, is this relevant). What is in the scripts? What errors do you get? What are you expecting?
– ctrl-alt-delor
Sep 7 at 10:03




All I see is you successfully running two scripts. (and some sleeping, is this relevant). What is in the scripts? What errors do you get? What are you expecting?
– ctrl-alt-delor
Sep 7 at 10:03










1 Answer
1






active

oldest

votes

















up vote
1
down vote













. Script.ksh includes source of script into your one. And if there any "exit" command it will exit your script. Try to replace it with just /bin/ksh Script






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    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',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f463840%2fhow-to-call-shell-script-ksh-file-from-another-shell-script%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    . Script.ksh includes source of script into your one. And if there any "exit" command it will exit your script. Try to replace it with just /bin/ksh Script






    share|improve this answer
























      up vote
      1
      down vote













      . Script.ksh includes source of script into your one. And if there any "exit" command it will exit your script. Try to replace it with just /bin/ksh Script






      share|improve this answer






















        up vote
        1
        down vote










        up vote
        1
        down vote









        . Script.ksh includes source of script into your one. And if there any "exit" command it will exit your script. Try to replace it with just /bin/ksh Script






        share|improve this answer












        . Script.ksh includes source of script into your one. And if there any "exit" command it will exit your script. Try to replace it with just /bin/ksh Script







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 21 at 11:46









        Alexander

        77913




        77913



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f463840%2fhow-to-call-shell-script-ksh-file-from-another-shell-script%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?