-ksh: revenue_ext.ksh: not found [No such file or directory]





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







5















I am getting the same not found [No such file or directory] error when trying to execute a ksh script. Read tips about the PATH and running the script with a ./ in the posts here and here and tried but no luck. The script does exist under the directory from where I am trying to execute and has full permissions but gives the same error when run directly or with a ./. The first line within the script also has #!/usr/bin/ksh



The error message is like below:



-ksh: revenue_ext.ksh: not found [No such file or directory]


However, other ksh scripts under the same directory run fine so am absolutely clueless about what could be wrong here. Any help would be greatly appreciated










share|improve this question

























  • What is the output of cat -v revenue_ext.ksh?

    – Ramesh
    Jun 5 '14 at 4:00











  • If you have moved this file from windows to unix Then run dos2unix filename filename command

    – sonal
    May 31 '16 at 8:18


















5















I am getting the same not found [No such file or directory] error when trying to execute a ksh script. Read tips about the PATH and running the script with a ./ in the posts here and here and tried but no luck. The script does exist under the directory from where I am trying to execute and has full permissions but gives the same error when run directly or with a ./. The first line within the script also has #!/usr/bin/ksh



The error message is like below:



-ksh: revenue_ext.ksh: not found [No such file or directory]


However, other ksh scripts under the same directory run fine so am absolutely clueless about what could be wrong here. Any help would be greatly appreciated










share|improve this question

























  • What is the output of cat -v revenue_ext.ksh?

    – Ramesh
    Jun 5 '14 at 4:00











  • If you have moved this file from windows to unix Then run dos2unix filename filename command

    – sonal
    May 31 '16 at 8:18














5












5








5


1






I am getting the same not found [No such file or directory] error when trying to execute a ksh script. Read tips about the PATH and running the script with a ./ in the posts here and here and tried but no luck. The script does exist under the directory from where I am trying to execute and has full permissions but gives the same error when run directly or with a ./. The first line within the script also has #!/usr/bin/ksh



The error message is like below:



-ksh: revenue_ext.ksh: not found [No such file or directory]


However, other ksh scripts under the same directory run fine so am absolutely clueless about what could be wrong here. Any help would be greatly appreciated










share|improve this question
















I am getting the same not found [No such file or directory] error when trying to execute a ksh script. Read tips about the PATH and running the script with a ./ in the posts here and here and tried but no luck. The script does exist under the directory from where I am trying to execute and has full permissions but gives the same error when run directly or with a ./. The first line within the script also has #!/usr/bin/ksh



The error message is like below:



-ksh: revenue_ext.ksh: not found [No such file or directory]


However, other ksh scripts under the same directory run fine so am absolutely clueless about what could be wrong here. Any help would be greatly appreciated







shell-script ksh executable






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '17 at 12:36









Community

1




1










asked Jun 5 '14 at 3:51









user68112user68112

33126




33126













  • What is the output of cat -v revenue_ext.ksh?

    – Ramesh
    Jun 5 '14 at 4:00











  • If you have moved this file from windows to unix Then run dos2unix filename filename command

    – sonal
    May 31 '16 at 8:18



















  • What is the output of cat -v revenue_ext.ksh?

    – Ramesh
    Jun 5 '14 at 4:00











  • If you have moved this file from windows to unix Then run dos2unix filename filename command

    – sonal
    May 31 '16 at 8:18

















What is the output of cat -v revenue_ext.ksh?

– Ramesh
Jun 5 '14 at 4:00





What is the output of cat -v revenue_ext.ksh?

– Ramesh
Jun 5 '14 at 4:00













If you have moved this file from windows to unix Then run dos2unix filename filename command

– sonal
May 31 '16 at 8:18





If you have moved this file from windows to unix Then run dos2unix filename filename command

– sonal
May 31 '16 at 8:18










2 Answers
2






active

oldest

votes


















7














I believe there may be some carriage returns causing this error here. I was able to reproduce the error successfully.



Testing



