Bin/sh^m:bad interpreter:no such file or directory resolves

Source: Internet
Author: User

Bin/sh^m:bad interpreter:no such file or directory resolves

   The reason is that the. Sh script was written in a Notepad file under Windows system. The encoding format of the different systems is caused.   Career Change file encoding format:  1, to ensure that users have read and write files and execute rights       [email protected]:~/RMAN/bin> chmod a+x Test.sh 2, then modify the file format      (1) Use VI tools       [email protected]:~/rman/bin > VI test.sh     (2) Use the following command to view file formats       :set FF or: Set fileformat     & nbsp; you can see the following information       fileformat=dos or fileformat=unix       (3) modify the file format with the following command       :set Ff=unix or: Set fileformat=unix      :WQ (save to exit)  3, final execution  & nbsp   [email protected]:~/rman/bin>/test.sh linux execute. SH script error: Command not found       Command not found this problem is generally a novice like me to commit, so just learn Linux children's shoes encounter this problem can see my explanation, may give you help.        Actually this problem may be caused by a lot of reasons, today I met the reason is worth attention, generally we write Java code when the definition of variables like this "String  test  =  " ”; ”。 Today I wrote a shell script that defines a variable in the script ("host =" "), and the result is executedNow this command is not found. I was pondering ah, how to think can not think why, and then I finally found that the problem is a space in the mischief, in fact, in the definition of a shell script variable between the variable name and equal sign is not allowed to have spaces, and I wrote the test and = there is a space between, so the system defaults that test is a command , so the system cannot find this command.

Bin/sh^m:bad interpreter:no such file or directory resolves

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.