Linux remove newlines -

Scenario: When using nmap combined with the for loop to detect the ip in the text, it is found that there is a newline character \r after each line of ip, which affects the execution of the shell script  


Solution: use vim editor to do the replacement:

use

vim -v file //Open the file and execute the following replacement command

:%s/\r//

6.jpg

After processing, open it again as follows:

2.jpg


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324727029&siteId=291194637