当前位置:网站首页>Problem solving: interpreter error: no file or directory
Problem solving: interpreter error: no file or directory
2022-07-05 08:05:00 【Car chezi】
Execute a I wrote perl Script , Command line error :
/usr/bin/perl^M: Interpreter error : There is no file or directory
analysis :
UNIX and Linux Use “\n” Line break , and Windows use “\r\n”( No \n\r, Verified ).
It is speculated that the script file is windows Edited by . use sed The command puts \r Get rid of .
solve :sed -i 's/\r$//' filename
Explain it. ,-i
Express edit files in place, Modify the original text directly s/a/b/
Express the a Replace with b$
Express “ End position ”
So the above command means : If a line with \r
ending , Just put \r
Replace empty , That is to remove it .
Someone asked , Not in \r\n
The end ?
Use standard sed, You will not see line breaks . This is because sed Read line by line , So in sed In pattern space , There is no newline at the end of the current line of text . let me put it another way ,sed Read data separated by newline , And the separator is not sed Part of what the script sees .
therefore ,\n
As a separator , So at the end of each line is \r
.
Reference material
How to use sed Detect end of line
边栏推荐
- Global and Chinese markets of large aperture scintillators 2022-2028: Research Report on technology, participants, trends, market size and share
- Hardware and software solution of FPGA key chattering elimination
- [popular science] some interesting things that I don't know whether they are useful or not
- Development tools -- gcc compiler usage
- How to define guid in AMI code
- [trio basic tutorial 17 from getting started to mastering] set up and connect the trio motion controller and input the activation code
- How to excavate and research ideas from the paper
- Network port usage
- C#,数值计算(Numerical Recipes in C#),线性代数方程的求解,LU分解(LU Decomposition)源程序
- Beijing Winter Olympics opening ceremony display equipment record 3
猜你喜欢
A simple method to prove 1/t Fourier transform
H264 (I) i/p/b frame gop/idr/ and other parameters
研究发现,跨境电商客服系统都有这五点功能!
Design a clock frequency division circuit that can be switched arbitrarily
Shape template matching based on Halcon learning [viii] PM_ multiple_ models. Hdev routine
The research found that the cross-border e-commerce customer service system has these five functions!
The printer encountered an abnormal configuration problem 0x8007007e (win10)
[trio basic tutorial 18 from introduction to proficiency] trio motion controller UDP fast exchange data communication
Carrier period, electrical speed, carrier period variation
Semiconductor devices (I) PN junction
随机推荐
Fundamentals of C language
Semiconductor devices (I) PN junction
Solutions to compilation warnings in Quartus II
Factors affecting the quality of slip rings in production
[trio basic from introduction to mastery tutorial 20] trio calculates the arc center and radius through three points of spatial arc
Record the visual shock of the Winter Olympics and the introduction of the screen 2
Wifi-802.11 negotiation rate table
Altium designer 19.1.18 - clear information generated by measuring distance
Train your dataset with yolov4
Nb-iot technical summary
Global and Chinese market of rammers 2022-2028: Research Report on technology, participants, trends, market size and share
My-basic application 2: my-basic installation and operation
MySQL blind note common functions
[trio basic tutorial 18 from introduction to proficiency] trio motion controller UDP fast exchange data communication
Semiconductor devices (III) FET
Measurement fitting based on Halcon learning [i] fuse Hdev routine
Shape template matching based on Halcon learning [VII] reuse_ model. Hdev routine
. Net service governance flow limiting middleware -fireflysoft RateLimit
Halcon's practice based on shape template matching [1]
[trio basic from introduction to mastery tutorial XIV] trio realizes unit axis multi-color code capture