This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11128|Reply: 0

[linux] The files automatically generated by the shell have a question mark suffix

[Copy link]
Posted on 1/6/2015 12:01:14 AM | | |

Write a script to automatically process a file.


rm -f session.log
rm -f link
wget ftp://hostname/f:/ddn/session.log
egrep '^N[[:digit:]]|^D[1-4]' session.log >>link
egrep -c '^N[[:digit:]]|^D[1-4]' session.log >>link
egrep -v 'ACT/UP' link>>link
ls -l session.log >>link
gedit link


As a result, the file name of the downloaded session.log became a strange character, and the link became link? As shown in the figure below.


Subsequent processing of link session.log files will prompt that the corresponding file cannot be found.

I searched for a long time and didn't find the corresponding Chinese information.

The situation here is that the script is written under windows, and then passed to Linux to run, and the line break under windows is ^M$ The line break under linux is ^M before $linux when running, and it shows strange characters.






Previous:vi/vim basic usage methods
Next:Are there any classmates who help with the exam application writing on the 15th? The remuneration fee is 50 yuan
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com