当前位置:网站首页>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
边栏推荐
- . Net service governance flow limiting middleware -fireflysoft RateLimit
- Ads learning record (lna_atf54143)
- Shell脚本基本语法
- Sql Server的存储过程详解
- Record the opening ceremony of Beijing Winter Olympics with display equipment
- Some errors in configuring the environment
- Altium designer 19.1.18 - hide the fly line of a network
- WiFi wpa_ Detailed description of supplicant hostpad interface
- Interview catalogue
- Live555 RTSP audio and video streaming summary (II) modify RTSP server streaming URL address
猜你喜欢
Shell脚本基本语法
UEFI development learning 2 - running ovmf in QEMU
如何将EasyCVR平台RTSP接入的设备数据迁移到EasyNVR中?
Mlperf training v2.0 list released, with the same GPU configuration, the performance of Baidu PaddlePaddle ranks first in the world
C WinForm [help interface - send email] - practice five
Altium designer 19.1.18 - clear information generated by measuring distance
How to migrate the device data accessed by the RTSP of the easycvr platform to easynvr?
Process communication mode between different hosts -- socket
Ads usage skills
Record the visual shock of the Winter Olympics and the introduction of the screen 2
随机推荐
[trio basic from introduction to mastery tutorial XIV] trio realizes unit axis multi-color code capture
Gradle composite construction
IC software learning
C WinForm [get file path -- traverse folder pictures] - practical exercise 6
Global and Chinese market of resistivity meter 2022-2028: Research Report on technology, participants, trends, market size and share
Ten thousand words detailed eight sorting must read (code + dynamic diagram demonstration)
Factors affecting the quality of slip rings in production
After installing the new version of keil5 or upgrading the JLINK firmware, you will always be prompted about the firmware update
C WinForm [display real-time time in the status bar] - practical exercise 1
Random function usage notes
Altium designer 19.1.18 - change the transparency of copper laying
Baiwen 7-day smart home learning experience of Internet of things
Connection mode - bridge and net
WiFi wpa_ Detailed description of supplicant hostpad interface
[tutorial 19 of trio basic from introduction to proficiency] detailed introduction of trio as a slave station connecting to the third-party bus (anybus PROFIBUS DP...)
Mlperf training v2.0 list released, with the same GPU configuration, the performance of Baidu PaddlePaddle ranks first in the world
1089 Insert or Merge 含测试点5
Ads learning record (lna_atf54143)
[trio basic tutorial 17 from getting started to mastering] set up and connect the trio motion controller and input the activation code
Global and Chinese markets for recycled boilers 2022-2028: Research Report on technology, participants, trends, market size and share