How to solve the Shell script bash:. / t.sh:/bin/ Bash ^ M: broken interpreter
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!