cat ksh_experiment.ksh

#!/usr/bin/ksh
echo "Hello"


Now after providing the permissions when I ran the file, it produced the output successfully. Now as discussed over here, I inserted some carriage returns in my file. Now when I ran the script, I was getting the output as,



ksh: ./ksh_experiment.ksh: not found [No such file or directory]


Now, cat -v ksh_experiment.ksh too produced the same output. Also, if I typed vim ksh_experiment.ksh , a new file was getting opened.



As discussed in the answer of the link that I provided, I removed the carriage returns using the command,



 perl -p -i -e "s/r//g" ksh_experiment.ksh


After fixing when I ran, I got the output as expected.






share|improve this answer


























  • Yes you are right.There were ^M characters within the file that were not easily visible to the naked eye. Gave dos2unix revenue_ext.ksh and it worked:)

    – user68112
    Jun 5 '14 at 5:14



















0














In my case, I had this same error message come up if the file is either .ksh or .sh like this:



-ksh: ./somefile.sh: not found [No such file or directory]


Turns out its the access issue.



Even though you make this file executable, on the server you might need admin rights to run. I could run command line, but executing the script would return not found, try run the script in sudo, then you will know if you are allowed to run the script as root or not.






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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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%2funix.stackexchange.com%2fquestions%2f134581%2fksh-revenue-ext-ksh-not-found-no-such-file-or-directory%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









    7














    I believe there may be some carriage returns causing this error here. I was able to reproduce the error successfully.



    Testing



    cat ksh_experiment.ksh

    #!/usr/bin/ksh
    echo "Hello"


    Now after providing the permissions when I ran the file, it produced the output successfully. Now as discussed over here, I inserted some carriage returns in my file. Now when I ran the script, I was getting the output as,



    ksh: ./ksh_experiment.ksh: not found [No such file or directory]


    Now, cat -v ksh_experiment.ksh too produced the same output. Also, if I typed vim ksh_experiment.ksh , a new file was getting opened.



    As discussed in the answer of the link that I provided, I removed the carriage returns using the command,



     perl -p -i -e "s/r//g" ksh_experiment.ksh


    After fixing when I ran, I got the output as expected.






    share|improve this answer


























    • Yes you are right.There were ^M characters within the file that were not easily visible to the naked eye. Gave dos2unix revenue_ext.ksh and it worked:)

      – user68112
      Jun 5 '14 at 5:14
















    7














    I believe there may be some carriage returns causing this error here. I was able to reproduce the error successfully.



    Testing



    cat ksh_experiment.ksh

    #!/usr/bin/ksh
    echo "Hello"


    Now after providing the permissions when I ran the file, it produced the output successfully. Now as discussed over here, I inserted some carriage returns in my file. Now when I ran the script, I was getting the output as,



    ksh: ./ksh_experiment.ksh: not found [No such file or directory]


    Now, cat -v ksh_experiment.ksh too produced the same output. Also, if I typed vim ksh_experiment.ksh , a new file was getting opened.



    As discussed in the answer of the link that I provided, I removed the carriage returns using the command,



     perl -p -i -e "s/r//g" ksh_experiment.ksh


    After fixing when I ran, I got the output as expected.






    share|improve this answer


























    • Yes you are right.There were ^M characters within the file that were not easily visible to the naked eye. Gave dos2unix revenue_ext.ksh and it worked:)

      – user68112
      Jun 5 '14 at 5:14














    7












    7








    7







    I believe there may be some carriage returns causing this error here. I was able to reproduce the error successfully.



    Testing



    cat ksh_experiment.ksh

    #!/usr/bin/ksh
    echo "Hello"


    Now after providing the permissions when I ran the file, it produced the output successfully. Now as discussed over here, I inserted some carriage returns in my file. Now when I ran the script, I was getting the output as,



    ksh: ./ksh_experiment.ksh: not found [No such file or directory]


    Now, cat -v ksh_experiment.ksh too produced the same output. Also, if I typed vim ksh_experiment.ksh , a new file was getting opened.



    As discussed in the answer of the link that I provided, I removed the carriage returns using the command,



     perl -p -i -e "s/r//g" ksh_experiment.ksh


    After fixing when I ran, I got the output as expected.






    share|improve this answer















    I believe there may be some carriage returns causing this error here. I was able to reproduce the error successfully.



    Testing



    cat ksh_experiment.ksh

    #!/usr/bin/ksh
    echo "Hello"


    Now after providing the permissions when I ran the file, it produced the output successfully. Now as discussed over here, I inserted some carriage returns in my file. Now when I ran the script, I was getting the output as,



    ksh: ./ksh_experiment.ksh: not found [No such file or directory]


    Now, cat -v ksh_experiment.ksh too produced the same output. Also, if I typed vim ksh_experiment.ksh , a new file was getting opened.



    As discussed in the answer of the link that I provided, I removed the carriage returns using the command,



     perl -p -i -e "s/r//g" ksh_experiment.ksh


    After fixing when I ran, I got the output as expected.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited May 23 '17 at 12:40









    Community

    1




    1










    answered Jun 5 '14 at 4:05









    RameshRamesh

    24k34105188




    24k34105188













    • Yes you are right.There were ^M characters within the file that were not easily visible to the naked eye. Gave dos2unix revenue_ext.ksh and it worked:)

      – user68112
      Jun 5 '14 at 5:14



















    • Yes you are right.There were ^M characters within the file that were not easily visible to the naked eye. Gave dos2unix revenue_ext.ksh and it worked:)

      – user68112
      Jun 5 '14 at 5:14

















    Yes you are right.There were ^M characters within the file that were not easily visible to the naked eye. Gave dos2unix revenue_ext.ksh and it worked:)

    – user68112
    Jun 5 '14 at 5:14





    Yes you are right.There were ^M characters within the file that were not easily visible to the naked eye. Gave dos2unix revenue_ext.ksh and it worked:)

    – user68112
    Jun 5 '14 at 5:14













    0














    In my case, I had this same error message come up if the file is either .ksh or .sh like this:



    -ksh: ./somefile.sh: not found [No such file or directory]


    Turns out its the access issue.



    Even though you make this file executable, on the server you might need admin rights to run. I could run command line, but executing the script would return not found, try run the script in sudo, then you will know if you are allowed to run the script as root or not.






    share|improve this answer






























      0














      In my case, I had this same error message come up if the file is either .ksh or .sh like this:



      -ksh: ./somefile.sh: not found [No such file or directory]


      Turns out its the access issue.



      Even though you make this file executable, on the server you might need admin rights to run. I could run command line, but executing the script would return not found, try run the script in sudo, then you will know if you are allowed to run the script as root or not.






      share|improve this answer




























        0












        0








        0







        In my case, I had this same error message come up if the file is either .ksh or .sh like this:



        -ksh: ./somefile.sh: not found [No such file or directory]


        Turns out its the access issue.



        Even though you make this file executable, on the server you might need admin rights to run. I could run command line, but executing the script would return not found, try run the script in sudo, then you will know if you are allowed to run the script as root or not.






        share|improve this answer















        In my case, I had this same error message come up if the file is either .ksh or .sh like this:



        -ksh: ./somefile.sh: not found [No such file or directory]


        Turns out its the access issue.



        Even though you make this file executable, on the server you might need admin rights to run. I could run command line, but executing the script would return not found, try run the script in sudo, then you will know if you are allowed to run the script as root or not.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 5 hours ago









        Rui F Ribeiro

        41.9k1483142




        41.9k1483142










        answered Apr 27 '17 at 17:29









        Ajay. AAjay. A

        11




        11






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • 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%2funix.stackexchange.com%2fquestions%2f134581%2fksh-revenue-ext-ksh-not-found-no-such-file-or-directory%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

            濃尾地震

            How to rewrite equation of hyperbola in standard form

            No ethernet ip address in my vocore2