Linux error First bullet:/bin/sh^m:bad interpreter:no such file or directory

Source: Internet
Author: User
Tags ultraedit
Write a shell script from Windows Sublime, move to Linux, find an error,/bin/sh^m:bad interpreter:no such file or directory cause: This is caused by different system encoding formats: in WI The. sh file that is edited in the ndows system may have invisible characters, so the above exception information is reported in the Linux system execution. Resolution: 1) under Windows conversion: Use some editors such as UltraEdit or EditPlus to first convert the script encoding and then put it into Linux for execution. The conversion mode is as follows (UltraEdit): File-->conversions-->dos->unix. 2) can also be converted in Linux: first to ensure that the file has executable permissions chmod file permissions and then modify the file format VI filename Use the following command to view the file format : Set FF or: Set fileformat< /c4> can see the following information Fileformat=dos (This is the coding problem) or Fileformat=unix (not the coding problem, need to find the reason) to modify the file format using the following command : Set ff= UNIX or: Set Fileformat=unix: Wq (Save to exit) execute the file last./filename

should be successful.

Linux error First bullet:/bin/sh^m:bad interpreter:no such file or directory

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.