Shell script bash:./t.sh:/bin/bash^m: Corrupted interpreter: No file or directory _linux shell

Source: Internet
Author: User

Sometimes you write scripts with errors that are listed like headings, mostly because your script files are edited under Windows. Windows, the end of each line is \n\r, and in Linux under the end of the file is \ n, then you edit the file in Windows under Linux open to see the end of each line will be more than one character \ r, Cat-a Urfile you can see this \ The r character is displayed as a ^m, and it is only necessary to delete this character. You can use the command sed-i ' s/\r$//' urfile. Sometimes you write scripts with errors that are listed like headings, mostly because your script files are edited under Windows. Windows, the end of each line is \n\r, and in Linux under the end of the file is \ n, then you edit the file in Windows under Linux open to see the end of each line will be more than one character \ r, Cat-a Urfile you can see this \ The r character is displayed as a ^m, and it is only necessary to delete this character. You can use the command sed-i ' s/\r$//' urfile.

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.