A problem with the name of an SH file in Linux when it executes

Source: Internet
Author: User

Today in the project need to write a sh, perform some initialization operations, and then tune the original execution file, but I in the operation mainly to the first line to join the #!/bin/sh expression, but always error when executing, because every execution, the expression after the addition of a strange strange character, Finally found the reason, because I use the Windows editing files, and then directly to the Linux run, because the two systems have different lines of code, so there will be more than one character in Linux, resulting in a failure to run

can use

: Set FF?

Query file format is UNIX or DOS

Check it out, it is a DOS format, and then use the following command to modify the UNIX format

: Set Ff=unix

  

A problem with the name of an SH file in Linux when it executes

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.