Linux error/bin/sh M:bad interpreter:no such file or directory issues

Source: Internet
Author: User
Originally this year, Chiang has plans to learn the contents of Linux script, so in a variety of books in the previous activities to buy a lot of books, but most of the plastic cover has not been demolished. Today, the company has no business, so try to toss back the script, although there are some references on the Web documents, but at any time also need to explore their own side and modify to more convenient for our general purpose of the script.

Many of our friends play Linux scripts to modify and write the time is based on the Windows system, so we edit the script file is easy to run when the "/bin/sh^m:bad interpreter:no such file or directory" error problem. We'll solve the problem when we have a problem. There are a number of such solutions on the Web, which we use directly in an effective way.

First, install Dos2unix
The code is as follows Copy Code
Yum-y Install Dos2unix #CentOS

Apt-get install-y Dos2unix #Debian

We need to install the Dos2unix component to convert our scripts to format.

Second, perform the conversion
The code is as follows Copy Code
Dos2unix itbulu.com.sh

We need to upload an existing SH script to the corresponding directory and then perform a script conversion.

After this conversion is complete, we can then execute our own script file.

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.