In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
What to do when the Linux script runs wrong? for this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
Reason:
In Linux, sometimes it doesn't work when we copy a script written under Windows to the Linux environment.
Mainly, the newline character of Windows is\ r\ n, while the newline symbol in Linux environment is\ n.
Solution:
Use the UE text editing tool to replace all\ r\ nscript files with\ npossible.
Method 2:
When executing the script, an error message pops up:
/ bin/ sh ^ M: corrupted interpreter: no file or directory
one
This is due to the fact that the script file was saved in the DOS file format, so you can open the file with vim and do the following:
: set ff=unix
: wq
one
two
When editing scripts under windows, you often encounter all kinds of pits, so editing script files under windows is not recommended. If you use UltraEdit, the default open file encoding format is simplified Chinese GBK, it is best to switch to utf8 format.
The setting method is as follows:
Advanced-Settings-File processing-DOS/Unix/Mac processing, change the "default type of new file" to "UNIX".
The editing code under windows is really crappy. Android Studio without utf8 format can not be compiled all the time, and it is not possible to switch coding formats with Notepad++, resulting in APK interface garbled.
It is recommended to use Sublime Text under winodws. The code is highlighted completely, the interface is simple, or UltraEdit is used, but remember: when using UltraEdit, you must change the default file type of UltraEdit to "UNIX".
This is the answer to the question about how to run errors in the Linux script. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel to learn more about it.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.