Linux.com

Home Learn Linux Linux Answers Systems Management -ksh: test.sh: not found [No such file or directory]
Answers
  • The message is pretty clear, it appears that the shell script is not in the directory which you are trying to execute it from.

    Answered by mfillpot
    3 years ago
    0 0
  • Point is that how did u execute test.sh.... If the script file requires root permission, then execute with root privilege. Remember, generally we copy a file on the current desktop. So, if u login as user (say "abcd") then open terminal > type Desktop and press enter, then try to do the same job with su command. If u login as root, then open terminal and type Desktop and press enter, and again try to execute the same. Always remember either the file copied in another location or it requires root permission causes the problem which u mentioned. U can also use su command from general user.

    Answered by rechil_colin
    3 years ago
    0 0
  • It is possible you typed the command like this:
    $ test.sh
    If test.sh is not in your path, then you will get this error. You must precede test.sh with ./ if you are trying to execute from the present working directory.
    Verify that test.sh has the proper mode so that it is executable by the username you are using.
    You must satisfy any dependencies that the shell script might have.

    Answered by CodifexMaximus
    3 years ago
    0 0
  • Use sh if it's a sh script. Ksh if it's a ksh script. Therefore

    
    sh test.sh
    

    Assuming it *is* an sh script rather than only a extension some programer assigned to the file.

    The thing is that I do not really understand the question because you mention .ksh scripts but you later ask for test.sh?

    Regards

    Answered by marc
    3 years ago
    0 0
Please register/login to answer this question. Click here to login
Similar Questions Found
Questions from category Systems Management

Upcoming Linux Foundation Courses

  1. LFS230 Linux Network Management
    06 Oct » 09 Oct - Virtual
    Details
  2. LFD331 Developing Linux Device Drivers
    13 Oct » 17 Oct - Virtual
    Details
  3. LFS430 Linux Enterprise Automation
    13 Oct » 16 Oct - Virtual
    Details

View All Upcoming Courses

Community Answers - Search


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board