Troubleshooting Linux compile Make file error "/bin/bash^m: Bad interpreter: No file or directory" problem

Source: Internet
Author: User

PS Background: I am in the company to do the SDK PC-side development, so often in the win under the compiler to run after running to Linux to run again has been ensured to support multi-platform.

Today, after running a program under win, and then running under Linux, I used the command:

[plain] view plain copy

    1. sudo./

But nothing happens. So I changed the instructions, with

[plain] view plain copy

    1. chmod u+x
    2. ./

Error "^m: Bad interpreter: No file or directory". Previously encountered this problem, changed several methods of compilation to solve, single this time or not, so change:

When compiling the error:

Later a think \ r This symbol how to appear, so all kinds of Baidu, just know the reason may be because I in win under Operation, modified to this file.

When the edit under Win, the end of the line is \n\r, and under Linux is \ n, so there will be more out of the \ r

With instructions:

[plain] view plain copy

    1. Sed-i ' s/\r$//'

will replace the \ r in with blank!

Compile again! Success!!

PS: Write in the back

Reference article:

On the first floor, Daniel proposed that there is a Dos2unix software, I see sure good! Thanks Cedardiao Daniel!

Troubleshooting Linux compile Make file error "/bin/bash^m: Bad interpreter: No file or directory" problem

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: 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.