当前位置:网站首页>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 market of rammers 2022-2028: Research Report on technology, participants, trends, market size and share
- LED display equipment records of the opening ceremony of the Beijing Winter Olympics
- 生产中影响滑环质量的因素
- Altium designer 19.1.18 - change the transparency of copper laying
- How to excavate and research ideas from the paper
- Software designer: 03 database system
- 【论文阅读】2022年最新迁移学习综述笔注(Transferability in Deep Learning: A Survey)
- 如何进行导电滑环选型
- Nb-iot technical summary
- IC software learning
猜你喜欢

Interview catalogue

Create inf module in AMI code

Some thoughts on extracting perspectives from ealfa and Ebeta
![Shape template matching based on Halcon learning [v] find_ cocoa_ packages_ max_ deformation. Hdev routine](/img/a1/d13b37955b044b6be5f1fd10263c5e.jpg)
Shape template matching based on Halcon learning [v] find_ cocoa_ packages_ max_ deformation. Hdev routine

导电滑环磨损快的原因

PMSM dead time compensation

Markdown tips

Altium designer 19.1.18 - clear information generated by measuring distance
![C WinForm [get file path -- traverse folder pictures] - practical exercise 6](/img/8b/1e470de4e4ecd4fd1bb8e5cf23f466.jpg)
C WinForm [get file path -- traverse folder pictures] - practical exercise 6
![Halcon's practice based on shape template matching [2]](/img/70/3e905661785e570fb406b8e97d41e6.jpg)
Halcon's practice based on shape template matching [2]
随机推荐
C language enhancement -- pointer
Mlperf training v2.0 list released, with the same GPU configuration, the performance of Baidu PaddlePaddle ranks first in the world
OLED 0.96 inch test
matlab timeserise
The firmware of the connected j-link does not support the following memory access
C WinForm [help interface - send email] - practice five
Global and Chinese market of core pallets 2022-2028: Research Report on technology, participants, trends, market size and share
Programming knowledge -- assembly knowledge
Drive LED -- GPIO control
Basic embedded concepts
Hardware and software solution of FPGA key chattering elimination
Cadence learning records
Detailed explanation of SQL server stored procedures
Process communication mode between different hosts -- socket
Can't find real-time chat software? Recommend to you what e-commerce enterprises are using!
[trio basic tutorial 17 from getting started to mastering] set up and connect the trio motion controller and input the activation code
Carrier period, electrical speed, carrier period variation
Some tips for using source insight (solve the problem of selecting all)
Global and Chinese market of quenching furnaces 2022-2028: Research Report on technology, participants, trends, market size and share
Network communication process