Executing shell script error-/bin/sh^m:bad interpreter:no such file or directory

Source: Internet
Author: User

Under Windows, after using nodepad++ to write the shell script, upload the shell script to the Linux system, execute the shell script on Linux, report the error message, and cannot execute the shell script, the error message is as follows:

-bash:./solrcloud-shutdown.sh:/bin/sh^m:bad interpreter:no such file or directory
This problem arises because of the coding format of the shell script file, which, under Windows, uses nodepad++ to write the file encoding of the saved Shell script: ANSI encoding, and in Linux, The shell script file written using VIM is encoded in utf-8. So you just need to use VIM to modify the code format of the shell script file to Utf-8 to execute the script.

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.