当前位置:网站首页>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
边栏推荐
- Shape template matching based on Halcon learning [VII] reuse_ model. Hdev routine
- Count and sort the occurrence times of specific fields through SQL statements
- Communication standard -- communication protocol
- General makefile (I) single C language compilation template
- C, Numerical Recipes in C, solution of linear algebraic equations, LU decomposition source program
- Define in and define out
- The browser cannot access Baidu
- MLPerf Training v2.0 榜单发布,在同等GPU配置下百度飞桨性能世界第一
- [untitled] record the visual shock of the Winter Olympics and the introduction of the display screen
- Compilation warning solution sorting in Quartus II
猜你喜欢
Nb-iot technical summary
A simple method to prove 1/t Fourier transform
如何进行导电滑环选型
Step motor generates S-curve upper computer
C#,数值计算(Numerical Recipes in C#),线性代数方程的求解,LU分解(LU Decomposition)源程序
C language # and #
Altium designer 19.1.18 - Import frame
Arduino uses nrf24l01+ communication
Some thoughts on extracting perspectives from ealfa and Ebeta
C WinForm [view status bar -- statusstrip] - Practice 2
随机推荐
Sql Server的存儲過程詳解
IC software learning
【云原生 | 从零开始学Kubernetes】三、Kubernetes集群管理工具kubectl
Imx6ull bare metal development learning 2- use C language to light LED indicator
【论文阅读】2022年最新迁移学习综述笔注(Transferability in Deep Learning: A Survey)
Sql Server的存储过程详解
Shape template matching based on Halcon learning [9] PM_ multiple_ dxf_ models. Hdev routine -- [read and write XLD from DXF file]
Global and Chinese market of peeled bourdon tubes 2022-2028: Research Report on technology, participants, trends, market size and share
Summary -st2.0 Hall angle estimation
Some tips for using source insight (solve the problem of selecting all)
Connection mode - bridge and net
C WinForm [display real-time time in the status bar] - practical exercise 1
PMSM dead time compensation
Mlperf training v2.0 list released, with the same GPU configuration, the performance of Baidu PaddlePaddle ranks first in the world
The browser cannot access Baidu
LED display equipment records of the opening ceremony of the Beijing Winter Olympics
Soem EtherCAT source code analysis I (data type definition)
About yolov3, conduct map test directly
[trio basic tutorial 17 from getting started to mastering] set up and connect the trio motion controller and input the activation code
Network communication process