Solution: $'\r': command not found (error resolution of unexpected end of file in linux environment)

Problem description:
After using secureFx to download a file under linux to the window for editing and re-upload it to linux, the file unexpected end of file error is reported.

Insert picture description here

After consulting the information, I found the problem: this is caused by the difference between the default format of windows and Unix text editing, and it needs to be converted to unix format.

Solution:
1. Install the transcoding tool

# 这里是centos,其他的换一下即可
yum -y install dos2unix*

Insert picture description here

2. Transcoding

#file 为你要转码的文件名
dos2unix -k file

Insert picture description here
The problem is solved after transcoding

Guess you like

Origin blog.csdn.net/Hambur_/article/details/111224428