Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the Shell script bash:. / t.sh:/bin/ Bash ^ M: broken interpreter

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "how to solve Shell script bash:. / t.sh:/bin/ Bash ^ M: broken interpreter". The content in the article is simple, clear and easy to learn and understand. Please follow the editor's train of thought to study and learn "how to solve Shell script bash:. / t.sh:/bin/ Bash ^ M: broken interpreter"!

Sometimes there are errors like the one listed in the title when writing a script, mostly because your script file has been edited under windows.

Under windows, the end of each line is\ n\ r, while the end of the file under linux is\ n, then the file you edited under windows will have an extra character\ r at the end of each line when it is opened under linux. When you use cat-A urfile, you can see that the\ r character is displayed as ^ M. at this time, you only need to delete this character.

You can use the command sed-I's /\ rpm _ debase _ urfile.

Thank you for reading. The above is the content of "how to solve Shell script bash:. / t.sh:/bin/ Bash ^ M: broken interpreter". After the study of this article, I believe you have a deeper understanding of how to solve the problem of Shell script bash:. / t.sh:/bin/ Bash ^ M: broken interpreter, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report