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

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











up vote
5
down vote

favorite
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























  • 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














up vote
5
down vote

favorite
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























  • 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












up vote
5
down vote

favorite
1









up vote
5
down vote

favorite
1






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









user68112

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










3 Answers
3






active

oldest

votes

















up vote
7
down vote



accepted










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

















up vote
0
down vote













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. Hope it helps.






share|improve this answer





























    up vote
    0
    down vote













    Please have a look on i have the same issue, since i have sh file error!!!




    ksh: rms_biweekly_pid.sh: not found.






    share








    New contributor




    DEEPAK PATRA is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

















      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%2f134581%2fksh-revenue-ext-ksh-not-found-no-such-file-or-directory%23new-answer', 'question_page');

      );

      Post as a guest






























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      7
      down vote



      accepted










      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














      up vote
      7
      down vote



      accepted










      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












      up vote
      7
      down vote



      accepted







      up vote
      7
      down vote



      accepted






      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









      Ramesh

      22.6k31100179




      22.6k31100179











      • 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












      up vote
      0
      down vote













      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. Hope it helps.






      share|improve this answer


























        up vote
        0
        down vote













        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. Hope it helps.






        share|improve this answer
























          up vote
          0
          down vote










          up vote
          0
          down vote









          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. Hope it helps.






          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. Hope it helps.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 27 '17 at 18:10









          Thomas

          3,69141225




          3,69141225










          answered Apr 27 '17 at 17:29









          Ajay. A

          11




          11




















              up vote
              0
              down vote













              Please have a look on i have the same issue, since i have sh file error!!!




              ksh: rms_biweekly_pid.sh: not found.






              share








              New contributor




              DEEPAK PATRA is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.





















                up vote
                0
                down vote













                Please have a look on i have the same issue, since i have sh file error!!!




                ksh: rms_biweekly_pid.sh: not found.






                share








                New contributor




                DEEPAK PATRA is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.



















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Please have a look on i have the same issue, since i have sh file error!!!




                  ksh: rms_biweekly_pid.sh: not found.






                  share








                  New contributor




                  DEEPAK PATRA is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  Please have a look on i have the same issue, since i have sh file error!!!




                  ksh: rms_biweekly_pid.sh: not found.







                  share








                  New contributor




                  DEEPAK PATRA is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.








                  share


                  share






                  New contributor




                  DEEPAK PATRA is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 7 mins ago









                  DEEPAK PATRA

                  1




                  1




                  New contributor




                  DEEPAK PATRA is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  DEEPAK PATRA is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  DEEPAK PATRA is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.



























                       

                      draft saved


                      draft discarded















































                       


                      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













































































                      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?