Sh script exception:/bin/sh ^ M: badinterpreter: Nosuchfileordirectory

Source: Internet
Author: User
Tags ultraedit
Sh script exception:/bin/sh ^ M: badinterpreter: Nosuchfileordirectory problem is executed in Linux. sh script, exception/bin/sh ^ M: badinterpreter: Nosuchfileordirectory analysis: This is caused by different system encoding formats ,...
Sh script exception:/bin/sh ^ M: bad interpreter: No such file or directory problem is executed in Linux. sh script, exception/bin/sh ^ M: bad interpreter: No such file or directory analysis: This is caused by different system encoding formats, edited in windows. sh files may contain invisible characters. Therefore, the preceding exception information is reported when executed in Linux. In windows, www.2cto.com 1 converts the script encoding using some editors, such as UltraEdit or EditPlus, and then runs it in Linux. The conversion method is as follows (UltraEdit): File --> Conversions --> DOS-> UNIX. 2 In Linux, to convert 2.1, first ensure that the file has executable permissions # sh> chmod a + x filename 2.2 and then modify the file format # sh> vi filename 2.3. use the following command to view the file format: set ff or: set fileformat: The following information is displayed: fileformat = dos or fileformat = unix 2.4 use the following command to modify the file format: set ff = unix or: set fileformat = unix: wq (disk logout) 2.5 and then execute the file # sh>. /filename
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.