When Linux executes the. sh file, prompts no such what to do with file or directory (three solutions) _linux Shell

Source: Internet
Author: User
Tags ultraedit

First of all, let's look at the problem description, the following figure is my run-time error screenshot:

Solving method

Analyze the reason, maybe because I have a problem with my platform migration, we have permission to convert.

1 conversion under Windows:

Use tools such as UltraEdit or editplus to convert scripts to code and then execute them in Linux. The conversion method is as follows (UltraEdit): File-->conversions-->dos->unix.

2) method

Use VIM to open the Sh file and enter:

[Plain]
: Set FF

Enter, display fileformat=dos, reset file format:

[Plain]
: Set Ff=unix

Save exit:

[Plain]
: Wq

We can do it again.

3 Conversion of permissions in Linux

can also be converted in Linux:

First, make sure the file has executable permissions

#chmod u+x filename

Then modify the file format

#vi filename

All of the above three methods can help you solve the Linux implementation. sh file when no such files or directiory a problem, there is a need for friends can be consulted, I hope this article to share for everyone to help.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.